8#if QT_CONFIG(itemviews)
12#include <private/qguiapplication_p.h>
13#include <qpa/qplatformtheme.h>
16#if QT_CONFIG(dockwidget)
20#if QT_CONFIG(dialogbuttonbox)
23#if QT_CONFIG(formlayout)
28#if QT_CONFIG(groupbox)
45#if QT_CONFIG(tabwidget)
51#if QT_CONFIG(toolbutton)
54#if QT_CONFIG(rubberband)
57#if QT_CONFIG(treeview)
60#include <private/qcommonstylepixmaps_p.h>
61#include <private/qmath_p.h>
67#if QT_CONFIG(filedialog)
72#if QT_CONFIG(settings)
77#if QT_CONFIG(animation)
78#include <private/qstyleanimation_p.h>
85#include <private/qtextengine_p.h>
86#include <private/qstylehelper_p.h>
103 , m_bSaveRestore(bSaveRestore)
114 if (m_bSaveRestore) {
115 m_bSaveRestore =
false;
216 QColor bg = fropt->backgroundColor;
234 const int markH = markW;
244 for (
i = 0;
i < markW/2; ++
i) {
245 a <<
QLineF(xx, yy, xx, yy + 2);
250 for (;
i < markH; ++
i) {
251 a <<
QLineF(xx, yy, xx, yy + 2);
275#if QT_CONFIG(toolbar)
284 else if (
const QStyleOptionToolBar *
frame = qstyleoption_cast<const QStyleOptionToolBar *>(
opt)){
295#if QT_CONFIG(progressbar)
298 bool vertical =
false;
312 static const int decoration_size = 9;
320 int delta = decoration_size / 2;
325 p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4);
327 p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);
328 QPen oldPen =
p->pen();
330 p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
350 QPen oldPen =
p->pen();
379 if (
const QStyleOptionTabBarBase *tbb
380 = qstyleoption_cast<const QStyleOptionTabBarBase *>(
opt)) {
382 switch (tbb->shape) {
385 p->setPen(
QPen(tbb->palette.light(), 0));
386 p->drawLine(tbb->rect.topLeft(), tbb->rect.topRight());
390 p->setPen(
QPen(tbb->palette.light(), 0));
391 p->drawLine(tbb->rect.topLeft(), tbb->rect.bottomLeft());
395 p->setPen(
QPen(tbb->palette.shadow(), 0));
396 p->drawLine(tbb->rect.left(), tbb->rect.bottom(),
397 tbb->rect.right(), tbb->rect.bottom());
398 p->setPen(
QPen(tbb->palette.dark(), 0));
399 p->drawLine(tbb->rect.left(), tbb->rect.bottom() - 1,
400 tbb->rect.right() - 1, tbb->rect.bottom() - 1);
404 p->setPen(
QPen(tbb->palette.dark(), 0));
405 p->drawLine(tbb->rect.topRight(), tbb->rect.bottomRight());
411 if (
d->tabBarcloseButtonIcon.isNull())
438#if QT_CONFIG(groupbox)
455#if QT_CONFIG(dockwidget)
466#if QT_CONFIG(toolbar)
505#if QT_CONFIG(spinbox)
516 const qreal devicePixelRatio =
p->device()->devicePixelRatio();
518 const qreal inverseScale =
qreal(1) / devicePixelRatio;
519 p->scale(inverseScale, inverseScale);
524 p->translate(0.5, 0.5);
526 int len = std::min(
w,
h);
529 int step = (
len + 4) / 5;
532 const int step2 = step / 2;
538 p->translate(center);
553 const qreal devicePixelRatio =
p->device()->devicePixelRatio();
555 const qreal inverseScale =
qreal(1) / devicePixelRatio;
556 p->scale(inverseScale, inverseScale);
561 p->translate(0.5, 0.5);
571 int sx =
x +
w / 2 - sw / 2;
572 int sy =
y +
h / 2 - sh / 2;
583 p->translate(sx + bsx, sy + bsy);
602 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
604 const bool horizontal = tab->rect.height() > tab->rect.width();
605 const int margin = 4;
615 for (
int jags = 1; jags <=
count; ++jags, rtl = !rtl)
624 for (
int jags = 1; jags <=
count; ++jags, rtl = !rtl)
628 p->setPen(
QPen(tab->palette.dark(),
qreal(.8)));
629 p->setBrush(tab->palette.window());
635#if QT_CONFIG(lineedit)
641 if (
panel->lineWidth > 0)
646#if QT_CONFIG(columnview)
648 if (
const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
652 int x = viewOpt->rect.x() + 1;
653 int offset = (viewOpt->rect.height() / 3);
659 x = viewOpt->rect.x() + viewOpt->rect.width() - 1;
667 if (viewOpt->showDecorationSelected) {
701 p->drawLine(
rect.topLeft(),
rect.topRight());
705#if QT_CONFIG(itemviews)
707 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
715 else if (vopt->features & QStyleOptionViewItem::Alternate)
720 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
729 if (vopt->backgroundBrush.style() !=
Qt::NoBrush) {
731 p->setBrushOrigin(vopt->rect.topLeft());
732 p->fillRect(vopt->rect, vopt->backgroundBrush);
733 p->setBrushOrigin(oldBO);
754 if (
r.width() <= 1 ||
r.height() <= 1)
758 const qreal dpr =
p->device()->devicePixelRatio();
761 % HexString<uint>(pe),
766 const int sizeDpr =
size *
dpr;
774 std::array<QPointF, 4> poly;
797 imagePainter.translate((sizeDpr -
width) / 2, (sizeDpr -
height) / 2);
801 imagePainter.translate(bsx, bsy);
808 imagePainter.translate(ofs, ofs);
811 imagePainter.drawPolygon(poly.data(),
int(poly.size()));
812 imagePainter.drawPoints(poly.data(),
int(poly.size()));
813 imagePainter.translate(-ofs, -ofs);
817 imagePainter.drawPolygon(poly.data(),
int(poly.size()));
819 imagePainter.drawPoints(poly.data(),
int(poly.size()));
824 int xOffset =
r.x() + (
r.width() -
size)/2;
825 int yOffset =
r.y() + (
r.height() -
size)/2;
826 p->drawPixmap(xOffset, yOffset,
pixmap);
834#if QT_CONFIG(toolbutton)
839 switch (toolbutton->arrowType) {
864 *lastVisibleLine = -1;
873 line.setLineWidth(lineWidth);
876 widthUsed =
qMax(widthUsed,
line.naturalTextWidth());
878 if (maxHeight > 0 && lastVisibleLine &&
height +
line.height() > maxHeight) {
880 *lastVisibleLine = nextLine.
isValid() ?
i : -1;
892 bool lastVisibleLineShouldBeElided,
QPointF *paintStartPosition)
const
900 const bool vAlignmentOptimization = paintStartPosition && valign.testFlag(
Qt::AlignVCenter);
902 int lastVisibleLine = -1;
910 if (paintStartPosition)
915 const int lineCount = textLayout.
lineCount();
916 for (
int i = 0;
i < lineCount; ++
i) {
922 if (paintStartPosition)
923 paintStartPosition->ry() +=
line.height();
930 bool elideLastVisibleLine = lastVisibleLine ==
i;
931 if (!drawElided &&
i + 1 < lineCount && lastVisibleLineShouldBeElided) {
936 elideLastVisibleLine =
true;
940 if (drawElided || elideLastVisibleLine) {
941 if (elideLastVisibleLine) {
953 if (
i < lineCount - 1 &&
954 !
ret.endsWith(QChar::LineSeparator))
955 ret += QChar::LineSeparator;
962 (lastVisibleLine >= 0 && lastVisibleLine ==
i))
968#if QT_CONFIG(itemviews)
970QSize QCommonStylePrivate::viewItemSize(
const QStyleOptionViewItem *
option,
int role)
const
975 if (
option->features & QStyleOptionViewItem::HasCheckIndicator)
980 if (
option->features & QStyleOptionViewItem::HasDisplay) {
985 const bool wrapText =
option->features & QStyleOptionViewItem::WrapText;
988 switch (
option->decorationPosition) {
989 case QStyleOptionViewItem::Left:
990 case QStyleOptionViewItem::Right: {
993 if (
option->features & QStyleOptionViewItem::HasDecoration)
994 width -=
option->decorationSize.width() + 2 * textMargin;
1000 case QStyleOptionViewItem::Top:
1001 case QStyleOptionViewItem::Bottom: {
1006 else if (
option->features & QStyleOptionViewItem::HasDecoration)
1020 if (
wrapText &&
option->features & QStyleOptionViewItem::HasCheckIndicator)
1023 const int lineWidth = bounds.
width();
1029 if (
option->features & QStyleOptionViewItem::HasDecoration) {
1030 return option->decorationSize;
1040void QCommonStylePrivate::viewItemDrawText(
QPainter *
p,
const QStyleOptionViewItem *
option,
const QRect &
rect)
const
1046 const bool wrapText =
option->features & QStyleOptionViewItem::WrapText;
1055 option->textElideMode, 0,
1056 true, &paintPosition);
1072void QCommonStylePrivate::viewItemLayout(
const QStyleOptionViewItem *
opt,
QRect *checkRect,
1081 const bool hasCheck = checkRect->isValid();
1082 const bool hasPixmap = pixmapRect->isValid();
1084 const bool hasMargin = (hasText | hasPixmap | hasCheck);
1085 const int frameHMargin = hasMargin ?
1087 const int textMargin = hasText ? frameHMargin : 0;
1088 const int pixmapMargin = hasPixmap ? frameHMargin : 0;
1089 const int checkMargin = hasCheck ? frameHMargin : 0;
1101 pm = pixmapRect->size();
1102 pm.rwidth() += 2 * pixmapMargin;
1106 if (
opt->decorationPosition == QStyleOptionViewItem::Left
1107 ||
opt->decorationPosition == QStyleOptionViewItem::Right) {
1120 cw = checkRect->width() + 2 * checkMargin;
1121 if (sizehint)
w +=
cw;
1131 switch (
opt->decorationPosition) {
1132 case QStyleOptionViewItem::Top: {
1134 pm.setHeight(pm.height() + pixmapMargin);
1145 case QStyleOptionViewItem::Bottom: {
1158 case QStyleOptionViewItem::Left: {
1167 case QStyleOptionViewItem::Right: {
1177 qCWarning(lcCommonStyle,
"doLayout: decoration position is invalid");
1184 checkRect->size(), check);
1197#if QT_CONFIG(toolbutton)
1217#if QT_CONFIG(tabbar)
1233 tr.setRect(0, 0,
tr.height(),
tr.width());
1240 verticalShift = -verticalShift;
1241 tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding);
1244 tr.setTop(
tr.top() - verticalShift);
1245 tr.setRight(
tr.right() - horizontalShift);
1249 if (!
opt->leftButtonSize.isEmpty()) {
1250 tr.setLeft(
tr.left() + 4 +
1254 if (!
opt->rightButtonSize.isEmpty()) {
1255 tr.setRight(
tr.right() - 4 -
1272 const int offsetX = (
iconSize.width() - tabIconSize.width()) / 2;
1273 *iconRect =
QRect(
tr.left() + offsetX,
tr.center().y() - tabIconSize.height() / 2,
1274 tabIconSize.width(), tabIconSize.height());
1277 tr.setLeft(
tr.left() + tabIconSize.width() + 4);
1287#if QT_CONFIG(animation)
1291 return animations.value(
target);
1307void QCommonStylePrivate::stopAnimation(
const QObject *
target)
const
1317void QCommonStylePrivate::removeAnimation(
const QObject *
target)
const
1319 animations.remove(
target);
1340 fropt.QStyleOption::operator=(*btn);
1365 newBtn.
rect =
QRect(ir.right() - mbi - 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6);
1397 int pixmapHeight =
pixmap.height() /
pixmap.devicePixelRatio();
1398 int labelWidth = pixmapWidth;
1399 int labelHeight = pixmapHeight;
1400 int iconSpacing = 4;
1403 labelWidth += (textWidth + iconSpacing);
1408 pixmapWidth, pixmapHeight);
1415 textRect.
setLeft(iconRect.left() + iconRect.width() + iconSpacing / 2);
1418 if (
p->layoutDirection() ==
button->direction)
1426 p->drawPixmap(iconRect,
pixmap);
1452 fropt.QStyleOption::operator=(*btn);
1503#if QT_CONFIG(menubar)
1524#if QT_CONFIG(progressbar)
1527 = qstyleoption_cast<const QStyleOptionProgressBar *>(
opt)) {
1533 if (pb->textVisible) {
1553 QRect shadowRect(pb->rect);
1554 shadowRect.translate(1,1);
1555 QColor shadowColor = (pb->palette.color(textRole).value() <= 128)
1557 QPalette shadowPalette = pb->palette;
1558 shadowPalette.
setColor(textRole, shadowColor);
1572 const bool inverted = pb->invertedAppearance;
1582 m.translate(0, -(
rect.height() +
rect.y()*2));
1587 if (pal2.highlight() == pal2.window())
1590 bool reverse = ((!vertical && (pb->direction ==
Qt::RightToLeft)) || vertical);
1593 int w =
rect.width();
1594 if (pb->minimum == 0 && pb->maximum == 0) {
1596 int x = (progress - minimum) % (
w * 2);
1600 p->setPen(
QPen(pal2.highlight().color(), 4));
1609 u = ((
rect.width() + unit_width) / unit_width);
1612 qint64 p_v = progress - minimum;
1613 qint64 t_s = (maximum - minimum) ? (maximum - minimum) :
qint64(1);
1615 if (u > 0 && p_v >= INT_MAX / u && t_s >= u) {
1623 tnu = nu = p_v * u / t_s;
1625 if (nu * unit_width >
w)
1633 int x0 = reverse ?
rect.right() - ((unit_width > 1) ? unit_width : 0)
1638 pbBits.palette = pal2;
1639 int myY = pbBits.rect.
y();
1640 int myHeight = pbBits.rect.height();
1642 for (
int i = 0;
i < nu; ++
i) {
1643 pbBits.rect.setRect(
x0 +
x, myY, unit_width, myHeight);
1644 pbBits.rect =
m.mapRect(
QRectF(pbBits.rect)).toRect();
1646 x += reverse ? -unit_width : unit_width;
1652 int pixels_left =
w - (nu * unit_width);
1653 int offset = reverse ?
x0 +
x + unit_width-pixels_left :
x0 +
x;
1654 pbBits.rect.setRect(
offset, myY, pixels_left, myHeight);
1655 pbBits.rect =
m.mapRect(
QRectF(pbBits.rect)).toRect();
1665 if (!
header->icon.isNull()) {
1673 p->drawPixmap(inter.x(), inter.y(),
pixmap,
1680 rect.setLeft(
rect.left() + pixw + margin);
1682 rect.setRight(
rect.right() - pixw - margin);
1697 text = fm.elidedText(
header->text, headerV2->textElideMode,
rect.width());
1703#if QT_CONFIG(toolbutton)
1706 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
1716 if (((!hasArrow && toolbutton->icon.isNull()) && !toolbutton->text.isEmpty())
1721 rect.translate(shiftX, shiftY);
1722 p->setFont(toolbutton->font);
1729 QSize pmSize = toolbutton->iconSize;
1730 if (!toolbutton->icon.isNull()) {
1739 pm = toolbutton->icon.pixmap(toolbutton->rect.size().boundedTo(toolbutton->iconSize),
p->device()->devicePixelRatio(),
1745 p->setFont(toolbutton->font);
1753 pr.setHeight(pmSize.height() + 4);
1754 tr.adjust(0, pr.height() - 1, 0, -1);
1755 pr.translate(shiftX, shiftY);
1763 pr.setWidth(pmSize.width() + 4);
1764 tr.adjust(pr.width(), 0, 0, 0);
1765 pr.translate(shiftX, shiftY);
1773 tr.translate(shiftX, shiftY);
1779 rect.translate(shiftX, shiftY);
1790#if QT_CONFIG(toolbox)
1799 p->setPen(tb->palette.mid().color().darker(150));
1800 int d = 20 + tb->rect.height() - 3;
1803 QPoint(-1, tb->rect.height() + 1),
1805 QPoint(tb->rect.width() -
d, 1),
1806 QPoint(tb->rect.width() - 20, tb->rect.height() - 2),
1807 QPoint(tb->rect.width() - 1, tb->rect.height() - 2),
1808 QPoint(tb->rect.width() - 1, tb->rect.height() + 1),
1809 QPoint(-1, tb->rect.height() + 1),
1814 QPoint(tb->rect.width(), tb->rect.height() + 1),
1815 QPoint(tb->rect.width(), 1),
1817 QPoint(20 - 1, tb->rect.height() - 2),
1818 QPoint(0, tb->rect.height() - 2),
1819 QPoint(0, tb->rect.height() + 1),
1820 QPoint(tb->rect.width(), tb->rect.height() + 1),
1824 p->setPen(tb->palette.light().color());
1826 p->drawLine(0, 2, tb->rect.width() -
d, 2);
1827 p->drawLine(tb->rect.width() -
d - 1, 2, tb->rect.width() - 21, tb->rect.height() - 1);
1828 p->drawLine(tb->rect.width() - 20, tb->rect.height() - 1,
1829 tb->rect.width(), tb->rect.height() - 1);
1831 p->drawLine(tb->rect.width() - 1, 2,
d - 1, 2);
1832 p->drawLine(
d, 2, 20, tb->rect.height() - 1);
1833 p->drawLine(19, tb->rect.height() - 1,
1834 -1, tb->rect.height() - 1);
1840#if QT_CONFIG(tabbar)
1842 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
1848 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
1852 bool onlyOne = tab->position == QStyleOptionTab::OnlyOneTab;
1856 switch (tab->shape) {
1858 rect.adjust(0, 0, 0, -tabOverlap);
1860 rect.adjust(1, 1, -1, 0);
1863 rect.adjust(0, tabOverlap, 0, 0);
1865 rect.adjust(1, 0, -1, -1);
1868 rect.adjust(tabOverlap, 0, 0, 0);
1870 rect.adjust(0, 1, -1, -1);
1873 rect.adjust(0, 0, -tabOverlap, 0);
1875 rect.adjust(1, 1, 0, -1);
1882 p->setPen(
QPen(tab->palette.windowText(), 0));
1884 p->setBrush(tab->palette.base());
1889 p->setBrush(tab->palette.window());
1895 switch (tab->shape) {
1898 a.setPoint(0, 0, -1);
1899 a.setPoint(1, 0, 0);
1900 y =
rect.height() - 2;
1902 a.setPoint(2,
x++,
y - 1);
1904 a.setPoint(3,
x++,
y++);
1905 a.setPoint(4,
x,
y);
1909 for (
i = 0;
i < 5; ++
i)
1910 a.setPoint(9 -
i,
right -
a.point(
i).x(),
a.point(
i).y());
1912 for (
i = 0;
i < 10; ++
i)
1913 a.setPoint(
i,
a.point(
i).x(),
rect.height() - 1 -
a.point(
i).y());
1917 p->translate(0, 0.5);
1925 a.setPoint(0, -1, 0);
1926 a.setPoint(1, 0, 0);
1927 x =
rect.width() - 2;
1929 a.setPoint(2,
x - 1,
y++);
1931 a.setPoint(3,
x++,
y++);
1932 a.setPoint(4,
x,
y);
1935 for (
i = 0;
i < 5; ++
i)
1936 a.setPoint(9 -
i,
a.point(
i).x(),
bottom -
a.point(
i).y());
1938 for (
i = 0;
i < 10; ++
i)
1939 a.setPoint(
i,
rect.width() - 1 -
a.point(
i).x(),
a.point(
i).y());
1942 p->translate(0.5, 0);
1957 QPixmap pm = tb->icon.pixmap(
QSize(iconExtent, iconExtent),
p->device()->devicePixelRatio(),
1965 tr.adjust(4, 0, -8, 0);
1982 p->drawPixmap(ir.left(), (tb->rect.height() - ih) / 2, pm);
1999 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
2012 int newX, newY, newRot;
2014 newX =
tr.width() +
tr.x();
2019 newY =
tr.y() +
tr.height();
2024 p->setTransform(
m,
true);
2027 d->tabLayout(tab,
widget, &
tr, &iconRect);
2030 if (tab->position != QStyleOptionTab::TabPosition::Moving)
2033 if (!tab->icon.isNull()) {
2034 QPixmap tabIcon = tab->icon.pixmap(tab->iconSize,
p->device()->devicePixelRatio(),
2039 p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon);
2050 x1 = tab->rect.left();
2051 x2 = tab->rect.right() - 1;
2054 fropt.QStyleOption::operator=(*tab);
2056 x2 -
x1 - 2*OFFSET, tab->rect.height() - 2*OFFSET);
2062#if QT_CONFIG(sizegrip)
2070 p->translate(0,
h -
w);
2072 p->translate(
w -
h, 0);
2080 corner = sgOpt->corner;
2088 for (
int i = 0;
i < 4; ++
i) {
2090 p->drawLine(
x, sy - 1 , sx + 1, sw);
2092 p->drawLine(
x, sy, sx, sw);
2094 p->drawLine(
x, sy + 1, sx - 1, sw);
2099 for (
int i = 0;
i < 4; ++
i) {
2101 p->drawLine(sx - 1, sw, sw, sy - 1);
2103 p->drawLine(sx, sw, sw, sy);
2105 p->drawLine(sx + 1, sw, sw, sy + 1);
2111 for (
int i = 0;
i < 4; ++
i) {
2113 p->drawLine(sx - 1,
y, sw, sy + 1);
2115 p->drawLine(sx,
y, sw, sy);
2117 p->drawLine(sx + 1,
y, sw, sy - 1);
2122 for (
int i = 0;
i < 4; ++
i) {
2124 p->drawLine(
x, sy - 1, sx - 1,
y);
2126 p->drawLine(
x, sy, sx,
y);
2128 p->drawLine(
x, sy + 1, sx + 1,
y);
2135#if QT_CONFIG(rubberband)
2137 if (
const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(
opt)) {
2139 QPainter pixmapPainter(&tiledPixmap);
2144 pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height());
2145 pixmapPainter.end();
2153 p->setClipRegion(
mask.region);
2154 p->drawTiledPixmap(
r.x(),
r.y(),
r.width(),
r.height(), tiledPixmap);
2157 p->drawRect(
r.adjusted(0, 0, -1, -1));
2159 p->drawRect(
r.adjusted(3, 3, -4, -4));
2163#if QT_CONFIG(dockwidget)
2167 if (dwOpt->movable) {
2172 if (!dwOpt->title.isEmpty()) {
2173 const bool verticalTitleBar = dwOpt->verticalTitleBar;
2176 if (verticalTitleBar) {
2179 p->translate(
r.left(),
r.top() +
r.width());
2181 p->translate(-
r.left(), -
r.top());
2184 const int indent =
p->fontMetrics().descent();
2195 QRegion clipRegion =
p->clipRegion();
2201 if (
auto v2 = qstyleoption_cast<const QStyleOptionHeaderV2 *>(
opt))
2212 p->setClipRegion(clipRegion);
2226#if QT_CONFIG(combobox)
2231 p->setClipRect(editRect);
2232 if (!
cb->currentIcon.isNull()) {
2236 QRect iconRect(editRect);
2237 iconRect.setWidth(
cb->iconSize.width() + 4);
2240 iconRect.size(), editRect);
2246 editRect.translate(-4 -
cb->iconSize.width(), 0);
2248 editRect.translate(
cb->iconSize.width() + 4, 0);
2250 if (!
cb->currentText.isEmpty() && !
cb->editable) {
2258#if QT_CONFIG(toolbar)
2260 if (
const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(
opt)) {
2263 frame.QStyleOption::operator=(*toolBar);
2270 qDrawShadePanel(
p, toolBar->rect, toolBar->palette,
false, toolBar->lineWidth,
2292 p->drawLine(line1starting,
top, line1starting,
bottom);
2293 p->drawLine(line2starting,
top, line2starting,
bottom);
2297#if QT_CONFIG(itemviews)
2299 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
2303 p->setClipRegion(clipRegion);
2313 if (vopt->features & QStyleOptionViewItem::HasCheckIndicator) {
2314 QStyleOptionViewItem
option(*vopt);
2318 switch (vopt->checkState) {
2339 vopt->icon.paint(
p, iconRect, vopt->decorationAlignment,
mode,
state);
2342 if (!vopt->text.isEmpty()) {
2364 o.QStyleOption::operator=(*vopt);
2381 int frameShape =
f->frameShape;
2389 int lw =
f->lineWidth;
2390 int mlw =
f->midLineWidth;
2395 switch (frameShape) {
2437 QPen oldPen =
p->pen();
2439 p->drawLine(
p1,
p2);
2453#if !QT_CONFIG(tabbar) && !QT_CONFIG(itemviews)
2481 int dbw1 = 0, dbw2 = 0;
2526 r.adjust(1, 1, -1, -1);
2577 r.adjust(1, 1, -1, -1);
2600#if QT_CONFIG(slider)
2602 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
2606 r.setRect(0, tickOffset - 1, slider->rect.width(), thickness + 2);
2608 r.setRect(tickOffset - 1, 0, thickness + 2, slider->rect.height());
2609 r =
r.intersected(slider->rect);
2614#if QT_CONFIG(progressbar)
2622 if (pb->textVisible)
2623 textw =
qMax(pb->fontMetrics.horizontalAdvance(pb->text), pb->fontMetrics.horizontalAdvance(
"100%"_L1)) + 6;
2628 r.setCoords(pb->rect.left(), pb->rect.top(),
2629 pb->rect.right() - textw, pb->rect.bottom());
2631 r.setCoords(pb->rect.right() - textw, pb->rect.top(),
2632 pb->rect.right(), pb->rect.bottom());
2640#if QT_CONFIG(combobox)
2643 int margin =
cb->frame ? 3 : 0;
2650#if QT_CONFIG(toolbox)
2667 r.setHeight(
r.height() - (
opt->
rect.
width() / 2) - (margin * 2));
2680 int horiz_size =
h / 2;
2681 r.setRect(
x +
w - margin * 2 - horiz_size,
y + 5,
2682 horiz_size,
h - margin * 2 - 5);
2684 int vert_size =
w / 2;
2685 r.setRect(
x + 5,
y +
h - margin * 2 - vert_size,
2686 w - margin * 2 - 5, vert_size);
2699#if QT_CONFIG(tabwidget)
2701 if (
const QStyleOptionTabWidgetFrame *twf
2702 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
2703 r.setSize(twf->tabBarSize);
2705 switch (twf->shape) {
2710 r.setWidth(
qMin(
r.width(), twf->rect.width()
2711 - twf->leftCornerWidgetSize.width()
2712 - twf->rightCornerWidgetSize.width()));
2716 r.moveTopLeft(
QPoint(twf->leftCornerWidgetSize.width(), 0));
2719 r.moveTopLeft(
QPoint(twf->rect.center().x() -
qRound(
r.width() / 2.0f)
2720 + (twf->leftCornerWidgetSize.width() / 2)
2721 - (twf->rightCornerWidgetSize.width() / 2), 0));
2724 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width()
2725 - twf->rightCornerWidgetSize.width(), 0));
2732 r.setWidth(
qMin(
r.width(), twf->rect.width()
2733 - twf->leftCornerWidgetSize.width()
2734 - twf->rightCornerWidgetSize.width()));
2738 r.moveTopLeft(
QPoint(twf->leftCornerWidgetSize.width(),
2739 twf->rect.height() - twf->tabBarSize.height()));
2742 r.moveTopLeft(
QPoint(twf->rect.center().x() -
qRound(
r.width() / 2.0f)
2743 + (twf->leftCornerWidgetSize.width() / 2)
2744 - (twf->rightCornerWidgetSize.width() / 2),
2745 twf->rect.height() - twf->tabBarSize.height()));
2748 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width()
2749 - twf->rightCornerWidgetSize.width(),
2750 twf->rect.height() - twf->tabBarSize.height()));
2757 r.setHeight(
qMin(
r.height(), twf->rect.height()
2758 - twf->leftCornerWidgetSize.height()
2759 - twf->rightCornerWidgetSize.height()));
2763 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2764 twf->leftCornerWidgetSize.height()));
2767 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2768 twf->rect.center().y() -
r.height() / 2));
2771 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2772 twf->rect.height() - twf->tabBarSize.height()
2773 - twf->rightCornerWidgetSize.height()));
2779 r.setHeight(
qMin(
r.height(), twf->rect.height()
2780 - twf->leftCornerWidgetSize.height()
2781 - twf->rightCornerWidgetSize.height()));
2785 r.moveTopLeft(
QPoint(0, twf->leftCornerWidgetSize.height()));
2788 r.moveTopLeft(
QPoint(0, twf->rect.center().y() -
r.height() / 2));
2791 r.moveTopLeft(
QPoint(0, twf->rect.height() - twf->tabBarSize.height()
2792 - twf->rightCornerWidgetSize.height()));
2801 if (
const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
2802 QStyleOptionTab tabopt;
2803 tabopt.shape = twf->shape;
2805 if (twf->lineWidth == 0)
2807 switch (twf->shape) {
2811 QSize(twf->rect.width(),
qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height())));
2815 r =
QRect(
QPoint(0,0),
QSize(twf->rect.width(),
qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height())));
2819 r =
QRect(
QPoint(0, 0),
QSize(
qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height()));
2824 QSize(
qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height()));
2828 r.adjust(2, 2, -2, -2);
2832 if (
const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
2834 switch (twf->shape) {
2837 r =
QRect(
QPoint(paneRect.x(), paneRect.y() - twf->leftCornerWidgetSize.height()),
2838 twf->leftCornerWidgetSize);
2842 r =
QRect(
QPoint(paneRect.x(), paneRect.height()), twf->leftCornerWidgetSize);
2851 if (
const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
2853 switch (twf->shape) {
2856 r =
QRect(
QPoint(paneRect.width() - twf->rightCornerWidgetSize.width(),
2857 paneRect.y() - twf->rightCornerWidgetSize.height()),
2858 twf->rightCornerWidgetSize);
2862 r =
QRect(
QPoint(paneRect.width() - twf->rightCornerWidgetSize.width(),
2863 paneRect.height()), twf->rightCornerWidgetSize);
2872 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
2873 QRect dummyIconRect;
2874 d->tabLayout(tab,
widget, &
r, &dummyIconRect);
2879 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
2884 hpadding =
qMax(hpadding, 4);
2893 verticalShift = -verticalShift;
2895 qSwap(horizontalShift, verticalShift);
2896 horizontalShift *= -1;
2897 verticalShift *= -1;
2900 horizontalShift = -horizontalShift;
2902 tr.adjust(0, 0, horizontalShift, verticalShift);
2905 tr.setBottom(
tr.bottom() - verticalShift);
2906 tr.setRight(
tr.right() - horizontalShift);
2910 int w =
size.width();
2911 int h =
size.height();
2912 int midHeight =
static_cast<int>(
qCeil(
float(
tr.height() -
h) / 2));
2913 int midWidth = ((
tr.width() -
w) / 2);
2915 bool atTheTop =
true;
2916 switch (tab->shape) {
2927 r =
QRect(tab->rect.x() + hpadding, midHeight,
w,
h);
2929 r =
QRect(tab->rect.right() -
w - hpadding, midHeight,
w,
h);
2934 r =
QRect(midWidth,
tr.y() + tab->rect.height() - hpadding -
h,
w,
h);
2936 r =
QRect(midWidth,
tr.y() + hpadding,
w,
h);
2942#if QT_CONFIG(tabbar)
2944 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
2945 switch (tab->shape) {
2950 r.setRect(tab->rect.left(), tab->rect.top(), 8,
opt->
rect.
height());
2956 r.setRect(tab->rect.left(), tab->rect.top(),
opt->
rect.
width(), 8);
2987 r =
f->rect.
adjusted(
f->lineWidth,
f->lineWidth, -
f->lineWidth, -
f->lineWidth);
3000 int frameShape =
f->frameShape;
3010 switch (frameShape) {
3018 switch (frameShadow) {
3020 frameWidth =
f->lineWidth;
3024 frameWidth = (short)(
f->lineWidth*2 +
f->midLineWidth);
3042 switch (frameShadow) {
3046 frameWidth =
f->lineWidth;
3051 r =
f->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
3054#if QT_CONFIG(dockwidget)
3065 = qstyleoption_cast<const QStyleOptionDockWidget*>(
opt);
3066 bool canClose = dwOpt ==
nullptr ? true : dwOpt->closable;
3067 bool canFloat = dwOpt ==
nullptr ?
false : dwOpt->floatable;
3069 const bool verticalTitleBar = dwOpt && dwOpt->verticalTitleBar;
3074 if (verticalTitleBar)
3086 sz +=
QSize(buttonMargin, buttonMargin);
3087 if (verticalTitleBar)
3092 right = closeRect.left() - 1;
3103 sz +=
QSize(buttonMargin, buttonMargin);
3104 if (verticalTitleBar)
3109 right = floatRect.left() - 1;
3119 if (dw->isFloating())
3120 icon = dw->windowIcon();
3124 if (verticalTitleBar)
3128 left = iconRect.right() + margin;
3145 if (verticalTitleBar) {
3148 r.height(),
r.width());
3155#if QT_CONFIG(itemviews)
3157 if (!qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
3165 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
3166 if (!
d->isViewItemCached(*vopt)) {
3167 d->viewItemLayout(vopt, &
d->checkRect, &
d->decorationRect, &
d->displayRect,
false);
3168 if (
d->cachedOption) {
3169 delete d->cachedOption;
3170 d->cachedOption =
nullptr;
3172 d->cachedOption =
new QStyleOptionViewItem(*vopt);
3177 r =
d->decorationRect;
3183#if QT_CONFIG(toolbar)
3185 if (
const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(
opt)) {
3186 if (tbopt->features & QStyleOptionToolBar::Movable) {
3190 const QMargins margins = tb && tb->layout() ? tb->layout()->contentsMargins() :
QMargins(2, 2, 2, 2);
3195 tbopt->rect.height() - (margins.
top() + margins.
bottom()));
3199 tbopt->rect.width() - (margins.
left() + margins.
right()),
3210#if !QT_CONFIG(tabwidget) && !QT_CONFIG(itemviews)
3219struct StaticPolygonF
3223 constexpr int size()
const {
return N; }
3224 constexpr const QPointF *cbegin()
const {
return data; }
3225 constexpr const QPointF &operator[](
int idx)
const {
return data[idx]; }
3228static StaticPolygonF<3> calcArrow(
const QStyleOptionSlider *dial,
qreal &
a)
3230 int width = dial->rect.width();
3231 int height = dial->rect.height();
3233 int currentSliderPosition = dial->upsideDown ? dial->sliderPosition : (dial->maximum - dial->sliderPosition);
3235 if (dial->maximum == dial->minimum)
3237 else if (dial->dialWrapping)
3238 a =
Q_PI * 3 / 2 - (currentSliderPosition - dial->minimum) * 2 *
Q_PI
3239 / (dial->maximum - dial->minimum);
3241 a = (
Q_PI * 8 - (currentSliderPosition - dial->minimum) * 10 *
Q_PI
3242 / (dial->maximum - dial->minimum)) / 6;
3244 int xc =
width / 2 + dial->rect.left();
3245 int yc =
height / 2 + dial->rect.top();
3247 int len =
r - QStyleHelper::calcBigLineSize(
r) - 5;
3252 StaticPolygonF<3> arrow = {{
3256 0.5 + yc - back *
qSin(
a +
Q_PI * 5 / 6)),
3258 0.5 + yc - back *
qSin(
a -
Q_PI * 5 / 6)),
3272#if QT_CONFIG(slider)
3274 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
3277 int ticks = slider->tickPosition;
3281 int interval = slider->tickInterval;
3282 if (interval <= 0) {
3283 interval = slider->singleStep;
3288 interval = slider->pageStep;
3292 int fudge =
len / 2;
3296 p->translate(slider->rect.x(), slider->rect.y());
3297 p->setPen(slider->palette.windowText().color());
3298 int v = slider->minimum;
3299 while (v <= slider->maximum + 1) {
3300 if (
v == slider->maximum + 1 && interval == 1)
3302 const int v_ =
qMin(
v, slider->maximum);
3304 v_, available) + fudge;
3307 p->drawLine(
pos, 0,
pos, tickOffset - 2);
3309 p->drawLine(
pos, tickOffset + thickness + 1,
pos,
3310 slider->rect.height()-1);
3313 p->drawLine(0,
pos, tickOffset - 2,
pos);
3315 p->drawLine(tickOffset + thickness + 1,
pos,
3316 slider->rect.width()-1,
pos);
3319 int nextInterval =
v + interval;
3320 if (nextInterval <
v)
3328#if QT_CONFIG(scrollbar)
3330 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
3332 QStyleOptionSlider newScrollbar = *scrollbar;
3333 State saveFlags = scrollbar->state;
3336 newScrollbar.state = saveFlags;
3338 if (newScrollbar.rect.isValid()) {
3345 newScrollbar.rect = scrollbar->rect;
3346 newScrollbar.state = saveFlags;
3348 if (newScrollbar.rect.isValid()) {
3355 newScrollbar.rect = scrollbar->rect;
3356 newScrollbar.state = saveFlags;
3358 if (newScrollbar.rect.isValid()) {
3365 newScrollbar.rect = scrollbar->rect;
3366 newScrollbar.state = saveFlags;
3368 if (newScrollbar.rect.isValid()) {
3375 newScrollbar.rect = scrollbar->rect;
3376 newScrollbar.state = saveFlags;
3378 if (newScrollbar.rect.isValid()) {
3385 newScrollbar.rect = scrollbar->rect;
3386 newScrollbar.state = saveFlags;
3388 if (newScrollbar.rect.isValid()) {
3395 newScrollbar.rect = scrollbar->rect;
3396 newScrollbar.state = saveFlags;
3398 if (newScrollbar.rect.isValid()) {
3405 fropt.QStyleOption::operator=(newScrollbar);
3406 fropt.
rect.
setRect(newScrollbar.rect.x() + 2, newScrollbar.rect.y() + 2,
3407 newScrollbar.rect.width() - 5,
3408 newScrollbar.rect.height() - 5);
3416#if QT_CONFIG(spinbox)
3418 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
3419 QStyleOptionSpinBox
copy = *sb;
3432 copy.state &= ~State_Enabled;
3435 copy.palette = pal2;
3442 copy.state &= ~State_Sunken;
3449 copy.rect.adjust(3, 0, -4, 0);
3455 copy.state = sb->state;
3459 copy.state &= ~State_Enabled;
3461 copy.palette = pal2;
3468 copy.state &= ~State_Sunken;
3475 copy.rect.adjust(3, 0, -4, 0);
3481#if QT_CONFIG(toolbutton)
3484 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
3489 State bflags = toolbutton->state & ~State_Sunken;
3493 bflags &= ~State_Raised;
3496 State mflags = bflags;
3507 tool.
state = bflags;
3514 fr.QStyleOption::operator=(*toolbutton);
3528 tool.
rect = menuarea;
3529 tool.
state = mflags;
3535 QRect ir = toolbutton->rect;
3537 newBtn.
rect =
QRect(ir.right() + 5 - mbi, ir.y() + ir.height() - mbi + 4, mbi - 6, mbi - 6);
3548 QColor left = tb->palette.highlight().color();
3553 QPoint p1(tb->rect.x(), tb->rect.top() + tb->rect.height()/2);
3554 QPoint p2(tb->rect.right(), tb->rect.top() + tb->rect.height()/2);
3556 lg.setColorAt(0,
left);
3557 lg.setColorAt(1,
right);
3565 p->setPen(tb->palette.highlightedText().color());
3566 p->drawText(ir.x() + 2, ir.y(), ir.width() - 2, ir.height(),
3578#if QT_CONFIG(dockwidget)
3579 || qobject_cast<const QDockWidget *>(
widget)
3637 if (drawNormalButton) {
3701 if (!tb->icon.isNull()) {
3702 tb->icon.paint(
p, ir);
3715 if (
const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
3723 int width = dial->rect.width();
3724 int height = dial->rect.height();
3727 qreal dx = dial->rect.x() + d_ + (
width - 2 *
r) / 2 + 1;
3728 qreal dy = dial->rect.y() + d_ + (
height - 2 *
r) / 2 + 1;
3729 QRect br =
QRect(
int(dx),
int(dy),
int(
r * 2 - 2 * d_ - 2),
int(
r * 2 - 2 * d_ - 2));
3735 p->drawLines(QStyleHelper::calcLines(dial));
3746 p->drawArc(br, 60 * 16, 180 * 16);
3748 p->drawArc(br, 240 * 16, 180 * 16);
3751 const StaticPolygonF<3> arrow = calcArrow(dial,
a);
3755 p->drawPolygon(arrow.cbegin(), arrow.size());
3760 if (a <= 0 || a > 200) {
3762 p->drawLine(arrow[2], arrow[0]);
3763 p->drawLine(arrow[1], arrow[2]);
3765 p->drawLine(arrow[0], arrow[1]);
3766 }
else if (
a > 0 &&
a < 45) {
3768 p->drawLine(arrow[2], arrow[0]);
3770 p->drawLine(arrow[1], arrow[2]);
3771 p->drawLine(arrow[0], arrow[1]);
3772 }
else if (
a >= 45 &&
a < 135) {
3774 p->drawLine(arrow[2], arrow[0]);
3775 p->drawLine(arrow[1], arrow[2]);
3777 p->drawLine(arrow[0], arrow[1]);
3778 }
else if (
a >= 135 &&
a < 200) {
3780 p->drawLine(arrow[2], arrow[0]);
3782 p->drawLine(arrow[0], arrow[1]);
3783 p->drawLine(arrow[1], arrow[2]);
3788 fropt.
rect = dial->rect;
3789 fropt.state = dial->state;
3790 fropt.palette = dial->palette;
3792 br.adjust(0, 0, 2, 2);
3795 br.translate(-
r / 6, -
r / 6);
3796 br.setWidth(br.width() +
r / 3);
3797 br.setHeight(br.height() +
r / 3);
3799 fropt.rect = br.adjusted(-2, -2, 2, 2);
3805#if QT_CONFIG(groupbox)
3813 frame.QStyleOption::operator=(*groupBox);
3825 finalRect.
adjust(ltr ? -4 : 0, 0, ltr ? 0 : 4, 0);
3829 region -= finalRect;
3831 p->setClipRegion(region);
3839 p->setPen(textColor);
3850 fropt.QStyleOption::operator=(*groupBox);
3859 box.QStyleOption::operator=(*groupBox);
3866#if QT_CONFIG(mdiarea)
3870 btnOpt.QStyleOption::operator=(*opt);
3871 btnOpt.
state &= ~State_MouseOver;
3875 const QSize buttonIconSize(buttonIconMetric, buttonIconMetric);
3879 btnOpt.state &= ~State_Raised;
3884 btnOpt.state &= ~State_Sunken;
3896 btnOpt.state &= ~State_Raised;
3901 btnOpt.state &= ~State_Sunken;
3913 btnOpt.state &= ~State_Raised;
3918 btnOpt.state &= ~State_Sunken;
3931 qCWarning(lcCommonStyle,
"QCommonStyle::drawComplexControl: Control %d not handled", cc);
3943#if QT_CONFIG(slider)
3945 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
3947 if (
r.isValid() &&
r.contains(pt)) {
3951 if (
r.isValid() &&
r.contains(pt))
3957#if QT_CONFIG(scrollbar)
3959 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
3964 if (
r.isValid() &&
r.contains(pt)) {
3973#if QT_CONFIG(toolbutton)
3980 if (
r.isValid() &&
r.contains(pt)) {
3989#if QT_CONFIG(spinbox)
3991 if (
const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
3996 if (
r.isValid() &&
r.contains(pt)) {
4012 if (
r.isValid() &&
r.contains(pt)) {
4020#if QT_CONFIG(combobox)
4027 if (
r.isValid() &&
r.contains(pt)) {
4036#if QT_CONFIG(groupbox)
4043 if (
r.isValid() &&
r.contains(pt)) {
4058 if (
r.isValid() &&
r.contains(pt) && (
opt->subControls & ctrl)) {
4067 qCWarning(lcCommonStyle,
"QCommonStyle::hitTestComplexControl: Case %d not handled", cc);
4080#if QT_CONFIG(slider)
4082 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4092 slider->sliderPosition,
4093 (horizontal ? slider->rect.width()
4094 : slider->rect.height()) -
len,
4095 slider->upsideDown);
4097 ret.setRect(slider->rect.x() + sliderPos, slider->rect.y() + tickOffset,
len, thickness);
4099 ret.setRect(slider->rect.x() + tickOffset, slider->rect.y() + sliderPos, thickness,
len);
4103 ret.setRect(slider->rect.x(), slider->rect.y() + tickOffset,
4104 slider->rect.width(), thickness);
4106 ret.setRect(slider->rect.x() + tickOffset, slider->rect.y(),
4107 thickness, slider->rect.height());
4116#if QT_CONFIG(scrollbar)
4118 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4119 const QRect scrollBarRect = scrollbar->rect;
4124 scrollBarRect.width() : scrollBarRect.height()) - (sbextent * 2);
4128 if (scrollbar->maximum != scrollbar->minimum) {
4129 uint range = scrollbar->maximum - scrollbar->minimum;
4130 sliderlen = (
qint64(scrollbar->pageStep) * maxlen) / (
range + scrollbar->pageStep);
4133 if (sliderlen < slidermin || range > INT_MAX / 2)
4134 sliderlen = slidermin;
4135 if (sliderlen > maxlen)
4143 scrollbar->sliderPosition,
4145 scrollbar->upsideDown);
4150 int buttonWidth =
qMin(scrollBarRect.width() / 2, sbextent);
4151 ret.setRect(0, 0, buttonWidth, scrollBarRect.height());
4153 int buttonHeight =
qMin(scrollBarRect.height() / 2, sbextent);
4154 ret.setRect(0, 0, scrollBarRect.width(), buttonHeight);
4159 int buttonWidth =
qMin(scrollBarRect.width()/2, sbextent);
4160 ret.setRect(scrollBarRect.width() - buttonWidth, 0, buttonWidth, scrollBarRect.height());
4162 int buttonHeight =
qMin(scrollBarRect.height()/2, sbextent);
4163 ret.setRect(0, scrollBarRect.height() - buttonHeight, scrollBarRect.width(), buttonHeight);
4168 ret.setRect(sbextent, 0, sliderstart - sbextent, scrollBarRect.height());
4170 ret.setRect(0, sbextent, scrollBarRect.width(), sliderstart - sbextent);
4174 ret.setRect(sliderstart + sliderlen, 0,
4175 maxlen - sliderstart - sliderlen + sbextent, scrollBarRect.height());
4177 ret.setRect(0, sliderstart + sliderlen, scrollBarRect.width(),
4178 maxlen - sliderstart - sliderlen + sbextent);
4182 ret.setRect(sbextent, 0, scrollBarRect.width() - sbextent * 2,
4183 scrollBarRect.height());
4185 ret.setRect(0, sbextent, scrollBarRect.width(),
4186 scrollBarRect.height() - sbextent * 2);
4190 ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());
4192 ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);
4201#if QT_CONFIG(spinbox)
4203 if (
const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
4206 bs.setHeight(
qMax(8, spinbox->rect.height()/2 - fw));
4208 bs.setWidth(
qMax(16,
qMin(bs.height() * 8 / 5, spinbox->rect.width() / 4)));
4209 int y = fw + spinbox->rect.y();
4211 x = spinbox->rect.x() + spinbox->rect.width() - fw - bs.width();
4224 ret =
QRect(
x,
y + bs.height(), bs.width(), bs.height());
4228 ret =
QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw);
4230 ret =
QRect(lx, fw,
rx, spinbox->rect.height() - 2*fw);
4234 ret = spinbox->rect;
4243#if QT_CONFIG(toolbutton)
4253 ret.adjust(0, 0, -mbi, 0);
4259 ret.adjust(
ret.width() - mbi, 0, 0, 0);
4268#if QT_CONFIG(combobox)
4272 const int x =
cb->rect.x(),
y =
cb->rect.y(), wi =
cb->rect.width(), he =
cb->rect.height();
4300 const int controlMargin = 2;
4301 const int controlHeight = tb->rect.height() - controlMargin *2;
4302 const int delta = controlHeight + controlMargin;
4313 ret.adjust(delta, 0, -delta, 0);
4315 ret.adjust(0, 0, -delta, 0);
4317 ret.adjust(0, 0, -delta, 0);
4319 ret.adjust(0, 0, -delta, 0);
4321 ret.adjust(0, 0, -delta, 0);
4365 ret.setRect(tb->rect.right() -
offset, tb->rect.top() + controlMargin,
4366 controlHeight, controlHeight);
4370 ret.setRect(tb->rect.left() + controlMargin, tb->rect.top() + controlMargin,
4371 controlHeight, controlHeight);
4380#if QT_CONFIG(groupbox)
4394 topMargin = topHeight / 2;
4400 frameRect.
setTop(topMargin);
4410 ret = frameRect.
adjusted(frameWidth, frameWidth + topHeight - topMargin,
4411 -frameWidth, -frameWidth);
4426 int checkBoxWidth = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0;
4427 int checkBoxHeight = hasCheckBox ? indicatorHeight : 0;
4429 int h =
qMax(th, checkBoxHeight);
4442 left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth);
4443 int top = totalRect.top() + (
h - checkBoxHeight) / 2;
4444 totalRect.setRect(
left,
top, indicatorWidth, indicatorHeight);
4447 left = ltr ? (totalRect.left() + checkBoxWidth - 2) : totalRect.left();
4448 int top = totalRect.top() + (
h - th) / 2;
4449 totalRect.setRect(
left,
top, totalRect.width() - checkBoxWidth, th);
4462#if QT_CONFIG(mdiarea)
4465 int numSubControls = 0;
4472 if (numSubControls == 0)
4475 int buttonWidth =
opt->
rect.
width() / numSubControls - 1;
4480 if (numSubControls == 1)
4482 offset += buttonWidth + 2;
4488 if (numSubControls == 1 || (numSubControls == 2 && !(
opt->subControls &
SC_MdiMinButton)))
4500 if (numSubControls == 1)
4507 qCWarning(lcCommonStyle,
"QCommonStyle::subControlRect: Case %d not handled", cc);
4509#if !QT_CONFIG(slider) && !QT_CONFIG(spinbox) && !QT_CONFIG(toolbutton) && !QT_CONFIG(groupbox)
4534#if QT_CONFIG(dockwidget)
4535 }
else if (qobject_cast<const QDockWidget*>(
widget)) {
4596#if QT_CONFIG(scrollbar)
4598 if (qstyleoption_cast<const QStyleOptionSlider *>(
opt))
4608#if QT_CONFIG(slider)
4614 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4615 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height()
4618 int ticks = sl->tickPosition;
4621 ret = (space - thickness) / 2;
4623 ret = space - thickness;
4632 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4642#if QT_CONFIG(dockwidget)
4667#if QT_CONFIG(toolbar)
4693#if QT_CONFIG(tabbar)
4712 const QStyleOptionTab *tb = qstyleoption_cast<const QStyleOptionTab *>(
opt);
4808#if QT_CONFIG(filedialog)
4809 if (qobject_cast<const QSidebar *>(
widget))
4892 switch (contentsType) {
4894 if (
const auto *buttonOpt = qstyleoption_cast<const QStyleOptionButton *>(
opt)) {
4899 width += buttonMargin + defaultFrameWidth;
4900 height += buttonMargin + defaultFrameWidth;
4905 width += buttonIndicator;
4906 height += buttonIndicator;
4913 if (
const auto *buttonOpt = qstyleoption_cast<const QStyleOptionButton *>(
opt)) {
4924 if (!buttonOpt->icon.isNull() || !buttonOpt->text.isEmpty()) {
4935 if (
const auto *menuItemOpt = qstyleoption_cast<const QStyleOptionMenuItem *>(
opt)) {
4936 const bool checkable = menuItemOpt->menuHasCheckableItems;
4937 const int maxpmw = menuItemOpt->maxIconWidth;
4944 height = menuItemOpt->fontMetrics.height() + 8;
4945 if (!menuItemOpt->icon.isNull()) {
4948 menuItemOpt->icon.actualSize(
QSize(iconExtent,
4949 iconExtent)).
height() + 4);
4952 if (menuItemOpt->text.contains(u
'\t'))
4955 width += maxpmw + 6;
4956 if (checkable && maxpmw < 20)
4957 width += 20 - maxpmw;
4958 if (checkable || maxpmw > 0)
4965#if QT_CONFIG(toolbutton)
4970#if QT_CONFIG(combobox)
4972 if (
const auto *comboBoxOpt = qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
4979 const int other =
qMax(23, 2 * textMargins
4988 if (
const auto *headerOpt = qstyleoption_cast<const QStyleOptionHeader *>(
opt)) {
4989 const bool nullIcon = headerOpt->icon.isNull();
4994 const QSize textSize = headerOpt->fontMetrics.size(0, headerOpt->text);
4997 + (headerOpt->text.isNull() ? 0 : margin) + textSize.width() + margin);
5001 size.rwidth() +=
size.height() + margin;
5003 size.rheight() +=
size.width() + margin;
5011 if (
const auto *frameOpt = qstyleoption_cast<const QStyleOptionFrame *>(
opt))
5012 size +=
QSize(2 * frameOpt->lineWidth, 2 * frameOpt->lineWidth);
5014#if QT_CONFIG(groupbox)
5016 if (
const auto *groupBoxOpt = qstyleoption_cast<const QStyleOptionGroupBox *>(
opt))
5021 if (
const auto *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(
opt)) {
5025 width += buttonSize + 1;
5027 width += buttonSize + 1;
5029 width += buttonSize + 1;
5033 size =
QSize(1 + 3 * (buttonSize + 1), buttonSize);
5036#if QT_CONFIG(itemviews)
5038 if (
const auto *viewItemOpt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
5039 QRect decorationRect, displayRect, checkRect;
5040 d->viewItemLayout(viewItemOpt, &checkRect, &decorationRect, &displayRect,
true);
5041 size = (decorationRect|displayRect|checkRect).
size();
5042 if (decorationRect.isValid() &&
size.height() == decorationRect.height())
5043 size.rheight() += 2;
5049#if QT_CONFIG(spinbox)
5051 if (
const auto *spinBoxOpt = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
5059 size +=
QSize(buttonWidth + 2 * frameWidth, 2 * frameWidth);
5098#if QT_CONFIG(dialogbuttonbox)
5103#if QT_CONFIG(groupbox)
5163#if defined(Q_OS_DARWIN)
5180 ret =
hint.toChar().unicode();
5244#if QT_CONFIG(rubberband)
5246 if (
const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(
opt)) {
5293#if QT_CONFIG(dialogbuttonbox)
5320#if QT_CONFIG(tabwidget)
5334 vret->variant =
fmt;
5337#if QT_CONFIG(wizard)
5342#if QT_CONFIG(formlayout)
5362#if QT_CONFIG(tabbar)
5387#if QT_CONFIG(tooltip)
5398#if QT_CONFIG(treeview)
5399 if (qobject_cast<const QTreeView*>(
widget)) {
5410#if QT_CONFIG(itemviews)
5487#if QT_CONFIG(imageformat_xpm)
5488static QPixmap cachedPixmapFromXPM(
const char *
const *xpm)
5499static inline QPixmap titleBarMenuCachedPixmapFromXPM() {
return cachedPixmapFromXPM(
qt_menu_xpm); }
5502#if QT_CONFIG(imageformat_png)
5503static constexpr QLatin1StringView iconResourcePrefix() noexcept {
return ":/qt-project.org/styles/commonstyle/images/"_L1; }
5504static constexpr QLatin1StringView iconPngSuffix() noexcept {
return ".png"_L1; }
5506template <
typename T>
5510 const auto fullPrefix = iconResourcePrefix() + prefix;
5516static constexpr auto dockTitleIconSizes = {10, 16, 20, 32, 48, 64};
5517static constexpr auto titleBarSizes = {16, 32, 48};
5518static constexpr auto toolBarExtHSizes = {8, 16, 32, 128};
5519static constexpr auto toolBarExtVSizes = {5, 10, 20, 80};
5520static constexpr auto pngIconSizes = {16, 32, 128};
5546#ifndef QT_NO_IMAGEFORMAT_XPM
5561 return titleBarMenuCachedPixmapFromXPM();
5602 switch (standardIcon) {
5641 pixmap = theme->standardPixmap(spOn, pixSize);
5661 switch (standardIcon) {
5764 if (!linkIcon.isNull() || !baseIcon.isNull()) {
5771 const auto w =
size.width() / 2;
5804 switch (standardIcon) {
5819 constexpr auto imagesPrefix =
":/qt-project.org/styles/macstyle/images/"_L1;
5823 for (
const auto size : dockTitleIconSizes) {
5826 titleBarIcon.addFile(imagesPrefix + namePrefix +
"down-macstyle-"_L1 +
QString::number(
size)
5829 return titleBarIcon;
5863 retIcon.addPixmap(mainIcon);
5886#ifndef QT_NO_IMAGEFORMAT_PNG
5887 switch (standardIcon) {
5889 addIconFiles(u
"information-", pngIconSizes,
icon);
5892 addIconFiles(u
"warning-", pngIconSizes,
icon);
5895 addIconFiles(u
"critical-", pngIconSizes,
icon);
5898 addIconFiles(u
"question-", pngIconSizes,
icon);
5901 addIconFiles(u
"filedialog_start-", pngIconSizes,
icon);
5904 addIconFiles(u
"filedialog_end-", pngIconSizes,
icon);
5907 addIconFiles(u
"titlebar-min-", titleBarSizes,
icon);
5910 addIconFiles(u
"titlebar-max-", titleBarSizes,
icon);
5913 addIconFiles(u
"titlebar-shade-", titleBarSizes,
icon);
5916 addIconFiles(u
"titlebar-unshade-", titleBarSizes,
icon);
5919 addIconFiles(u
"titlebar-contexthelp-", titleBarSizes,
icon);
5922 addIconFiles(u
"newdirectory-", pngIconSizes,
icon);
5929 addIconFiles(u
"viewdetailed-", pngIconSizes,
icon);
5932 addIconFiles(u
"fileinfo-", pngIconSizes,
icon);
5935 addIconFiles(u
"filecontents-", pngIconSizes,
icon);
5938 addIconFiles(u
"viewlist-", pngIconSizes,
icon);
5941 addIconFiles(u
"standardbutton-ok-", pngIconSizes,
icon);
5944 addIconFiles(u
"standardbutton-cancel-", pngIconSizes,
icon);
5947 addIconFiles(u
"standardbutton-help-", pngIconSizes,
icon);
5950 addIconFiles(u
"standardbutton-open-", pngIconSizes,
icon);
5953 addIconFiles(u
"standardbutton-save-", pngIconSizes,
icon);
5956 addIconFiles(u
"standardbutton-close-", pngIconSizes,
icon);
5959 addIconFiles(u
"standardbutton-apply-", pngIconSizes,
icon);
5962 addIconFiles(u
"standardbutton-clear-", pngIconSizes,
icon);
5965 addIconFiles(u
"standardbutton-delete-", pngIconSizes,
icon);
5968 addIconFiles(u
"standardbutton-yes-", pngIconSizes,
icon);
5971 addIconFiles(u
"standardbutton-no-", pngIconSizes,
icon);
5983 addIconFiles(u
"left-", pngIconSizes,
icon);
5986 addIconFiles(u
"right-", pngIconSizes,
icon);
5989 addIconFiles(u
"up-", pngIconSizes,
icon);
5992 addIconFiles(u
"down-", pngIconSizes,
icon);
6000 addIconFiles(u
"diropen-", pngIconSizes,
icon);
6003 addIconFiles(u
"dirclosed-", pngIconSizes,
icon);
6006 addIconFiles(u
"dirlink-", pngIconSizes,
icon);
6009 addIconFiles(u
"cdr-", pngIconSizes,
icon);
6012 addIconFiles(u
"floppy-", pngIconSizes,
icon);
6015 addIconFiles(u
"harddrive-", pngIconSizes,
icon);
6018 addIconFiles(u
"dvd-", pngIconSizes,
icon);
6021 addIconFiles(u
"networkdrive-", pngIconSizes,
icon);
6024 addIconFiles(u
"file-", pngIconSizes,
icon);
6027 addIconFiles(u
"filelink-", pngIconSizes,
icon);
6030 addIconFiles(u
"desktop-", {16, 32},
icon);
6033 addIconFiles(u
"trash-", pngIconSizes,
icon);
6036 addIconFiles(u
"computer-", {16, 32},
icon);
6039 addIconFiles(u
"refresh-", {24, 32},
icon);
6042 addIconFiles(u
"stop-", {24, 32},
icon);
6045 addIconFiles(u
"media-play-", pngIconSizes,
icon);
6048 addIconFiles(u
"media-pause-", pngIconSizes,
icon);
6051 addIconFiles(u
"media-stop-", pngIconSizes,
icon);
6054 addIconFiles(u
"media-seek-forward-", pngIconSizes,
icon);
6057 addIconFiles(u
"media-seek-backward-", pngIconSizes,
icon);
6060 addIconFiles(u
"media-skip-forward-", pngIconSizes,
icon);
6063 addIconFiles(u
"media-skip-backward-", pngIconSizes,
icon);
6066 addIconFiles(u
"media-volume-", {16},
icon);
6069 addIconFiles(u
"media-volume-muted-", {16},
icon);
6073 addIconFiles(u
"closedock-", dockTitleIconSizes,
icon);
6076# ifndef QT_NO_IMAGEFORMAT_XPM
6079 icon.
addFile(
":/qt-project.org/qmessagebox/images/qtlogo-64.png"_L1);
6082 addIconFiles(u
"normalizedockup-", dockTitleIconSizes,
icon);
6085 addIconFiles(
rtl(
option) ? u
"toolbar-ext-h-rtl-" : u
"toolbar-ext-h-", toolBarExtHSizes,
icon);
6088 addIconFiles(u
"toolbar-ext-v-", toolBarExtVSizes,
icon);
6096 addIconFiles(u
"cleartext-", pngIconSizes,
icon);
6135#ifndef QT_NO_IMAGEFORMAT_XPM
6153 return (77 *
r + 150 *
g + 28 *
b) / 255;
6169 uchar reds[256], greens[256], blues[256];
6170 for (
int i=0;
i<128; ++
i) {
6175 for (
int i=0;
i<128; ++
i) {
6182 const int factor = 191;
6190 intensity =
qMin(255, intensity + 91);
6191 else if (intensity <= 128)
6197 QRgb pixel = *scanLine;
6201 *scanLine =
qRgba(reds[ci], greens[ci], blues[ci],
qAlpha(pixel));
6273 d->tabBarcloseButtonIcon =
QIcon();
6280#include "moc_qcommonstyle.cpp"
void stop()
Stops the animation.
void start(QAbstractAnimation::DeletionPolicy policy=KeepWhenStopped)
Starts the animation.
The QApplication class manages the GUI application's control flow and main settings.
const QColor & color() const
Returns the brush color.
The QColor class provides colors based on RGB, HSV or CMYK values.
void setAlphaF(float alpha)
Sets the alpha of this color to alpha.
QRgb rgba() const noexcept
Returns the RGB value of the color, including its alpha.
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.
void getHsv(int *h, int *s, int *v, int *a=nullptr) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
QIcon iconFromMacTheme(QCommonStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
QString calculateElidedText(const QString &text, const QTextOption &textOption, const QFont &font, const QRect &textRect, const Qt::Alignment valign, Qt::TextElideMode textElideMode, int flags, bool lastVisibleLineShouldBeElided, QPointF *paintStartPosition) const
QIcon iconFromResourceTheme(QCommonStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
static bool rtl(const QStyleOption *option)
QIcon iconFromApplicationTheme(QCommonStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
QIcon iconFromWindowsTheme(QCommonStyle::StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
~QCommonStyle()
Destroys the style.
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
QCommonStyle()
Constructs a QCommonStyle.
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
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=nullptr) const override
\reimp
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
\reimp
int styleHint(StyleHint sh, const QStyleOption *opt=nullptr, const QWidget *w=nullptr, QStyleHintReturn *shret=nullptr) const override
\reimp
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
\reimp
void polish(QPalette &) override
\reimp
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=nullptr) const 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
int height() const
Returns the height of the font.
QRect boundingRect(QChar) const
Returns the rectangle that is covered by ink if character ch were to be drawn at the origin of the co...
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
int midLineWidth
the width of the mid-line
int lineWidth
the line width
static QPlatformTheme * platformTheme()
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.; otherwise returns false.
QIcon windowIcon
the default window icon
The QIcon class provides scalable icons in different modes and states.
static bool hasThemeIcon(const QString &name)
static QString themeName()
void addPixmap(const QPixmap &pixmap, Mode mode=Normal, State state=Off)
Adds pixmap to the icon, as a specialization for mode and state.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
qint64 cacheKey() const
Returns a number that identifies the contents of this QIcon object.
void addFile(const QString &fileName, const QSize &size=QSize(), Mode mode=Normal, State state=Off)
Adds an image from the file with the given fileName to the icon, as a specialization for size,...
State
This enum describes the state for which a pixmap is intended to be used.
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.
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.
static QIcon fromTheme(const QString &name)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
int width() const
Returns the width of the image.
int height() const
Returns the height of the image.
@ Format_ARGB32_Premultiplied
QImage mirrored(bool horizontally=false, bool vertically=true) const &
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
constexpr int bottom() const noexcept
Returns the bottom margin.
constexpr int left() const noexcept
Returns the left margin.
constexpr int right() const noexcept
Returns the right margin.
constexpr int top() const noexcept
Returns the top margin.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
qreal devicePixelRatio() const
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
The QPainter class performs low-level painting on widgets and other paint devices.
void restore()
Restores the current painter state (pops a saved state off the stack).
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void save()
Saves the current painter state (pushes the state onto a stack).
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.
@ CompositionMode_SourceAtop
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
The QPalette class contains color groups for each widget state.
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 & toolTipBase() const
const QBrush & windowText() const
Returns the window text (general 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 & toolTipText() const
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 QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
const QBrush & mid() const
Returns the mid brush of the current color group.
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.
ColorGroup
\value Disabled \value Active \value Inactive \value Normal synonym for Active
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 & buttonText() const
Returns the button text foreground brush of the current color group.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
void setWidth(int width)
Sets the pen width to the given width in pixels with integer precision.
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
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.
QSize size() const
Returns the size of the pixmap.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
int width() const
Returns the width of the pixmap.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the pixmap.
qreal devicePixelRatio() const
Returns the device pixel ratio for 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.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
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 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...
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.
QRect intersected(const QRect &other) const noexcept
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr void setRight(int pos) noexcept
Sets the right edge of the rectangle to the given x coordinate.
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 void setLeft(int pos) noexcept
Sets the left edge of the rectangle to the given x coordinate.
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 setWidth(int w) noexcept
Sets the width of the rectangle to the given width.
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 void setCoords(int x1, int y1, int x2, int y2) noexcept
Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its botto...
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.
QRect united(const QRect &other) const noexcept
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr void setTop(int pos) noexcept
Sets the top edge of the rectangle to the given y coordinate.
The QRegion class specifies a clip region for a painter.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr QSize transposed() const noexcept
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
void chop(qsizetype n)
Removes n characters from the end of the string.
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
The QStyleHintReturnMask class provides style hints that return a QRegion.
The QStyleHintReturnVariant class provides style hints that return a QVariant.
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionToolButton::features
\variable QStyleOptionMenuItem::menuItemType
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
\variable QStyleOptionFrame::features
\variable QStyleOptionButton::features
\variable QStyleOptionToolBox::selectedPosition
The QStyleOption class stores the parameters used by QStyle functions.
Qt::LayoutDirection direction
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
@ State_KeyboardFocusChange
ContentsType
This enum describes the available contents types.
virtual void polish(QWidget *widget)
Initializes the appearance of the given widget.
virtual QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
Returns the area within the given rectangle in which to draw the specified pixmap according to the de...
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment)
Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLe...
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
StyleHint
This enum describes the available style hints.
@ SH_TitleBar_ShowToolTipsOnButtons
@ SH_ComboBox_ListMouseTracking
@ SH_GroupBox_TextLabelColor
@ SH_TabBar_CloseButtonPosition
@ SH_Slider_PageSetButtons
@ SH_ScrollView_FrameOnlyAroundContents
@ SH_Splitter_OpaqueResize
@ SH_MainWindow_SpaceBelowMenuBar
@ SH_ProgressDialog_CenterCancelButton
@ SH_SpinBox_AnimateButton
@ SH_Menu_SubMenuUniDirectionFailCount
@ SH_TextControl_FocusIndicatorTextCharFormat
@ SH_MessageBox_UseBorderForButtonSpacing
@ SH_SpinBox_ClickAutoRepeatRate
@ SH_ItemView_PaintAlternatingRowColorsForEmptyArea
@ SH_ComboBox_UseNativePopup
@ SH_ItemView_ChangeHighlightOnFocus
@ SH_SpinBox_KeyPressAutoRepeatRate
@ SH_ItemView_MovementWithoutUpdatingSelection
@ SH_MenuBar_AltKeyNavigation
@ SH_Menu_SubMenuUniDirection
@ SH_ScrollBar_RollBetweenButtons
@ SH_TabBar_AllowWheelScrolling
@ SH_SpinControls_DisableOnBounds
@ SH_ScrollBar_MiddleClickAbsolutePosition
@ SH_Menu_FlashTriggeredItem
@ SH_Menu_SubMenuPopupDelay
@ SH_ItemView_ArrowKeysNavigateIntoChildren
@ SH_Slider_AbsoluteSetButtons
@ SH_Widget_Animation_Duration
@ SH_Menu_SubMenuResetWhenReenteringParent
@ SH_ComboBox_PopupFrameStyle
@ SH_Slider_SloppyKeyEvents
@ SH_TabWidget_DefaultTabPosition
@ SH_TabBar_ChangeCurrentDelay
@ SH_Header_ArrowAlignment
@ SH_ToolBox_SelectedPageTitleBold
@ SH_LineEdit_PasswordMaskDelay
@ SH_SpinBox_SelectOnStep
@ SH_TabBar_PreferNoArrows
@ SH_Menu_SupportsSections
@ SH_Menu_SubMenuSloppySelectOtherActions
@ SH_FormLayoutWrapPolicy
@ SH_Widget_ShareActivation
@ SH_ComboBox_LayoutDirection
@ SH_DialogButtons_DefaultButton
@ SH_ComboBox_AllowWheelScrolling
@ SH_ToolButton_PopupDelay
@ SH_Menu_AllowActiveAndDisabled
@ SH_SpinBox_StepModifier
@ SH_TabBar_SelectMouseType
@ SH_Menu_FillScreenWithScroll
@ SH_Table_AlwaysDrawLeftTopGridLines
@ SH_FontDialog_SelectAssociatedText
@ SH_ToolTipLabel_Opacity
@ SH_ScrollBar_LeftClickAbsolutePosition
@ SH_DialogButtonBox_ButtonsHaveIcons
@ SH_MenuBar_MouseTracking
@ SH_FormLayoutFieldGrowthPolicy
@ SH_SpinBox_ClickAutoRepeatThreshold
@ SH_ScrollBar_ContextMenu
@ SH_FormLayoutFormAlignment
@ SH_Menu_SubMenuDontStartSloppyOnLeave
@ SH_MessageBox_CenterButtons
@ SH_TitleBar_ModifyNotification
@ SH_Slider_StopMouseOverSlider
@ SH_DrawMenuBarSeparator
@ SH_RequestSoftwareInputPanel
@ SH_LineEdit_PasswordCharacter
@ SH_SpinBox_ButtonsInsideFrame
@ SH_ItemView_DrawDelegateFrame
@ SH_GroupBox_TextLabelVerticalAlignment
@ SH_ScrollBar_ScrollWhenPointerLeavesControl
@ SH_ToolTip_FallAsleepDelay
@ SH_PrintDialog_RightAlignButtons
@ SH_BlinkCursorWhenTextSelected
@ SH_ListViewExpand_SelectMouseType
@ SH_ItemView_EllipsisLocation
@ SH_ItemView_ActivateItemOnSingleClick
@ SH_MessageBox_TextInteractionFlags
@ SH_RichText_FullWidthSelection
@ SH_FormLayoutLabelAlignment
@ SH_ItemView_ShowDecorationSelected
@ SH_DockWidget_ButtonsHaveFrame
@ SH_Menu_SpaceActivatesItem
@ SH_FocusFrame_AboveWidget
@ SH_ProgressDialog_TextLabelAlignment
@ SH_Menu_SubMenuSloppyCloseTimeout
@ SH_Workspace_FillSpaceOnMaximize
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
virtual ~QStyle()
Destroys the style object.
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,...
virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
Returns the area within the given rectangle in which to draw the provided text according to the speci...
StandardPixmap
This enum describes the available standard pixmaps.
@ SP_DockWidgetCloseButton
@ SP_TitleBarContextHelpButton
@ SP_TitleBarNormalButton
@ SP_FileDialogDetailedView
@ SP_MessageBoxInformation
@ SP_FileDialogContentsView
@ SP_TitleBarUnshadeButton
@ SP_ToolBarVerticalExtensionButton
@ SP_ToolBarHorizontalExtensionButton
ControlElement
This enum represents a control element.
static QRect alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rectangle)
Returns a new rectangle of the specified size that is aligned to the given rectangle according to the...
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const =0
Returns the sub-area for the given element as described in the provided style option.
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
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.
PixelMetric
This enum describes the various available pixel metrics.
@ PM_TabBar_ScrollButtonOverlap
@ PM_TitleBarButtonIconSize
@ PM_DockWidgetFrameWidth
@ PM_DockWidgetTitleMargin
@ PM_ExclusiveIndicatorHeight
@ PM_ButtonShiftHorizontal
@ PM_MdiSubWindowFrameWidth
@ PM_DockWidgetTitleBarButtonMargin
@ PM_ToolBarSeparatorExtent
@ PM_HeaderDefaultSectionSizeHorizontal
@ PM_ScrollView_ScrollBarOverlap
@ PM_DockWidgetSeparatorExtent
@ PM_TabCloseIndicatorWidth
@ PM_CheckBoxLabelSpacing
@ PM_LayoutVerticalSpacing
@ PM_TabBarTabShiftVertical
@ PM_LayoutHorizontalSpacing
@ PM_SliderTickmarkOffset
@ PM_ButtonDefaultIndicator
@ PM_SliderControlThickness
@ PM_SliderSpaceAvailable
@ PM_MenuDesktopFrameWidth
@ PM_ProgressBarChunkWidth
@ PM_TabBarScrollButtonWidth
@ PM_DockWidgetHandleExtent
@ PM_ToolBarExtensionExtent
@ PM_TabCloseIndicatorHeight
@ PM_HeaderDefaultSectionSizeVertical
@ PM_RadioButtonLabelSpacing
@ PM_TabBarTabShiftHorizontal
@ PM_ScrollView_ScrollBarSpacing
@ PM_MdiSubWindowMinimizedWidth
@ PM_ExclusiveIndicatorWidth
@ PM_ToolTipLabelFrameWidth
ComplexControl
This enum describes the available complex controls.
PrimitiveElement
This enum describes the various primitive elements.
@ PE_IndicatorToolBarHandle
@ PE_IndicatorHeaderArrow
@ PE_PanelScrollAreaCorner
@ PE_IndicatorButtonDropDown
@ PE_IndicatorProgressChunk
@ PE_IndicatorColumnViewArrow
@ PE_IndicatorItemViewItemDrop
@ PE_IndicatorRadioButton
@ PE_IndicatorToolBarSeparator
@ PE_IndicatorMenuCheckMark
@ PE_IndicatorItemViewItemCheck
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given element with the provided painter with the style options specified by option.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
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.
virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const =0
virtual void unpolish(QWidget *widget)
Uninitialize the given {widget}'s appearance.
SubElement
This enum represents a sub-area of a widget.
@ SE_TreeViewDisclosureItem
@ SE_TabBarTabRightButton
@ SE_ItemViewItemDecoration
@ SE_ItemViewItemFocusRect
@ SE_TabWidgetRightCorner
@ SE_ItemViewItemCheckIndicator
@ SE_RadioButtonFocusRect
@ SE_DockWidgetTitleBarText
@ SE_TabBarScrollRightButton
@ SE_TabBarScrollLeftButton
@ SE_DockWidgetFloatButton
@ SE_RadioButtonIndicator
@ SE_RadioButtonClickRect
@ SE_DockWidgetCloseButton
@ SE_TabWidgetTabContents
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
const QStyle * proxy() const
SubControl
This enum describes the available sub controls.
@ SC_TitleBarUnshadeButton
@ SC_TitleBarNormalButton
@ SC_ComboBoxListBoxPopup
@ SC_TitleBarContextHelpButton
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
QTextLine createLine()
Returns a new text line to be laid out if there is text to be inserted into the layout; otherwise ret...
void beginLayout()
Begins the layout process.
QString text() const
Returns the layout's text.
int lineCount() const
Returns the number of lines in this text layout.
QTextLine lineAt(int i) const
Returns the {i}-th line of text in this text layout.
void setTextOption(const QTextOption &option)
Sets the text option structure that controls the layout process to the given option.
void draw(QPainter *p, const QPointF &pos, const QList< FormatRange > &selections=QList< FormatRange >(), const QRectF &clip=QRectF()) const
Draws the whole layout on the painter p at the position specified by pos.
void endLayout()
Ends the layout process.
QRectF boundingRect() const
The smallest rectangle that contains all the lines in the layout.
qreal height() const
Returns the line's height.
bool isValid() const
Returns true if this text line is valid; otherwise returns false.
void setTextDirection(Qt::LayoutDirection aDirection)
Sets the direction of the text layout defined by the option to the given direction.
void setWrapMode(WrapMode wrap)
Sets the option's text wrap mode to the given mode.
void setAlignment(Qt::Alignment alignment)
Sets the option's text alignment to the specified alignment.
QStyleOptionButton subopt
[2]
const QStyleOptionButton * btn
[3]
struct wl_display * display
Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi)
Q_WIDGETS_EXPORT qreal dpi(const QStyleOption *option)
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size, qreal dpr)
Combined button and popup list for selecting options.
@ WindowContextHelpButtonHint
@ WindowMaximizeButtonHint
@ WindowMinimizeButtonHint
@ ToolButtonTextUnderIcon
static jboolean copy(JNIEnv *, jobject)
static QString wrapText(const QString &names, int optionNameMaxWidth, const QString &description)
static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth, int maxHeight=-1, int *lastVisibleLine=nullptr)
static uint qt_intensity(uint r, uint g, uint b)
static qreal qt_getDevicePixelRatio(const QWidget *widget)
static const char *const filedialog_end_xpm[]
static const char *const tb_extension_arrow_v_xpm[]
static const char *const information_xpm[]
static const char *const qt_help_xpm[]
static const char *const tb_extension_arrow_h_xpm[]
static const char *const qt_normalizeup_xpm[]
static const char *const qt_shade_xpm[]
static const char *const dock_widget_close_xpm[]
static const char *const qt_unshade_xpm[]
static const char *const qt_menu_xpm[]
static const char *const warning_xpm[]
static const char *const qt_minimize_xpm[]
static const char *const filedialog_start_xpm[]
static const char *const question_xpm[]
static const char *const critical_xpm[]
static const char *const qt_close_xpm[]
static const char *const qt_maximize_xpm[]
AudioChannelLayoutTag tag
static QString header(const QString &name)
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
void qDrawWinPanel(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)
void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
int qRound(qfloat16 d) noexcept
static QByteArray cacheKey(Args &&...args)
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
static QT_BEGIN_NAMESPACE const qreal Q_PI
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
static QString themeName()
GLint GLfloat GLfloat GLfloat v2
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * label
[43]
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei const GLint * box
GLfloat GLfloat GLfloat GLfloat h
GLfixed GLfixed GLint GLint GLfixed points
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
static const QRectF boundingRect(const QPointF *points, int pointCount)
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
static void stopAnimation(QObject *object)
static bool isWindow(QObject *object)
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr int qGray(int r, int g, int b)
constexpr QRgb qRgba(int r, int g, int b, int a)
constexpr int qAlpha(QRgb rgb)
Int aligned(Int v, Int byteAlign)
static const struct TessellationWindingOrderTab cw[]
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define QStringLiteral(str)
QPixmap styleCachePixmap(const QSize &size, qreal pixelRatio)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
constexpr bool verticalTabs(QTabBar::Shape shape) noexcept
QVideoFrameFormat::PixelFormat fmt
const char className[16]
[1]
obj metaObject() -> className()
QApplication app(argc, argv)
[0]
QPainterStateSaver(QPainter *p, bool bSaveRestore=true)