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>
151 QWindow dummyTransparentWindow;
189 {
return y / cellh; }
192 {
if (
isRightToLeft())
return ncols - (
x / cellw) - 1;
return x / cellw; }
195 {
return cellh *
row; }
207 {
return QRect(0, 0, cellw, cellh); }
210 {
return QSize(ncols * cellw, nrows * cellh); }
215 if (
row >= 0 && row < nrows && column >= 0 &&
column < ncols)
260 int rowfirst =
rowAt(cy);
274 if (collast < 0 || collast >= ncols)
276 if (rowlast < 0 || rowlast >= nrows)
280 for (
int r = rowfirst;
r <= rowlast; ++
r) {
287 for (
int c = colfirst;
c <= collast; ++
c) {
300 ,nrows(rows), ncols(cols)
327 opt.midLineWidth = 1;
334 if ((
row == curRow) && (col == curCol)) {
355 p->drawLine(
r.topLeft(),
r.bottomRight());
356 p->drawLine(
r.topRight(),
r.bottomLeft());
380 if ((curRow ==
row) && (curCol == col))
383 if (
row < 0 || col < 0)
409 if (
row < 0 || col < 0)
487 switch (
event->type()) {
512 return QColorDialogOptions::customColorCount();
522 return QColor(QColorDialogOptions::customColor(
index));
534 QColorDialogOptions::setCustomColor(
index,
color.rgba());
544 return QColor(QColorDialogOptions::standardColor(
index));
556 QColorDialogOptions::setStandardColor(
index,
color.rgba());
563 c.getHsv(&
h, &
s, &
v);
580#if QT_CONFIG(draganddrop)
581 void dragEnterEvent(QDragEnterEvent *
e)
override;
582 void dragLeaveEvent(QDragLeaveEvent *
e)
override;
583 void dragMoveEvent(QDragMoveEvent *
e)
override;
584 void dropEvent(QDropEvent *
e)
override;
606 pressPos =
e->position().toPoint();
612#if QT_CONFIG(draganddrop)
620 mime->setColorData(col);
629 mousePressed =
false;
635#if QT_CONFIG(draganddrop)
636void QColorWell::dragEnterEvent(QDragEnterEvent *
e)
638 if (qvariant_cast<QColor>(
e->mimeData()->colorData()).isValid())
644void QColorWell::dragLeaveEvent(QDragLeaveEvent *)
650void QColorWell::dragMoveEvent(QDragMoveEvent *
e)
652 if (qvariant_cast<QColor>(
e->mimeData()->colorData()).isValid()) {
660void QColorWell::dropEvent(QDropEvent *
e)
662 QColor col = qvariant_cast<QColor>(
e->mimeData()->colorData());
679 mousePressed =
false;
708 int huePt(
const QPoint &pt);
709 int satPt(
const QPoint &pt);
743 enum { foff = 3, coff = 4 };
756int QColorLuminancePicker::y2val(
int y)
759 return 255 - (
y - coff)*255/
d;
762int QColorLuminancePicker::val2y(
int v)
765 return coff + (255-
v)*
d/255;
771 hue = 100;
val = 100; sat = 100;
783 setVal(y2val(
m->position().toPoint().y()));
787 setVal(y2val(
m->position().toPoint().y()));
790void QColorLuminancePicker::setVal(
int v)
795 delete pix; pix=
nullptr;
812 int wi =
r.width() - 2;
813 int hi =
r.height() - 2;
814 if (!pix || pix->
height() != hi || pix->
width() != wi) {
819 for (
y = 0;
y < hi;
y++) {
827 p.drawPixmap(1, coff, *pix);
830 p.setPen(
g.windowText().color());
831 p.setBrush(
g.windowText());
834 a.setPoints(3,
w,
y,
w+5,
y+5,
w+5,
y-5);
844 delete pix; pix=
nullptr;
848QPoint QColorPicker::colPt()
851 return QPoint((360 - hue) * (
r.width() - 1) / 360, (255 - sat) * (
r.height() - 1) / 255);
854int QColorPicker::huePt(
const QPoint &pt)
857 return 360 - pt.
x() * 360 / (
r.width() - 1);
860int QColorPicker::satPt(
const QPoint &pt)
863 return 255 - pt.
y() * 255 / (
r.height() - 1);
868 setCol(huePt(pt), satPt(pt));
903 if (nhue == hue && nsat == sat)
907 hue = nhue; sat = nsat;
934 p.drawPixmap(
r.topLeft(), pix);
937 QPoint pt = colPt() +
r.topLeft();
953 for (
y = 0;
y <
h;
y++) {
956 while (pixel <
end) {
959 c.setHsv(huePt(
p), satPt(
p), 200);
980class QColorShowLabel;
1015 void showCurrentColor();
1040 friend class QT_PREPEND_NAMESPACE(QColorDialog);
1041 friend class QT_PREPEND_NAMESPACE(QColorDialogPrivate);
1051 setAcceptDrops(
true);
1052 mousePressed =
false;
1064#if QT_CONFIG(draganddrop)
1065 void dragEnterEvent(QDragEnterEvent *
e)
override;
1066 void dragLeaveEvent(QDragLeaveEvent *
e)
override;
1067 void dropEvent(QDropEvent *
e)
override;
1080 p.fillRect(contentsRect()&
e->rect(), col);
1085 alphaLab->setVisible(
b);
1086 alphaEd->setVisible(
b);
1091 return alphaLab->isVisible();
1096 mousePressed =
true;
1097 pressPos =
e->position().toPoint();
1102#if !QT_CONFIG(draganddrop)
1109 mime->setColorData(col);
1118 mousePressed =
false;
1124#if QT_CONFIG(draganddrop)
1125void QColorShowLabel::dragEnterEvent(QDragEnterEvent *
e)
1127 if (qvariant_cast<QColor>(
e->mimeData()->colorData()).isValid())
1133void QColorShowLabel::dragLeaveEvent(QDragLeaveEvent *)
1137void QColorShowLabel::dropEvent(QDropEvent *
e)
1139 QColor color = qvariant_cast<QColor>(
e->mimeData()->colorData());
1140 if (
color.isValid()) {
1155 mousePressed =
false;
1163 curCol =
qRgb(255, 255, 255);
1171#ifdef QT_SMALL_COLORDIALOG
1178#if !defined(QT_SMALL_COLORDIALOG)
1188 lblHue =
new QLabel(
this);
1189#ifndef QT_NO_SHORTCUT
1193#if !defined(QT_SMALL_COLORDIALOG)
1202 lblSat =
new QLabel(
this);
1203#ifndef QT_NO_SHORTCUT
1207#if !defined(QT_SMALL_COLORDIALOG)
1216 lblVal =
new QLabel(
this);
1217#ifndef QT_NO_SHORTCUT
1221#if !defined(QT_SMALL_COLORDIALOG)
1230 lblRed =
new QLabel(
this);
1231#ifndef QT_NO_SHORTCUT
1235#if !defined(QT_SMALL_COLORDIALOG)
1244 lblGreen =
new QLabel(
this);
1245#ifndef QT_NO_SHORTCUT
1249#if !defined(QT_SMALL_COLORDIALOG)
1258 lblBlue =
new QLabel(
this);
1259#ifndef QT_NO_SHORTCUT
1263#if !defined(QT_SMALL_COLORDIALOG)
1272 alphaLab =
new QLabel(
this);
1273#ifndef QT_NO_SHORTCUT
1277#if !defined(QT_SMALL_COLORDIALOG)
1286 lblHtml =
new QLabel(
this);
1289#ifndef QT_NO_SHORTCUT
1293#if QT_CONFIG(regularexpression)
1295 QRegularExpressionValidator *validator =
new QRegularExpressionValidator(regExp,
this);
1303#if defined(QT_SMALL_COLORDIALOG)
1339void QColorShower::showCurrentColor()
1345void QColorShower::rgbEd()
1363void QColorShower::hsvEd()
1365 rgbOriginal =
false;
1371 c.setHsv(hue, sat,
val);
1385void QColorShower::htmlEd()
1443 rgbOriginal =
false;
1444 hue =
h;
val =
v; sat =
s;
1446 c.setHsv(hue, sat,
val);
1465 lblHue->
setText(QColorDialog::tr(
"Hu&e:"));
1466 lblSat->
setText(QColorDialog::tr(
"&Sat:"));
1467 lblVal->
setText(QColorDialog::tr(
"&Val:"));
1468 lblRed->
setText(QColorDialog::tr(
"&Red:"));
1469 lblGreen->
setText(QColorDialog::tr(
"&Green:"));
1470 lblBlue->
setText(QColorDialog::tr(
"Bl&ue:"));
1471 alphaLab->
setText(QColorDialog::tr(
"A&lpha channel:"));
1472 lblHtml->
setText(QColorDialog::tr(
"&HTML:"));
1477 QColor oldQColor(curQColor);
1479 if (curQColor != oldQColor)
1486 if (!nativeDialogInUse) {
1487 cs->setHsv(
h,
s,
v);
1489 lp->setCol(
h,
s,
v);
1496 if (!nativeDialogInUse) {
1498 _q_newColorTypedIn(
rgb);
1506 if (cs->curQColor !=
color) {
1507 cs->curQColor =
color;
1524 const QRgb *standardColors = QColorDialogOptions::standardColors();
1526 const QRgb *
match = std::find(standardColors, standardColorsEnd,
color);
1527 if (
match != standardColorsEnd) {
1528 const int index = int(
match - standardColors);
1534 standard->setFocus();
1540 const QRgb *customColors = QColorDialogOptions::customColors();
1542 const QRgb *
match = std::find(customColors, customColorsEnd,
color);
1543 if (
match != customColorsEnd) {
1566 return i.pixel(0, 0);
1572 if (!nativeDialogInUse) {
1576 lp->setCol(
h,
s,
v);
1588 setCurrentRgbColor(QColorDialogOptions::customColor(
i));
1590 standard->setSelected(-1,-1);
1595 setCurrentRgbColor(QColorDialogOptions::standardColor(
r +
c * 6));
1597 custom->setSelected(-1,-1);
1606 if (
auto *colorPicker = platformServices->colorPicker(
q->windowHandle())) {
1609 colorPicker->deleteLater();
1610 q->setCurrentColor(
color);
1612 colorPicker->pickColor();
1617 if (!colorPickingEventFilter)
1619 q->installEventFilter(colorPickingEventFilter);
1621 beforeScreenColorPicking = cs->currentColor();
1630 updateTimer->start(30);
1635 dummyTransparentWindow.show();
1641 q->setMouseTracking(
true);
1643 addCusBt->setDisabled(
true);
1644 buttons->setDisabled(
true);
1645 if (eyeDropperButton) {
1646 eyeDropperButton->setDisabled(
true);
1649 updateColorLabelText(globalPos);
1655 if (lblScreenColorInfo)
1656 lblScreenColorInfo->setText(QColorDialog::tr(
"Cursor at %1, %2\nPress ESC to cancel")
1658 .arg(globalPos.
y()));
1664 cp->setCrossVisible(
true);
1665 q->removeEventFilter(colorPickingEventFilter);
1668 updateTimer->stop();
1669 dummyTransparentWindow.setVisible(
false);
1671 q->releaseKeyboard();
1672 q->setMouseTracking(
false);
1673 lblScreenColorInfo->setText(
"\n"_L1);
1674 addCusBt->setDisabled(
false);
1675 buttons->setDisabled(
false);
1676 eyeDropperButton->setDisabled(
false);
1683 q->setSizeGripEnabled(
false);
1684 q->setWindowTitle(QColorDialog::tr(
"Select Color"));
1687 nativeDialogInUse = (platformColorDialogHelper() !=
nullptr);
1688 colorPickingEventFilter =
nullptr;
1691 if (!nativeDialogInUse)
1695 dummyTransparentWindow.resize(1, 1);
1699 q->setCurrentColor(initial);
1714#if defined(QT_SMALL_COLORDIALOG)
1715 smallDisplay =
true;
1716 const int lumSpace = 20;
1721 const int lumSpace = topLay->
spacing() / 2;
1724 if (!smallDisplay) {
1729 lblBasicColors =
new QLabel(
q);
1730#ifndef QT_NO_SHORTCUT
1731 lblBasicColors->setBuddy(standard);
1733 q->connect(standard,
SIGNAL(selected(
int,
int)),
SLOT(_q_newStandard(
int,
int)));
1734 leftLay->addWidget(lblBasicColors);
1735 leftLay->addWidget(standard);
1737#if !defined(QT_SMALL_COLORDIALOG)
1738 if (supportsColorPicking()) {
1740 leftLay->addWidget(eyeDropperButton);
1741 lblScreenColorInfo =
new QLabel(
"\n"_L1);
1742 leftLay->addWidget(lblScreenColorInfo);
1743 q->connect(eyeDropperButton,
SIGNAL(clicked()),
SLOT(_q_pickScreenColor()));
1745 eyeDropperButton =
nullptr;
1746 lblScreenColorInfo =
nullptr;
1750 leftLay->addStretch();
1753 custom->setAcceptDrops(
true);
1755 q->connect(custom,
SIGNAL(selected(
int,
int)),
SLOT(_q_newCustom(
int,
int)));
1756 q->connect(custom,
SIGNAL(currentChanged(
int,
int)),
SLOT(_q_nextCustom(
int,
int)));
1759 QColorDialogOptions::setCustomColor(
index,
color);
1764 lblCustomColors =
new QLabel(
q);
1765#ifndef QT_NO_SHORTCUT
1766 lblCustomColors->setBuddy(custom);
1768 leftLay->addWidget(lblCustomColors);
1769 leftLay->addWidget(custom);
1773 leftLay->addWidget(addCusBt);
1776#if defined(QT_SMALL_COLORDIALOG)
1802#if defined(QT_SMALL_COLORDIALOG)
1811#if defined(QT_SMALL_COLORDIALOG)
1814 lp->setFixedWidth(20);
1830#if defined(QT_SMALL_COLORDIALOG)
1835 leftLay->addSpacing(cs->gl->contentsMargins().right());
1843 ok->setDefault(
true);
1851 retranslateStrings();
1869 QColorDialogOptions::setCustomColor(nextCust, cs->currentColor());
1872 nextCust = (nextCust+1) % QColorDialogOptions::customColorCount();
1877 if (nativeDialogInUse)
1880 if (!smallDisplay) {
1881 lblBasicColors->setText(QColorDialog::tr(
"&Basic colors"));
1882 lblCustomColors->setText(QColorDialog::tr(
"&Custom colors"));
1883 addCusBt->setText(QColorDialog::tr(
"&Add to Custom Colors"));
1884#if !defined(QT_SMALL_COLORDIALOG)
1885 if (eyeDropperButton)
1886 eyeDropperButton->setText(QColorDialog::tr(
"&Pick Screen Color"));
1890 cs->retranslateStrings();
1905 if (nativeDialogInUse)
1913 return strcmp(QColorDialog::staticMetaObject.
className(),
q->metaObject()->className()) == 0;
2005 d->setCurrentColor(
color);
2011 return d->currentQColor();
2025 return d->selectedQColor;
2036 const QColorDialog::ColorDialogOptions previousOptions =
options();
2037 if (!(previousOptions &
option) != !on)
2052 return d->options->testOption(
static_cast<QColorDialogOptions::ColorDialogOption
>(
option));
2074 d->options->setOptions(QColorDialogOptions::ColorDialogOptions(
int(
options)));
2076 d->nativeDialogInUse =
false;
2079 if (!
d->nativeDialogInUse) {
2082 if (
d->eyeDropperButton)
2090 return QColorDialog::ColorDialogOptions(
int(
d->options->options()));
2145 if (
d->nativeDialogInUse) {
2146 if (
d->setNativeDialogVisible(
visible)) {
2172 d->receiverToDisconnectOnClose = receiver;
2173 d->memberToDisconnectOnClose = member;
2188 ColorDialogOptions options)
2215 d->retranslateStrings();
2223 static QPoint lastGlobalPos;
2225 if (lastGlobalPos == newGlobalPos)
2227 lastGlobalPos = newGlobalPos;
2229 if (!
q->rect().contains(
q->mapFromGlobal(newGlobalPos))) {
2232 dummyTransparentWindow.setPosition(newGlobalPos);
2266#if QT_CONFIG(shortcut)
2291 d->selectedQColor =
d->currentQColor();
2297 if (
d->receiverToDisconnectOnClose) {
2299 d->receiverToDisconnectOnClose,
d->memberToDisconnectOnClose);
2300 d->receiverToDisconnectOnClose =
nullptr;
2302 d->memberToDisconnectOnClose.clear();
2307#include "qcolordialog.moc"
2308#include "moc_qcolordialog.cpp"
int startDragDistance
the minimum distance required for a drag and drop operation to start.
int spacing() const override
Reimplements QLayout::spacing().
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
void addSpacing(int size)
Adds a non-stretchable space (a QSpacerItem) with size size to the end of this box layout.
void addStretch(int stretch=0)
Adds a stretchable space (a QSpacerItem) with zero minimum size and stretch factor stretch to the end...
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)
void _q_newColorTypedIn(QRgb rgb)
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
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 _q_nextCustom(int, int)
void setCurrentRgbColor(QRgb rgb)
void retranslateStrings()
QRgb currentColor() const
QPushButton * eyeDropperButton
void _q_newStandard(int, int)
bool handleColorPickingKeyPress(QKeyEvent *e)
void updateColorPicking(const QPoint &pos)
QSharedPointer< QColorDialogOptions > options
QDialogButtonBox * buttons
void _q_updateColorPicking()
bool supportsColorPicking() const
void _q_newHsv(int h, int s, int v)
QRgb beforeScreenColorPicking
virtual void initHelper(QPlatformDialogHelper *h) override
void _q_pickScreenColor()
QByteArray memberToDisconnectOnClose
void _q_newCustom(int, int)
QPointer< QObject > receiverToDisconnectOnClose
QColorPickingEventFilter * colorPickingEventFilter
virtual void helperPrepareShow(QPlatformDialogHelper *h) override
QPlatformColorDialogHelper * platformColorDialogHelper() const
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
static QColor customColor(int index)
void changeEvent(QEvent *event) override
\reimp
void setCurrentColor(const QColor &color)
void setOptions(ColorDialogOptions options)
static int customCount()
Returns the number of custom colors supported by QColorDialog.
QColorDialog(QWidget *parent=nullptr)
~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.
QPlatformDialogHelper * platformHelper() const
The QDialog class is the base class of dialog windows.
virtual int exec()
Shows the dialog as a \l{QDialog::Modal Dialogs}{modal dialog}, blocking until the user closes it.
virtual void done(int)
Closes the dialog and sets its result code to r.
Qt::DropAction exec(Qt::DropActions supportedActions=Qt::MoveAction)
void setMimeData(QMimeData *data)
Sets the data to be sent to the given MIME data.
void setPixmap(const QPixmap &)
Sets pixmap as the pixmap used to represent the data in a drag and drop operation.
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.
The QKeyEvent class describes a key event.
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 setSizeConstraint(SizeConstraint)
void setContentsMargins(int left, int top, int right, int bottom)
The QLineEdit widget is a one-line text editor.
void setValidator(const QValidator *)
Sets the validator for values of line edit to v.
void textChanged(const QString &)
This signal is emitted whenever the text changes.
void setText(const QString &)
QString text
the line edit's text.
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.
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.
\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.
The QPolygon class provides a list of points using integer precision.
\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 int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
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 availableGeometry
the screen's available geometry in pixels
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().
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
Returns true if the string has no characters; otherwise returns false.
\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...
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.
@ WA_WState_ExplicitShowHide
@ AA_DontUseNativeDialogs
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
static const Qt::WindowFlags qcd_DefaultWindowFlags
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]
GLbitfield GLuint64 timeout
[4]
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLsizei void GLsizei void * column
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 QT_BEGIN_NAMESPACE QString windowTitle(HWND hwnd)
const char className[16]
[1]
application x qt windows mime
[2]
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent