10#include <QtGui/qbitmap.h>
11#include <QtGui/qevent.h>
12#include <QtGui/qpaintengine.h>
13#include <QtGui/qpainter.h>
14#include <QtCore/qdebug.h>
15#include <QtCore/qfile.h>
16#include <QtCore/qtextstream.h>
17#include <QtGui/qpixmapcache.h>
18#include <QtGui/qpa/qplatformintegration.h>
19#include <QtGui/private/qguiapplication_p.h>
20#include <QtGui/qstylehints.h>
21#include <private/qmath_p.h>
23#include <QtGui/qpainterpath.h>
24#include <QtGui/qscreen.h>
25#include <QtGui/qwindow.h>
26#include <qpa/qplatformtheme.h>
27#include <qpa/qplatformscreen.h>
28#include <private/qguiapplication_p.h>
29#include <private/qhighdpiscaling_p.h>
30#include <qpa/qplatformnativeinterface.h>
31#include <QtQuickTemplates2/private/qquicktheme_p.h>
33#if 0 && QT_CONFIG(animation)
46# ifndef COLOR_GRADIENTACTIVECAPTION
47# define COLOR_GRADIENTACTIVECAPTION 27
49# ifndef COLOR_GRADIENTINACTIVECAPTION
50# define COLOR_GRADIENTINACTIVECAPTION 28
70qreal QWindowsStylePrivate::appDevicePixelRatio()
72 return qApp->devicePixelRatio();
82 const QVariant darkModeStyleP = ni->property(
"darkModeStyle");
84 && darkModeStyleP.
value<
bool>()
85 && ni->property(
"darkMode").value<
bool>();
94bool QWindowsStylePrivate::hasSeenAlt(
const QWidget *
widget)
const
137#if 0 && QT_CONFIG(menubar)
139 for (
int i = 0;
i < l.
size(); ++
i)
203#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
206 return GetSystemMetrics(SM_CXFRAME);
213 return GetSystemMetrics(SM_CYSMCAPTION) - 1;
216 return GetSystemMetrics(SM_CYCAPTION) - 1;
220 NONCLIENTMETRICS ncm;
221 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) +
sizeof(LOGFONT);
222 if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS), &ncm, 0))
223 return qMax(ncm.iScrollHeight, ncm.iScrollWidth);
228 return GetSystemMetrics(SM_CYFRAME);
254#if 0 && QT_CONFIG(tabbar)
264#if 0 && QT_CONFIG(menu)
313 if (
screen != primaryScreen) {
317 result *= logicalDpi / primaryLogicalDpi;
350 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height() : sl->rect.width();
351 int ticks = sl->tickPosition;
368 thick += (space * 2) / (
n + 2);
394#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
415 desktopIcon = theme->standardPixmap(
sp,
QSizeF(16, 16));
424 desktopIcon = theme->standardPixmap(
sp,
QSizeF());
430 if (!desktopIcon.
isNull()) {
445 ret = d_func()->isDarkMode() ? 0 : 1;
461#if 0 && QT_CONFIG(listview)
462 if (qobject_cast<const QListView*>(
widget))
473#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
483#if 0 && QT_CONFIG(menubar)
492 if (
menuBar->d_func()->keyboardState ||
d->altDown())
501#ifndef QT_NO_ACCESSIBILITY
503 && QStyleHelper::isInstanceOf(
opt->
styleObject, QAccessible::MenuItem)
512#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
514 if (SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0))
521#if 0 && QT_CONFIG(rubberband)
538#if 0 && QT_CONFIG(wizard)
560 bool doRestore =
false;
563#if 0 && QT_CONFIG(toolbar)
567 const int margin = 2;
568 QPen oldPen =
p->pen();
573 rect.bottomLeft().y() - margin,
575 rect.topLeft().y() + margin);
578 rect.bottomLeft().y() - margin,
580 rect.topLeft().y() + margin);
585 p->drawLine(
rect.topLeft().x() + margin ,
587 rect.topRight().x() - margin,
590 p->drawLine(
rect.topLeft().x() + margin ,
592 rect.topRight().x() - margin,
626 QPen oldPen =
p->pen();
627#if 0 && QT_CONFIG(dockwidget)
628 if (
w &&
w->inherits(
"QDockWidgetTitleButton")) {
689 p->drawRect(
r.adjusted(0, 0, -1, -1));
699 QPen oldPen =
p->pen();
705 rect.adjust(topLevelAdjustment, topLevelAdjustment,
706 bottomRightAdjustment, bottomRightAdjustment);
735#if 0 && QT_CONFIG(itemviews)
738 p->setPen(itemViewOpt
773 QColor bg_col = fropt->backgroundColor;
775 bg_col =
p->background().color();
776 bg_col = bg_col.
toRgb();
778 QColor patternCol((bg_col.
red() ^ 0xff) & 0xff,
779 (bg_col.
green() ^ 0xff) & 0xff,
780 (bg_col.
blue() ^ 0xff) & 0xff);
782 p->setBrushOrigin(
r.topLeft());
784 p->drawRect(
r.left(),
r.top(),
r.width(), 1);
785 p->drawRect(
r.left(),
r.bottom(),
r.width(), 1);
786 p->drawRect(
r.left(),
r.top(), 1,
r.height());
787 p->drawRect(
r.right(),
r.top(), 1,
r.height());
798 qreal radius = (
r.width() + (
r.width() + 1) % 2) / 2.0 - 1;
801 path1.
addEllipse(circleCenter, radius, radius);
804 path2.
addEllipse(circleCenter, radius, radius);
807 path3.
addEllipse(circleCenter, radius, radius);
810 path4.
addEllipse(circleCenter, radius, radius);
812 QPolygon topLeftPol, bottomRightPol;
813 topLeftPol.
setPoints(3,
r.x(),
r.y(),
r.x(),
r.y() +
r.height(),
r.x() +
r.width(),
r.y());
814 bottomRightPol.
setPoints(3,
r.x(),
r.y() +
r.height(),
r.x() +
r.width(),
r.y() +
r.height(),
r.x() +
r.width(),
r.y());
816 p->setClipRegion(
QRegion(topLeftPol));
824 p->setClipRegion(
QRegion(bottomRightPol));
835 p->setClipping(
false);
836 p->setPen(fillColor);
837 p->setBrush(fillColor);
904#if 0 && QT_CONFIG(dockwidget)
908 if (qstyleoption_cast<const QStyleOptionFrame *>(
opt)) {
920 bool vertical =
false, inverted =
false;
923 inverted = pb->invertedAppearance;
965#if 0 && QT_CONFIG(rubberband)
967 if (qstyleoption_cast<const QStyleOptionRubberBand *>(
opt)) {
970 QPainter pixmapPainter(&tiledPixmap);
982 p->setClipRegion(
mask.region);
983 p->drawTiledPixmap(
r.x(),
r.y(),
r.width(),
r.height(), tiledPixmap);
990#if 0 && QT_CONFIG(menu) && QT_CONFIG(mainwindow)
994 QPen oldPen =
p->pen();
1001#if 0 && QT_CONFIG(menu)
1005 menuitem->rect.getRect(&
x, &
y, &
w, &
h);
1006 int tab = menuitem->tabWidth;
1009 ? menuitem->checked :
false;
1016 p->fillRect(menuitem->rect.adjusted(0, 0, -1, 0),
fill);
1019 int yoff =
y-1 +
h / 2;
1020 p->setPen(menuitem->palette.dark().color());
1021 p->drawLine(
x + 2, yoff,
x +
w - 4, yoff);
1022 p->setPen(menuitem->palette.light().color());
1023 p->drawLine(
x + 2, yoff + 1,
x +
w - 4, yoff + 1);
1028 if (!menuitem->icon.isNull() && checked) {
1031 menuitem->palette,
true, 1,
1044 if (!menuitem->icon.isNull()) {
1053 const int pixw =
pixmap.width() /
pixmap.devicePixelRatio();
1054 const int pixh =
pixmap.height() /
pixmap.devicePixelRatio();
1055 QRect pmr(0, 0, pixw, pixh);
1057 p->setPen(menuitem->palette.text().color());
1059 }
else if (checked) {
1072 p->setPen(act ? menuitem->palette.highlightedText().color() : menuitem->palette.buttonText().color());
1076 discol = menuitem->palette.text().color();
1081 int xpos = menuitem->rect.x() + xm;
1085 QStringRef
s(&menuitem->text);
1098 p->setPen(menuitem->palette.light().color());
1099 p->drawText(vShortcutRect.
adjusted(1, 1, 1, 1), text_flags, textToDraw);
1102 p->drawText(vShortcutRect, text_flags, textToDraw);
1111 p->setPen(menuitem->palette.light().color());
1112 p->drawText(vTextRect.
adjusted(1, 1, 1, 1), text_flags, textToDraw);
1115 p->drawText(vTextRect, text_flags, textToDraw);
1125 newMI.
rect = vSubMenuRect;
1136#if 0 && QT_CONFIG(menubar)
1144 if (active || hasFocus) {
1147 p->setBrushOrigin(
p->brushOrigin() +
QPoint(1, 1));
1148 if (active && hasFocus)
1150 mbi->rect.height(), mbi->palette, active && down, 1, 0, &
b);
1151 if (active && down) {
1154 p->setBrushOrigin(
p->brushOrigin() -
QPoint(1, 1));
1161#if 0 && QT_CONFIG(tabbar)
1171 bool firstTab = ((!rtlHorTabs
1176 bool previousSelected =
1185 && tab->selectedPosition
1188 bool leftAligned = (!rtlHorTabs && tabBarAlignment ==
Qt::AlignLeft)
1192 bool rightAligned = (!rtlHorTabs && tabBarAlignment ==
Qt::AlignRight)
1196 QColor light = tab->palette.light().color();
1197 QColor dark = tab->palette.dark().color();
1198 QColor shadow = tab->palette.shadow().color();
1201 borderThinkness /= 2;
1207 switch (tab->shape) {
1214 x1 += onlyOne || firstTab ? borderThinkness : 0;
1215 x2 -= onlyOne || lastTab ? borderThinkness : 0;
1218 p->fillRect(
QRect(
x1 + 1,
y1 + 1, (
x2 -
x1) - 1, (
y2 -
y1) - 2), tab->palette.window());
1226 if (firstTab || selected || onlyOne || !previousSelected) {
1228 p->drawLine(
x1,
y1 + 2,
x1,
y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));
1229 p->drawPoint(
x1 + 1,
y1 + 1);
1233 int beg =
x1 + (previousSelected ? 0 : 2);
1234 int end =
x2 - (nextSelected ? 0 : 2);
1239 if (lastTab || selected || onlyOne || !nextSelected) {
1241 p->drawLine(
x2,
y1 + 2,
x2,
y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1242 p->drawPoint(
x2 - 1,
y1 + 1);
1244 p->drawLine(
x2 - 1,
y1 + 2,
x2 - 1,
y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1250 x1 += firstTab ? borderThinkness : 0;
1251 x2 -= lastTab ? borderThinkness : 0;
1254 p->fillRect(
QRect(
x1 + 1,
y1 + 2, (
x2 -
x1) - 1, (
y2 -
y1) - 1), tab->palette.window());
1258 p->fillRect(
QRect(
x1,
y1 + 1, (
x2 - 1)-
x1, 1), tab->palette.window());
1259 p->fillRect(
QRect(
x1,
y1, (
x2 - 1)-
x1, 1), tab->palette.window());
1262 if (firstTab || selected || onlyOne || !previousSelected) {
1264 p->drawLine(
x1,
y2 - 2,
x1,
y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));
1265 p->drawPoint(
x1 + 1,
y2 - 1);
1269 int beg =
x1 + (previousSelected ? 0 : 2);
1270 int end =
x2 - (nextSelected ? 0 : 2);
1274 p->drawLine(beg,
y2 - 1,
end,
y2 - 1);
1277 if (lastTab || selected || onlyOne || !nextSelected) {
1279 p->drawLine(
x2,
y2 - 2,
x2,
y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1280 p->drawPoint(
x2 - 1,
y2 - 1);
1282 p->drawLine(
x2 - 1,
y2 - 2,
x2 - 1,
y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
1288 y1 += firstTab ? borderThinkness : 0;
1289 y2 -= lastTab ? borderThinkness : 0;
1292 p->fillRect(
QRect(
x1 + 1,
y1 + 1, (
x2 -
x1) - 2, (
y2 -
y1) - 1), tab->palette.window());
1300 if (firstTab || selected || onlyOne || !previousSelected) {
1302 p->drawLine(
x1 + 2,
y1,
x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness),
y1);
1303 p->drawPoint(
x1 + 1,
y1 + 1);
1307 int beg =
y1 + (previousSelected ? 0 : 2);
1308 int end =
y2 - (nextSelected ? 0 : 2);
1313 if (lastTab || selected || onlyOne || !nextSelected) {
1315 p->drawLine(
x1 + 3,
y2,
x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2);
1316 p->drawPoint(
x1 + 2,
y2 - 1);
1318 p->drawLine(
x1 + 3,
y2 - 1,
x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2 - 1);
1319 p->drawPoint(
x1 + 1,
y2 - 1);
1320 p->drawPoint(
x1 + 2,
y2);
1326 y1 += firstTab ? borderThinkness : 0;
1327 y2 -= lastTab ? borderThinkness : 0;
1330 p->fillRect(
QRect(
x1 + 2,
y1 + 1, (
x2 -
x1) - 1, (
y2 -
y1) - 1), tab->palette.window());
1334 p->fillRect(
QRect(
x1 + 1,
y1, 1, (
y2 - 1)-
y1),tab->palette.window());
1338 if (firstTab || selected || onlyOne || !previousSelected) {
1340 p->drawLine(
x2 - 2,
y1,
x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness),
y1);
1341 p->drawPoint(
x2 - 1,
y1 + 1);
1345 int beg =
y1 + (previousSelected ? 0 : 2);
1346 int end =
y2 - (nextSelected ? 0 : 2);
1350 p->drawLine(
x2 - 1, beg,
x2 - 1,
end);
1353 if (lastTab || selected || onlyOne || !nextSelected) {
1355 p->drawLine(
x2 - 2,
y2,
x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2);
1356 p->drawPoint(
x2 - 1,
y2 - 1);
1358 p->drawLine(
x2 - 2,
y2 - 1,
x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness),
y2 - 1);
1370#if 0 && QT_CONFIG(splitter)
1375#if 0 && QT_CONFIG(scrollbar)
1433 p->setBackground(bg);
1434 p->setBackgroundMode(bg_mode);
1453 buttonOpt.QStyleOption::operator=(*opt);
1476#if 0 && QT_CONFIG(toolbar)
1484 bool paintLeftBorder =
true;
1485 bool paintRightBorder =
true;
1486 bool paintBottomBorder =
true;
1488 switch (toolbar->toolBarArea){
1490 switch (toolbar->positionOfLine){
1493 paintBottomBorder =
false;
1500 switch (toolbar->positionWithinLine){
1502 paintLeftBorder =
false;
1505 paintRightBorder =
false;
1508 paintRightBorder =
false;
1509 paintLeftBorder =
false;
1515 bool tmp = paintLeftBorder;
1516 paintRightBorder=paintLeftBorder;
1517 paintLeftBorder=tmp;
1521 switch (toolbar->positionOfLine){
1524 paintRightBorder =
false;
1531 switch (toolbar->positionOfLine){
1534 paintLeftBorder =
false;
1547 p->drawLine(
rect.topLeft().x(),
1549 rect.topRight().x(),
1550 rect.topRight().y());
1552 if (paintLeftBorder){
1554 p->drawLine(
rect.topLeft().x(),
1556 rect.bottomLeft().x(),
1557 rect.bottomLeft().y());
1560 if (paintRightBorder){
1562 p->drawLine(
rect.topRight().x(),
1563 rect.topRight().y(),
1564 rect.bottomRight().x(),
1565 rect.bottomRight().y());
1568 if (paintBottomBorder){
1570 p->drawLine(
rect.bottomLeft().x(),
1571 rect.bottomLeft().y(),
1572 rect.bottomRight().x(),
1573 rect.bottomRight().y());
1584 if (!
rect.isValid())
1588 const bool inverted = pb->invertedAppearance;
1594 m.translate(0, -(
rect.height() +
rect.y()*2));
1601 bool reverse = ((!vertical && (pb->direction ==
Qt::RightToLeft)) || vertical);
1604 int w =
rect.width();
1606 if (pb->minimum == 0 && pb->maximum == 0) {
1615 int chunkCount =
w / unit_width + 1;
1616#if 0 && QT_CONFIG(animation)
1618 step = (
animation->animationStep() / 3) % chunkCount;
1624 int chunksInRow = 5;
1625 int myY = pbBits.
rect.
y();
1627 int chunksToDraw = chunksInRow;
1629 if (step > chunkCount - 5)chunksToDraw = (chunkCount - step);
1633 int x0 = reverse ?
rect.left() +
rect.width() - unit_width*(step) - unit_width :
rect.left() + unit_width * step;
1636 for (
int i = 0;
i < chunksToDraw ; ++
i) {
1640 x += reverse ? -unit_width : unit_width;
1643 if ( step > chunkCount-5){
1644 x0 = reverse ?
rect.left() +
rect.width() - unit_width :
rect.left() ;
1646 int chunksToDraw = step - (chunkCount - chunksInRow);
1647 for (
int i = 0;
i < chunksToDraw ; ++
i) {
1651 x += reverse ? -unit_width : unit_width;
1657#if 0 && QT_CONFIG(animation)
1665#if 0 && QT_CONFIG(dockwidget)
1671 const bool verticalTitleBar = dwOpt->verticalTitleBar;
1676 if (verticalTitleBar) {
1680 p->translate(
r.left(),
r.top() +
r.width());
1682 p->translate(-
r.left(), -
r.top());
1685 bool floating =
false;
1687 QColor inactiveCaptionTextColor =
d->inactiveCaptionText;
1688 if (dwOpt->movable) {
1695 left =
d->activeCaptionColor;
1696 right =
d->activeGradientCaptionColor;
1698 left =
d->inactiveCaptionColor;
1699 right =
d->inactiveGradientCaptionColor;
1710 p->fillRect(
r.adjusted(0, 0, 0, -3), fillBrush);
1713 if (!dwOpt->title.isEmpty()) {
1714 QFont oldFont =
p->font();
1723 if (verticalTitleBar) {
1726 r.top() + titleRect.
left() -
rect.left(),
1733 p->setFont(oldFont);
1735 if (verticalTitleBar)
1740#if 0 && QT_CONFIG(combobox)
1744 p->setPen(
cb->palette.highlightedText().color());
1745 p->setBackground(
cb->palette.highlight());
1747 p->setPen(
cb->palette.text().color());
1748 p->setBackground(
cb->palette.window());
1771 = qstyleoption_cast<const QStyleOptionDockWidget*>(
opt);
1774 if (verticalTitleBar) {
1775 r.adjust(0, 0, 0, -
m);
1778 r.adjust(
m, 0, 0, 0);
1780 r.adjust(0, 0, -
m, 0);
1786 r.adjust(3, 3, -3, -3);
1801#if QT_CONFIG(slider)
1806 int ticks = slider->tickPosition;
1811 int mid = thickness / 2;
1818 p->setPen(slider->palette.shadow().color());
1821 groove.
width(), 4, slider->palette,
true);
1822 p->drawLine(groove.
x() + 1, groove.
y() + mid - 1,
1823 groove.
x() + groove.
width() - 3, groove.
y() + mid - 1);
1826 4, groove.
height(), slider->palette,
true);
1827 p->drawLine(groove.
x() + mid - 1, groove.
y() + 1,
1828 groove.
x() + mid - 1, groove.
y() + groove.
height() - 3);
1848 const QColor c0 = slider->palette.shadow().color();
1849 const QColor c1 = slider->palette.dark().color();
1851 const QColor c3 = slider->palette.midlight().color();
1852 const QColor c4 = slider->palette.light().color();
1877 fropt.QStyleOption::operator=(*slider);
1882 if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) {
1887 p->setBackgroundMode(oldMode);
1910 d = (wi + 1) / 2 - 1;
1911 a.setPoints(5,
x1,
y1,
x1,
y2,
x2,
y2,
x2,
y1,
x1+
d,
y1-
d);
1915 d = (wi + 1) / 2 - 1;
1916 a.setPoints(5,
x1,
y1,
x1,
y2,
x1+
d,
y2+
d,
x2,
y2,
x2,
y1);
1919 d = (he + 1) / 2 - 1;
1921 a.setPoints(5,
x1,
y1,
x1-
d,
y1+
d,
x1,
y2,
x2,
y2,
x2,
y1);
1924 d = (he + 1) / 2 - 1;
1926 a.setPoints(5,
x1,
y1,
x1,
y2,
x2,
y2,
x2+
d,
y1+
d,
x2,
y1);
1932 p->setBrush(handleBrush);
1937 p->setBrush(oldBrush);
1938 p->setBackgroundMode(oldMode);
2019#if QT_CONFIG(scrollbar)
2023 if (scrollbar->minimum == scrollbar->maximum)
2024 newScrollbar.
state &= ~State_Enabled;
2029#if QT_CONFIG(combobox)
2050 p->setPen(cmb->palette.dark().color());
2083 p->setPen(cmb->palette.highlightedText().color());
2084 p->setBackground(cmb->palette.highlight());
2087 p->setPen(cmb->palette.text().color());
2088 p->setBackground(cmb->palette.window());
2093 focus.QStyleOption::operator=(*cmb);
2096 focus.backgroundColor = cmb->palette.highlight().color();
2103#if QT_CONFIG(spinbox)
2126 copy.state &= ~State_Enabled;
2129 copy.palette = pal2;
2136 copy.state &= ~State_Sunken;
2144 copy.rect.adjust(4, 1, -5, -1);
2158 copy.state = sb->state;
2162 copy.state &= ~State_Enabled;
2164 copy.palette = pal2;
2171 copy.state &= ~State_Sunken;
2179 copy.rect.adjust(4, 0, -5, -1);
2218#ifndef QT_QWS_SMALL_PUSHBUTTON
2219 if (w < minwidth + defwidth && !btn->
text.
isEmpty())
2220 w = minwidth + defwidth;
2221 if (
h < minheight + defwidth)
2222 h = minheight + defwidth;
2227#if 0 && QT_CONFIG(menu)
2236 else if (mi->icon.isNull()) {
2244 mi->icon.actualSize(
QSize(iconExtent, iconExtent)).
height()
2247 int maxpmw = mi->maxIconWidth;
2248 int tabSpacing = 20;
2257 QFont fontBold = mi->font;
2270#if 0 && QT_CONFIG(menubar)
2277 if (qstyleoption_cast<const QStyleOptionToolButton *>(
opt))
2278 return sz +=
QSize(7, 6);
2295 nativeWindowsApp->populateLightSystemPalette(pal);
2304 paletteTimer.
start(0,
this);
2319#include "moc_qquickwindowsstyle_p.cpp"
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or \nullptr if no applica...
void start(int msec, QObject *obj)
\obsolete Use chrono overload instead.
int timerId() const noexcept
Returns the timer's ID.
void stop()
Stops the timer.
bool isActive() const noexcept
Returns true if the timer is running and has not been stopped; otherwise returns false.
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.
QColor toRgb() const noexcept
Create and returns an RGB QColor based on this color.
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.
\reentrant \inmodule QtGui
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
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
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
static QPlatformIntegration * platformIntegration()
static QList< QScreen * > screen_list
static QPlatformTheme * platformTheme()
static QPlatformNativeInterface * platformNativeInterface()
QScreen * primaryScreen
the primary (or default) screen of the application.
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
iterator erase(const_iterator begin, const_iterator end)
const_reference at(qsizetype i) const noexcept
Native interface to QGuiApplication, to be retrieved from QPlatformIntegration. \inmodule QtGui.
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,...
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched 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.
void setBackground(const QBrush &bg)
Sets the background brush of the painter to the given brush.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setBackgroundMode(Qt::BGMode mode)
Sets the background mode of the painter to the given mode.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
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.
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.
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...
int height() const
Returns the height of the pixmap.
QImage toImage() const
Converts the pixmap to a QImage.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
int width() const
Returns the width of the pixmap.
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.
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt=nullptr) const override
int styleHint(StyleHint sh, const QStyleOption *opt=nullptr, QStyleHintReturn *shret=nullptr) const override
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt=nullptr) const override
int pixelMetric(PixelMetric m, const QStyleOption *opt=nullptr) const override
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override
\reimp
QStyle::SubControls subControls
bool showDecorationSelected
const QStyle * proxy() const
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr) const =0
@ SE_DockWidgetTitleBarText
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const =0
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc) const =0
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.
@ SH_MenuBar_AltKeyNavigation
@ SH_Slider_StopMouseOverSlider
@ SH_DialogButtonBox_ButtonsHaveIcons
@ SH_FontDialog_SelectAssociatedText
@ SH_Menu_SubMenuSloppyCloseTimeout
@ SH_MenuBar_MouseTracking
@ SH_ToolBox_SelectedPageTitleBold
@ SH_ItemView_ArrowKeysNavigateIntoChildren
@ SH_ItemView_ChangeHighlightOnFocus
@ SH_Menu_AllowActiveAndDisabled
@ SH_ItemView_ShowDecorationSelected
@ SH_PrintDialog_RightAlignButtons
@ SH_ComboBox_ListMouseTracking
@ SH_MainWindow_SpaceBelowMenuBar
@ SH_Menu_SubMenuPopupDelay
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, QStyleHintReturn *returnData=nullptr) const =0
@ State_KeyboardFocusChange
@ PE_IndicatorItemViewItemCheck
@ PE_IndicatorRadioButton
@ PE_IndicatorToolBarHandle
@ PE_IndicatorMenuCheckMark
@ PE_IndicatorToolBarSeparator
@ PE_IndicatorProgressChunk
@ PE_IndicatorDockWidgetResizeHandle
@ PM_TabBarTabShiftHorizontal
@ PM_ButtonDefaultIndicator
@ PM_MdiSubWindowFrameWidth
@ PM_ProgressBarChunkWidth
@ PM_DockWidgetTitleBarButtonMargin
@ PM_ButtonShiftHorizontal
@ PM_SliderControlThickness
@ PM_DockWidgetFrameWidth
@ PM_DockWidgetSeparatorExtent
@ PM_TabBarTabShiftVertical
@ PM_DockWidgetTitleMargin
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.
@ SP_MessageBoxInformation
static int fixedPixelMetric(QStyle::PixelMetric pm)
static qreal devicePixelRatio(const QStyleOption *option=nullptr)
static qreal nativeMetricScaleFactor(const QStyleOption *option=nullptr)
QList< const QWidget * > seenAlt
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option=nullptr)
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr) const override
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override
\reimp
int pixelMetric(PixelMetric pm, const QStyleOption *option=nullptr) const override
\reimp
int styleHint(StyleHint hint, const QStyleOption *opt=nullptr, QStyleHintReturn *returnData=nullptr) const override
\reimp
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt) const override
\reimp
~QWindowsStyle() override
Destroys the QWindowsStyle object.
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override
\reimp
QWindowsStyle()
Constructs a QWindowsStyle object.
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
\reimp
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override
\reimp
static QQuickTheme * instance()
void setPalette(Scope scope, const QPalette &palette)
\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 void moveCenter(const QPoint &p) noexcept
Moves the rectangle, leaving the center point at the given position.
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.
QPlatformScreen * handle() const
Get the platform screen handle.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
\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.
Qt::LayoutDirection direction
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
QMetaType metaType() const
const QStyleOptionButton * btn
[3]
qreal dpi(const QStyleOption *option)
qreal dpiScaled(qreal value, qreal dpi)
static QScreen * screenOf(const QWindow *w)
void qDrawShadeRect(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, 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 qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
Combined button and popup list for selecting options.
static jboolean copy(JNIEnv *, jobject)
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
int qRound(qfloat16 d) noexcept
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
HICON qt_pixmapToWinHICON(const QPixmap &p)
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 SPI_GETKEYBOARDCUES
#define QT_BEGIN_INCLUDE_NAMESPACE
#define QT_END_INCLUDE_NAMESPACE
\inmodule QtCore \reentrant
bool contains(const AT &t) const noexcept