44 #ifndef QT_NO_COLORDIALOG 65 #include "private/qguiplatformplugin_p.h" 68 #include "private/qt_s60_p.h" 71 #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) 72 # define QT_SMALL_COLORDIALOG 110 {
return y /
cellh; }
116 {
return cellh * row; }
136 if (row >= 0 && row < nrows && column >= 0 && column <
ncols)
180 int rowfirst =
rowAt(cy);
181 int rowlast =
rowAt(cy + ch);
194 if (collast < 0 || collast >= ncols)
196 if (rowlast < 0 || rowlast >= nrows)
200 for (
int r = rowfirst; r <= rowlast; ++r) {
207 for (
int c = colfirst;
c <= collast; ++
c) {
309 if (row < 0 || col < 0)
333 if (row < 0 || col < 0)
444 for (
int g = 0; g < 4; g++)
445 for (
int r = 0; r < 4; r++)
446 for (
int b = 0; b < 3; b++)
447 stdrgb[i++] =
qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
449 for (i = 0; i < 2*8; i++)
472 if (
uint(index) >=
uint(customCount()))
473 return qRgb(255, 255, 255);
487 if (
uint(index) >=
uint(customCount()))
521 :
QWellArray(r, c, parent),
values(vals), mousePressed(false), oldCurrent(-1, -1)
529 #ifndef QT_NO_DRAGANDDROP 561 #ifndef QT_NO_DRAGANDDROP 578 mousePressed =
false;
584 #ifndef QT_NO_DRAGANDDROP 622 #endif // QT_NO_DRAGANDDROP 629 mousePressed =
false;
640 void setCol(
int h,
int s);
643 void newCol(
int h,
int s);
657 int huePt(
const QPoint &pt);
658 int satPt(
const QPoint &pt);
659 void setCol(
const QPoint &pt);
675 void setCol(
int h,
int s,
int v);
676 void setCol(
int h,
int s);
679 void newHsv(
int h,
int s,
int v);
687 enum { foff = 3, coff = 4 };
703 return 255 - (y - coff)*255/d;
709 return coff + (255-v)*d/255;
756 int wi = r.
width() - 2;
763 for (y = 0; y < hi; y++) {
765 while (pixel < end) {
782 a.
setPoints(3, w, y, w+5, y+5, w+5, y-5);
805 return 360 - pt.
x() * 360 / (r.
width() - 1);
811 return 255 - pt.
y() * 255 / (r.
height() - 1);
816 setCol(huePt(pt), satPt(pt));
842 if (nhue ==
hue && nsat ==
sat)
891 for (y = 0; y < h; y++) {
894 while (pixel < end) {
911 :
QSpinBox(parent) { setRange(0, 255); }
929 void setHsv(
int h,
int s,
int v);
934 void showAlpha(
bool b);
935 bool isAlphaVisible()
const;
939 void retranslateStrings();
947 void currentColorChanged(
const QColor &color);
953 void showCurrentColor();
987 mousePressed =
false;
992 void colorDropped(
QRgb);
999 #ifndef QT_NO_DRAGANDDROP 1020 alphaLab->setVisible(b);
1021 alphaEd->setVisible(b);
1026 return alphaLab->isVisible();
1031 mousePressed =
true;
1032 pressPos = e->
pos();
1037 #ifdef QT_NO_DRAGANDDROP 1053 mousePressed =
false;
1059 #ifndef QT_NO_DRAGANDDROP 1078 emit colorDropped(col.rgb());
1084 #endif // QT_NO_DRAGANDDROP 1090 mousePressed =
false;
1105 #ifdef QT_SMALL_COLORDIALOG 1107 const bool nonTouchUI = !S60->hasTouchscreen;
1108 # elif defined Q_WS_MAEMO_5 1109 const bool nonTouchUI =
false;
1114 #ifdef QT_SMALL_COLORDIALOG 1125 #if !defined(QT_SMALL_COLORDIALOG) 1139 #ifndef QT_NO_SHORTCUT 1143 #if !defined(QT_SMALL_COLORDIALOG) 1158 #ifndef QT_NO_SHORTCUT 1162 #if !defined(QT_SMALL_COLORDIALOG) 1177 #ifndef QT_NO_SHORTCUT 1181 #if !defined(QT_SMALL_COLORDIALOG) 1196 #ifndef QT_NO_SHORTCUT 1200 #if !defined(QT_SMALL_COLORDIALOG) 1215 #ifndef QT_NO_SHORTCUT 1219 #if !defined(QT_SMALL_COLORDIALOG) 1234 #ifndef QT_NO_SHORTCUT 1238 #if !defined(QT_SMALL_COLORDIALOG) 1253 #ifndef QT_NO_SHORTCUT 1257 #if !defined(QT_SMALL_COLORDIALOG) 1292 return cs->currentQColor();
1358 if (h < -1 || (
uint)s > 255 || (
uint)v > 255)
1401 cs->setHsv(h, s, v);
1403 lp->setCol(h, s, v);
1410 _q_newColorTypedIn(rgb);
1417 if (cs->curQColor != color) {
1418 cs->curQColor = color;
1419 emit q->currentColorChanged(color);
1429 for (i = 0; i < 6; i++) {
1430 for (j = 0; j < 8; j++) {
1431 if (color ==
stdrgb[i + j*6]) {
1432 _q_newStandard(i, j);
1433 standard->setCurrent(i, j);
1434 standard->setSelected(i, j);
1435 standard->setFocus();
1443 for (i = 0; i < 2; i++) {
1444 for (j = 0; j < 8; j++) {
1445 if (color ==
cusrgb[i + j*2]) {
1447 custom->setCurrent(i, j);
1448 custom->setSelected(i, j);
1464 lp->setCol(h, s, v);
1470 setCurrentColor(
cusrgb[i]);
1473 standard->setSelected(-1,-1);
1478 setCurrentColor(
stdrgb[r+c*6]);
1480 custom->setSelected(-1,-1);
1487 q->setSizeGripEnabled(
false);
1490 nativeDialogInUse =
false;
1502 #if defined(Q_WS_WINCE) || defined(QT_SMALL_COLORDIALOG) 1503 smallDisplay =
true;
1504 const int lumSpace = 20;
1509 const int lumSpace = topLay->
spacing() / 2;
1512 if (!smallDisplay) {
1519 #ifndef QT_NO_SETTINGS 1522 for (
int i = 0; i < 2*8; ++i) {
1532 #if defined(QT_SMALL_COLORDIALOG) 1533 # if defined(Q_WS_S60) 1534 const bool nonTouchUI = !S60->hasTouchscreen;
1535 # elif defined(Q_WS_MAEMO_5) 1536 const bool nonTouchUI =
false;
1540 if (!smallDisplay) {
1542 lblBasicColors =
new QLabel(q);
1543 #ifndef QT_NO_SHORTCUT 1544 lblBasicColors->setBuddy(standard);
1546 q->connect(standard,
SIGNAL(selected(
int,
int)),
SLOT(_q_newStandard(
int,
int)));
1547 leftLay->addWidget(lblBasicColors);
1548 leftLay->addWidget(standard);
1550 #if !defined(Q_WS_WINCE) 1551 leftLay->addStretch();
1555 custom->setAcceptDrops(
true);
1557 q->connect(custom,
SIGNAL(selected(
int,
int)),
SLOT(_q_newCustom(
int,
int)));
1558 lblCustomColors =
new QLabel(q);
1559 #ifndef QT_NO_SHORTCUT 1560 lblCustomColors->setBuddy(custom);
1562 leftLay->addWidget(lblCustomColors);
1563 leftLay->addWidget(custom);
1567 leftLay->addWidget(addCusBt);
1570 #if defined(QT_SMALL_COLORDIALOG) 1596 #if defined(QT_SMALL_COLORDIALOG) 1610 #if defined(QT_SMALL_COLORDIALOG) 1612 const int minDimension =
qMin(screenSize.
height(), screenSize.
width());
1614 int pickerWidth = !nonTouchUI ? minDimension/9 : minDimension/12;
1615 lp->setFixedWidth(pickerWidth);
1621 lp->setFixedWidth(20);
1634 #if defined(QT_SMALL_COLORDIALOG) 1636 pWidth -= cp->size().width();
1647 ok->setDefault(
true);
1657 q->setCurrentColor(initial);
1662 cusrgb[nextCust] = cs->currentColor();
1665 nextCust = (nextCust+1) % 16;
1670 if (!smallDisplay) {
1676 cs->retranslateStrings();
1761 d->setCurrentColor(color.
rgb());
1762 d->selectColor(color);
1763 d->setCurrentAlpha(color.
alpha());
1766 d->setCurrentQColor(color);
1767 d->setCocoaPanelColor(color);
1769 if (
d->nativeDialogInUse)
1776 return d->currentQColor();
1791 return d->selectedQColor;
1803 if (!(
d->opts & option) != !on)
1821 return (
d->opts & option) != 0;
1843 ColorDialogOptions changed = (options ^
d->opts);
1848 d->buttons->setVisible(!(options &
NoButtons));
1923 #if defined(Q_WS_MAC) 1934 d->closeCocoaColorPanel();
1942 d->nativeDialogInUse =
true;
1947 d->nativeDialogInUse =
false;
1971 d->receiverToDisconnectOnClose = receiver;
1972 d->memberToDisconnectOnClose = member;
1993 extern QColor qtSymbianGetColor(
const QColor &initial);
2018 return qtSymbianGetColor(initial);
2042 return qtSymbianGetColor(initial);
2080 #if defined(Q_WS_MAC) 2082 d->releaseCocoaColorPanelDelegate();
2087 #ifndef QT_NO_SETTINGS 2090 for (
int i = 0; i < 2*8; ++i)
2094 if (
d->nativeDialogInUse)
2107 d->retranslateStrings();
2123 d->selectedQColor =
d->currentQColor();
2128 if (
d->receiverToDisconnectOnClose) {
2130 d->receiverToDisconnectOnClose,
d->memberToDisconnectOnClose);
2131 d->receiverToDisconnectOnClose = 0;
2133 d->memberToDisconnectOnClose.clear();
2138 #include "qcolordialog.moc" 2139 #include "moc_qcolordialog.cpp" 2141 #endif // QT_NO_COLORDIALOG static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
void setRgb(int r, int g, int b, int a=255)
Sets the RGB value to r, g, b and the alpha value to a.
virtual void setCellBrush(int row, int col, const QBrush &)
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.
void setValue(const QString &key, const QVariant &value)
Sets the value of setting key to value.
ColorDialogOption
This enum specifies various options that affect the look and feel of a color dialog.
int columnX(int column) const
bool blockSignals(bool b)
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
void selected(int row, int col)
The QKeyEvent class describes a key event.
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Returns the value for setting key.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
void setPixmap(const QPixmap &)
Sets pixmap as the pixmap used to represent the data in a drag and drop operation.
const QColor & color() const
Returns the brush color.
The QDrag class provides support for MIME-based drag and drop data transfer.
int width() const
Returns the width of the pixmap.
void setMimeData(QMimeData *data)
Sets the data to be sent to the given MIME data.
void mousePressEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseReleaseEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void setCurrentColor(QRgb rgb)
QStyle::State state
the style flags that are used when drawing the control
void _q_newHsv(int h, int s, int v)
The QDialog class is the base class of dialog windows.
void setText(const QString &)
virtual void setSelected(int row, int col)
int exec()
Shows the dialog as a modal dialog, blocking until the user closes it.
QColor currentQColor() const
The QSettings class provides persistent platform-independent application settings.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
ColorDialogOptions options() const
QVariant colorData() const
Returns a color if the data stored in the object represents a color (MIME type application/x-color); ...
void _q_newStandard(int, int)
void resizeEvent(QResizeEvent *)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
QRect united(const QRect &other) const
Returns the bounding rectangle of this rectangle and the given rectangle.
void setColorData(const QVariant &color)
Sets the color data in the object to the given color.
QColorWell(QWidget *parent, int r, int c, QRgb *vals)
void addLayout(QLayout *layout, int stretch=0)
Adds layout to the end of the box, with serial stretch factor stretch.
QColor selectedColor() const
Returns the color that the user selected by clicking the OK or equivalent button. ...
static Qt::MouseButtons buttons
QColor currentQColor() const
void mousePressEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void focusInEvent(QFocusEvent *)
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
void accept()
Calls QDropEvent::accept().
int width() const
Returns the width of the rectangle.
QColSpinBox(QWidget *parent)
static int customCount()
Returns the number of custom colors supported by QColorDialog.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
const QBrush & foreground() const
Use windowText() instead.
long ASN1_INTEGER_get ASN1_INTEGER * a
int columnAt(int x) const
The QPolygon class provides a vector of points using integer precision.
void keyPressEvent(QKeyEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
void drawLine(const QLineF &line)
Draws a line defined by line.
QColorDialog(QWidget *parent=0)
Constructs a color dialog with the given parent.
int height() const
Returns the height of the rectangle.
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
static void setStandardColor(int index, QRgb color)
Sets the standard color at index to the QRgb color value.
The QString class provides a Unicode character string.
QBrush cellBrush(int row, int col)
em>Reimplemented Function
void _q_newCustom(int, int)
void updateCell(int row, int column)
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
void setCol(int h, int s, int v)
static const Qt::WindowFlags DefaultWindowFlags
The QObject class is the base class of all Qt objects.
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=0)
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment...
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
void setRange(int min, int max)
Convenience function to set the minimum, and maximum values with a single function call...
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void focusOutEvent(QFocusEvent *)
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
void getHsv(int *h, int *s, int *v, int *a=0) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
void newHsv(int h, int s, int v)
void setHsv(int h, int s, int v, int a=255)
Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha componen...
bool testOption(ColorDialogOption option) const
Returns true if the given option is enabled; otherwise, returns false.
QColorDialog * colorDialog
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
void setCurrentColor(const QColor &color)
void mouseMoveEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void dragLeaveEvent(QDragLeaveEvent *e)
This event handler is called when a drag is in progress and the mouse leaves this widget...
void addStretch(int stretch=0)
Adds a stretchable space (a QSpacerItem) with zero minimum size and stretch factor stretch to the end...
void retranslateStrings()
int key() const
Returns the code of the key that was pressed or released.
int lineWidth
the line width for drawing the frame
int width() const
Returns the width.
QColorPicker(QWidget *parent)
void setOptions(ColorDialogOptions options)
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QColorDialog class provides a dialog widget for specifying colors.
void setCol(int h, int s)
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
QRect cellGeometry(int row, int column)
QPoint bottomRight() const
Returns the position of the rectangle's bottom-right corner.
void done(int result)
Closes the dialog and sets its result code to result.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QRgb getRgba(QRgb rgba=0xffffffff, bool *ok=0, QWidget *parent=0)
void init(const QColor &initial)
QRgb currentColor() const
QSize size() const
Returns the size of the rectangle.
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
The QStyleOptionFocusRect class is used to describe the parameters for drawing a focus rectangle with...
The QResizeEvent class contains event parameters for resize events.
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
QWellArray(int rows, int cols, QWidget *parent=0)
int spacing() const
If the vertical spacing is equal to the horizontal spacing, this function returns that value; otherwi...
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
void setCurrentAlpha(int a)
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
void drawFrame(QPainter *)
em>Reimplemented Function
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
bool isAlphaVisible() const
void dropEvent(QDropEvent *e)
This event handler is called when the drag is dropped on this widget.
QColor currentColor() const
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
void _q_newColorTypedIn(QRgb rgb)
QColorShower(QColorDialog *parent)
static int startDragDistance()
The QMimeData class provides a container for data that records information about its MIME type...
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
void dragMoveEvent(QDragMoveEvent *e)
This event handler is called if a drag is in progress, and when any of the following conditions occur...
void dropEvent(QDropEvent *e)
This event handler is called when the drag is dropped on this widget.
bool selectColor(const QColor &color)
void setRgba(QRgb rgba)
Use setRgb() instead.
The QMouseEvent class contains parameters that describe a mouse event.
static QColor getColor(const QColor &initial, QWidget *parent, const QString &title, ColorDialogOptions options=0)
Pops up a modal color dialog with the given window title (or "Select Color" if none is specified)...
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
virtual void done(int)
Closes the dialog and sets its result code to r.
QPoint topRight() const
Returns the position of the rectangle's top-right corner.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
QPalette palette
the palette that should be used when painting the control
The QBrush class defines the fill pattern of shapes drawn by QPainter.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
void mouseMoveEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
bool isAlphaVisible() const
void setHsv(int h, int s, int v)
void setBuddy(QWidget *)
Sets this label's buddy to buddy.
void setCurrentAlpha(int a)
QPoint bottomLeft() const
Returns the position of the rectangle's bottom-left corner.
static bool sharedColorPanelAvailable
QString cellContent(int row, int col) const
void dragLeaveEvent(QDragLeaveEvent *e)
This event handler is called when a drag is in progress and the mouse leaves this widget...
ushort alpha
Returns the alpha color component of this color.
int y() const
Returns the y-coordinate of the rectangle's top edge.
virtual void setCurrent(int row, int col)
void mouseMoveEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
int midLineWidth
the mid-line width for drawing the frame
int y() const
Returns the y position of the mouse cursor, relative to the widget that received the event...
void addSpacing(int size)
Adds a non-stretchable space (a QSpacerItem) with size size to the end of this box layout...
void mousePressEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
void setRect(int x, int y, int w, int h)
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
~QColorDialog()
Destroys the color dialog.
The QPoint class defines a point in the plane using integer precision.
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
The QGridLayout class lays out widgets in a grid.
void setFrameStyle(int)
Sets the frame style to style.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
virtual void paintCell(QPainter *, int row, int col, const QRect &)
void dragEnterEvent(QDragEnterEvent *e)
This event handler is called when a drag is in progress and the mouse enters this widget...
Qt::DropAction start(Qt::DropActions supportedActions=Qt::CopyAction)
Starts the drag and drop operation and returns a value indicating the requested drop action when it i...
int satPt(const QPoint &pt)
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
The QSpinBox class provides a spin box widget.
void mouseReleaseEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
The QLabel widget provides a text or image display.
T qvariant_cast(const QVariant &)
The QHBoxLayout class lines up widgets horizontally.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
int y() const
Returns the y coordinate of this point.
void retranslateStrings()
The QPixmap class is an off-screen image representation that can be used as a paint device...
int spacing() const
Reimplements QLayout::spacing().
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
static QRgb customColor(int index)
Returns the custom color at the given index as a QRgb value.
QRgb currentColor() const
void mouseReleaseEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void currentColorChanged(const QColor &color)
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
int height() const
Returns the height of the pixmap.
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).
QColorShowLabel(QWidget *parent)
const QMimeData * mimeData() const
Returns the data that was dropped on the widget and its associated MIME type information.
void setSizeConstraint(SizeConstraint)
void open()
Shows the dialog as a window modal dialog, returning immediately.
The QSize class defines the size of a two-dimensional object using integer point precision.
void setPoints(int nPoints, const int *points)
Resizes the polygon to nPoints and populates it with the given points.
void mousePressEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
QColorLuminancePicker(QWidget *parent=0)
int x() const
Returns the x coordinate of this point.
bool isValid() const
Returns true if the color is valid; otherwise returns false.
The QVBoxLayout class lines up widgets vertically.
void mouseMoveEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void changeEvent(QEvent *event)
Reimplemented Function
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
void addWidget(QWidget *w)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void paintCellContents(QPainter *, int row, int col, const QRect &)
Reimplement this function to change the contents of the well array.
bool signalsBlocked() const
Returns true if signals are blocked; otherwise returns false.
const QRect & rect() const
Returns the rectangle that needs to be updated.
void setVisible(bool visible)
Changes the visibility of the dialog.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
The QPaintEvent class contains event parameters for paint events.
virtual void paintCellContents(QPainter *, int row, int col, const QRect &)
Reimplement this function to change the contents of the well array.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
static const KeyPair *const end
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
The QFrame class is the base class of widgets that can have a frame.
void setOption(ColorDialogOption option, bool on=true)
Sets the given option to be enabled if on is true; otherwise, clears the given option.
void setVisible(bool visible)
Reimplemented Function
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int selectedColumn() const
void setAlignment(Qt::Alignment)
Without this function, a call to e.
void mousePressEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void setCurrentQColor(const QColor &color)
QRect rect
the area that should be used for various calculations and painting
void ignore()
Calls QDropEvent::ignore().
QRgb rgb() const
Returns the RGB value of the color.
The QFocusEvent class contains event parameters for widget focus events.
void newCol(int h, int s)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
const QPoint & pos() const
Returns the position where the drop was made.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
void colorSelected(const QColor &color)
This signal is emitted just after the user has clicked OK to select a color to use.
void dragEnterEvent(QDragEnterEvent *e)
This event handler is called when a drag is in progress and the mouse enters this widget...
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
static void setCustomColor(int index, QRgb color)
Sets the custom color at index to the QRgb color value.
The QPalette class contains color groups for each widget state.
int huePt(const QPoint &pt)