Qt 4.8
qstylehelper.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include <qstyleoption.h>
43 #include <qpainter.h>
44 #include <qpixmapcache.h>
45 #include <private/qmath_p.h>
46 #include <private/qstyle_p.h>
47 #include <qmath.h>
48 
49 #if defined(Q_WS_WIN)
50 #include "qt_windows.h"
51 #elif defined(Q_WS_MAC)
52 #include <private/qt_cocoa_helpers_mac_p.h>
53 #endif
54 
55 #include "qstylehelper_p.h"
56 #include <qstringbuilder.h>
57 
59 
60 namespace QStyleHelper {
61 
62 QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
63 {
64  const QStyleOptionComplex *complexOption = qstyleoption_cast<const QStyleOptionComplex *>(option);
65  QString tmp = key % HexString<uint>(option->state)
66  % HexString<uint>(option->direction)
67  % HexString<uint>(complexOption ? uint(complexOption->activeSubControls) : 0u)
69  % HexString<uint>(size.width())
70  % HexString<uint>(size.height());
71 
72 #ifndef QT_NO_SPINBOX
73  if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
74  tmp = tmp % HexString<uint>(spinBox->buttonSymbols)
75  % HexString<uint>(spinBox->stepEnabled)
76  % QLatin1Char(spinBox->frame ? '1' : '0'); ;
77  }
78 #endif // QT_NO_SPINBOX
79  return tmp;
80 }
81 
83 {
84  static qreal scale = -1;
85  if (scale < 0) {
86  scale = 1.0;
87 #if defined(Q_WS_WIN)
88  {
89  HDC hdcScreen = GetDC(0);
90  int dpi = GetDeviceCaps(hdcScreen, LOGPIXELSX);
91  ReleaseDC(0, hdcScreen);
92  scale = dpi/96.0;
93  }
94 #elif defined(Q_WS_MAC)
95  scale = qt_mac_get_scalefactor();
96 #endif
97  }
98  return value * scale;
99 }
100 
101 
102 #ifndef QT_NO_DIAL
103 
104 int calcBigLineSize(int radius)
105 {
106  int bigLineSize = radius / 6;
107  if (bigLineSize < 4)
108  bigLineSize = 4;
109  if (bigLineSize > radius / 2)
110  bigLineSize = radius / 2;
111  return bigLineSize;
112 }
113 
114 static QPointF calcRadialPos(const QStyleOptionSlider *dial, qreal offset)
115 {
116  const int width = dial->rect.width();
117  const int height = dial->rect.height();
118  const int r = qMin(width, height) / 2;
119  const int currentSliderPosition = dial->upsideDown ? dial->sliderPosition : (dial->maximum - dial->sliderPosition);
120  qreal a = 0;
121  if (dial->maximum == dial->minimum)
122  a = Q_PI / 2;
123  else if (dial->dialWrapping)
124  a = Q_PI * 3 / 2 - (currentSliderPosition - dial->minimum) * 2 * Q_PI
125  / (dial->maximum - dial->minimum);
126  else
127  a = (Q_PI * 8 - (currentSliderPosition - dial->minimum) * 10 * Q_PI
128  / (dial->maximum - dial->minimum)) / 6;
129  qreal xc = width / 2.0;
130  qreal yc = height / 2.0;
131  qreal len = r - QStyleHelper::calcBigLineSize(r) - 3;
132  qreal back = offset * len;
133  QPointF pos(QPointF(xc + back * qCos(a), yc - back * qSin(a)));
134  return pos;
135 }
136 
137 qreal angle(const QPointF &p1, const QPointF &p2)
138 {
139  static const qreal rad_factor = 180 / Q_PI;
140  qreal _angle = 0;
141 
142  if (p1.x() == p2.x()) {
143  if (p1.y() < p2.y())
144  _angle = 270;
145  else
146  _angle = 90;
147  } else {
148  qreal x1, x2, y1, y2;
149 
150  if (p1.x() <= p2.x()) {
151  x1 = p1.x(); y1 = p1.y();
152  x2 = p2.x(); y2 = p2.y();
153  } else {
154  x2 = p1.x(); y2 = p1.y();
155  x1 = p2.x(); y1 = p2.y();
156  }
157 
158  qreal m = -(y2 - y1) / (x2 - x1);
159  _angle = qAtan(m) * rad_factor;
160 
161  if (p1.x() < p2.x())
162  _angle = 180 - _angle;
163  else
164  _angle = -_angle;
165  }
166  return _angle;
167 }
168 
170 {
171  QPolygonF poly;
172  int width = dial->rect.width();
173  int height = dial->rect.height();
174  qreal r = qMin(width, height) / 2;
175  int bigLineSize = calcBigLineSize(int(r));
176 
177  qreal xc = width / 2 + 0.5;
178  qreal yc = height / 2 + 0.5;
179  const int ns = dial->tickInterval;
180  if (!ns) // Invalid values may be set by Qt Designer.
181  return poly;
182  int notches = (dial->maximum + ns - 1 - dial->minimum) / ns;
183  if (notches <= 0)
184  return poly;
185  if (dial->maximum < dial->minimum || dial->maximum - dial->minimum > 1000) {
186  int maximum = dial->minimum + 1000;
187  notches = (maximum + ns - 1 - dial->minimum) / ns;
188  }
189 
190  poly.resize(2 + 2 * notches);
191  int smallLineSize = bigLineSize / 2;
192  for (int i = 0; i <= notches; ++i) {
193  qreal angle = dial->dialWrapping ? Q_PI * 3 / 2 - i * 2 * Q_PI / notches
194  : (Q_PI * 8 - i * 10 * Q_PI / notches) / 6;
195  qreal s = qSin(angle);
196  qreal c = qCos(angle);
197  if (i == 0 || (((ns * i) % (dial->pageStep ? dial->pageStep : 1)) == 0)) {
198  poly[2 * i] = QPointF(xc + (r - bigLineSize) * c,
199  yc - (r - bigLineSize) * s);
200  poly[2 * i + 1] = QPointF(xc + r * c, yc - r * s);
201  } else {
202  poly[2 * i] = QPointF(xc + (r - 1 - smallLineSize) * c,
203  yc - (r - 1 - smallLineSize) * s);
204  poly[2 * i + 1] = QPointF(xc + (r - 1) * c, yc -(r - 1) * s);
205  }
206  }
207  return poly;
208 }
209 
210 // This will draw a nice and shiny QDial for us. We don't want
211 // all the shinyness in QWindowsStyle, hence we place it here
212 
213 void drawDial(const QStyleOptionSlider *option, QPainter *painter)
214 {
215  QPalette pal = option->palette;
216  QColor buttonColor = pal.button().color();
217  const int width = option->rect.width();
218  const int height = option->rect.height();
219  const bool enabled = option->state & QStyle::State_Enabled;
220  qreal r = qMin(width, height) / 2;
221  r -= r/50;
222  const qreal penSize = r/20.0;
223 
224  painter->save();
226 
227  // Draw notches
228  if (option->subControls & QStyle::SC_DialTickmarks) {
229  painter->setPen(option->palette.dark().color().darker(120));
230  painter->drawLines(QStyleHelper::calcLines(option));
231  }
232 
233  // Cache dial background
235  p->setRenderHint(QPainter::Antialiasing);
236 
237  const qreal d_ = r / 6;
238  const qreal dx = option->rect.x() + d_ + (width - 2 * r) / 2 + 1;
239  const qreal dy = option->rect.y() + d_ + (height - 2 * r) / 2 + 1;
240 
241  QRectF br = QRectF(dx + 0.5, dy + 0.5,
242  int(r * 2 - 2 * d_ - 2),
243  int(r * 2 - 2 * d_ - 2));
244  buttonColor.setHsv(buttonColor .hue(),
245  qMin(140, buttonColor .saturation()),
246  qMax(180, buttonColor.value()));
247  QColor shadowColor(0, 0, 0, 20);
248 
249  if (enabled) {
250  // Drop shadow
251  qreal shadowSize = qMax(1.0, penSize/2.0);
252  QRectF shadowRect= br.adjusted(-2*shadowSize, -2*shadowSize,
253  2*shadowSize, 2*shadowSize);
254  QRadialGradient shadowGradient(shadowRect.center().x(),
255  shadowRect.center().y(), shadowRect.width()/2.0,
256  shadowRect.center().x(), shadowRect.center().y());
257  shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40));
258  shadowGradient.setColorAt(qreal(1.0), Qt::transparent);
259  p->setBrush(shadowGradient);
260  p->setPen(Qt::NoPen);
261  p->translate(shadowSize, shadowSize);
262  p->drawEllipse(shadowRect);
263  p->translate(-shadowSize, -shadowSize);
264 
265  // Main gradient
266  QRadialGradient gradient(br.center().x() - br.width()/3, dy,
267  br.width()*1.3, br.center().x(),
268  br.center().y() - br.height()/2);
269  gradient.setColorAt(0, buttonColor.lighter(110));
270  gradient.setColorAt(qreal(0.5), buttonColor);
271  gradient.setColorAt(qreal(0.501), buttonColor.darker(102));
272  gradient.setColorAt(1, buttonColor.darker(115));
273  p->setBrush(gradient);
274  } else {
275  p->setBrush(Qt::NoBrush);
276  }
277 
278  p->setPen(QPen(buttonColor.darker(280)));
279  p->drawEllipse(br);
280  p->setBrush(Qt::NoBrush);
281  p->setPen(buttonColor.lighter(110));
282  p->drawEllipse(br.adjusted(1, 1, -1, -1));
283 
284  if (option->state & QStyle::State_HasFocus) {
285  QColor highlight = pal.highlight().color();
286  highlight.setHsv(highlight.hue(),
287  qMin(160, highlight.saturation()),
288  qMax(230, highlight.value()));
289  highlight.setAlpha(127);
290  p->setPen(QPen(highlight, 2.0));
291  p->setBrush(Qt::NoBrush);
292  p->drawEllipse(br.adjusted(-1, -1, 1, 1));
293  }
294 
296 
297  QPointF dp = calcRadialPos(option, qreal(0.70));
298  buttonColor = buttonColor.lighter(104);
299  buttonColor.setAlphaF(qreal(0.8));
300  const qreal ds = r/qreal(7.0);
301  QRectF dialRect(dp.x() - ds, dp.y() - ds, 2*ds, 2*ds);
302  QRadialGradient dialGradient(dialRect.center().x() + dialRect.width()/2,
303  dialRect.center().y() + dialRect.width(),
304  dialRect.width()*2,
305  dialRect.center().x(), dialRect.center().y());
306  dialGradient.setColorAt(1, buttonColor.darker(140));
307  dialGradient.setColorAt(qreal(0.4), buttonColor.darker(120));
308  dialGradient.setColorAt(0, buttonColor.darker(110));
309  if (penSize > 3.0) {
310  painter->setPen(QPen(QColor(0, 0, 0, 25), penSize));
311  painter->drawLine(calcRadialPos(option, qreal(0.90)), calcRadialPos(option, qreal(0.96)));
312  }
313 
314  painter->setBrush(dialGradient);
315  painter->setPen(QColor(255, 255, 255, 150));
316  painter->drawEllipse(dialRect.adjusted(-1, -1, 1, 1));
317  painter->setPen(QColor(0, 0, 0, 80));
318  painter->drawEllipse(dialRect);
319  painter->restore();
320 }
321 #endif //QT_NO_DIAL
322 
323 void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
324  int left, int top, int right,
325  int bottom)
326 {
327  QSize size = pixmap.size();
328  //painter->setRenderHint(QPainter::SmoothPixmapTransform);
329 
330  //top
331  if (top > 0) {
332  painter->drawPixmap(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), pixmap,
333  QRect(left, 0, size.width() -right - left, top));
334 
335  //top-left
336  if(left > 0)
337  painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap,
338  QRect(0, 0, left, top));
339 
340  //top-right
341  if (right > 0)
342  painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top(), right, top), pixmap,
343  QRect(size.width() - right, 0, right, top));
344  }
345 
346  //left
347  if (left > 0)
348  painter->drawPixmap(QRect(rect.left(), rect.top()+top, left, rect.height() - top - bottom), pixmap,
349  QRect(0, top, left, size.height() - bottom - top));
350 
351  //center
352  painter->drawPixmap(QRect(rect.left() + left, rect.top()+top, rect.width() -right - left,
353  rect.height() - bottom - top), pixmap,
354  QRect(left, top, size.width() -right -left,
355  size.height() - bottom - top));
356  //right
357  if (right > 0)
358  painter->drawPixmap(QRect(rect.left() +rect.width() - right, rect.top()+top, right, rect.height() - top - bottom), pixmap,
359  QRect(size.width() - right, top, right, size.height() - bottom - top));
360 
361  //bottom
362  if (bottom > 0) {
363  painter->drawPixmap(QRect(rect.left() +left, rect.top() + rect.height() - bottom,
364  rect.width() - right - left, bottom), pixmap,
365  QRect(left, size.height() - bottom,
366  size.width() - right - left, bottom));
367  //bottom-left
368  if (left > 0)
369  painter->drawPixmap(QRect(rect.left(), rect.top() + rect.height() - bottom, left, bottom), pixmap,
370  QRect(0, size.height() - bottom, left, bottom));
371 
372  //bottom-right
373  if (right > 0)
374  painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top() + rect.height() - bottom, right, bottom), pixmap,
375  QRect(size.width() - right, size.height() - bottom, right, bottom));
376 
377  }
378 }
379 }
#define BEGIN_STYLE_PIXMAPCACHE(a)
Definition: qstyle_p.h:76
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
const QBrush & highlight() const
Returns the highlight brush of the current color group.
Definition: qpalette.h:140
double qreal
Definition: qglobal.h:1193
unsigned char c[8]
Definition: qnumeric_p.h:62
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
Definition: qbrush.cpp:1475
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
ushort hue
Returns the hue color component of this color.
Definition: qcolor.h:250
QSize size() const
Returns the size of the pixmap.
Definition: qpixmap.cpp:661
const QBrush & dark() const
Returns the dark brush of the current color group.
Definition: qpalette.h:127
static QPointF calcRadialPos(const QStyleOptionSlider *dial, qreal offset)
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
CGFloat qt_mac_get_scalefactor()
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qint64 cacheKey() const
Returns a number that identifies the contents of this QPalette object.
Definition: qpalette.cpp:1093
void restore()
Restores the current painter state (pops a saved state off the stack).
Definition: qpainter.cpp:1620
int tickInterval
the interval that should be drawn between tick marks
Definition: qstyleoption.h:711
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
#define END_STYLE_PIXMAPCACHE
Definition: qstyle_p.h:96
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
quint16 u
long ASN1_INTEGER_get ASN1_INTEGER * a
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
Definition: qstyleoption.h:694
void drawLine(const QLineF &line)
Draws a line defined by line.
Definition: qpainter.h:573
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush...
Definition: qbrush.h:297
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void save()
Saves the current painter state (pushes the state onto a stack).
Definition: qpainter.cpp:1590
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
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...
Definition: qcolor.cpp:734
bool dialWrapping
whether the dial should wrap or not
Definition: qstyleoption.h:718
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
Definition: qcolor.h:301
bool upsideDown
the slider control orientation
Definition: qstyleoption.h:712
int width() const
Returns the width.
Definition: qsize.h:126
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
Definition: qpainter.cpp:7620
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
Definition: qpainter.cpp:4464
ushort value
Returns the value color component of this color.
Definition: qcolor.h:252
void drawDial(const QStyleOptionSlider *option, QPainter *painter)
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
int calcBigLineSize(int radius)
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
Definition: qpainter.cpp:4873
The QStyleOption class stores the parameters used by QStyle functions.
Definition: qstyleoption.h:67
ushort saturation
Returns the saturation color component of this color.
Definition: qcolor.h:251
qreal qSin(qreal v)
Definition: qmath.h:93
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
Definition: qstyleoption.h:729
The QPolygonF class provides a vector of points using floating point precision.
Definition: qpolygon.h:134
unsigned int uint
Definition: qglobal.h:996
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
int sliderPosition
the position of the slider handle
Definition: qstyleoption.h:713
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:781
qreal dpiScaled(qreal value)
qreal qAtan(qreal v)
Definition: qmath.h:173
QPalette palette
the palette that should be used when painting the control
Definition: qstyleoption.h:92
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
qreal angle(const QPointF &p1, const QPointF &p2)
int maximum
the maximum value for the slider
Definition: qstyleoption.h:709
QPolygonF calcLines(const QStyleOptionSlider *dial)
void setAlphaF(qreal alpha)
Sets the alpha of this color to alpha.
Definition: qcolor.cpp:1117
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
T qstyleoption_cast(const QStyleOption *opt)
Definition: qstyleoption.h:885
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int minimum
the minimum value for the slider
Definition: qstyleoption.h:708
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
int key
void setBrush(const QBrush &brush)
Sets the painter&#39;s brush to the given brush.
Definition: qpainter.cpp:4171
void setAlpha(int alpha)
Sets the alpha of this color to alpha.
Definition: qcolor.cpp:1094
void setPen(const QColor &color)
Sets the painter&#39;s pen to have style Qt::SolidLine, width 0 and the specified color.
Definition: qpainter.cpp:4047
int height() const
Returns the height.
Definition: qsize.h:129
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
Definition: qstyleoption.h:89
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect, int left, int top, int right, int bottom)
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...
Definition: qpainter.cpp:5619
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
Definition: qstyleoption.h:701
int pageStep
the size of the page step of the slider
Definition: qstyleoption.h:716
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
Definition: qstyleoption.h:687
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
Definition: qcolor.h:298
const QBrush & button() const
Returns the button brush of the current color group.
Definition: qpalette.h:125
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QPointF center() const
Returns the center point of the rectangle.
Definition: qrect.h:686
qreal qCos(qreal v)
Definition: qmath.h:109
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
Definition: qstyleoption.h:693
#define enabled
static const qreal Q_PI
Definition: qmath_p.h:61
The QPalette class contains color groups for each widget state.
Definition: qpalette.h:61