7#if QT_CONFIG(style_windows) || defined(QT_PLUGIN)
18#include <private/qmenubar_p.h>
22#if QT_CONFIG(rubberband)
31#if QT_CONFIG(mainwindow)
40#if QT_CONFIG(listview)
43#include <private/qmath_p.h>
45#include <QtGui/qpainterpath.h>
46#include <QtGui/qscreen.h>
47#include <QtGui/qwindow.h>
48#include <qpa/qplatformtheme.h>
49#include <qpa/qplatformscreen.h>
50#include <private/qguiapplication_p.h>
51#include <private/qhighdpiscaling_p.h>
52#include <qpa/qplatformintegration.h>
53#include <private/qwidget_p.h>
55#include <private/qstylehelper_p.h>
56#if QT_CONFIG(animation)
57#include <private/qstyleanimation_p.h>
69# ifndef COLOR_GRADIENTACTIVECAPTION
70# define COLOR_GRADIENTACTIVECAPTION 27
72# ifndef COLOR_GRADIENTINACTIVECAPTION
73# define COLOR_GRADIENTINACTIVECAPTION 28
89QWindowsStylePrivate::QWindowsStylePrivate() =
default;
91qreal QWindowsStylePrivate::appDevicePixelRatio()
93 return qApp->devicePixelRatio();
97bool QWindowsStylePrivate::hasSeenAlt(
const QWidget *
widget)
const
100 return seenAlt.contains(
widget);
109 if (!
o->isWidgetType())
123 ||
w->style()->styleHint(SH_UnderlineShortcut,
nullptr,
w);
141#if QT_CONFIG(menubar)
143 for (
int i = 0;
i < l.
size(); ++
i)
176QWindowsStyle::QWindowsStyle() :
QCommonStyle(*new QWindowsStylePrivate)
185QWindowsStyle::QWindowsStyle(QWindowsStylePrivate &dd) :
QCommonStyle(dd)
191QWindowsStyle::~QWindowsStyle()
196static inline QRgb colorref2qrgb(COLORREF col)
198 return qRgb(GetRValue(col), GetGValue(col), GetBValue(col));
206 QWindowsStylePrivate *
d =
const_cast<QWindowsStylePrivate*
>(d_func());
208 if (!
proxy()->styleHint(SH_UnderlineShortcut,
nullptr) &&
app)
212 d->activeGradientCaptionColor =
palette.highlight().color();
213 d->activeCaptionColor =
d->activeGradientCaptionColor;
214 d->inactiveGradientCaptionColor =
palette.dark().color();
215 d->inactiveCaptionColor =
d->inactiveGradientCaptionColor;
216 d->inactiveCaptionText =
palette.window().color();
220 DWORD activeCaption = GetSysColor(COLOR_ACTIVECAPTION);
222 DWORD inactiveCaption = GetSysColor(COLOR_INACTIVECAPTION);
224 DWORD inactiveCaptionText = GetSysColor(COLOR_INACTIVECAPTIONTEXT);
225 d->activeCaptionColor = colorref2qrgb(activeCaption);
226 d->activeGradientCaptionColor = colorref2qrgb(gradientActiveCaption);
227 d->inactiveCaptionColor = colorref2qrgb(inactiveCaption);
228 d->inactiveGradientCaptionColor = colorref2qrgb(gradientInactiveCaption);
229 d->inactiveCaptionText = colorref2qrgb(inactiveCaptionText);
256void QWindowsStyle::polish(
QPalette &pal)
266 return GetSystemMetrics(SM_CXFRAME);
271 return GetSystemMetrics(SM_CYSMCAPTION) - 1;
273 return GetSystemMetrics(SM_CYCAPTION) - 1;
277 NONCLIENTMETRICS ncm;
278 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) +
sizeof(LOGFONT);
279 if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS), &ncm, 0))
280 return qMax(ncm.iScrollHeight, ncm.iScrollWidth);
285 return GetSystemMetrics(SM_CYFRAME);
294 return QWindowsStylePrivate::InvalidMetric;
344 return QWindowsStylePrivate::InvalidMetric;
366 if (
screen != primaryScreen) {
380 int ret = QWindowsStylePrivate::pixelMetricFromSystemDp(pm,
opt,
widget);
381 if (
ret != QWindowsStylePrivate::InvalidMetric)
384 ret = QWindowsStylePrivate::fixedPixelMetric(pm);
385 if (
ret != QWindowsStylePrivate::InvalidMetric)
391 case PM_MaximumDragDistance:
401 case PM_SliderControlThickness:
402 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
403 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height() : sl->rect.width();
404 int ticks = sl->tickPosition;
417 thick +=
proxy()->pixelMetric(PM_SliderLength, sl,
widget) / 4;
421 thick += (space * 2) / (
n + 2);
427 case PM_IconViewIconSize:
431 case PM_SplitterWidth:
451 switch(standardPixmap) {
453 case SP_DriveDVDIcon:
454 case SP_DriveNetIcon:
458 case SP_FileLinkIcon:
460 case SP_DirClosedIcon:
462 case SP_ComputerIcon:
464 case SP_FileDialogNewFolder:
470 desktopIcon = theme->standardPixmap(
sp,
QSizeF(16, 16));
473 case SP_MessageBoxInformation:
474 case SP_MessageBoxWarning:
475 case SP_MessageBoxCritical:
476 case SP_MessageBoxQuestion:
479 desktopIcon = theme->standardPixmap(
sp,
QSizeF());
485 if (!desktopIcon.
isNull()) {
499 case SH_EtchDisabledText: {
507 case SH_Slider_SnapToValue:
508 case SH_PrintDialog_RightAlignButtons:
509 case SH_FontDialog_SelectAssociatedText:
510 case SH_Menu_AllowActiveAndDisabled:
511 case SH_MenuBar_AltKeyNavigation:
512 case SH_MenuBar_MouseTracking:
513 case SH_Menu_MouseTracking:
514 case SH_ComboBox_ListMouseTracking:
515 case SH_Slider_StopMouseOverSlider:
516 case SH_MainWindow_SpaceBelowMenuBar:
520 case SH_ItemView_ShowDecorationSelected:
521#if QT_CONFIG(listview)
522 if (qobject_cast<const QListView*>(
widget))
526 case SH_ItemView_ChangeHighlightOnFocus:
529 case SH_ToolBox_SelectedPageTitleBold:
534 case SH_UnderlineShortcut:
541 Q_D(
const QWindowsStyle);
543#if QT_CONFIG(menubar)
552 if (
menuBar->d_func()->keyboardState ||
d->altDown())
561#if QT_CONFIG(accessibility)
563 && QStyleHelper::isInstanceOf(
opt->
styleObject, QAccessible::MenuItem)
570 case SH_Menu_SubMenuSloppyCloseTimeout:
571 case SH_Menu_SubMenuPopupDelay: {
574 if (SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0))
581#if QT_CONFIG(rubberband)
582 case SH_RubberBand_Mask:
583 if (
const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(
opt)) {
603 case SH_ItemView_ArrowKeysNavigateIntoChildren:
606 case SH_DialogButtonBox_ButtonsHaveIcons:
621 bool doRestore =
false;
624#if QT_CONFIG(toolbar)
625 case PE_IndicatorToolBarSeparator:
628 const int margin = 2;
629 QPen oldPen =
p->pen();
634 rect.bottomLeft().y() - margin,
636 rect.topLeft().y() + margin);
639 rect.bottomLeft().y() - margin,
641 rect.topLeft().y() + margin);
646 p->drawLine(
rect.topLeft().x() + margin ,
648 rect.topRight().x() - margin,
651 p->drawLine(
rect.topLeft().x() + margin ,
653 rect.topRight().x() - margin,
659 case PE_IndicatorToolBarHandle:
662 if (
opt->
state & State_Horizontal) {
685 case PE_FrameButtonTool:
686 case PE_PanelButtonTool: {
687 QPen oldPen =
p->pen();
688#if QT_CONFIG(dockwidget)
689 if (
w &&
w->inherits(
"QDockWidgetTitleButton")) {
701 bool panel = (pe == PE_PanelButtonTool);
713 if (
opt->
state & (State_Raised | State_Sunken | State_On)) {
715 if (
opt->
state & (State_Enabled | State_Sunken | State_On)){
721 opt->
state & (State_Sunken | State_On), 1);
736 case PE_PanelButtonCommand:
742 if (! (
flags & State_Sunken) && (
flags & State_On))
750 p->drawRect(
r.adjusted(0, 0, -1, -1));
751 }
else if (
flags & (State_Raised | State_On | State_Sunken)) {
759 case PE_FrameDefaultButton: {
760 QPen oldPen =
p->pen();
766 rect.adjust(topLevelAdjustment, topLevelAdjustment,
767 bottomRightAdjustment, bottomRightAdjustment);
772 case PE_IndicatorCheckBox: {
778 else if (
opt->
state & State_Enabled)
791 case PE_IndicatorItemViewItemCheck:
796#if QT_CONFIG(itemviews)
797 if (pe == PE_IndicatorItemViewItemCheck) {
798 const QStyleOptionViewItem *itemViewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt);
799 p->setPen(itemViewOpt
800 && itemViewOpt->showDecorationSelected
826 case PE_FrameFocusRect:
829 if (!(fropt->state & State_KeyboardFocusChange) && !
proxy()->styleHint(SH_UnderlineShortcut,
opt))
834 QColor bg_col = fropt->backgroundColor;
836 bg_col =
p->background().color();
838 QColor patternCol((bg_col.
red() ^ 0xff) & 0xff,
839 (bg_col.
green() ^ 0xff) & 0xff,
840 (bg_col.
blue() ^ 0xff) & 0xff);
842 p->setBrushOrigin(
r.topLeft());
844 p->drawRect(
r.left(),
r.top(),
r.width(), 1);
845 p->drawRect(
r.left(),
r.bottom(),
r.width(), 1);
846 p->drawRect(
r.left(),
r.top(), 1,
r.height());
847 p->drawRect(
r.right(),
r.top(), 1,
r.height());
851 case PE_IndicatorRadioButton:
858 qreal radius = (
r.width() + (
r.width() + 1) % 2) / 2.0 - 1;
861 path1.
addEllipse(circleCenter, radius, radius);
864 path2.
addEllipse(circleCenter, radius, radius);
867 path3.
addEllipse(circleCenter, radius, radius);
870 path4.
addEllipse(circleCenter, radius, radius);
872 QPolygon topLeftPol, bottomRightPol;
873 topLeftPol.
setPoints(3,
r.x(),
r.y(),
r.x(),
r.y() +
r.height(),
r.x() +
r.width(),
r.y());
874 bottomRightPol.
setPoints(3,
r.x(),
r.y() +
r.height(),
r.x() +
r.width(),
r.y() +
r.height(),
r.x() +
r.width(),
r.y());
876 p->setClipRegion(
QRegion(topLeftPol));
884 p->setClipRegion(
QRegion(bottomRightPol));
895 p->setClipping(
false);
896 p->setPen(fillColor);
897 p->setBrush(fillColor);
914 if (pe == PE_FrameMenu) {
918 if (pe == PE_Frame && (
frame->state & State_Raised))
920 else if (pe == PE_Frame && (
frame->state & State_Sunken))
938 case PE_FrameButtonBevel:
939 case PE_PanelButtonBevel: {
941 bool panel = pe != PE_FrameButtonBevel;
948 if (
opt->
state & (State_Raised | State_On | State_Sunken)) {
958 case PE_FrameWindow: {
964#if QT_CONFIG(dockwidget)
965 case PE_IndicatorDockWidgetResizeHandle:
967 case PE_FrameDockWidget:
968 if (qstyleoption_cast<const QStyleOptionFrame *>(
opt)) {
974 case PE_FrameStatusBarItem:
978 case PE_IndicatorProgressChunk:
980 bool vertical =
false, inverted =
false;
983 inverted = pb->invertedAppearance;
987 int chunksize =
proxy()->pixelMetric(PM_ProgressBarChunkWidth,
opt,
w) - space;
1012 case PE_FrameTabWidget: {
1026#if QT_CONFIG(rubberband)
1028 if (qstyleoption_cast<const QStyleOptionRubberBand *>(
opt)) {
1031 QPainter pixmapPainter(&tiledPixmap);
1036 pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height());
1037 pixmapPainter.end();
1043 p->setClipRegion(
mask.region);
1044 p->drawTiledPixmap(
r.x(),
r.y(),
r.width(),
r.height(), tiledPixmap);
1051#if QT_CONFIG(menu) && QT_CONFIG(mainwindow)
1052 case CE_MenuBarEmptyArea:
1055 QPen oldPen =
p->pen();
1066 menuitem->rect.getRect(&
x, &
y, &
w, &
h);
1067 int tab = menuitem->reservedShortcutWidth;
1068 bool dis = !(menuitem->state & State_Enabled);
1070 ? menuitem->checked :
false;
1071 bool act = menuitem->state & State_Selected;
1074 int checkcol = qMax<int>(menuitem->maxIconWidth, QWindowsStylePrivate::windowsCheckMarkWidth);
1077 p->fillRect(menuitem->rect.adjusted(0, 0, -1, 0),
fill);
1080 int yoff =
y-1 +
h / 2;
1081 p->setPen(menuitem->palette.dark().color());
1082 p->drawLine(
x + 2, yoff,
x +
w - 4, yoff);
1083 p->setPen(menuitem->palette.light().color());
1084 p->drawLine(
x + 2, yoff + 1,
x +
w - 4, yoff + 1);
1089 if (!menuitem->icon.isNull() && checked) {
1092 menuitem->palette,
true, 1,
1105 if (!menuitem->icon.isNull()) {
1115 pmr.moveCenter(vCheckRect.
center());
1116 p->setPen(menuitem->palette.text().color());
1117 p->drawPixmap(pmr.topLeft(),
pixmap);
1118 }
else if (checked) {
1120 newMi.
state = State_None;
1122 newMi.
state |= State_Enabled;
1124 newMi.
state |= State_On | State_Selected;
1126 menuitem->rect.y() + QWindowsStylePrivate::windowsItemFrame,
1127 checkcol - 2 * QWindowsStylePrivate::windowsItemFrame,
1128 menuitem->rect.height() - 2 * QWindowsStylePrivate::windowsItemFrame));
1129 proxy()->drawPrimitive(PE_IndicatorMenuCheckMark, &newMi,
p,
widget);
1131 p->setPen(act ? menuitem->palette.highlightedText().color() : menuitem->
palette.buttonText().
color());
1135 discol = menuitem->palette.text().color();
1139 int xm = int(QWindowsStylePrivate::windowsItemFrame) + checkcol + int(QWindowsStylePrivate::windowsItemHMargin);
1140 int xpos = menuitem->rect.x() + xm;
1141 QRect textRect(xpos,
y + QWindowsStylePrivate::windowsItemVMargin,
1142 w - xm - QWindowsStylePrivate::windowsRightBorder - tab + 1,
h - 2 * QWindowsStylePrivate::windowsItemVMargin);
1149 if (!
proxy()->styleHint(SH_UnderlineShortcut, menuitem,
widget))
1156 if (dis && !act &&
proxy()->styleHint(SH_EtchDisabledText,
opt,
widget)) {
1157 p->setPen(menuitem->palette.light().color());
1158 p->drawText(vShortcutRect.
adjusted(1, 1, 1, 1), text_flags, textToDraw);
1161 p->drawText(vShortcutRect, text_flags, textToDraw);
1169 if (dis && !act &&
proxy()->styleHint(SH_EtchDisabledText,
opt,
widget)) {
1170 p->setPen(menuitem->palette.light().color());
1171 p->drawText(vTextRect.
adjusted(1, 1, 1, 1), text_flags, textToDraw);
1174 p->drawText(vTextRect, text_flags, textToDraw);
1178 int dim = (
h - 2 * QWindowsStylePrivate::windowsItemFrame) / 2;
1179 PrimitiveElement arrow;
1181 xpos =
x +
w - QWindowsStylePrivate::windowsArrowHMargin - QWindowsStylePrivate::windowsItemFrame - dim;
1184 newMI.
rect = vSubMenuRect;
1185 newMI.
state = dis ? State_None : State_Enabled;
1195#if QT_CONFIG(menubar)
1196 case CE_MenuBarItem:
1198 bool active = mbi->state & State_Selected;
1199 bool hasFocus = mbi->state & State_HasFocus;
1200 bool down = mbi->state & State_Sunken;
1203 if (active || hasFocus) {
1206 p->setBrushOrigin(
p->brushOrigin() +
QPoint(1, 1));
1207 if (active && hasFocus)
1209 mbi->rect.height(), mbi->palette, active && down, 1, 0, &
b);
1210 if (active && down) {
1212 proxy()->pixelMetric(PM_ButtonShiftVertical, mbi,
widget));
1213 p->setBrushOrigin(
p->brushOrigin() -
QPoint(1, 1));
1220#if QT_CONFIG(tabbar)
1221 case CE_TabBarTabShape:
1222 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
1226 bool selected = tab->state & State_Selected;
1227 bool lastTab = ((!rtlHorTabs && tab->position == QStyleOptionTab::End)
1229 && tab->position == QStyleOptionTab::Beginning));
1230 bool firstTab = ((!rtlHorTabs
1231 && tab->position == QStyleOptionTab::Beginning)
1233 && tab->position == QStyleOptionTab::End));
1234 bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab;
1235 bool previousSelected =
1237 && tab->selectedPosition == QStyleOptionTab::PreviousIsSelected)
1239 && tab->selectedPosition == QStyleOptionTab::NextIsSelected));
1242 && tab->selectedPosition == QStyleOptionTab::NextIsSelected)
1244 && tab->selectedPosition
1245 == QStyleOptionTab::PreviousIsSelected));
1246 int tabBarAlignment =
proxy()->styleHint(SH_TabBar_Alignment, tab,
widget);
1247 bool leftAligned = (!rtlHorTabs && tabBarAlignment ==
Qt::AlignLeft)
1251 bool rightAligned = (!rtlHorTabs && tabBarAlignment ==
Qt::AlignRight)
1255 QColor light = tab->palette.light().color();
1256 QColor dark = tab->palette.dark().color();
1257 QColor shadow = tab->palette.shadow().color();
1258 int borderThinkness =
proxy()->pixelMetric(PM_TabBarBaseOverlap, tab,
widget);
1260 borderThinkness /= 2;
1266 switch (tab->shape) {
1273 x1 += onlyOne || firstTab ? borderThinkness : 0;
1274 x2 -= onlyOne || lastTab ? borderThinkness : 0;
1277 p->fillRect(
QRect(
x1 + 1,
y1 + 1, (
x2 -
x1) - 1, (
y2 -
y1) - 2), tab->palette.window());
1285 if (firstTab || selected || onlyOne || !previousSelected) {
1287 p->drawLine(
x1,
y1 + 2,
x1,
y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));
1288 p->drawPoint(
x1 + 1,
y1 + 1);
1292 int beg =
x1 + (previousSelected ? 0 : 2);
1293 int end =
x2 - (nextSelected ? 0 : 2);
1298 if (lastTab || selected || onlyOne || !nextSelected) {
1300 p->drawLine(
x2,
y1 + 2,
x2,
y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1301 p->drawPoint(
x2 - 1,
y1 + 1);
1303 p->drawLine(
x2 - 1,
y1 + 2,
x2 - 1,
y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1309 x1 += firstTab ? borderThinkness : 0;
1310 x2 -= lastTab ? borderThinkness : 0;
1313 p->fillRect(
QRect(
x1 + 1,
y1 + 2, (
x2 -
x1) - 1, (
y2 -
y1) - 1), tab->palette.window());
1317 p->fillRect(
QRect(
x1,
y1 + 1, (
x2 - 1)-
x1, 1), tab->palette.window());
1318 p->fillRect(
QRect(
x1,
y1, (
x2 - 1)-
x1, 1), tab->palette.window());
1321 if (firstTab || selected || onlyOne || !previousSelected) {
1323 p->drawLine(
x1,
y2 - 2,
x1,
y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));
1324 p->drawPoint(
x1 + 1,
y2 - 1);
1328 int beg =
x1 + (previousSelected ? 0 : 2);
1329 int end =
x2 - (nextSelected ? 0 : 2);
1333 p->drawLine(beg,
y2 - 1,
end,
y2 - 1);
1336 if (lastTab || selected || onlyOne || !nextSelected) {
1338 p->drawLine(
x2,
y2 - 2,
x2,
y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1339 p->drawPoint(
x2 - 1,
y2 - 1);
1341 p->drawLine(
x2 - 1,
y2 - 2,
x2 - 1,
y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1347 y1 += firstTab ? borderThinkness : 0;
1348 y2 -= lastTab ? borderThinkness : 0;
1351 p->fillRect(
QRect(
x1 + 1,
y1 + 1, (
x2 -
x1) - 2, (
y2 -
y1) - 1), tab->palette.window());
1359 if (firstTab || selected || onlyOne || !previousSelected) {
1361 p->drawLine(
x1 + 2,
y1,
x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness),
y1);
1362 p->drawPoint(
x1 + 1,
y1 + 1);
1366 int beg =
y1 + (previousSelected ? 0 : 2);
1367 int end =
y2 - (nextSelected ? 0 : 2);
1372 if (lastTab || selected || onlyOne || !nextSelected) {
1374 p->drawLine(
x1 + 3,
y2,
x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2);
1375 p->drawPoint(
x1 + 2,
y2 - 1);
1377 p->drawLine(
x1 + 3,
y2 - 1,
x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2 - 1);
1378 p->drawPoint(
x1 + 1,
y2 - 1);
1379 p->drawPoint(
x1 + 2,
y2);
1385 y1 += firstTab ? borderThinkness : 0;
1386 y2 -= lastTab ? borderThinkness : 0;
1389 p->fillRect(
QRect(
x1 + 2,
y1 + 1, (
x2 -
x1) - 1, (
y2 -
y1) - 1), tab->palette.window());
1393 p->fillRect(
QRect(
x1 + 1,
y1, 1, (
y2 - 1)-
y1),tab->palette.window());
1397 if (firstTab || selected || onlyOne || !previousSelected) {
1399 p->drawLine(
x2 - 2,
y1,
x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness),
y1);
1400 p->drawPoint(
x2 - 1,
y1 + 1);
1404 int beg =
y1 + (previousSelected ? 0 : 2);
1405 int end =
y2 - (nextSelected ? 0 : 2);
1409 p->drawLine(
x2 - 1, beg,
x2 - 1,
end);
1412 if (lastTab || selected || onlyOne || !nextSelected) {
1414 p->drawLine(
x2 - 2,
y2,
x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2);
1415 p->drawPoint(
x2 - 1,
y2 - 1);
1417 p->drawLine(
x2 - 2,
y2 - 1,
x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2 - 1);
1424 case CE_ToolBoxTabShape:
1426 opt->
state & (State_Sunken | State_On), 1,
1429#if QT_CONFIG(splitter)
1434#if QT_CONFIG(scrollbar)
1435 case CE_ScrollBarSubLine:
1436 case CE_ScrollBarAddLine: {
1443 if (!(buttonOpt.
state & State_Sunken))
1444 buttonOpt.
state |= State_Raised;
1451 PrimitiveElement arrow;
1452 if (
opt->
state & State_Horizontal) {
1453 if (ce == CE_ScrollBarAddLine)
1458 if (ce == CE_ScrollBarAddLine)
1459 arrow = PE_IndicatorArrowDown;
1461 arrow = PE_IndicatorArrowUp;
1467 case CE_ScrollBarAddPage:
1468 case CE_ScrollBarSubPage: {
1492 p->setBackground(bg);
1493 p->setBackgroundMode(bg_mode);
1495 case CE_ScrollBarSlider:
1496 if (!(
opt->
state & State_Enabled)) {
1512 buttonOpt.QStyleOption::operator=(*opt);
1513 buttonOpt.
state = State_Enabled | State_Raised;
1522 case CE_HeaderSection: {
1529 if (
opt->
state & (State_Raised | State_Sunken)) {
1535#if QT_CONFIG(toolbar)
1537 if (
const QStyleOptionToolBar *toolbar = qstyleoption_cast<const QStyleOptionToolBar *>(
opt)) {
1543 bool paintLeftBorder =
true;
1544 bool paintRightBorder =
true;
1545 bool paintBottomBorder =
true;
1547 switch (toolbar->toolBarArea){
1549 switch(toolbar->positionOfLine){
1550 case QStyleOptionToolBar::Beginning:
1551 case QStyleOptionToolBar::OnlyOne:
1552 paintBottomBorder =
false;
1559 switch(toolbar->positionWithinLine){
1560 case QStyleOptionToolBar::Beginning:
1561 paintLeftBorder =
false;
1563 case QStyleOptionToolBar::End:
1564 paintRightBorder =
false;
1566 case QStyleOptionToolBar::OnlyOne:
1567 paintRightBorder =
false;
1568 paintLeftBorder =
false;
1574 bool tmp = paintLeftBorder;
1575 paintRightBorder=paintLeftBorder;
1576 paintLeftBorder=tmp;
1580 switch (toolbar->positionOfLine){
1581 case QStyleOptionToolBar::Beginning:
1582 case QStyleOptionToolBar::OnlyOne:
1583 paintRightBorder =
false;
1590 switch (toolbar->positionOfLine){
1591 case QStyleOptionToolBar::Beginning:
1592 case QStyleOptionToolBar::OnlyOne:
1593 paintLeftBorder =
false;
1606 p->drawLine(
rect.topLeft().x(),
1608 rect.topRight().x(),
1609 rect.topRight().y());
1611 if (paintLeftBorder){
1613 p->drawLine(
rect.topLeft().x(),
1615 rect.bottomLeft().x(),
1616 rect.bottomLeft().y());
1619 if (paintRightBorder){
1621 p->drawLine(
rect.topRight().x(),
1622 rect.topRight().y(),
1623 rect.bottomRight().x(),
1624 rect.bottomRight().y());
1627 if (paintBottomBorder){
1629 p->drawLine(
rect.bottomLeft().x(),
1630 rect.bottomLeft().y(),
1631 rect.bottomRight().x(),
1632 rect.bottomRight().y());
1640 case CE_ProgressBarContents:
1643 if (!
rect.isValid())
1647 const bool inverted = pb->invertedAppearance;
1653 m.translate(0, -(
rect.height() +
rect.y()*2));
1660 bool reverse = ((!vertical && (pb->direction ==
Qt::RightToLeft)) || vertical);
1663 int w =
rect.width();
1664 Q_D(
const QWindowsStyle);
1665 if (pb->minimum == 0 && pb->maximum == 0) {
1666 const int unit_width =
proxy()->pixelMetric(PM_ProgressBarChunkWidth, pb,
widget);
1674 int chunkCount =
w / unit_width + 1;
1675#if QT_CONFIG(animation)
1677 step = (
animation->animationStep() / 3) % chunkCount;
1683 int chunksInRow = 5;
1684 int myY = pbBits.
rect.
y();
1686 int chunksToDraw = chunksInRow;
1688 if (step > chunkCount - 5)chunksToDraw = (chunkCount - step);
1692 int x0 = reverse ?
rect.left() +
rect.width() - unit_width*(step) - unit_width :
rect.
left() + unit_width * step;
1695 for (
int i = 0;
i < chunksToDraw ; ++
i) {
1698 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits,
p,
widget);
1699 x += reverse ? -unit_width : unit_width;
1702 if ( step > chunkCount-5){
1703 x0 = reverse ?
rect.left() +
rect.width() - unit_width :
rect.left() ;
1705 int chunksToDraw = step - (chunkCount - chunksInRow);
1706 for (
int i = 0;
i < chunksToDraw ; ++
i) {
1709 proxy()->drawPrimitive(PE_IndicatorProgressChunk, &pbBits,
p,
widget);
1710 x += reverse ? -unit_width : unit_width;
1716#if QT_CONFIG(animation)
1724#if QT_CONFIG(dockwidget)
1725 case CE_DockWidgetTitle:
1728 Q_D(
const QWindowsStyle);
1730 const bool verticalTitleBar = dwOpt->verticalTitleBar;
1735 if (verticalTitleBar) {
1739 p->translate(
r.left(),
r.top() +
r.width());
1741 p->translate(-
r.left(), -
r.top());
1744 bool floating =
false;
1745 bool active = dwOpt->state & State_Active;
1746 QColor inactiveCaptionTextColor =
d->inactiveCaptionText;
1747 if (dwOpt->movable) {
1754 left =
d->activeCaptionColor;
1755 right =
d->activeGradientCaptionColor;
1757 left =
d->inactiveCaptionColor;
1758 right =
d->inactiveGradientCaptionColor;
1765 lg.setColorAt(0,
left);
1766 lg.setColorAt(1,
right);
1769 p->fillRect(
r.adjusted(0, 0, 0, -3), fillBrush);
1772 if (!dwOpt->title.isEmpty()) {
1773 QFont oldFont =
p->font();
1781 QRect titleRect = subElementRect(SE_DockWidgetTitleBarText,
opt,
widget);
1782 if (verticalTitleBar) {
1785 r.top() + titleRect.
left() -
rect.left(),
1788 proxy()->drawItemText(
p, titleRect,
1790 dwOpt->state & State_Enabled, dwOpt->title,
1792 p->setFont(oldFont);
1794 if (verticalTitleBar)
1799#if QT_CONFIG(combobox)
1800 case CE_ComboBoxLabel:
1802 if (
cb->state & State_HasFocus) {
1803 p->setPen(
cb->palette.highlightedText().color());
1804 p->setBackground(
cb->palette.highlight());
1806 p->setPen(
cb->palette.text().color());
1807 p->setBackground(
cb->palette.window());
1823 case SE_SliderFocusRect:
1824 case SE_ToolBoxTabContents:
1827 case SE_DockWidgetTitleBarText: {
1830 = qstyleoption_cast<const QStyleOptionDockWidget*>(
opt);
1832 int m =
proxy()->pixelMetric(PM_DockWidgetTitleMargin,
opt,
w);
1833 if (verticalTitleBar) {
1834 r.adjust(0, 0, 0, -
m);
1837 r.adjust(
m, 0, 0, 0);
1839 r.adjust(0, 0, -
m, 0);
1843 case SE_ProgressBarContents:
1845 r.adjust(3, 3, -3, -3);
1859#if QT_CONFIG(slider)
1861 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
1862 int thickness =
proxy()->pixelMetric(PM_SliderControlThickness, slider,
widget);
1864 int ticks = slider->tickPosition;
1865 QRect groove =
proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove,
widget);
1868 if ((slider->subControls & SC_SliderGroove) && groove.
isValid()) {
1869 int mid = thickness / 2;
1876 p->setPen(slider->palette.shadow().color());
1879 groove.
width(), 4, slider->palette,
true);
1880 p->drawLine(groove.
x() + 1, groove.
y() + mid - 1,
1881 groove.
x() + groove.
width() - 3, groove.
y() + mid - 1);
1884 4, groove.
height(), slider->palette,
true);
1885 p->drawLine(groove.
x() + mid - 1, groove.
y() + 1,
1886 groove.
x() + mid - 1, groove.
y() + groove.
height() - 3);
1890 if (slider->subControls & SC_SliderTickmarks) {
1891 QStyleOptionSlider tmpSlider = *slider;
1892 tmpSlider.subControls = SC_SliderTickmarks;
1896 if (slider->subControls & SC_SliderHandle) {
1906 const QColor c0 = slider->palette.shadow().color();
1907 const QColor c1 = slider->palette.dark().color();
1909 const QColor c3 = slider->palette.midlight().color();
1910 const QColor c4 = slider->palette.light().color();
1913 if (slider->state & State_Enabled) {
1933 if (slider->state & State_HasFocus) {
1935 fropt.QStyleOption::operator=(*slider);
1936 fropt.
rect = subElementRect(SE_SliderFocusRect, slider,
widget);
1937 proxy()->drawPrimitive(PE_FrameFocusRect, &fropt,
p,
widget);
1940 if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) {
1945 p->setBackgroundMode(oldMode);
1968 d = (wi + 1) / 2 - 1;
1969 a.setPoints(5,
x1,
y1,
x1,
y2,
x2,
y2,
x2,
y1,
x1+
d,
y1-
d);
1973 d = (wi + 1) / 2 - 1;
1974 a.setPoints(5,
x1,
y1,
x1,
y2,
x1+
d,
y2+
d,
x2,
y2,
x2,
y1);
1977 d = (he + 1) / 2 - 1;
1979 a.setPoints(5,
x1,
y1,
x1-
d,
y1+
d,
x1,
y2,
x2,
y2,
x2,
y1);
1982 d = (he + 1) / 2 - 1;
1984 a.setPoints(5,
x1,
y1,
x1,
y2,
x2,
y2,
x2+
d,
y1+
d,
x2,
y1);
1990 p->setBrush(handleBrush);
1995 p->setBrush(oldBrush);
1996 p->setBackgroundMode(oldMode);
2004 if (
dir != SlLeft) {
2010 if (
dir != SlRight) {
2016 if (
dir != SlDown) {
2077#if QT_CONFIG(scrollbar)
2079 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
2080 QStyleOptionSlider newScrollbar = *scrollbar;
2081 if (scrollbar->minimum == scrollbar->maximum)
2082 newScrollbar.state &= ~State_Enabled;
2087#if QT_CONFIG(combobox)
2091 if ((cmb->subControls & SC_ComboBoxFrame)) {
2101 if (cmb->subControls & SC_ComboBoxArrow) {
2104 QRect ar =
proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow,
widget);
2105 bool sunkenArrow = cmb->activeSubControls == SC_ComboBoxArrow
2106 && cmb->state & State_Sunken;
2108 p->setPen(cmb->palette.dark().color());
2122 flags |= State_Enabled;
2124 flags |= State_HasFocus;
2127 flags |= State_Sunken;
2131 proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt,
p,
widget);
2134 if (cmb->subControls & SC_ComboBoxEditField) {
2135 QRect re =
proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField,
widget);
2136 if (cmb->state & State_HasFocus && !cmb->editable)
2140 if (cmb->state & State_HasFocus) {
2141 p->setPen(cmb->palette.highlightedText().color());
2142 p->setBackground(cmb->palette.highlight());
2145 p->setPen(cmb->palette.text().color());
2146 p->setBackground(cmb->palette.window());
2149 if (cmb->state & State_HasFocus && !cmb->editable) {
2151 focus.QStyleOption::operator=(*cmb);
2152 focus.rect = subElementRect(SE_ComboBoxFocusRect, cmb,
widget);
2153 focus.state |= State_FocusAtBorder;
2154 focus.backgroundColor = cmb->palette.highlight().color();
2161#if QT_CONFIG(spinbox)
2163 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
2164 QStyleOptionSpinBox
copy = *sb;
2165 PrimitiveElement pe;
2167 if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) {
2179 if (sb->subControls & SC_SpinBoxUp) {
2180 copy.subControls = SC_SpinBoxUp;
2184 copy.state &= ~State_Enabled;
2187 copy.palette = pal2;
2189 if (sb->activeSubControls == SC_SpinBoxUp && (sb->state & State_Sunken)) {
2190 copy.state |= State_On;
2191 copy.state |= State_Sunken;
2193 copy.state |= State_Raised;
2194 copy.state &= ~State_Sunken;
2197 : PE_IndicatorSpinUp);
2199 copy.rect =
proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxUp,
widget);
2202 copy.rect.adjust(4, 1, -5, -1);
2206 QStyleOptionSpinBox lightCopy =
copy;
2207 lightCopy.rect.adjust(1, 1, 1, 1);
2214 if (sb->subControls & SC_SpinBoxDown) {
2215 copy.subControls = SC_SpinBoxDown;
2216 copy.state = sb->state;
2220 copy.state &= ~State_Enabled;
2222 copy.palette = pal2;
2224 if (sb->activeSubControls == SC_SpinBoxDown && (sb->state & State_Sunken)) {
2225 copy.state |= State_On;
2226 copy.state |= State_Sunken;
2228 copy.state |= State_Raised;
2229 copy.state &= ~State_Sunken;
2232 : PE_IndicatorSpinDown);
2234 copy.rect =
proxy()->subControlRect(CC_SpinBox, sb, SC_SpinBoxDown,
widget);
2237 copy.rect.adjust(4, 0, -5, -1);
2241 QStyleOptionSpinBox lightCopy =
copy;
2242 lightCopy.rect.adjust(1, 1, 1, 1);
2270 defwidth = 2 *
proxy()->pixelMetric(PM_ButtonDefaultIndicator,
btn,
widget);
2275 if (w < minwidth + defwidth && !btn->
text.
isEmpty())
2276 w = minwidth + defwidth;
2277 if (
h < minheight + defwidth)
2278 h = minheight + defwidth;
2290 sz =
QSize(10, QWindowsStylePrivate::windowsSepHeight);
2292 else if (mi->icon.isNull()) {
2293 sz.setHeight(sz.height() - 2);
2298 int iconExtent =
proxy()->pixelMetric(PM_SmallIconSize,
opt,
widget);
2299 sz.setHeight(
qMax(sz.height(),
2300 mi->icon.actualSize(
QSize(iconExtent, iconExtent)).
height()
2301 + 2 * QWindowsStylePrivate::windowsItemFrame));
2303 int maxpmw = mi->maxIconWidth;
2304 int tabSpacing = 20;
2305 if (mi->text.contains(u
'\t'))
2308 w += 2 * QWindowsStylePrivate::windowsArrowHMargin;
2313 QFont fontBold = mi->font;
2316 w += fmBold.horizontalAdvance(mi->text) - fm.horizontalAdvance(mi->text);
2319 int checkcol = qMax<int>(maxpmw, QWindowsStylePrivate::windowsCheckMarkWidth);
2321 w += int(QWindowsStylePrivate::windowsRightBorder) + 10;
2326#if QT_CONFIG(menubar)
2327 case CT_MenuBarItem:
2329 sz +=
QSize(QWindowsStylePrivate::windowsItemHMargin * 4, QWindowsStylePrivate::windowsItemVMargin * 2);
2333 if (qstyleoption_cast<const QStyleOptionToolButton *>(
opt))
2334 return sz +=
QSize(7, 6);
2356#include "moc_qwindowsstyle_p.cpp"
The QApplication class manages the GUI application's control flow and main settings.
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or \nullptr if no applica...
QImage textureImage() const
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set.
const QColor & color() const
Returns the brush color.
Qt::BrushStyle style() const
Returns the brush style.
The QColor class provides colors based on RGB, HSV or CMYK values.
int lightness() const noexcept
int red() const noexcept
Returns the red color component of this color.
int blue() const noexcept
Returns the blue color component of this color.
int green() const noexcept
Returns the green color component of this color.
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
int pixelMetric(PixelMetric m, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override
\reimp
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=nullptr) const override
\reimp
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=nullptr) const override
\reimp
void unpolish(QWidget *widget) override
\reimp
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override
\reimp
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const override
\reimp
int styleHint(StyleHint sh, const QStyleOption *opt=nullptr, const QWidget *w=nullptr, QStyleHintReturn *shret=nullptr) const override
\reimp
void polish(QPalette &) override
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=nullptr) const override
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const override
\reimp
\reentrant \inmodule QtGui
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
int lineWidth
the line width
static QList< QScreen * > screen_list
static QPlatformTheme * platformTheme()
QScreen * primaryScreen
the primary (or default) screen of the application.
static QPalette palette()
Returns the current application palette.
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.; otherwise returns false.
static qreal factor(C *context)
The QIcon class provides scalable icons in different modes and states.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
The QKeyEvent class describes a key event.
int key() const
Returns the code of the key that was pressed or released.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype removeIf(Predicate pred)
T findChild(const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns the child of this object that can be cast into type T and that is called name,...
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
void removeEventFilter(QObject *obj)
Removes an event filter object obj from this object.
QList< T > findChildren(const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns all children of this object with the given name that can be cast to type T,...
QVariant property(const char *name) const
Returns the value of the object's name property.
void addEllipse(const QRectF &rect)
Creates an ellipse within the specified boundingRectangle and adds it to the painter path as a closed...
The QPainter class performs low-level painting on widgets and other paint devices.
The QPalette class contains color groups for each widget state.
const QBrush & highlight() const
Returns the highlight brush of the current color group.
const QBrush & button() const
Returns the button brush of the current color group.
const QBrush & text() const
Returns the text foreground brush of the current color group.
const QBrush & dark() const
Returns the dark brush of the current color group.
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
const QBrush & shadow() const
Returns the shadow brush of the current color group.
const QBrush & light() const
Returns the light brush of the current color group.
void setCurrentColorGroup(ColorGroup cg)
Set the palette's current color group to cg.
const QBrush & midlight() const
Returns the midlight brush of the current color group.
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...
const QBrush & window() const
Returns the window (general background) brush of the current color group.
const QBrush & base() const
Returns the base brush of the current color group.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QPolygon class provides a list of points using integer precision.
Q_GUI_EXPORT void setPoints(int nPoints, const int *points)
Resizes the polygon to nPoints and populates it with the given points.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr QPoint bottomLeft() const noexcept
Returns the position of the rectangle's bottom-left corner.
constexpr void adjust(int x1, int y1, int x2, int y2) noexcept
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QPoint topRight() const noexcept
Returns the position of the rectangle's top-right corner.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setRect(int x, int y, int w, int h) noexcept
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void translate(int dx, int dy) noexcept
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position.
constexpr QPoint bottomRight() const noexcept
Returns the position of the rectangle's bottom-right corner.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QRegion class specifies a clip region for a painter.
The QScreen class is used to query screen properties. \inmodule QtGui.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
The QStyleHintReturnMask class provides style hints that return a QRegion.
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionToolButton::features
\variable QStyleOptionMenuItem::menuItemType
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
\variable QStyleOptionButton::features
The QStyleOption class stores the parameters used by QStyle functions.
Qt::LayoutDirection direction
PixelMetric
This enum describes the various available pixel metrics.
@ PM_DockWidgetFrameWidth
@ PM_DockWidgetTitleMargin
@ PM_ButtonShiftHorizontal
@ PM_MdiSubWindowFrameWidth
@ PM_DockWidgetTitleBarButtonMargin
@ PM_DockWidgetSeparatorExtent
@ PM_TabBarTabShiftVertical
@ PM_ButtonDefaultIndicator
@ PM_TabBarTabShiftHorizontal
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
[Window class with invokable method]
const QStyleOptionButton * btn
[3]
Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi)
Q_WIDGETS_EXPORT qreal dpi(const QStyleOption *option)
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
void qDrawWinButton(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
void qDrawShadeRect(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
int qRound(qfloat16 d) noexcept
static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLfloat GLfloat GLfloat GLfloat h
GLfixed GLfixed GLint GLint GLfixed points
GLfixed GLfixed GLfixed y2
GLenum GLenum GLenum GLenum GLenum scale
HICON qt_pixmapToWinHICON(const QPixmap &p)
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr QRgb qRgb(int r, int g, int b)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define COLOR_GRADIENTINACTIVECAPTION
#define SPI_GETKEYBOARDCUES
#define COLOR_GRADIENTACTIVECAPTION
#define QT_BEGIN_INCLUDE_NAMESPACE
#define QT_END_INCLUDE_NAMESPACE
QApplication app(argc, argv)
[0]