44 #if !defined(QT_NO_STYLE_WINDOWSXP) || defined(QT_PLUGIN) 46 #include <private/qobject_p.h> 47 #include <private/qpaintengine_raster_p.h> 48 #include <private/qapplication_p.h> 49 #include <private/qstylehelper_p.h> 50 #include <private/qwidget_p.h> 51 #include <private/qsystemlibrary_p.h> 83 typedef HRESULT (WINAPI *
PtrGetCurrentThemeName)(OUT LPWSTR pszThemeFileName,
int cchMaxNameChars, OUT OPTIONAL LPWSTR pszColorBuff,
int cchMaxColorChars, OUT OPTIONAL LPWSTR pszSizeBuff,
int cchMaxSizeChars);
88 typedef HRESULT (WINAPI *
PtrGetThemeFilename)(HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId, OUT LPWSTR pszThemeFileName,
int cchMaxBuffChars);
89 typedef HRESULT (WINAPI *
PtrGetThemeFont)(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId,
int iStateId,
int iPropId, OUT LOGFONT *pFont);
90 typedef HRESULT (WINAPI *
PtrGetThemeInt)(HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId, OUT
int *piVal);
92 typedef HRESULT (WINAPI *
PtrGetThemeMargins)(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId,
int iStateId,
int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins);
93 typedef HRESULT (WINAPI *
PtrGetThemeMetric)(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId,
int iStateId,
int iPropId, OUT
int *piVal);
94 typedef HRESULT (WINAPI *
PtrGetThemePartSize)(HTHEME hTheme, HDC hdc,
int iPartId,
int iStateId, OPTIONAL RECT *prc,
enum THEMESIZE eSize, OUT
SIZE *psz);
98 typedef HRESULT (WINAPI *
PtrGetThemeString)(HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId, OUT LPWSTR pszBuff,
int cchMaxBuffChars);
182 r.right = qr.
x() + qr.
width();
184 r.bottom = qr.
y() + qr.
height();
231 if (ref.ref() && !force)
245 if (bufferDC && nullBitmap)
246 SelectObject(bufferDC, nullBitmap);
247 DeleteObject(bufferBitmap);
255 if (ref.deref() && !force)
266 limboWidget->deleteLater();
284 for (it = handleMap->
begin(); it != handleMap->
end(); ++
it)
296 if (!parent1 || parent1->
isWindow())
299 return parent2 && widget->
inherits(
"QLineEdit")
300 && parent2->
inherits(
"QAbstractItemView");
319 limboWidget->createWinId();
320 limboWidget->setObjectName(
QLatin1String(
"xp_limbo_widget"));
326 return limboWidget->winId();
347 drawBackground(theme);
351 painter.drawPixmap(0, 0, temp, 0, sz.cy-1, -1, -1);
352 painter.drawTiledPixmap(0, sz.cy, sz.cx, tabbody->height()-sz.cy, temp);
366 static bool tried =
false;
414 if (bufferW >= w && bufferH >= h)
417 if (bufferDC && nullBitmap)
418 SelectObject(bufferDC, nullBitmap);
419 DeleteObject(bufferBitmap);
423 w =
qMax(bufferW, w);
424 h =
qMax(bufferH, h);
431 memset(&bmi, 0,
sizeof(bmi));
432 bmi.bmiHeader.biSize =
sizeof(BITMAPINFOHEADER);
433 bmi.bmiHeader.biWidth = w;
434 bmi.bmiHeader.biHeight = -h;
435 bmi.bmiHeader.biPlanes = 1;
436 bmi.bmiHeader.biBitCount = 32;
437 bmi.bmiHeader.biCompression = BI_RGB;
441 bufferBitmap = CreateDIBSection(bufferDC, &bmi, DIB_RGB_COLORS, (
void **) &bufferPixels, 0, 0);
443 nullBitmap = (HBITMAP)SelectObject(bufferDC, bufferBitmap);
446 qErrnoWarning(
"QWindowsXPStylePrivate::buffer(w,h), failed to create dibsection");
452 qErrnoWarning(
"QWindowsXPStylePrivate::buffer(w,h), did not allocate pixel data");
459 #ifdef DEBUG_XP_STYLE 460 qDebug(
"Creating new dib section (%d, %d)", w, h);
492 HRGN dest = CreateRectRgn(0, 0, 0, 0);
493 const bool success = CombineRgn(dest, hRgn, 0, RGN_COPY) !=
ERROR;
514 HRGN hrgn = themeData.
mask();
516 SetWindowRgn(winId(widget), hrgn,
true);
530 const int startX = rect.
left();
531 const int startY = rect.
top();
532 const int w = rect.
width();
533 const int h = rect.
height();
535 for (
int y = startY; y < h; ++y) {
536 register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
537 for (
int x = startX; x < w; ++x, ++buffer) {
538 int alpha = (*buffer) >> 24;
555 const int startX = rect.
left();
556 const int startY = rect.
top();
557 const int w = rect.
width();
558 const int h = rect.
height();
561 for (
int y = startY; y < h/2; ++y) {
562 register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
563 for (
int x = startX; x < w; ++x, ++buffer) {
564 int alpha = (*buffer) >> 24;
565 if (firstAlpha == -1)
567 else if (alpha != firstAlpha)
587 const int startX = rect.
left();
588 const int startY = rect.
top();
589 const int w = rect.
width();
590 const int h = rect.
height();
591 bool hasFixedAlphaValue =
false;
593 for (
int y = startY; y < h; ++y) {
594 register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
595 for (
register int x = startX; x < w; ++x, ++buffer) {
596 uint pixel = *buffer;
597 int alpha =
qAlpha(pixel);
598 if (
qRed(pixel) > alpha ||
qGreen(pixel) > alpha ||
qBlue(pixel) > alpha) {
599 *buffer |= 0xff000000;
600 hasFixedAlphaValue =
true;
604 return hasFixedAlphaValue;
621 const int startX = rect.
left();
622 const int startY = rect.
top();
623 const int w = rect.
width();
624 const int h = rect.
height();
625 bool valueChange =
false;
628 for (
int y = startY; y < h; ++y) {
629 register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
630 for (
register int x = startX; x < w; ++x, ++buffer) {
632 *buffer |= 0xFF000000;
635 register unsigned int alphaValue = (*buffer) & 0xFF000000;
636 if (alphaValue == 0xFF000000) {
639 }
else if (alphaValue == 0) {
640 *buffer |= 0xFF000000;
666 Q_ASSERT_X(painter != 0,
"QWindowsXPStylePrivate::drawBackground()",
"Trying to draw a theme part without a painter");
667 if (!painter || !painter->
isActive())
674 bool translucentToplevel =
false;
687 || translucentToplevel;
690 drawBackgroundDirectly(themeData);
692 drawBackgroundThruNativeBuffer(themeData);
721 SelectClipRgn(dc, sysRgn.
handle());
723 #ifdef DEBUG_XP_STYLE 724 printf(
"---[ DIRECT PAINTING ]------------------> Name(%-10s) Part(%d) State(%d)\n",
726 showProperties(themeData);
729 RECT drawRECT = themeData.
toRECT(area);
731 drawOptions.
dwSize =
sizeof(drawOptions);
747 PROPERTYORIGIN origin = PO_NOTFOUND;
753 if ((origin == PO_CLASS || origin == PO_PART || origin == PO_STATE) && borderSize > 0) {
756 drawRECT = themeData.
toRECT(area.
adjusted(-borderSize, -borderSize, borderSize, borderSize));
761 QRegion content = area.
adjusted(borderSize, borderSize, -borderSize, -borderSize);
762 extraClip ^= content;
767 SelectClipRgn(dc, extraClip.handle());
772 SelectClipRgn(dc, 0);
791 if ((themeData.
rotate + 90) % 180 == 0) {
797 int w = rect.
width();
802 bool stateHasData =
true;
803 bool hasAlpha =
false;
804 bool partIsTransparent;
806 bool potentialInvalidAlpha;
815 bool haveCachedPixmap =
false;
828 #ifdef DEBUG_XP_STYLE 830 ::sprintf(buf,
"+ Pixmap(%3d, %3d) ]", w, h);
831 printf(
"---[ CACHED %s--------> Name(%-10s) Part(%d) State(%d)\n",
832 haveCachedPixmap ? buf :
"]-------------------",
837 BOOL tmt_borderonly =
false;
838 COLORREF tmt_transparentcolor = 0x0;
839 PROPERTYORIGIN proporigin = PO_NOTFOUND;
843 inspectData = (tmt_transparentcolor != 0 || tmt_borderonly || proporigin == PO_PART || proporigin == PO_STATE);
847 if (themeData.
partId == WP_CAPTION || themeData.
partId == WP_SMALLCAPTION)
851 partIsTransparent = isTransparent(themeData);
853 potentialInvalidAlpha =
false;
855 if (proporigin == PO_PART || proporigin == PO_STATE) {
858 potentialInvalidAlpha = partIsTransparent && !inspectData && tmt_glyphtype ==
GT_IMAGEGLYPH;
861 #ifdef DEBUG_XP_STYLE 862 printf(
"---[ NOT CACHED ]-----------------------> Name(%-10s) Part(%d) State(%d)\n",
864 printf(
"-->partIsTransparen = %d\n", partIsTransparent);
865 printf(
"-->inspectData = %d\n", inspectData);
866 printf(
"-->potentialInvalidAlpha = %d\n", potentialInvalidAlpha);
867 showProperties(themeData);
870 bool wasAlphaSwapped =
false;
871 bool wasAlphaFixed =
false;
877 bool addBorderContentClipping =
false;
887 PROPERTYORIGIN origin = PO_NOTFOUND;
892 if ((origin == PO_CLASS || origin == PO_PART || origin == PO_STATE) && borderSize > 0) {
895 area = area.
adjusted(-borderSize, -borderSize, borderSize, borderSize);
900 QRegion content = area.
adjusted(borderSize, borderSize, -borderSize, -borderSize);
901 extraClip ^= content;
908 if (!haveCachedPixmap) {
910 HDC dc = bufferHDC();
915 memset(bufferPixels, inspectData ? 0xFF : 0x00, bufferW * h * 4);
919 int dx = area.
x() - rect.
x();
920 int dy = area.
y() - rect.
y();
928 drawOptions.
dwSize =
sizeof(drawOptions);
940 if (addBorderContentClipping) {
941 SelectClipRgn(dc, extraClip.
handle());
948 if (addBorderContentClipping)
949 SelectClipRgn(dc, 0);
956 stateHasData = hasAnyData(rect);
959 memset(&data, 0,
sizeof(data));
961 alphaCache.insert(key, data);
964 hasAlpha = hasAlphaChannel(rect);
965 if (!hasAlpha && partIsTransparent)
966 potentialInvalidAlpha =
true;
967 #if defined(DEBUG_XP_STYLE) && 1 974 wasAlphaSwapped = swapAlphaChannel(rect);
977 if (potentialInvalidAlpha)
978 wasAlphaFixed = fixAlphaChannel(rect);
981 if ((partIsTransparent && !wasAlphaSwapped) || (!partIsTransparent && hasAlpha)) {
984 }
else if (wasAlphaSwapped) {
993 swapAlphaChannel(rect,
true);
996 #if defined(DEBUG_XP_STYLE) && 1 997 printf(
"Image format is: %s\n", alphaType ==
RealAlpha ?
"Real Alpha" : alphaType ==
MaskAlpha ?
"Masked Alpha" :
"No Alpha");
999 img =
QImage(bufferPixels, bufferW, bufferH, format);
1003 bool useRegion = partIsTransparent && !hasAlpha && !wasAlphaSwapped;
1008 newRegion = region(themeData);
1011 #if defined(DEBUG_XP_STYLE) && 0 1012 printf(
"Using region:\n");
1014 for (
int i = 0; i < rects.
count(); ++i) {
1016 printf(
" (%d, %d, %d, %d)\n", r.
x(), r.
y(), r.
right(), r.
bottom());
1021 if (addBorderContentClipping)
1025 if (!haveCachedPixmap)
1036 if (!haveCachedPixmap)
1037 imgCopy = img.
copy(rect);
1039 imgCopy = cachedPixmap.
toImage();
1053 if (useRegion || addBorderContentClipping) {
1061 if (!haveCachedPixmap && w && h) {
1064 #ifdef DEBUG_XP_STYLE 1065 printf(
"+++Adding pixmap to cache, size(%d, %d), wasAlphaSwapped(%d), wasAlphaFixed(%d), name(%s)\n",
1066 w, h, wasAlphaSwapped, wasAlphaFixed,
qPrintable(pixmapCacheKey));
1072 memset(&data, 0,
sizeof(data));
1080 alphaCache.insert(key, data);
1145 if (qobject_cast<QAbstractButton*>(widget)
1146 || qobject_cast<QToolButton*>(widget)
1147 || qobject_cast<QTabBar*>(widget)
1149 || qobject_cast<QComboBox*>(widget)
1151 || qobject_cast<QScrollBar*>(widget)
1152 || qobject_cast<QSlider*>(widget)
1153 || qobject_cast<QHeaderView*>(widget)
1155 || qobject_cast<QAbstractSpinBox*>(widget)
1156 || qobject_cast<QSpinBox*>(widget)
1158 || widget->
inherits(
"QWorkspaceChild")
1162 #ifndef QT_NO_RUBBERBAND 1163 if (qobject_cast<QRubberBand*>(widget)) {
1167 if (qobject_cast<QStackedWidget*>(widget) &&
1168 qobject_cast<QTabWidget*>(widget->
parent()))
1172 if (!
d->hasInitColors) {
1177 d->groupBoxTextColor =
qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
1179 d->groupBoxTextColorDisabled =
qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
1182 d->sliderTickColor =
qRgb(165, 162, 148);
1183 d->hasInitColors =
true;
1197 #ifndef QT_NO_RUBBERBAND 1198 if (qobject_cast<QRubberBand*>(widget)) {
1208 if ((oldState != newState) && newState) {
1215 d->cleanupHandleMap();
1217 if (qobject_cast<QAbstractButton*>(widget)
1218 || qobject_cast<QToolButton*>(widget)
1219 || qobject_cast<QTabBar*>(widget)
1221 || qobject_cast<QComboBox*>(widget)
1223 || qobject_cast<QScrollBar*>(widget)
1224 || qobject_cast<QSlider*>(widget)
1225 || qobject_cast<QHeaderView*>(widget)
1227 || qobject_cast<QAbstractSpinBox*>(widget)
1228 || qobject_cast<QSpinBox*>(widget)
1230 || widget->
inherits(
"QWorkspaceChild")
1251 if (qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option))
1255 if (
const QTabWidget *tabWidget = qobject_cast<const QTabWidget *>(widget)) {
1256 if (tabWidget->documentMode())
1260 rect.
adjust(0, 0, -2, -2);
1277 rect.
adjust(-overlap + borderThickness, 0, -overlap + borderThickness, 0);
1282 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
1286 HTHEME theme = buttontheme.
handle();
1290 stateId = PBS_DISABLED;
1292 stateId = PBS_PRESSED;
1296 stateId = PBS_DEFAULTED;
1298 stateId = PBS_NORMAL;
1301 rect = option->
rect.
adjusted(border, border, -border, -border);
1311 if (result == S_OK) {
1312 rect.
adjust(borderSize.cxLeftWidth, borderSize.cyTopHeight,
1313 -borderSize.cxRightWidth, -borderSize.cyBottomHeight);
1323 rect.
adjust(4, 3, -4, -3);
1325 rect.
adjust(3, 2, -3, -2);
1351 bool hMirrored =
false;
1352 bool vMirrored =
false;
1353 bool noBorder =
false;
1354 bool noContent =
false;
1360 = qstyleoption_cast<const QStyleOptionTabBarBase *>(option)) {
1362 switch (tbb->shape) {
1365 p->
drawLine(tbb->rect.topLeft(), tbb->rect.topRight());
1369 p->
drawLine(tbb->rect.left(), tbb->rect.top(), tbb->rect.left(), tbb->rect.bottom());
1373 p->
drawLine(tbb->rect.left(), tbb->rect.top(),
1374 tbb->rect.right(), tbb->rect.top());
1378 p->
drawLine(tbb->rect.topLeft(), tbb->rect.bottomLeft());
1393 partId = BP_PUSHBUTTON;
1395 stateId = PBS_DISABLED;
1397 stateId = PBS_PRESSED;
1403 stateId = PBS_NORMAL;
1407 if (widget && widget->
inherits(
"QDockWidgetTitleButton")) {
1414 if (!(flags & State_Enabled))
1415 stateId = TS_DISABLED;
1416 else if (flags & State_Sunken)
1417 stateId = TS_PRESSED;
1418 else if (flags & State_MouseOver)
1419 stateId = flags & State_On ? TS_HOTCHECKED : TS_HOT;
1420 else if (flags & State_On)
1421 stateId = TS_CHECKED;
1425 stateId = TS_NORMAL;
1430 partId = TP_SPLITBUTTONDROPDOWN;
1431 if (!(flags & State_Enabled))
1432 stateId = TS_DISABLED;
1433 else if (flags & State_Sunken)
1434 stateId = TS_PRESSED;
1435 else if (flags & State_MouseOver)
1436 stateId = flags & State_On ? TS_HOTCHECKED : TS_HOT;
1437 else if (flags & State_On)
1438 stateId = TS_CHECKED;
1439 else if (!(flags & State_AutoRaise))
1442 stateId = TS_NORMAL;
1449 partId = BP_CHECKBOX;
1450 if (!(flags & State_Enabled))
1451 stateId = CBS_UNCHECKEDDISABLED;
1452 else if (flags & State_Sunken)
1453 stateId = CBS_UNCHECKEDPRESSED;
1454 else if (flags & State_MouseOver)
1455 stateId = CBS_UNCHECKEDHOT;
1457 stateId = CBS_UNCHECKEDNORMAL;
1459 if (flags & State_On)
1460 stateId += CBS_CHECKEDNORMAL-1;
1462 stateId += CBS_MIXEDNORMAL-1;
1468 partId = BP_RADIOBUTTON;
1469 if (!(flags & State_Enabled))
1470 stateId = RBS_UNCHECKEDDISABLED;
1471 else if (flags & State_Sunken)
1472 stateId = RBS_UNCHECKEDPRESSED;
1473 else if (flags & State_MouseOver)
1474 stateId = RBS_UNCHECKEDHOT;
1476 stateId = RBS_UNCHECKEDNORMAL;
1478 if (flags & State_On)
1479 stateId += RBS_CHECKEDNORMAL-1;
1490 partId = LVP_LISTGROUP;
1493 if (!(flags & State_Enabled))
1494 stateId = ETS_DISABLED;
1496 stateId = ETS_NORMAL;
1502 QColor bordercolor(
qRgb(GetRValue(bcRef), GetGValue(bcRef), GetBValue(bcRef)));
1515 }
else if (fillType ==
BT_NONE) {
1534 }
else if (qstyleoption_cast<const QStyleOptionFrame *>(option)) {
1536 partId = EP_EDITTEXT;
1538 if (!(flags & State_Enabled))
1539 stateId = ETS_DISABLED;
1541 stateId = ETS_NORMAL;
1547 if (
const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
1549 partId = EP_EDITTEXT;
1552 bool usePalette =
false;
1554 uint resolve_mask = panel->palette.resolve();
1556 #ifndef QT_NO_SPINBOX 1560 resolve_mask = spinbox->palette().resolve();
1562 #endif // QT_NO_SPINBOX 1569 stateId = isEnabled ? ETS_NORMAL : ETS_DISABLED;
1574 XPThemeData theme(0, p, name, partId, stateId, rect);
1596 PROPERTYORIGIN origin = PO_NOTFOUND;
1599 if ((origin == PO_PART || origin == PO_STATE)) {
1602 fillColor =
QBrush(
qRgb(GetRValue(bgRef), GetGValue(bgRef), GetBValue(bgRef)));
1609 if (panel->lineWidth > 0)
1622 bool useGradient =
true;
1623 const int maxlength = 256;
1624 wchar_t themeFileName[maxlength];
1625 wchar_t themeColor[maxlength];
1628 wchar_t *offset = 0;
1629 if ((offset = wcsrchr(themeFileName,
QChar(
QLatin1Char(
'\\')).unicode())) != NULL) {
1631 if (!lstrcmp(offset, L
"Luna.msstyles") && !lstrcmp(offset, L
"Metallic")) {
1632 useGradient =
false;
1643 reg -= contentsRect;
1645 XPThemeData theme(widget, p, name, partId, stateId, rect);
1653 switch (tab->shape) {
1687 if (
const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(option))
1691 stateId = FS_ACTIVE;
1693 stateId = FS_INACTIVE;
1700 theme.
rect =
QRect(frm->rect.x(), frm->rect.y(), frm->rect.x()+fwidth, frm->rect.height()-fwidth); theme.
partId = WP_SMALLFRAMELEFT;
1702 theme.
rect =
QRect(frm->rect.width()-fwidth, frm->rect.y(), fwidth, frm->rect.height()-fwidth);
1703 theme.
partId = WP_SMALLFRAMERIGHT;
1705 theme.
rect =
QRect(frm->rect.x(), frm->rect.bottom()-fwidth+1, frm->rect.width(), fwidth);
1706 theme.
partId = WP_SMALLFRAMEBOTTOM;
1714 #if 0 // XP theme engine doesn't know about this :( 1716 partId = HP_HEADERSORTARROW;
1717 if (flags & State_Down)
1718 stateId = HSAS_SORTEDDOWN;
1720 stateId = HSAS_SORTEDUP;
1722 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
1753 partId = BP_GROUPBOX;
1754 if (!(flags & State_Enabled))
1755 stateId = GBS_DISABLED;
1757 stateId = GBS_NORMAL;
1758 if (
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
1762 QRect fr = frame->rect;
1765 rect =
QRect(p1, p2);
1774 bool inverted =
false;
1776 orient = pb2->orientation;
1777 if (pb2->invertedAppearance)
1786 partId = PP_CHUNKVERT;
1797 partId = TP_SEPARATOR;
1799 partId = TP_SEPARATORVERT;
1803 if (
const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(option))
1807 stateId = FS_ACTIVE;
1809 stateId = FS_INACTIVE;
1811 int fwidth = frm->lineWidth + frm->midLineWidth;
1818 theme.
partId = WP_FRAMELEFT;
1821 theme.
partId = WP_FRAMERIGHT;
1824 theme.
partId = WP_FRAMEBOTTOM;
1827 theme.
partId = WP_CAPTION;
1835 static const int decoration_size = 9;
1854 int delta = decoration_size / 2;
1860 theme.
rect =
QRect(bef_h, bef_v, decoration_size, decoration_size);
1861 theme.
partId = TVP_GLYPH;
1876 partId = TP_SEPARATOR;
1878 if (option->
state & State_Horizontal)
1879 partId = TP_SEPARATOR;
1881 partId = TP_SEPARATORVERT;
1888 partId = RP_GRIPPER;
1889 if (option->
state & State_Horizontal) {
1890 partId = RP_GRIPPER;
1891 rect.
adjust(0, 0, -2, 0);
1894 partId = RP_GRIPPERVERT;
1895 rect.
adjust(0, 0, 0, -2);
1901 button.QStyleOption::operator=(*option);
1902 button.
state &= ~State_MouseOver;
1911 XPThemeData theme(0, p, name, partId, stateId, rect);
1940 bool hMirrored =
false;
1941 bool vMirrored =
false;
1950 partId = SP_GRIPPER;
1955 if (
const QStyleOptionSizeGrip *sg = qstyleoption_cast<const QStyleOptionSizeGrip *>(option)) {
1956 switch (sg->corner) {
1965 rect =
QRect(rect.
right() - sz.cx, rect.
top() + 1, sz.cx, sz.cy);
1969 rect =
QRect(rect.
left() + 1, rect.
top() + 1, sz.cx, sz.cy);
1970 hMirrored = vMirrored =
true;
1978 partId = HP_HEADERITEM;
1980 stateId = HIS_PRESSED;
1984 stateId = HIS_NORMAL;
1992 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option))
1995 partId = BP_PUSHBUTTON;
1998 && !(flags & State_MouseOver)
2001 stateId = PBS_DISABLED;
2004 else if (flags & (State_Sunken |
State_On))
2005 stateId = PBS_PRESSED;
2006 else if (flags & State_MouseOver)
2009 stateId = PBS_DEFAULTED;
2011 stateId = PBS_NORMAL;
2014 XPThemeData theme(widget, p, name, partId, stateId, rect);
2019 int mbiw = 0, mbih = 0;
2028 QRect ir = btn->rect;
2037 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option))
2039 stateId = tab->state &
State_Enabled ? TIS_NORMAL : TIS_DISABLED;
2044 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option))
2060 stateId = TIS_DISABLED;
2062 stateId = TIS_SELECTED;
2064 stateId = TIS_FOCUSED;
2068 stateId = TIS_NORMAL;
2071 if (firstTab || onlyOne) {
2073 partId = TABP_TABITEMLEFTEDGE;
2074 }
else if (centerAligned) {
2075 partId = TABP_TABITEM;
2077 partId = TABP_TABITEMRIGHTEDGE;
2080 partId = TABP_TABITEM;
2086 bool temp = firstTab;
2090 bool begin = firstTab || onlyOne;
2091 bool end = lastTab || onlyOne;
2092 switch (tab->shape) {
2095 rect.
adjust(begin ? 0 : -tabOverlap, 0, end ? 0 : tabOverlap, borderThickness);
2097 rect.
adjust(begin? tabOverlap : 0, tabOverlap, end ? -tabOverlap : 0, 0);
2103 rect.
adjust(begin ? 0 : -tabOverlap , -borderThickness, end ? 0 : tabOverlap, 0);
2105 rect.
adjust(begin ? tabOverlap : 0, 0, end ? -tabOverlap : 0 , -tabOverlap);
2110 rect.
adjust(-borderThickness, begin ? 0 : -tabOverlap, 0, end ? 0 : tabOverlap);
2112 rect.
adjust(0, begin ? tabOverlap : 0, -tabOverlap, end ? -tabOverlap : 0);
2119 rect.
adjust(0, begin ? 0 : -tabOverlap, borderThickness, end ? 0 : tabOverlap);
2121 rect.
adjust(tabOverlap, begin ? tabOverlap : 0, 0, end ? -tabOverlap : 0);
2130 switch (tab->shape) {
2154 orient = pb2->orientation;
2163 if (
const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option))
2165 int tab = menuitem->tabWidth;
2168 bool checkable = menuitem->menuHasCheckableItems;
2169 bool checked = checkable ? menuitem->checked :
false;
2172 int checkcol =
qMax(menuitem->maxIconWidth, 12);
2185 int yoff = y-1 + h / 2;
2186 p->
setPen(menuitem->palette.dark().color());
2189 p->
setPen(menuitem->palette.light().color());
2197 if (!menuitem->icon.isNull()) {
2204 int pixw = pixmap.
width();
2205 int pixh = pixmap.
height();
2206 QRect iconRect(0, 0, pixw, pixh);
2209 p->
setPen(menuitem->palette.text().color());
2216 }
else if (checked) {
2232 QColor textColor = dis ? menuitem->palette.text().color() :
2233 act ? menuitem->palette.highlightedText().color() : menuitem->palette.buttonText().color();
2238 xpos = menuitem->rect.x() + xm;
2252 p->
setPen(menuitem->palette.light().color());
2256 p->
drawText(vShortcutRect, text_flags, s.
mid(t + 1));
2259 QFont font = menuitem->font;
2264 p->
setPen(menuitem->palette.light().color());
2268 p->
drawText(vTextRect, text_flags, s);
2274 int dim = (h - 2) / 2;
2280 newMI.
rect = vSubMenuRect;
2314 #ifndef QT_NO_DOCKWIDGET 2318 int buttonMargin = 4;
2321 bool isFloating = widget && widget->
isWindow();
2328 if (verticalTitleBar) {
2338 QRect titleRect = r;
2340 if (dwOpt->closable) {
2342 titleRect.
adjust(0, 0, -sz.
width() - mw - buttonMargin, 0);
2345 if (dwOpt->floatable) {
2347 titleRect.
adjust(0, 0, -sz.
width() - mw - buttonMargin, 0);
2351 titleRect.
adjust(0, -fw, 0, 0);
2355 titleRect.
adjust(mw, 0, 0, 0);
2356 if (!dwOpt->floatable && !dwOpt->closable)
2357 titleRect.
adjust(0, 0, -mw, 0);
2360 if (!verticalTitleBar)
2361 titleRect =
visualRect(dwOpt->direction, r, titleRect);
2380 stateId = CS_ACTIVE;
2382 stateId = CS_INACTIVE;
2384 int titleHeight = rect.
height() - 2;
2385 rect = rect.
adjusted(-fw, -fw, fw, 0);
2393 theme.
partId = WP_SMALLCAPTION;
2407 if (!dwOpt->title.isEmpty()) {
2410 QFont titleFont = oldFont;
2419 COLORREF textShadowRef;
2421 QColor textShadow =
qRgb(GetRValue(textShadowRef), GetGValue(textShadowRef), GetBValue(textShadowRef));
2428 COLORREF captionText = GetSysColor(isActive ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT);
2429 QColor textColor =
qRgb(GetRValue(captionText), GetGValue(captionText), GetBValue(captionText));
2443 #endif // QT_NO_DOCKWIDGET 2444 #ifndef QT_NO_RUBBERBAND 2446 if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
2452 qMin(highlight.
blue()/2 + 110, 255),
2453 (widget && widget->
isTopLevel())? 255 : 127);
2459 #endif // QT_NO_RUBBERBAND 2464 stateId = HIS_NORMAL;
2475 XPThemeData theme(widget, p, name, partId, stateId, rect);
2511 #ifndef QT_NO_SPINBOX 2513 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
2518 partId = EP_EDITTEXT;
2520 stateId = ETS_DISABLED;
2522 stateId = ETS_FOCUSED;
2524 stateId = ETS_NORMAL;
2534 stateId = UPS_DISABLED;
2535 else if (sb->activeSubControls == SC_SpinBoxUp && (sb->state &
State_Sunken))
2536 stateId = UPS_PRESSED;
2537 else if (sb->activeSubControls == SC_SpinBoxUp && (sb->state &
State_MouseOver))
2540 stateId = UPS_NORMAL;
2549 stateId = DNS_DISABLED;
2550 else if (sb->activeSubControls == SC_SpinBoxDown && (sb->state &
State_Sunken))
2551 stateId = DNS_PRESSED;
2552 else if (sb->activeSubControls == SC_SpinBoxDown && (sb->state &
State_MouseOver))
2555 stateId = DNS_NORMAL;
2562 #endif // QT_NO_SPINBOX 2563 #ifndef QT_NO_COMBOBOX 2569 partId = EP_EDITTEXT;
2571 stateId = ETS_DISABLED;
2573 stateId = ETS_FOCUSED;
2575 stateId = ETS_NORMAL;
2582 if (!cmb->editable) {
2599 partId = CP_DROPDOWNBUTTON;
2601 stateId = CBXS_DISABLED;
2602 else if (cmb->activeSubControls == SC_ComboBoxArrow && (cmb->state &
State_Sunken))
2603 stateId = CBXS_PRESSED;
2604 else if (cmb->activeSubControls == SC_ComboBoxArrow && (cmb->state &
State_MouseOver))
2607 stateId = CBXS_NORMAL;
2614 #endif // QT_NO_COMBOBOX 2616 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
2619 bool maxedOut = (scrollbar->maximum == scrollbar->minimum);
2627 partId = SBP_ARROWBTN;
2629 stateId = (isHorz ? (isRTL ? ABS_LEFTDISABLED : ABS_RIGHTDISABLED) : ABS_DOWNDISABLED);
2630 else if (scrollbar->activeSubControls & SC_ScrollBarAddLine && (scrollbar->state &
State_Sunken))
2631 stateId = (isHorz ? (isRTL ? ABS_LEFTPRESSED : ABS_RIGHTPRESSED) : ABS_DOWNPRESSED);
2632 else if (scrollbar->activeSubControls & SC_ScrollBarAddLine && (scrollbar->state &
State_MouseOver))
2633 stateId = (isHorz ? (isRTL ? ABS_LEFTHOT : ABS_RIGHTHOT) : ABS_DOWNHOT);
2635 stateId = (isHorz ? (isRTL ? ABS_LEFTNORMAL : ABS_RIGHTNORMAL) : ABS_DOWNNORMAL);
2642 partId = SBP_ARROWBTN;
2644 stateId = (isHorz ? (isRTL ? ABS_RIGHTDISABLED : ABS_LEFTDISABLED) : ABS_UPDISABLED);
2645 else if (scrollbar->activeSubControls & SC_ScrollBarSubLine && (scrollbar->state &
State_Sunken))
2646 stateId = (isHorz ? (isRTL ? ABS_RIGHTPRESSED : ABS_LEFTPRESSED) : ABS_UPPRESSED);
2647 else if (scrollbar->activeSubControls & SC_ScrollBarSubLine && (scrollbar->state &
State_MouseOver))
2648 stateId = (isHorz ? (isRTL ? ABS_RIGHTHOT : ABS_LEFTHOT) : ABS_UPHOT);
2650 stateId = (isHorz ? (isRTL ? ABS_RIGHTNORMAL : ABS_LEFTNORMAL) : ABS_UPNORMAL);
2659 partId = scrollbar->orientation ==
Qt::Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
2660 stateId = SCRBS_DISABLED;
2667 partId = flags & State_Horizontal ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT;
2669 stateId = SCRBS_DISABLED;
2670 else if (scrollbar->activeSubControls & SC_ScrollBarSubPage && (scrollbar->state &
State_Sunken))
2671 stateId = SCRBS_PRESSED;
2672 else if (scrollbar->activeSubControls & SC_ScrollBarSubPage && (scrollbar->state &
State_MouseOver))
2673 stateId = SCRBS_HOT;
2675 stateId = SCRBS_NORMAL;
2682 partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
2684 stateId = SCRBS_DISABLED;
2685 else if (scrollbar->activeSubControls & SC_ScrollBarAddPage && (scrollbar->state &
State_Sunken))
2686 stateId = SCRBS_PRESSED;
2687 else if (scrollbar->activeSubControls & SC_ScrollBarAddPage && (scrollbar->state &
State_MouseOver))
2688 stateId = SCRBS_HOT;
2690 stateId = SCRBS_NORMAL;
2698 stateId = SCRBS_DISABLED;
2699 else if (scrollbar->activeSubControls & SC_ScrollBarSlider && (scrollbar->state &
State_Sunken))
2700 stateId = SCRBS_PRESSED;
2701 else if (scrollbar->activeSubControls & SC_ScrollBarSlider && (scrollbar->state &
State_MouseOver))
2702 stateId = SCRBS_HOT;
2704 stateId = SCRBS_NORMAL;
2708 theme.
partId = flags & State_Horizontal ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT;
2716 MARGINS contentsMargin;
2721 theme.
partId = flags & State_Horizontal ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT;
2723 int gw = size.cx, gh = size.cy;
2726 QRect gripperBounds;
2727 if (flags & State_Horizontal && ((swidth - contentsMargin.cxLeftWidth - contentsMargin.cxRightWidth) > gw)) {
2732 }
else if ((sheight - contentsMargin.cyTopHeight - contentsMargin.cyBottomHeight) > gh) {
2740 if (!gripperBounds.
isEmpty()) {
2742 theme.
rect = gripperBounds;
2752 #ifndef QT_NO_SLIDER 2754 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option))
2757 QRect slrect = slider->rect;
2763 stateId = TRS_NORMAL;
2766 partId = TKP_TRACKVERT;
2767 stateId = TRVS_NORMAL;
2773 tickreg -= theme.
rect;
2777 int ticks = slider->tickPosition;
2781 int interval = slider->tickInterval;
2782 if (interval <= 0) {
2783 interval = slider->singleStep;
2788 interval = slider->pageStep;
2792 int fudge = len / 2;
2797 int v = slider->minimum;
2798 while (v <= slider->maximum + 1) {
2799 if (v == slider->maximum + 1 && interval == 1)
2801 const int v_ =
qMin(v, slider->maximum);
2802 int tickLength = (v_ == slider->minimum || v_ >= slider->maximum) ? 4 : 3;
2804 v_, available) + fudge;
2807 lines.
append(
QLine(pos, tickOffset - 1 - bothOffset,
2808 pos, tickOffset - 1 - bothOffset - tickLength));
2811 lines.
append(
QLine(pos, tickOffset + thickness + bothOffset,
2812 pos, tickOffset + thickness + bothOffset + tickLength));
2815 lines.
append(
QLine(tickOffset - 1 - bothOffset, pos,
2816 tickOffset - 1 - bothOffset - tickLength, pos));
2819 lines.
append(
QLine(tickOffset + thickness + bothOffset, pos,
2820 tickOffset + thickness + bothOffset + tickLength, pos));
2823 int nextInterval = v + interval;
2824 if (nextInterval < v)
2828 if (lines.
size() > 0) {
2839 partId = TKP_THUMBTOP;
2841 partId = TKP_THUMBBOTTOM;
2846 stateId = TUS_DISABLED;
2847 else if (slider->activeSubControls & SC_SliderHandle && (slider->state &
State_Sunken))
2848 stateId = TUS_PRESSED;
2849 else if (slider->activeSubControls & SC_SliderHandle && (slider->state &
State_MouseOver))
2852 stateId = TUS_FOCUSED;
2854 stateId = TUS_NORMAL;
2857 partId = TKP_THUMBLEFT;
2859 partId = TKP_THUMBRIGHT;
2861 partId = TKP_THUMBVERT;
2864 stateId = TUVS_DISABLED;
2865 else if (slider->activeSubControls & SC_SliderHandle && (slider->state &
State_Sunken))
2866 stateId = TUVS_PRESSED;
2867 else if (slider->activeSubControls & SC_SliderHandle && (slider->state &
State_MouseOver))
2870 stateId = TUVS_FOCUSED;
2872 stateId = TUVS_NORMAL;
2880 fropt.QStyleOption::operator=(*slider);
2887 #ifndef QT_NO_TOOLBUTTON 2890 = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
2891 QRect button, menuarea;
2896 State mflags = bflags;
2915 tool.
palette = toolbutton->palette;
2920 theme.
partId = TP_SPLITBUTTON;
2921 theme.
rect = button;
2923 stateId = TS_DISABLED;
2925 stateId = TS_PRESSED;
2927 stateId = flags &
State_On ? TS_HOTCHECKED : TS_HOT;
2929 stateId = TS_CHECKED;
2931 stateId = TS_NORMAL;
2938 tool.
state = bflags;
2949 fr.QStyleOption::operator=(*toolbutton);
2953 toolbutton, widget), 0);
2957 label.
state = bflags;
2965 tool.
rect = menuarea;
2966 tool.
state = mflags;
2970 tool.
state = mflags;
2971 menuarea.
adjust(-2, 0, 0, 0);
2973 if ((bflags &
State_Sunken) != (mflags & State_Sunken)){
2995 QRect ir = toolbutton->rect;
3002 #endif // QT_NO_TOOLBUTTON 3013 if (widget && widget->
inherits(
"Q3DockWindowTitleBar")) {
3014 partId = WP_SMALLCAPTION;
3020 stateId = CS_DISABLED;
3022 stateId = CS_ACTIVE;
3024 stateId = CS_INACTIVE;
3035 COLORREF textShadowRef;
3037 QColor textShadow =
qRgb(GetRValue(textShadowRef), GetGValue(textShadowRef), GetBValue(textShadowRef));
3042 COLORREF captionText = GetSysColor(isActive ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT);
3043 QColor textColor =
qRgb(GetRValue(captionText), GetGValue(captionText), GetBValue(captionText));
3050 partId = WP_SYSBUTTON;
3051 if ((widget && !widget->
isEnabled()) || !isActive)
3052 stateId = SBS_DISABLED;
3054 stateId = SBS_PUSHED;
3058 stateId = SBS_NORMAL;
3059 if (!tb->icon.isNull()) {
3060 tb->icon.paint(p, theme.
rect);
3066 if (sz.cx == 0 || sz.cy == 0) {
3081 partId = WP_MINBUTTON;
3083 stateId = MINBS_DISABLED;
3085 stateId = MINBS_PUSHED;
3087 stateId = MINBS_HOT;
3091 stateId = MINBS_NORMAL;
3099 partId = WP_MAXBUTTON;
3101 stateId = MAXBS_DISABLED;
3103 stateId = MAXBS_PUSHED;
3105 stateId = MAXBS_HOT;
3109 stateId = MAXBS_NORMAL;
3117 partId = WP_HELPBUTTON;
3119 stateId = MINBS_DISABLED;
3121 stateId = MINBS_PUSHED;
3123 stateId = MINBS_HOT;
3127 stateId = MINBS_NORMAL;
3137 if (drawNormalButton) {
3139 partId = WP_RESTOREBUTTON;
3141 stateId = RBS_DISABLED;
3143 stateId = RBS_PUSHED;
3149 stateId = RBS_NORMAL;
3157 partId = WP_MINBUTTON;
3159 stateId = MINBS_DISABLED;
3161 stateId = MINBS_PUSHED;
3163 stateId = MINBS_HOT;
3167 stateId = MINBS_NORMAL;
3175 partId = WP_RESTOREBUTTON;
3177 stateId = RBS_DISABLED;
3179 stateId = RBS_PUSHED;
3185 stateId = RBS_NORMAL;
3193 partId = WP_CLOSEBUTTON;
3195 stateId = CBS_DISABLED;
3197 stateId = CBS_PUSHED;
3203 stateId = CBS_NORMAL;
3212 #ifndef QT_NO_WORKSPACE 3221 theme.
partId = WP_MDICLOSEBUTTON;
3222 theme.
rect = buttonRect;
3237 theme.
partId = WP_MDIRESTOREBUTTON;
3238 theme.
rect = buttonRect;
3253 theme.
partId = WP_MDIMINBUTTON;
3254 theme.
rect = buttonRect;
3268 #endif //QT_NO_WORKSPACE 3271 if (
const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option))
3274 #endif // QT_NO_DIAL 3294 if (qobject_cast<const QListView*>(widget))
3311 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(option)) {
3312 switch (tab->shape) {
3365 orient = pb2->orientation;
3367 if (theme.isValid()) {
3369 pGetThemePartSize(theme.handle(), 0, theme.partId, theme.stateId, 0, TS_TRUE, &size);
3389 if (widget && widget->
inherits(
"Q3DockWindowTitleBar")) {
3390 res = GetSystemMetrics(SM_CYSMCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME);
3394 res = GetSystemMetrics(SM_CYSMCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME);
3396 res = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME);
3415 #ifndef QT_NO_TOOLBAR 3420 #endif // QT_NO_TOOLBAR 3440 if (qstyleoption_cast<const QStyleOptionToolButton *>(option))
3466 bool retVal =
false;
3477 if (isMinimized && (flags & Qt::WindowMinimizeButtonHint))
3483 if (!isMaximized && (flags & Qt::WindowMaximizeButtonHint))
3491 if (isMinimized && flags & Qt::WindowShadeButtonHint)
3499 if (flags & Qt::WindowSystemMenuHint)
3521 if (
const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
3524 const bool isToolTitle =
false;
3525 const int height = tb->rect.
height();
3526 const int width = tb->rect.width();
3527 int buttonHeight = GetSystemMetrics(SM_CYSIZE) - 4;
3528 int buttonWidth = GetSystemMetrics(SM_CXSIZE) - 4;
3529 const int delta = buttonWidth + 2;
3530 int controlTop = option->
rect.
bottom() - buttonHeight - 2;
3541 switch (subControl) {
3543 rect =
QRect(frameWidth, 0, width - (buttonWidth + frameWidth + 10), height);
3546 rect.
adjust(0, 0, -buttonWidth - 3, 0);
3548 if (minimizeHint || maximizeHint)
3549 rect.
adjust(0, 0, -buttonWidth - 2, 0);
3552 const int leftOffset = height - 8;
3553 rect.
adjust(leftOffset, 0, 0, 0);
3556 rect.
adjust(0, 0, -buttonWidth - 2, 0);
3558 rect.
adjust(0, 0, -buttonWidth - 2, 0);
3560 rect.
adjust(0, 0, -buttonWidth - 2, 0);
3562 rect.
adjust(0, 0, -buttonWidth - 2, 0);
3608 rect.
setRect(width - offset - controlTop + 1, controlTop,
3609 buttonWidth, buttonHeight);
3614 const int controlTop = 6;
3615 const int controlHeight = height - controlTop - 3;
3617 QSize iconSize = tb->icon.actualSize(
QSize(iconExtent, iconExtent));
3618 if (tb->icon.isNull())
3619 iconSize =
QSize(controlHeight, controlHeight);
3620 int hPad = (controlHeight - iconSize.
height())/2;
3621 int vPad = (controlHeight - iconSize.
width())/2;
3622 rect =
QRect(frameWidth + hPad, controlTop + vPad, iconSize.
width(), iconSize.
height());
3632 if (
const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
3633 int x = cmb->rect.x(), y = cmb->rect.y(), wi = cmb->rect.width(), he = cmb->rect.height();
3635 xpos += wi - 1 - 16;
3637 switch (subControl) {
3643 rect =
QRect(xpos, y+1, 16, he-2);
3647 rect =
QRect(x+2, y+2, wi-3-16, he-4);
3659 #ifndef QT_NO_WORKSPACE 3662 int numSubControls = 0;
3669 if (numSubControls == 0)
3672 int buttonWidth = option->
rect.
width()/ numSubControls;
3674 switch (subControl) {
3677 if (numSubControls == 1)
3679 offset += buttonWidth;
3688 offset += buttonWidth;
3696 #endif // QT_NO_WORKSPACE 3715 QSize sz(contentsSize);
3721 HTHEME theme = buttontheme.
handle();
3731 if (result == S_OK) {
3732 sz +=
QSize(borderSize.cxLeftWidth + borderSize.cxRightWidth - 2,
3733 borderSize.cyBottomHeight + borderSize.cyTopHeight - 2);
3737 + textMargins, 23), 0);
3746 sz -=
QSize(2*border, 2*border);
3755 #ifndef QT_NO_MENUBAR 3762 if (
const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option))
3774 if (
const QStyleOptionComplex *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(option)) {
3782 sz =
QSize(width, 19);
3822 if (!widget || (widget && widget->
isEnabled()))
3837 if (mask && titlebar) {
3854 #ifndef QT_NO_RUBBERBAND 3856 if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) {
3860 #endif // QT_NO_RUBBERBAND 3891 switch(standardPixmap) {
3894 if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
3896 if (widget && widget->
isWindow()) {
3924 switch(standardIcon) {
3926 if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
3938 theme.
rect =
QRect(0, 0, size.cx, size.cy);
3961 if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
3972 theme.
partId = WP_CLOSEBUTTON;
3973 theme.
rect =
QRect(0, 0, size.cx, size.cy);
3995 if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
4007 theme.
rect =
QRect(0, 0, size.cx, size.cy);
4053 #ifdef DEBUG_XP_STYLE 4055 #define TMT_ENUMDEF 8 4056 #define TMT_ENUMVAL TEXT('A') 4057 #define TMT_ENUM TEXT('B') 4058 #define SCHEMA_STRINGS // For 2nd pass on schema file 4060 #include <tmschema.h> 4072 return wcscmp(a.propName, b.propName) < 0;
4093 void QWindowsXPStylePrivate::dumpNativeDIB(
int w,
int h)
4096 static int pCount = 0;
4097 DWORD *bufPix = (DWORD*)bufferPixels;
4099 char *bufferDump =
new char[bufferH * bufferW * 16];
4100 char *bufferPos = bufferDump;
4102 memset(bufferDump, 0,
sizeof(bufferDump));
4103 bufferPos += sprintf(bufferPos,
"const int pixelBufferW%d = %d;\n", pCount, w);
4104 bufferPos += sprintf(bufferPos,
"const int pixelBufferH%d = %d;\n", pCount, h);
4105 bufferPos += sprintf(bufferPos,
"const unsigned DWORD pixelBuffer%d[] = {", pCount);
4106 for (
int iy = 0; iy < h; ++iy) {
4107 bufferPos += sprintf(bufferPos,
"\n ");
4108 bufPix = (DWORD*)(bufferPixels + (iy * bufferW * 4));
4109 for (
int ix = 0; ix < w; ++ix) {
4110 bufferPos += sprintf(bufferPos,
"0x%08x, ", *bufPix);
4114 bufferPos += sprintf(bufferPos,
"\n};\n\n");
4117 delete[] bufferDump;
4128 static void showProperty(
XPThemeData &themeData,
const PropPair &prop)
4130 PROPERTYORIGIN origin = PO_NOTFOUND;
4132 const char *originStr;
4135 originStr =
"State ";
4138 originStr =
"Part ";
4141 originStr =
"Class ";
4144 originStr =
"Globl ";
4148 originStr =
"Unkwn ";
4152 switch(prop.propType) {
4155 wchar_t buffer[512];
4157 printf(
" (%sString) %-20S: %S\n", originStr, prop.propName, buffer);
4164 printf(
" (%sEnum) %-20S: %d\n", originStr, prop.propName, result);
4171 printf(
" (%sint) %-20S: %d\n", originStr, prop.propName, result);
4176 BOOL result =
false;
4178 printf(
" (%sbool) %-20S: %d\n", originStr, prop.propName, result);
4183 COLORREF result = 0;
4185 printf(
" (%scolor) %-20S: 0x%08X\n", originStr, prop.propName, result);
4191 memset(&result, 0,
sizeof(result));
4193 printf(
" (%smargins) %-20S: (%d, %d, %d, %d)\n", originStr,
4194 prop.propName, result.cxLeftWidth, result.cyTopHeight, result.cxRightWidth, result.cyBottomHeight);
4199 wchar_t buffer[512];
4201 printf(
" (%sfilename)%-20S: %S\n", originStr, prop.propName, buffer);
4209 memset(&result1, 0,
sizeof(result1));
4210 memset(&result2, 0,
sizeof(result2));
4211 memset(&result3, 0,
sizeof(result3));
4215 printf(
" (%ssize) %-20S: Min (%d, %d), True(%d, %d), Draw(%d, %d)\n", originStr, prop.propName,
4216 result1.cx, result1.cy, result2.cx, result2.cy, result3.cx, result3.cy);
4222 memset(&result, 0,
sizeof(result));
4224 printf(
" (%sPosition)%-20S: (%d, %d)\n", originStr, prop.propName, result.x, result.y);
4230 memset(&result, 0,
sizeof(result));
4232 printf(
" (%sRect) %-20S: (%d, %d, %d, %d)\n", originStr, prop.propName, result.left, result.top, result.right, result.bottom);
4238 memset(&result, 0,
sizeof(result));
4240 printf(
" (%sFont) %-20S: %S height(%d) width(%d) weight(%d)\n", originStr, prop.propName,
4241 result.lfFaceName, result.lfHeight, result.lfWidth, result.lfWeight);
4247 memset(&result, 0,
sizeof(result));
4249 printf(
" (%sInt list)%-20S: { ", originStr, prop.propName);
4250 for (
int i = 0; i < result.iValueCount; ++i)
4251 printf(
"%d ", result.iValues[i]);
4256 printf(
" %s%S : Unknown property type (%d)!\n", originStr, prop.propName, prop.propType);
4269 void QWindowsXPStylePrivate::showProperties(
XPThemeData &themeData)
4271 if (!all_props.
count()) {
4272 const TMSCHEMAINFO *infoTable = GetSchemaInfo();
4273 for (
int i = 0; i < infoTable->iPropCount; ++i) {
4274 int propType = infoTable->pPropTable[i].bPrimVal;
4275 int propValue = infoTable->pPropTable[i].sEnumVal;
4276 LPCWSTR propName = infoTable->pPropTable[i].pszName;
4283 if (propType != propValue) {
4285 prop.propValue = propValue;
4286 prop.propName = propName;
4287 prop.propType = propType;
4295 printf(
"part properties count = %d:\n", all_props.
count());
4296 printf(
" Enum Property Name Description\n");
4297 printf(
"-----------------------------------------------------------\n");
4298 wchar_t themeName[256];
4300 for (
int j = 0; j < all_props.
count(); ++j) {
4301 PropPair prop = all_props.
at(j);
4304 printf(
"%3d: (%4d) %-20S %S\n", j, prop.propValue, prop.propName, buf);
4309 printf(
"Global Properties:\n");
4310 for (
int j = 0; j < all_props.
count(); ++j) {
4311 PropPair prop = all_props.
at(j);
4312 PROPERTYORIGIN origin = PO_NOTFOUND;
4314 if (origin == PO_GLOBAL) {
4315 showProperty(themeData, prop);
4321 for (
int j = 0; j < all_props.
count(); ++j) {
4322 PropPair prop = all_props.
at(j);
4323 PROPERTYORIGIN origin = PO_NOTFOUND;
4325 if (origin != PO_NOTFOUND)
4327 showProperty(themeData, prop);
4337 #endif //QT_NO_WINDOWSXP QPixmap standardPixmap(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
Reimplemented Function
HRESULT(WINAPI * PtrGetThemePosition)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT POINT *pPoint)
The QPainter class performs low-level painting on widgets and other paint devices.
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or 0 if the painter is not acti...
static PtrGetThemeEnumValue pGetThemeEnumValue
HBITMAP buffer(int w=0, int h=0)
Returns a native buffer (DIB section) of at least the size of ( x , y ).
The QColor class provides colors based on RGB, HSV or CMYK values.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
void polish(QApplication *)
Reimplemented Function
void unpolish(QApplication *)
Reimplemented Function
const T * constData() const
QImage toImage() const
Converts the pixmap to a QImage.
HRESULT(WINAPI * PtrGetThemeRect)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT RECT *pRect)
const QBrush & highlight() const
Returns the highlight brush of the current color group.
The QApplication class manages the GUI application's control flow and main settings.
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.
HRESULT(WINAPI * PtrGetThemeColor)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT COLORREF *pColor)
Format
The following image formats are available in Qt.
QRect subElementRect(SubElement r, const QStyleOption *option, const QWidget *widget=0) const
Reimplemented Function
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
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 ...
void setHeight(int h)
Sets the height of the rectangle to the given height.
const QBrush & base() const
Returns the base brush of the current color group.
SubControl
This enum describes the available sub controls.
StyleHint
This enum describes the available style hints.
void drawBackgroundThruNativeBuffer(XPThemeData &themeData)
This function uses a secondary Native doublebuffer for painting parts.
static PtrGetThemeRect pGetThemeRect
HTHEME(WINAPI * PtrOpenThemeData)(HWND hwnd, LPCWSTR pszClassList)
The QStyleHintReturn class provides style hints that return more than basic data types.
void addPixmap(const QPixmap &pixmap, Mode mode=Normal, State state=Off)
Adds pixmap to the icon, as a specialization for mode and state.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static bool resolveSymbols()
Returns true if all the necessary theme engine symbols were resolved.
qreal opacity() const
Returns the opacity of the painter.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
~QWindowsXPStyle()
Destroys the style.
int width() const
Returns the width of the pixmap.
QPointer< QWidget > widget
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
The QLine class provides a two-dimensional vector using integer precision.
const QBrush & dark() const
Returns the dark brush of the current color group.
HRESULT(WINAPI * PtrGetThemePropertyOrigin)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin)
The QMatrix class specifies 2D transformations of a coordinate system.
QStyle::State state
the style flags that are used when drawing the control
#define it(className, varName)
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
int count(const T &t) const
Returns the number of occurrences of value in the vector.
static PtrIsAppThemed pIsAppThemed
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
static QSize globalStrut()
HRESULT(WINAPI * PtrGetThemeIntList)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT INTLIST *pIntList)
void rotate(qreal a)
Rotates the coordinate system the given angle clockwise.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
#define TMT_TEXTSHADOWCOLOR
ComplexControl
This enum describes the available complex controls.
qreal dx() const
Returns the horizontal translation factor.
bool remove(const T &value)
QRect united(const QRect &other) const
Returns the bounding rectangle of this rectangle and the given rectangle.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
Q_GUI_EXPORT HDC qt_win_display_dc()
static const int windowsArrowHMargin
static PtrGetThemeInt pGetThemeInt
The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar...
void restore()
Restores the current painter state (pops a saved state off the stack).
HRESULT(WINAPI * PtrGetThemeMargins)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins)
PixelMetric
This enum describes the various available pixel metrics.
HRESULT(WINAPI * PtrDrawThemeBackgroundEx)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const DTBGOPTS *pOptions)
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
static QBasicAtomicInt ref
int left() const
Returns the x-coordinate of the rectangle's left edge.
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
int width() const
Returns the width of the rectangle.
static bool buttonVisible(const QStyle::SubControl sc, const QStyleOptionTitleBar *tb)
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool fixAlphaChannel(const QRect &rect)
When the theme engine paints both a true alpha pixmap and a glyph into our buffer, the glyph might not contain a proper alpha value.
virtual void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const
Draws the given text in the specified rectangle using the provided painter and palette.
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
QRect boundingRect() const
Returns the bounding rectangle of this region.
void moveTo(int x, int t)
Moves the rectangle, leaving the top-left corner at the given position (x, y).
void drawBackground(XPThemeData &themeData)
Main theme drawing function.
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
void drawLine(const QLineF &line)
Draws a line defined by line.
static PtrGetThemeColor pGetThemeColor
ushort red
Returns the red color component of this color.
int height() const
Returns the height of the rectangle.
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
void setHeight(int h)
Sets the height to the given height.
T * qobject_cast(QObject *object)
const QMatrix & deviceMatrix() const
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dep...
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *option, SubControl sc, const QWidget *widget=0) const
Reimplemented Function
HRESULT(WINAPI * PtrGetThemeMetric)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OUT int *piVal)
#define Q_BASIC_ATOMIC_INITIALIZER(a)
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
The QStyleOptionSizeGrip class is used to describe the parameter for drawing a size grip...
bool operator<(int priority, const QPair< QRunnable *, int > &p)
virtual int devType() const
#define TMT_CAPTIONMARGINS
static const int windowsItemVMargin
void drawPoint(const QPointF &pt)
Draws a single point at the given position using the current pen's color.
The QChar class provides a 16-bit Unicode character.
QTabBar::Shape shape
the tab shape used to draw the tab; by default QTabBar::RoundedNorth
#define SIZE(large, small, mini)
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
static PtrGetCurrentThemeName pGetCurrentThemeName
HRESULT(WINAPI * PtrGetThemeBool)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT BOOL *pfVal)
void save()
Saves the current painter state (pushes the state onto a stack).
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags=0) const
If the string text is wider than width, returns an elided version of the string (i.
StandardPixmap
This enum describes the available standard pixmaps.
static QPixmap * find(const QString &key)
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
void drawBackgroundDirectly(XPThemeData &themeData)
This function draws the theme parts directly to the paintengines HDC.
Q_CORE_EXPORT void qDebug(const char *,...)
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
virtual HDC getDC() const
Empty default implementation.
The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progre...
int width() const
Returns the width.
static QIcon windowIcon()
QRegion clipRegion() const
Returns the currently set clip region.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
void append(const T &t)
Inserts value at the end of the list.
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
bool hasAnyData(const QRect &rect)
Returns true if the native doublebuffer contains a pixel which has a non-0xFF alpha value...
HRESULT(WINAPI * PtrGetThemeDocumentationProperty)(LPCWSTR pszThemeName, LPCWSTR pszPropertyName, OUT LPWSTR pszValueBuff, int cchMaxValChars)
const QPen & pen() const
Returns the painter's current pen.
#define QT_BEGIN_NAMESPACE
This macro expands to.
HRESULT(WINAPI * PtrGetThemeInt)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT int *piVal)
QFontMetrics fontMetrics() const
Returns the font metrics for the painter if the painter is active.
void setBrush(ColorRole cr, const QBrush &brush)
Sets the brush for the given color role to the specified brush for all groups in the palette...
void drawDial(const QStyleOptionSlider *option, QPainter *painter)
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
QMatrix & rotate(qreal a)
Rotates the coordinate system the given degrees counterclockwise.
const QBrush & light() const
Returns the light brush of the current color group.
void cleanup(bool force=false)
void drawControl(ControlElement element, const QStyleOption *option, QPainter *p, const QWidget *wwidget=0) const
Reimplemented Function
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
virtual QPalette standardPalette() const
Returns the style's standard palette.
HRESULT(WINAPI * PtrDrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect)
bool hasClipping() const
Returns true if clipping has been set; otherwise returns false.
The QStyleOption class stores the parameters used by QStyle functions.
int size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
ContentsType
This enum describes the available contents types.
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
void setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
const QFont & font() const
Returns the currently set font used for drawing text.
void drawPrimitive(PrimitiveElement pe, const QStyleOption *option, QPainter *p, const QWidget *widget=0) const
Reimplemented Function
const T value(const Key &key) const
Returns the value associated with the key key.
bool hasAlphaChannel(const QRect &rect)
Returns true if the native doublebuffer contains pixels with varying alpha value. ...
bool isActive() const
Returns true if begin() has been called and end() has not yet been called; otherwise returns false...
QSize size() const
Returns the size of the rectangle.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
const T & at(int i) const
Returns the item at index position i in the list.
HRESULT(WINAPI * PtrGetThemeString)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars)
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates 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...
int styleHint(StyleHint hint, const QStyleOption *option=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
void unpolish(QApplication *)
Reimplemented Function
The QImage class provides a hardware-independent image representation that allows direct access to th...
void transpose()
Swaps the width and height values.
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
static const char * data(const QByteArray &arr)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
const QTransform & deviceTransform() const
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dep...
int pixelMetric(PixelMetric pm, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
QSize sizeFromContents(ContentsType ct, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
HRESULT(WINAPI * PtrGetThemeBackgroundRegion)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, const RECT *pRect, OUT HRGN *pRegion)
The QRegion class specifies a clip region for a painter.
The QStyleOptionTabBarBase class is used to describe the base of a tab bar, i.e.
static QPalette * sys_pal
static PtrGetThemePartSize pGetThemePartSize
static bool isItemViewDelegateLineEdit(const QWidget *widget)
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
The State element defines configurations of objects and properties.
bool isTransparent(XPThemeData &themeData)
Returns true if the part contains any transparency at all.
virtual void releaseDC(HDC hdc) const
Empty default implementation.
QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode=Qt::FastTransformation) const
Returns a copy of the image that is transformed using the given transformation matrix and transformat...
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
static PtrGetThemeString pGetThemeString
HRESULT(WINAPI * PtrCloseThemeData)(HTHEME hTheme)
static PtrGetThemeIntList pGetThemeIntList
QImage mirrored(bool horizontally=false, bool vertically=true) const
Returns a mirror of the image, mirrored in the horizontal and/or the vertical direction depending on ...
static const int windowsRightBorder
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
FrameFeatures features
a bitwise OR of the features that describe this frame.
void qSort(RandomAccessIterator start, RandomAccessIterator end)
const QPixmap * tabBody(QWidget *widget)
Returns the pointer to a tab widgets body pixmap, scaled to the height of the screen.
static PtrGetThemePosition pGetThemePosition
static PtrOpenThemeData pOpenThemeData
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
const T & at(int i) const
Returns the item at index position i in the vector.
static PtrGetThemeMargins pGetThemeMargins
void moveCenter(const QPoint &p)
Moves the rectangle, leaving the center point at the given position.
int styleHint(StyleHint hint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
iterator begin()
Returns an STL-style iterator pointing to the first item in the map.
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
bool(WINAPI * PtrIsAppThemed)()
The QWindowsXPStyle class provides a Microsoft Windows XP-like look and feel.
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
void setTransparency(QWidget *widget, XPThemeData &themeData)
Sets the parts region on a window.
qreal dpiScaled(qreal value)
QPoint topRight() const
Returns the position of the rectangle's top-right corner.
RECT toRECT(const QRect &qr)
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
QPalette palette
the palette that should be used when painting the control
The QBrush class defines the fill pattern of shapes drawn by QPainter.
QPoint center() const
Returns the center point of the rectangle.
const QBrush & shadow() const
Returns the shadow brush of the current color group.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
Draws the given pixmap in the specified rectangle, according to the specified alignment, using the provided painter.
The QStyleHintReturnMask class provides style hints that return a QRegion.
static PtrIsThemeActive pIsThemeActive
#define Q_ASSERT_X(cond, where, what)
int top() const
Returns the y-coordinate of the rectangle's top edge.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction...
void * resolve(const char *symbol)
ushort blue
Returns the blue color component of this color.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option, QPainter *p, const QWidget *widget=0) const
Reimplemented Function
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
static bool closingDown()
Returns true if the application objects are being destroyed; otherwise returns false.
int right() const
Returns the x-coordinate of the rectangle's right edge.
PrimitiveElement
This enum describes the various primitive elements.
HRESULT(WINAPI * PtrGetThemePartSize)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz)
static PtrGetThemeDocumentationProperty pGetThemeDocumentationProperty
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
QRegion region(XPThemeData &themeData)
void setClipping(bool enable)
Enables clipping if enable is true, or disables clipping if enable is false.
qint64 cacheKey() const
Returns a number that identifies the contents of this QIcon object.
The QFont class specifies a font used for drawing text.
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
int y() const
Returns the y-coordinate of the rectangle's top edge.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
HRESULT(WINAPI * PtrGetCurrentThemeName)(OUT LPWSTR pszThemeFileName, int cchMaxNameChars, OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
int pixelMetric(PixelMetric pm, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
HRESULT(WINAPI * PtrGetThemeEnumValue)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT int *piVal)
T qstyleoption_cast(const QStyleOption *opt)
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
static PtrIsThemeBackgroundPartiallyTransparent pIsThemeBackgroundPartiallyTransparent
static PtrGetThemeFilename pGetThemeFilename
static PtrGetThemeMetric pGetThemeMetric
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
#define TMT_TEXTSHADOWTYPE
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
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)
static const QStyle::SubControl SubControls[]
qreal dy() const
Returns the vertical translation factor.
static HWND winId(const QWidget *widget)
This function will always return a valid window handle, and might create a limbo widget to do so...
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
The QPoint class defines a point in the plane using integer precision.
BOOL(WINAPI * PtrIsThemeBackgroundPartiallyTransparent)(HTHEME hTheme, int iPartId, int iStateId)
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given element with the provided painter with the style options specified by option...
QWindowsXPStyle()
Constructs a QWindowsStyle.
The QStyleOptionComboBox class is used to describe the parameter for drawing a combobox.
void setWidth(int w)
Sets the width of the rectangle to the given width.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
HRESULT(WINAPI * PtrGetThemeFont)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OUT LOGFONT *pFont)
int height() const
Returns the height.
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
static bool useXP(bool update=false)
The QLabel widget provides a text or image display.
static PtrCloseThemeData pCloseThemeData
void getRect(int *x, int *y, int *w, int *h) const
Extracts the position of the rectangle's top-left corner to *x and *y, and its dimensions to *width a...
static QWidget * limboWidget
The QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt ...
static PtrGetThemeFont pGetThemeFont
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 drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
const QStyle * proxy() const
static const int windowsItemHMargin
The QPixmap class is an off-screen image representation that can be used as a paint device...
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.
static QMap< QString, HTHEME > * handleMap
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
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.
HRESULT(WINAPI * PtrGetThemeFilename)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars)
void init(bool force=false)
static PtrDrawThemeBackgroundEx pDrawThemeBackgroundEx
ControlElement
This enum represents a control element.
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
The QSize class defines the size of a two-dimensional object using integer point precision.
void setFont(const QFont &f)
Sets the painter's font to the given font.
static PtrGetThemeBackgroundRegion pGetThemeBackgroundRegion
QRegion translated(int dx, int dy) const
Returns a copy of the region that is translated dx along the x axis and dy along the y axis...
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
Qt::WindowFlags titleBarFlags
the widget flags for the title bar
static PtrGetThemeBool pGetThemeBool
int x() const
Returns the x coordinate of this point.
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
#define TMT_TRANSPARENTCOLOR
QRegion region
the region for style hints that return a QRegion
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
void polish(QApplication *)
Reimplemented Function
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
#define TMT_SIZINGMARGINS
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
QPixmap copy(int x, int y, int width, int height) const
Returns a deep copy of the subset of the pixmap that is specified by the rectangle QRect( x...
AlphaChannelType alphaType
static const KeyPair *const end
int titleBarState
the state of the title bar
QPalette standardPalette() const
Reimplemented Function
#define qPrintable(string)
static const int windowsItemFrame
QRegion qt_region_from_HRGN(HRGN rgn)
QRegion systemClip() const
Returns the system clip.
ushort green
Returns the green color component of this color.
bool(WINAPI * PtrIsThemeActive)()
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
static PtrGetThemePropertyOrigin pGetThemePropertyOrigin
bool swapAlphaChannel(const QRect &rect, bool allPixels=false)
Swaps the alpha values on certain pixels: 0xFF?????? -> 0x00?????? 0x00?????? -> 0xFF?????? Used to determin the mask of a non-alpha transparent pixmap in the native doublebuffer, and swap the alphas so we may paint the image as a Premultiplied QImage with drawImage(), and obtain the mask transparency.
QRgb groupBoxTextColorDisabled
static PtrDrawThemeBackground pDrawThemeBackground
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QRect rect
the area that should be used for various calculations and painting
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
void setBackground(const QBrush &bg)
Sets the background brush of the painter to the given brush.
Handle handle() const
Returns a platform-specific region handle.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=0) const
Reimplemented Function
const QBrush & text() const
Returns the text foreground brush of the current color group.
SubElement
This enum represents a sub-area of a widget.
The QList class is a template class that provides lists.
static int area(const QSize &s)
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
void qErrnoWarning(const char *msg,...)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.
#define TMT_CONTENTMARGINS