10#if QT_CONFIG(draganddrop)
22#if QT_CONFIG(regularexpression)
25#if QT_CONFIG(settings)
40#include "private/qdialog_p.h"
42#include <qpa/qplatformintegration.h>
43#include <qpa/qplatformservices.h>
44#include <private/qguiapplication_p.h>
46#include <QtCore/qpointer.h>
154 QWindow dummyTransparentWindow;
192 {
return y / cellh; }
195 {
if (
isRightToLeft())
return ncols - (
x / cellw) - 1;
return x / cellw; }
198 {
return cellh *
row; }
210 {
return QRect(0, 0, cellw, cellh); }
213 {
return QSize(ncols * cellw, nrows * cellh); }
218 if (
row >= 0 && row < nrows && column >= 0 &&
column < ncols)
263 int rowfirst =
rowAt(cy);
277 if (collast < 0 || collast >= ncols)
279 if (rowlast < 0 || rowlast >= nrows)
283 for (
int r = rowfirst;
r <= rowlast; ++
r) {
290 for (
int c = colfirst;
c <= collast; ++
c) {
303 ,nrows(rows), ncols(cols)
330 opt.midLineWidth = 1;
337 if ((
row == curRow) && (col == curCol)) {
358 p->drawLine(
r.topLeft(),
r.bottomRight());
359 p->drawLine(
r.topRight(),
r.bottomLeft());
383 if ((curRow ==
row) && (curCol == col))
386 if (
row < 0 || col < 0)
412 if (
row < 0 || col < 0)
490 switch (
event->type()) {
515 return QColorDialogOptions::customColorCount();
525 return QColor(QColorDialogOptions::customColor(
index));
537 QColorDialogOptions::setCustomColor(
index,
color.rgba());
547 return QColor(QColorDialogOptions::standardColor(
index));
559 QColorDialogOptions::setStandardColor(
index,
color.rgba());
566 c.getHsv(&
h, &
s, &
v);
583#if QT_CONFIG(draganddrop)
584 void dragEnterEvent(QDragEnterEvent *e)
override;
585 void dragLeaveEvent(QDragLeaveEvent *e)
override;
586 void dragMoveEvent(QDragMoveEvent *e)
override;
587 void dropEvent(QDropEvent *e)
override;
615#if QT_CONFIG(draganddrop)
623 mime->setColorData(col);
630 drg->setMimeData(
mime);
632 mousePressed =
false;
638#if QT_CONFIG(draganddrop)
639void QColorWell::dragEnterEvent(QDragEnterEvent *e)
641 if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid())
647void QColorWell::dragLeaveEvent(QDragLeaveEvent *)
653void QColorWell::dragMoveEvent(QDragMoveEvent *e)
655 if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid()) {
663void QColorWell::dropEvent(QDropEvent *e)
665 QColor col = qvariant_cast<QColor>(e->mimeData()->colorData());
682 mousePressed =
false;
711 int huePt(
const QPoint &pt);
712 int satPt(
const QPoint &pt);
746 enum { foff = 3, coff = 4 };
759int QColorLuminancePicker::y2val(
int y)
762 return 255 - (
y - coff)*255/
d;
765int QColorLuminancePicker::val2y(
int v)
768 return coff + (255-
v)*
d/255;
774 hue = 100; val = 100; sat = 100;
790 setVal(y2val(
m->position().toPoint().y()));
794 setVal(y2val(
m->position().toPoint().y()));
797void QColorLuminancePicker::setVal(
int v)
802 delete pix; pix=
nullptr;
819 int wi =
r.width() - 2;
820 int hi =
r.height() - 2;
821 if (!pix || pix->
height() != hi || pix->
width() != wi) {
826 for (
y = 0;
y < hi;
y++) {
834 p.drawPixmap(1, coff, *pix);
837 p.setPen(
g.windowText().color());
838 p.setBrush(
g.windowText());
840 const int y = val2y(val);
842 p.drawPolygon(
points.data(),
static_cast<int>(
points.size()));
850 delete pix; pix=
nullptr;
854QPoint QColorPicker::colPt()
857 return QPoint((360 - hue) * (
r.width() - 1) / 360, (255 - sat) * (
r.height() - 1) / 255);
860int QColorPicker::huePt(
const QPoint &pt)
863 return 360 - pt.
x() * 360 / (
r.width() - 1);
866int QColorPicker::satPt(
const QPoint &pt)
869 return 255 - pt.
y() * 255 / (
r.height() - 1);
874 setCol(huePt(pt), satPt(pt));
909 if (nhue == hue && nsat == sat)
913 hue = nhue; sat = nsat;
944 p.drawPixmap(
r.topLeft(), pix);
947 QPoint pt = colPt() +
r.topLeft();
963 for (
y = 0;
y <
h;
y++) {
966 while (pixel <
end) {
969 c.setHsv(huePt(
p), satPt(
p), 200);
990class QColorShowLabel;
1025 void showCurrentColor();
1050 friend class QT_PREPEND_NAMESPACE(QColorDialog);
1051 friend class QT_PREPEND_NAMESPACE(QColorDialogPrivate);
1061 setAcceptDrops(
true);
1062 mousePressed =
false;
1074#if QT_CONFIG(draganddrop)
1075 void dragEnterEvent(QDragEnterEvent *e)
override;
1076 void dragLeaveEvent(QDragLeaveEvent *e)
override;
1077 void dropEvent(QDropEvent *e)
override;
1090 p.fillRect(contentsRect()&e->
rect(), col);
1095 alphaLab->setVisible(
b);
1096 alphaEd->setVisible(
b);
1101 return alphaLab->isVisible();
1106 mousePressed =
true;
1112#if !QT_CONFIG(draganddrop)
1119 mime->setColorData(col);
1126 drg->setMimeData(
mime);
1127 drg->setPixmap(
pix);
1128 mousePressed =
false;
1134#if QT_CONFIG(draganddrop)
1135void QColorShowLabel::dragEnterEvent(QDragEnterEvent *e)
1137 if (qvariant_cast<QColor>(e->mimeData()->colorData()).isValid())
1143void QColorShowLabel::dragLeaveEvent(QDragLeaveEvent *)
1147void QColorShowLabel::dropEvent(QDropEvent *e)
1149 QColor color = qvariant_cast<QColor>(e->mimeData()->colorData());
1150 if (
color.isValid()) {
1165 mousePressed =
false;
1173 curCol =
qRgb(255, 255, 255);
1181#ifdef QT_SMALL_COLORDIALOG
1188#if !defined(QT_SMALL_COLORDIALOG)
1198 lblHue =
new QLabel(
this);
1199#ifndef QT_NO_SHORTCUT
1203#if !defined(QT_SMALL_COLORDIALOG)
1212 lblSat =
new QLabel(
this);
1213#ifndef QT_NO_SHORTCUT
1217#if !defined(QT_SMALL_COLORDIALOG)
1226 lblVal =
new QLabel(
this);
1227#ifndef QT_NO_SHORTCUT
1231#if !defined(QT_SMALL_COLORDIALOG)
1240 lblRed =
new QLabel(
this);
1241#ifndef QT_NO_SHORTCUT
1245#if !defined(QT_SMALL_COLORDIALOG)
1254 lblGreen =
new QLabel(
this);
1255#ifndef QT_NO_SHORTCUT
1259#if !defined(QT_SMALL_COLORDIALOG)
1268 lblBlue =
new QLabel(
this);
1269#ifndef QT_NO_SHORTCUT
1273#if !defined(QT_SMALL_COLORDIALOG)
1282 alphaLab =
new QLabel(
this);
1283#ifndef QT_NO_SHORTCUT
1287#if !defined(QT_SMALL_COLORDIALOG)
1296 lblHtml =
new QLabel(
this);
1299#ifndef QT_NO_SHORTCUT
1303#if QT_CONFIG(regularexpression)
1305 QRegularExpressionValidator *validator =
new QRegularExpressionValidator(regExp,
this);
1313#if defined(QT_SMALL_COLORDIALOG)
1349void QColorShower::showCurrentColor()
1355void QColorShower::rgbEd()
1373void QColorShower::hsvEd()
1375 rgbOriginal =
false;
1381 c.setHsv(hue, sat,
val);
1395void QColorShower::htmlEd()
1401 if (!
t.startsWith(u
"#")) {
1453 rgbOriginal =
false;
1454 hue =
h; val =
v; sat =
s;
1456 c.setHsv(hue, sat, val);
1475 lblHue->
setText(QColorDialog::tr(
"Hu&e:"));
1476 lblSat->
setText(QColorDialog::tr(
"&Sat:"));
1477 lblVal->
setText(QColorDialog::tr(
"&Val:"));
1478 lblRed->
setText(QColorDialog::tr(
"&Red:"));
1479 lblGreen->
setText(QColorDialog::tr(
"&Green:"));
1480 lblBlue->
setText(QColorDialog::tr(
"Bl&ue:"));
1481 alphaLab->
setText(QColorDialog::tr(
"A&lpha channel:"));
1482 lblHtml->
setText(QColorDialog::tr(
"&HTML:"));
1487 QColor oldQColor(curQColor);
1489 if (curQColor != oldQColor)
1496 if (!nativeDialogInUse) {
1497 cs->setHsv(
h,
s,
v);
1499 lp->setCol(
h,
s,
v);
1506 if (!nativeDialogInUse) {
1508 newColorTypedIn(
rgb);
1516 if (cs->curQColor !=
color) {
1517 cs->curQColor =
color;
1534 const QRgb *standardColors = QColorDialogOptions::standardColors();
1536 const QRgb *
match = std::find(standardColors, standardColorsEnd,
color);
1537 if (
match != standardColorsEnd) {
1538 const int index = int(
match - standardColors);
1544 standard->setFocus();
1550 const QRgb *customColors = QColorDialogOptions::customColors();
1552 const QRgb *
match = std::find(customColors, customColorsEnd,
color);
1553 if (
match != customColorsEnd) {
1582 if (!nativeDialogInUse) {
1586 lp->setCol(
h,
s,
v);
1598 setCurrentRgbColor(QColorDialogOptions::customColor(
i));
1600 standard->setSelected(-1,-1);
1605 setCurrentRgbColor(QColorDialogOptions::standardColor(
r +
c * 6));
1607 custom->setSelected(-1,-1);
1616 if (
auto *colorPicker = platformServices->colorPicker(
q->windowHandle())) {
1619 colorPicker->deleteLater();
1620 q->setCurrentColor(
color);
1622 colorPicker->pickColor();
1627 if (!colorPickingEventFilter)
1629 q->installEventFilter(colorPickingEventFilter);
1631 beforeScreenColorPicking = cs->currentColor();
1640 updateTimer->start(30);
1645 dummyTransparentWindow.show();
1651 q->setMouseTracking(
true);
1653 addCusBt->setDisabled(
true);
1654 buttons->setDisabled(
true);
1655 if (eyeDropperButton) {
1656 eyeDropperButton->setDisabled(
true);
1659 updateColorLabelText(globalPos);
1665 if (lblScreenColorInfo)
1666 lblScreenColorInfo->setText(QColorDialog::tr(
"Cursor at %1, %2\nPress ESC to cancel")
1668 .arg(globalPos.
y()));
1674 cp->setCrossVisible(
true);
1675 q->removeEventFilter(colorPickingEventFilter);
1678 updateTimer->stop();
1679 dummyTransparentWindow.setVisible(
false);
1681 q->releaseKeyboard();
1682 q->setMouseTracking(
false);
1683 lblScreenColorInfo->setText(
"\n"_L1);
1684 addCusBt->setDisabled(
false);
1685 buttons->setDisabled(
false);
1686 eyeDropperButton->setDisabled(
false);
1693 q->setSizeGripEnabled(
false);
1694 q->setWindowTitle(QColorDialog::tr(
"Select Color"));
1697 nativeDialogInUse = (platformColorDialogHelper() !=
nullptr);
1698 colorPickingEventFilter =
nullptr;
1701 if (!nativeDialogInUse)
1705 dummyTransparentWindow.resize(1, 1);
1709 q->setCurrentColor(initial);
1720 mainLay->addLayout(topLay);
1724#if defined(QT_SMALL_COLORDIALOG)
1725 smallDisplay =
true;
1726 const int lumSpace = 20;
1731 const int lumSpace = topLay->spacing() / 2;
1734 if (!smallDisplay) {
1739 lblBasicColors =
new QLabel(
q);
1740#ifndef QT_NO_SHORTCUT
1741 lblBasicColors->setBuddy(standard);
1745 leftLay->addWidget(lblBasicColors);
1746 leftLay->addWidget(standard);
1748#if !defined(QT_SMALL_COLORDIALOG)
1749 if (supportsColorPicking()) {
1751 leftLay->addWidget(eyeDropperButton);
1752 lblScreenColorInfo =
new QLabel(
"\n"_L1);
1753 leftLay->addWidget(lblScreenColorInfo);
1757 eyeDropperButton =
nullptr;
1758 lblScreenColorInfo =
nullptr;
1762 leftLay->addStretch();
1765 custom->setAcceptDrops(
true);
1771 QColorDialogOptions::setCustomColor(
index,
color);
1776 lblCustomColors =
new QLabel(
q);
1777#ifndef QT_NO_SHORTCUT
1778 lblCustomColors->setBuddy(custom);
1780 leftLay->addWidget(lblCustomColors);
1781 leftLay->addWidget(custom);
1785 leftLay->addWidget(addCusBt);
1788#if defined(QT_SMALL_COLORDIALOG)
1814#if defined(QT_SMALL_COLORDIALOG)
1817 cLay->addSpacing(lumSpace);
1818 cLay->addWidget(cp);
1820 cLay->addSpacing(lumSpace);
1823#if defined(QT_SMALL_COLORDIALOG)
1826 lp->setFixedWidth(20);
1827 pickLay->addSpacing(10);
1828 pickLay->addWidget(lp);
1829 pickLay->addStretch();
1835 rightLay->addStretch();
1838 pickLay->setContentsMargins(cs->gl->contentsMargins());
1843#if defined(QT_SMALL_COLORDIALOG)
1844 topLay->addWidget(cs);
1846 rightLay->addWidget(cs);
1848 leftLay->addSpacing(cs->gl->contentsMargins().right());
1852 mainLay->addWidget(buttons);
1856 ok->setDefault(
true);
1865 retranslateStrings();
1876 colorDialogHelper->setOptions(options);
1886 QColorDialogOptions::setCustomColor(nextCust, cs->currentColor());
1889 nextCust = (nextCust+1) % QColorDialogOptions::customColorCount();
1894 if (nativeDialogInUse)
1897 if (!smallDisplay) {
1898 lblBasicColors->setText(QColorDialog::tr(
"&Basic colors"));
1899 lblCustomColors->setText(QColorDialog::tr(
"&Custom colors"));
1900 addCusBt->setText(QColorDialog::tr(
"&Add to Custom Colors"));
1901#if !defined(QT_SMALL_COLORDIALOG)
1902 if (eyeDropperButton)
1903 eyeDropperButton->setText(QColorDialog::tr(
"&Pick Screen Color"));
1907 cs->retranslateStrings();
1922 if (nativeDialogInUse)
1930 return strcmp(QColorDialog::staticMetaObject.
className(),
q->metaObject()->className()) == 0;
2022 d->setCurrentColor(
color);
2028 return d->currentQColor();
2042 return d->selectedQColor;
2053 const QColorDialog::ColorDialogOptions previousOptions =
options();
2054 if (!(previousOptions &
option) != !on)
2069 return d->options->testOption(
static_cast<QColorDialogOptions::ColorDialogOption
>(
option));
2091 d->options->setOptions(QColorDialogOptions::ColorDialogOptions(
int(
options)));
2093 d->nativeDialogInUse =
false;
2096 if (!
d->nativeDialogInUse) {
2099 if (
d->eyeDropperButton)
2107 return QColorDialog::ColorDialogOptions(
int(
d->options->options()));
2196 d->receiverToDisconnectOnClose = receiver;
2197 d->memberToDisconnectOnClose = member;
2212 ColorDialogOptions options)
2216 dlg.setWindowTitle(
title);
2218 dlg.setCurrentColor(initial);
2220 return dlg.selectedColor();
2238 d->retranslateStrings();
2246 static QPoint lastGlobalPos;
2248 if (lastGlobalPos == newGlobalPos)
2250 lastGlobalPos = newGlobalPos;
2252 if (!
q->rect().contains(
q->mapFromGlobal(newGlobalPos))) {
2255 dummyTransparentWindow.setPosition(newGlobalPos);
2289#if QT_CONFIG(shortcut)
2314 d->selectedQColor =
d->currentQColor();
2320 if (
d->receiverToDisconnectOnClose) {
2322 d->receiverToDisconnectOnClose,
d->memberToDisconnectOnClose);
2323 d->receiverToDisconnectOnClose =
nullptr;
2325 d->memberToDisconnectOnClose.clear();
2330#include "qcolordialog.moc"
2331#include "moc_qcolordialog.cpp"
int startDragDistance
the minimum distance required for a drag and drop operation to start.
void addLayout(QLayout *layout, int stretch=0)
Adds layout to the end of the box, with serial stretch factor stretch.
void releaseColorPicking()
QColor grabScreenColor(const QPoint &p)
QLabel * lblScreenColorInfo
bool selectColor(const QColor &color)
void init(const QColor &initial)
QColorLuminancePicker * lp
void setCurrentAlpha(int a)
bool handleColorPickingMouseButtonRelease(QMouseEvent *e)
QColor currentQColor() const
void updateColorPicking()
bool handleColorPickingMouseMove(QMouseEvent *e)
void _q_setCustom(int index, QRgb color)
void updateColorLabelText(const QPoint &)
void setCurrentColor(const QColor &color, SetColorMode setColorMode=SetColorAll)
bool isAlphaVisible() const
void setCurrentQColor(const QColor &color)
bool canBeNativeDialog() const override
void setCurrentRgbColor(QRgb rgb)
void retranslateStrings()
QRgb currentColor() const
QPushButton * eyeDropperButton
void newColorTypedIn(QRgb rgb)
bool handleColorPickingKeyPress(QKeyEvent *e)
void newStandard(int, int)
QSharedPointer< QColorDialogOptions > options
void setVisible(bool visible) override
QDialogButtonBox * buttons
bool supportsColorPicking() const
QRgb beforeScreenColorPicking
virtual void initHelper(QPlatformDialogHelper *h) override
QByteArray memberToDisconnectOnClose
QPointer< QObject > receiverToDisconnectOnClose
void newHsv(int h, int s, int v)
QColorPickingEventFilter * colorPickingEventFilter
virtual void helperPrepareShow(QPlatformDialogHelper *h) override
QPlatformColorDialogHelper * platformColorDialogHelper() const
void nextCustom(int, int)
The QColorDialog class provides a dialog widget for specifying colors.
static QColor getColor(const QColor &initial=Qt::white, QWidget *parent=nullptr, const QString &title=QString(), ColorDialogOptions options=ColorDialogOptions())
QColor currentColor
the currently selected color in the dialog
bool testOption(ColorDialogOption option) const
void setVisible(bool visible) override
Changes the visibility of the dialog.
static QColor customColor(int index)
void changeEvent(QEvent *event) override
\reimp
void setCurrentColor(const QColor &color)
void currentColorChanged(const QColor &color)
This signal is emitted whenever the current color changes in the dialog.
void setOptions(ColorDialogOptions options)
static int customCount()
Returns the number of custom colors supported by QColorDialog.
QColorDialog(QWidget *parent=nullptr)
void done(int result) override
Closes the dialog and sets its result code to result.
~QColorDialog()
Destroys the color dialog.
void colorSelected(const QColor &color)
This signal is emitted just after the user has clicked \uicontrol{OK} to select a color to use.
ColorDialogOptions options
the various options that affect the look and feel of the dialog
static void setCustomColor(int index, QColor color)
Sets the custom color at index to the QColor color value.
static QColor standardColor(int index)
static void setStandardColor(int index, QColor color)
Sets the standard color at index to the QColor color value.
QColor selectedColor() const
Returns the color that the user selected by clicking the \uicontrol{OK} or equivalent button.
void setOption(ColorDialogOption option, bool on=true)
Sets the given option to be enabled if on is true; otherwise, clears the given option.
The QColor class provides colors based on RGB, HSV or CMYK values.
QRgb rgb() const noexcept
Returns the RGB value of the color.
static QColor fromString(QAnyStringView name) noexcept
void setRgba(QRgb rgba) noexcept
Sets the RGB value to rgba, including its alpha.
static QColor fromHsv(int h, int s, int v, int a=255)
Static convenience function that returns a QColor constructed from the HSV color values,...
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
static bool testAttribute(Qt::ApplicationAttribute attribute)
Returns true if attribute attribute is set; otherwise returns false.
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
bool setNativeDialogVisible(bool visible)
virtual void setVisible(bool visible)
QPlatformDialogHelper * platformHelper() const
The QDialog class is the base class of dialog windows.
virtual void reject()
Hides the modal dialog and sets the result code to Rejected.
virtual void done(int)
Closes the dialog and sets its result code to r.
void setVisible(bool visible) override
\reimp
virtual void accept()
Hides the modal dialog and sets the result code to Accepted.
Type type() const
Returns the event type.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QFocusEvent class contains event parameters for widget focus events.
The QFrame class is the base class of widgets that can have a frame.
int frameWidth
the width of the frame that is drawn.
void drawFrame(QPainter *)
The QGridLayout class lays out widgets in a grid.
void addWidget(QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
int spacing() const override
If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwi...
static QPlatformIntegration * platformIntegration()
QScreen * primaryScreen
the primary (or default) screen of the application.
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
The QHBoxLayout class lines up widgets horizontally.
QRgb pixel(int x, int y) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QKeyEvent class describes a key event.
int key() const
Returns the code of the key that was pressed or released.
The QLabel widget provides a text or image display.
void setBuddy(QWidget *)
Sets this label's buddy to buddy.
void setText(const QString &)
void setAlignment(Qt::Alignment)
void setContentsMargins(int left, int top, int right, int bottom)
The QLineEdit widget is a one-line text editor.
void textEdited(const QString &)
This signal is emitted whenever the text is edited.
void setValidator(const QValidator *)
Sets the validator for values of line edit to v.
void setText(const QString &)
QString text
The line edit's text.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
The QPaintEvent class contains event parameters for paint events.
const QRect & rect() const
Returns the rectangle that needs to be updated.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPalette class contains color groups for each widget state.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
int height() const
Returns the height of the pixmap.
int width() const
Returns the width of the pixmap.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr void setRect(int x, int y, int w, int h) noexcept
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void translate(int dx, int dy) noexcept
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
\inmodule QtCore \reentrant
The QResizeEvent class contains event parameters for resize events.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect geometry
the screen's geometry in pixels
QPixmap grabWindow(WId window=0, int x=0, int y=0, int w=-1, int h=-1)
Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by Q...
QRect virtualGeometry
the pixel geometry of the virtual desktop to which this screen belongs
Exception-safe wrapper around QObject::blockSignals().
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
QPointF position() const
Returns the position of the point in this event, relative to the widget or item that received the eve...
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr QSize boundedTo(const QSize &) const noexcept
Returns a size holding the minimum width and height of this size and the given otherSize.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
The QSpinBox class provides a spin box widget.
int value
the value of the spin box
void setRange(int min, int max)
Convenience function to set the minimum, and maximum values with a single function call.
void valueChanged(int)
This signal is emitted whenever the spin box's value is changed.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
QString & prepend(QChar c)
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
void initFrom(const QWidget *w)
@ State_KeyboardFocusChange
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
The QVBoxLayout class lines up widgets vertically.
QColSpinBox(QWidget *parent)
QColorLuminancePicker(QWidget *parent=nullptr)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void setCol(int h, int s, int v)
void newHsv(int h, int s, int v)
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
QSize sizeHint() const override
void setCrossVisible(bool visible)
void resizeEvent(QResizeEvent *) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
QColorPicker(QWidget *parent)
void setCol(int h, int s)
void newCol(int h, int s)
bool eventFilter(QObject *, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent)
QColorShowLabel(QWidget *parent)
QColor currentQColor() const
void setCurrentAlpha(int a)
QColorShower(QColorDialog *parent)
bool isAlphaVisible() const
void setHsv(int h, int s, int v)
void retranslateStrings()
QRgb currentColor() const
void currentColorChanged(const QColor &color)
QColorWell(QWidget *parent, int r, int c, const QRgb *vals)
void paintCellContents(QPainter *, int row, int col, const QRect &) override
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void mouseReleaseEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void focusOutEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
void currentChanged(int row, int col)
int columnAt(int x) const
void updateCell(int row, int column)
void selected(int row, int col)
void colorChanged(int index, QRgb color)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void focusInEvent(QFocusEvent *) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
virtual void setCurrent(int row, int col)
virtual void setSelected(int row, int col)
QWellArray(int rows, int cols, QWidget *parent=nullptr)
QRect cellGeometry(int row, int column)
virtual void paintCell(QPainter *, int row, int col, const QRect &)
int columnX(int column) const
QSize sizeHint() const override
virtual void paintCellContents(QPainter *, int row, int col, const QRect &)
int selectedColumn() const
void keyPressEvent(QKeyEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
QString cellContent(int row, int col) const
Combined button and popup list for selecting options.
@ AA_DontUseNativeDialogs
QtPrivate::QColorShower QColorShower
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
QtPrivate::QColorWell QColorWell
static const Qt::WindowFlags qcd_DefaultWindowFlags
QtPrivate::QColorPickingEventFilter QColorPickingEventFilter
QtPrivate::QColorLuminancePicker QColorLuminancePicker
QtPrivate::QColorPicker QColorPicker
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLsizei void GLsizei void * column
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
QT_BEGIN_NAMESPACE QColor grabScreenColor(const QPoint &p)
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr QRgb qRgb(int r, int g, int b)
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr QRgb qRgba(int r, int g, int b, int a)
constexpr int qBlue(QRgb rgb)
static const struct TessellationWindingOrderTab cw[]
#define QStringLiteral(str)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
static QString windowTitle(HWND hwnd)
const char className[16]
[1]
application x qt windows mime
[2]
myObject disconnect()
[26]