12#include <QtGui/QWindow>
14#include <private/qguiapplication_p.h>
15#include <qpa/qplatformtheme.h>
22#include <private/qmath_p.h>
27#if QT_CONFIG(settings)
36#include <private/qtextengine_p.h>
37#include <QtGui/private/qhexstring_p.h>
43 return w !=
nullptr ?
w->devicePixelRatio() :
qApp->devicePixelRatio();
127 QColor bg = fropt->backgroundColor;
128 QPen oldPen =
p->pen();
140 p->drawRect(focusRect.
adjusted(0, 0, -1, -1));
146 const int markH = markW;
156 for (
i = 0;
i < markW/2; ++
i) {
157 a <<
QLineF(xx, yy, xx, yy + 2);
162 for (;
i < markH; ++
i) {
163 a <<
QLineF(xx, yy, xx, yy + 2);
211 static const int decoration_size = 9;
219 int delta = decoration_size / 2;
224 p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4);
226 p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);
227 QPen oldPen =
p->pen();
229 p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
249 QPen oldPen =
p->pen();
278 = qstyleoption_cast<const QStyleOptionTabBarBase *>(
opt)) {
280 switch (tbb->shape) {
283 p->setPen(
QPen(tbb->palette.light(), 0));
284 p->drawLine(tbb->rect.topLeft(), tbb->rect.topRight());
288 p->setPen(
QPen(tbb->palette.light(), 0));
289 p->drawLine(tbb->rect.topLeft(), tbb->rect.bottomLeft());
293 p->setPen(
QPen(tbb->palette.shadow(), 0));
294 p->drawLine(tbb->rect.left(), tbb->rect.bottom(),
295 tbb->rect.right(), tbb->rect.bottom());
296 p->setPen(
QPen(tbb->palette.dark(), 0));
297 p->drawLine(tbb->rect.left(), tbb->rect.bottom() - 1,
298 tbb->rect.right() - 1, tbb->rect.bottom() - 1);
302 p->setPen(
QPen(tbb->palette.dark(), 0));
303 p->drawLine(tbb->rect.topRight(), tbb->rect.bottomRight());
310 if (
d->tabBarcloseButtonIcon.isNull()) {
311 d->tabBarcloseButtonIcon.addPixmap(
QPixmap(
312 QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-16.png")),
314 d->tabBarcloseButtonIcon.addPixmap(
QPixmap(
315 QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-down-16.png")),
317 d->tabBarcloseButtonIcon.addPixmap(
QPixmap(
318 QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-closetab-hover-16.png")),
411 int step = (br.
width() + 4) / 5;
426 int x =
r.x(),
y =
r.y(),
w =
r.width(),
h =
r.height();
435 int sx =
x +
w / 2 - sw / 2;
436 int sy =
y +
h / 2 - sh / 2;
448 p->translate(sx + bsx, sy + bsy);
468 const bool horizontal = tab->rect.height() > tab->rect.width();
469 const int margin = 4;
473 QRect rect = tab->rect.adjusted(rtl ? margin : 0, 0, rtl ? 1 : -margin, 0);
479 for (
int jags = 1; jags <=
count; ++jags, rtl = !rtl)
482 QRect rect = tab->rect.adjusted(0, 0, 0, -margin);
488 for (
int jags = 1; jags <=
count; ++jags, rtl = !rtl)
492 p->setPen(
QPen(tab->palette.dark(),
qreal(.8)));
493 p->setBrush(tab->palette.window());
503 if (
panel->lineWidth > 0)
512 int x = viewOpt->rect.x() + 1;
513 int offset = (viewOpt->rect.height() / 3);
519 x = viewOpt->rect.x() + viewOpt->rect.width() - 1;
527 if (viewOpt->showDecorationSelected) {
561 p->drawLine(
rect.topLeft(),
rect.topRight());
586 if (vopt->backgroundBrush.style() !=
Qt::NoBrush) {
588 p->setBrushOrigin(vopt->rect.topLeft());
589 p->fillRect(vopt->rect, vopt->backgroundBrush);
590 p->setBrushOrigin(oldBO);
618 qreal pixelRatio =
p->device()->devicePixelRatioF();
651 QRect bounds =
a.boundingRect();
652 int sx = sqsize / 2 - bounds.
center().
x() - 1;
653 int sy = sqsize / 2 - bounds.
center().
y() - 1;
654 imagePainter.
translate(sx + bsx, sy + bsy);
671 pixmap.setDevicePixelRatio(pixelRatio);
674 int xOffset =
r.x() + (
r.width() -
size)/2;
675 int yOffset =
r.y() + (
r.height() -
size)/2;
676 p->drawPixmap(xOffset, yOffset,
pixmap);
712 *lastVisibleLine = -1;
721 line.setLineWidth(lineWidth);
724 widthUsed =
qMax(widthUsed,
line.naturalTextWidth());
726 if (maxHeight > 0 && lastVisibleLine &&
height +
line.height() > maxHeight) {
728 *lastVisibleLine = nextLine.
isValid() ?
i : -1;
740 bool lastVisibleLineShouldBeElided,
QPointF *paintStartPosition)
const
748 const bool vAlignmentOptimization = paintStartPosition && valign.testFlag(
Qt::AlignVCenter);
750 int lastVisibleLine = -1;
758 if (paintStartPosition)
763 const int lineCount = textLayout.
lineCount();
764 for (
int i = 0;
i < lineCount; ++
i) {
770 if (paintStartPosition)
771 paintStartPosition->
ry() +=
line.height();
778 bool elideLastVisibleLine = lastVisibleLine ==
i;
779 if (!drawElided &&
i + 1 < lineCount && lastVisibleLineShouldBeElided) {
784 elideLastVisibleLine =
true;
788 if (drawElided || elideLastVisibleLine) {
789 if (elideLastVisibleLine) {
801 if (
i < lineCount - 1 &&
810 (lastVisibleLine >= 0 && lastVisibleLine ==
i))
833 switch (
option->decorationPosition) {
839 width -=
option->decorationSize.width() + 2 * textMargin;
859 const int lineWidth = bounds.
width();
866 return option->decorationSize;
891 true, &paintPosition);
896 textLayout.
draw(
p, paintPosition);
916 const bool hasPixmap = pixmapRect->
isValid();
918 const bool hasMargin = (hasText | hasPixmap | hasCheck);
919 const int frameHMargin = hasMargin ?
921 const int textMargin = hasText ? frameHMargin : 0;
922 const int pixmapMargin = hasPixmap ? frameHMargin : 0;
923 const int checkMargin = hasCheck ? frameHMargin : 0;
935 pm = pixmapRect->
size();
936 pm.
rwidth() += 2 * pixmapMargin;
955 if (sizehint)
w +=
cw;
965 switch (
opt->decorationPosition) {
1011 qWarning(
"doLayout: decoration position is invalid");
1022 if (
opt->showDecorationSelected)
1067 tr.setRect(0, 0,
tr.height(),
tr.width());
1074 verticalShift = -verticalShift;
1075 tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding);
1078 tr.setTop(
tr.top() - verticalShift);
1079 tr.setRight(
tr.right() - horizontalShift);
1083 if (!
opt->leftButtonSize.isEmpty()) {
1084 tr.setLeft(
tr.left() + 4 +
1088 if (!
opt->rightButtonSize.isEmpty()) {
1089 tr.setRight(
tr.right() - 4 -
1106 const int offsetX = (
iconSize.width() - tabIconSize.
width()) / 2;
1107 *iconRect =
QRect(
tr.left() + offsetX,
tr.center().y() - tabIconSize.
height() / 2,
1111 tr.setLeft(
tr.left() + tabIconSize.
width() + 4);
1166 fropt.QStyleOption::operator=(*btn);
1189 int pixmapWidth =
pixmap.width() /
pixmap.devicePixelRatio();
1190 int pixmapHeight =
pixmap.height() /
pixmap.devicePixelRatio();
1191 int labelWidth = pixmapWidth;
1192 int labelHeight = pixmapHeight;
1193 int iconSpacing = 4;
1196 labelWidth += (textWidth + iconSpacing);
1201 pixmapWidth, pixmapHeight);
1216 p->drawPixmap(iconRect,
pixmap);
1249 fropt.QStyleOption::operator=(*btn);
1317 = qstyleoption_cast<const QStyleOptionProgressBar *>(
opt)) {
1323 if (pb->textVisible) {
1341 QRect shadowRect(pb->rect);
1343 QColor shadowColor = (pb->palette.color(textRole).value() <= 128)
1345 QPalette shadowPalette = pb->palette;
1346 shadowPalette.
setColor(textRole, shadowColor);
1358 const bool inverted = pb->invertedAppearance;
1371 int w =
rect.width();
1372 if (pb->minimum == 0 && pb->maximum == 0) {
1374 int x = (progress - minimum) % (
w * 2);
1387 u = ((
rect.width() + unit_width) / unit_width);
1390 qint64 p_v = progress - minimum;
1391 qint64 t_s = (maximum - minimum) ? (maximum - minimum) :
qint64(1);
1393 if (u > 0 && p_v >= INT_MAX / u && t_s >= u) {
1401 tnu = nu = p_v * u / t_s;
1403 if (nu * unit_width >
w)
1411 int x0 = reverse ?
rect.right() - ((unit_width > 1) ? unit_width : 0)
1417 int myY = pbBits.
rect.
y();
1420 for (
int i = 0;
i < nu; ++
i) {
1423 x += reverse ? -unit_width : unit_width;
1429 int pixels_left =
w - (nu * unit_width);
1430 int offset = reverse ?
x0 +
x + unit_width-pixels_left :
x0 +
x;
1449 p->drawPixmap(inter.
x(), inter.
y(),
pixmap,
1456 rect.setLeft(
rect.left() + pixw + margin);
1458 rect.setRight(
rect.right() - pixw - margin);
1471 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
1481 if (((!hasArrow && toolbutton->icon.isNull()) && !toolbutton->text.isEmpty())
1486 rect.translate(shiftX, shiftY);
1487 p->setFont(toolbutton->font);
1493 QSize pmSize = toolbutton->iconSize;
1494 if (!toolbutton->icon.isNull()) {
1503 pm = toolbutton->icon.pixmap(toolbutton->rect.size().boundedTo(toolbutton->iconSize),
1509 p->setFont(toolbutton->font);
1518 tr.adjust(0, pr.
height() - 1, 0, -1);
1528 tr.adjust(pr.
width(), 0, 0, 0);
1537 tr.translate(shiftX, shiftY);
1543 rect.translate(shiftX, shiftY);
1561 p->setPen(tb->palette.mid().color().darker(150));
1562 int d = 20 + tb->rect.height() - 3;
1565 QPoint(-1, tb->rect.height() + 1),
1567 QPoint(tb->rect.width() -
d, 1),
1568 QPoint(tb->rect.width() - 20, tb->rect.height() - 2),
1569 QPoint(tb->rect.width() - 1, tb->rect.height() - 2),
1570 QPoint(tb->rect.width() - 1, tb->rect.height() + 1),
1571 QPoint(-1, tb->rect.height() + 1),
1576 QPoint(tb->rect.width(), tb->rect.height() + 1),
1577 QPoint(tb->rect.width(), 1),
1579 QPoint(20 - 1, tb->rect.height() - 2),
1580 QPoint(0, tb->rect.height() - 2),
1581 QPoint(0, tb->rect.height() + 1),
1582 QPoint(tb->rect.width(), tb->rect.height() + 1),
1586 p->setPen(tb->palette.light().color());
1588 p->drawLine(0, 2, tb->rect.width() -
d, 2);
1589 p->drawLine(tb->rect.width() -
d - 1, 2, tb->rect.width() - 21, tb->rect.height() - 1);
1590 p->drawLine(tb->rect.width() - 20, tb->rect.height() - 1,
1591 tb->rect.width(), tb->rect.height() - 1);
1593 p->drawLine(tb->rect.width() - 1, 2,
d - 1, 2);
1594 p->drawLine(
d, 2, 20, tb->rect.height() - 1);
1595 p->drawLine(19, tb->rect.height() - 1,
1596 -1, tb->rect.height() - 1);
1617 switch (tab->shape) {
1619 rect.adjust(0, 0, 0, -tabOverlap);
1621 rect.adjust(1, 1, -1, 0);
1624 rect.adjust(0, tabOverlap, 0, 0);
1626 rect.adjust(1, 0, -1, -1);
1629 rect.adjust(tabOverlap, 0, 0, 0);
1631 rect.adjust(0, 1, -1, -1);
1634 rect.adjust(0, 0, -tabOverlap, 0);
1636 rect.adjust(1, 1, 0, -1);
1643 p->setPen(
QPen(tab->palette.windowText(), 0));
1645 p->setBrush(tab->palette.base());
1647 p->setBrush(tab->palette.window());
1653 switch (tab->shape) {
1656 a.setPoint(0, 0, -1);
1657 a.setPoint(1, 0, 0);
1658 y =
rect.height() - 2;
1660 a.setPoint(2,
x++,
y - 1);
1662 a.setPoint(3,
x++,
y++);
1663 a.setPoint(4,
x,
y);
1667 for (
i = 0;
i < 5; ++
i)
1668 a.setPoint(9 -
i,
right -
a.point(
i).x(),
a.point(
i).y());
1670 for (
i = 0;
i < 10; ++
i)
1671 a.setPoint(
i,
a.point(
i).x(),
rect.height() - 1 -
a.point(
i).y());
1675 p->translate(0, 0.5);
1683 a.setPoint(0, -1, 0);
1684 a.setPoint(1, 0, 0);
1685 x =
rect.width() - 2;
1687 a.setPoint(2,
x - 1,
y++);
1689 a.setPoint(3,
x++,
y++);
1690 a.setPoint(4,
x,
y);
1693 for (
i = 0;
i < 5; ++
i)
1694 a.setPoint(9 -
i,
a.point(
i).x(),
bottom -
a.point(
i).y());
1696 for (
i = 0;
i < 10; ++
i)
1697 a.setPoint(
i,
rect.width() - 1 -
a.point(
i).x(),
a.point(
i).y());
1700 p->translate(0.5, 0);
1724 tr.adjust(4, 0, -8, 0);
1741 p->drawPixmap(ir.
left(), (tb->rect.height() - ih) / 2, pm);
1771 int newX, newY, newRot;
1773 newX =
tr.width() +
tr.x();
1778 newY =
tr.y() +
tr.height();
1783 p->setTransform(
m,
true);
1786 d->tabLayout(tab, &
tr, &iconRect);
1789 if (!tab->icon.isNull()) {
1790 QPixmap tabIcon = tab->icon.pixmap(tab->iconSize,
dpr(
opt->window),
1795 p->drawPixmap(iconRect.
x(), iconRect.
y(), tabIcon);
1806 x1 = tab->rect.left();
1807 x2 = tab->rect.right() - 1;
1810 fropt.QStyleOption::operator=(*tab);
1812 x2 -
x1 - 2*OFFSET, tab->rect.height() - 2*OFFSET);
1824 p->translate(0,
h -
w);
1826 p->translate(
w -
h, 0);
1834 corner = sgOpt->corner;
1842 for (
int i = 0;
i < 4; ++
i) {
1844 p->drawLine(
x, sy - 1 , sx + 1, sw);
1846 p->drawLine(
x, sy, sx, sw);
1848 p->drawLine(
x, sy + 1, sx - 1, sw);
1853 for (
int i = 0;
i < 4; ++
i) {
1855 p->drawLine(sx - 1, sw, sw, sy - 1);
1857 p->drawLine(sx, sw, sw, sy);
1859 p->drawLine(sx + 1, sw, sw, sy + 1);
1865 for (
int i = 0;
i < 4; ++
i) {
1867 p->drawLine(sx - 1,
y, sw, sy + 1);
1869 p->drawLine(sx,
y, sw, sy);
1871 p->drawLine(sx + 1,
y, sw, sy - 1);
1876 for (
int i = 0;
i < 4; ++
i) {
1878 p->drawLine(
x, sy - 1, sx - 1,
y);
1880 p->drawLine(
x, sy, sx,
y);
1882 p->drawLine(
x, sy + 1, sx + 1,
y);
1892 QPainter pixmapPainter(&tiledPixmap);
1898 pixmapPainter.
end();
1906 p->setClipRegion(
mask.region);
1907 p->drawTiledPixmap(
r.x(),
r.y(),
r.width(),
r.height(), tiledPixmap);
1910 p->drawRect(
r.adjusted(0, 0, -1, -1));
1912 p->drawRect(
r.adjusted(3, 3, -4, -4));
1919 if (dwOpt->movable) {
1924 if (!dwOpt->title.isEmpty()) {
1925 const bool verticalTitleBar = dwOpt->verticalTitleBar;
1927 if (verticalTitleBar) {
1933 p->translate(-
r.left(), -
r.top());
1936 const int indent =
p->fontMetrics().descent();
1942 if (verticalTitleBar)
1949 QRegion clipRegion =
p->clipRegion();
1960 p->setClipRegion(clipRegion);
1978 p->setClipRect(editRect);
1979 if (!
cb->currentIcon.isNull()) {
1983 QRect iconRect(editRect);
1987 iconRect.
size(), editRect);
1997 if (!
cb->currentText.isEmpty() && !
cb->editable) {
2009 frame.QStyleOption::operator=(*toolBar);
2014 qDrawShadePanel(
p, toolBar->rect, toolBar->palette,
false, toolBar->lineWidth,
2035 p->drawLine(line1starting,
top, line1starting,
bottom);
2036 p->drawLine(line2starting,
top, line2starting,
bottom);
2057 switch (vopt->checkState) {
2078 vopt->icon.paint(
p, iconRect, vopt->decorationAlignment,
mode,
state);
2081 if (!vopt->text.isEmpty()) {
2103 o.QStyleOption::operator=(*vopt);
2119 int frameShape =
f->frameShape;
2127 int lw =
f->lineWidth;
2128 int mlw =
f->midLineWidth;
2131 switch (frameShape) {
2167 QPen oldPen =
p->pen();
2169 p->drawLine(
p1,
p2);
2203 int dbw1 = 0, dbw2 = 0;
2242 r.adjust(1, 1, -1, -1);
2292 r.adjust(1, 1, -1, -1);
2319 r.setRect(0, tickOffset - 1, slider->rect.width(), thickness + 2);
2321 r.setRect(tickOffset - 1, 0, thickness + 2, slider->rect.height());
2322 r =
r.intersected(slider->rect);
2331 if (pb->textVisible)
2332 textw =
qMax(pb->fontMetrics.horizontalAdvance(pb->text), pb->fontMetrics.horizontalAdvance(
QLatin1String(
"100%"))) + 6;
2336 r.setCoords(pb->rect.left(), pb->rect.top(),
2337 pb->rect.right() - textw, pb->rect.bottom());
2339 r.setCoords(pb->rect.right() - textw, pb->rect.top(),
2340 pb->rect.right(), pb->rect.bottom());
2349 int margin =
cb->frame ? 3 : 0;
2370 r.setHeight(
r.height() - (
opt->
rect.
width() / 2) - (margin * 2));
2383 int horiz_size =
h / 2;
2384 r.setRect(
x +
w - margin * 2 - horiz_size,
y + 5,
2385 horiz_size,
h - margin * 2 - 5);
2387 int vert_size =
w / 2;
2388 r.setRect(
x + 5,
y +
h - margin * 2 - vert_size,
2389 w - margin * 2 - 5, vert_size);
2404 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
2405 r.setSize(twf->tabBarSize);
2407 switch (twf->shape) {
2412 r.setWidth(
qMin(
r.width(), twf->rect.width()
2413 - twf->leftCornerWidgetSize.width()
2414 - twf->rightCornerWidgetSize.width()));
2418 r.moveTopLeft(
QPoint(twf->leftCornerWidgetSize.width(), 0));
2421 r.moveTopLeft(
QPoint(twf->rect.center().x() -
qRound(
r.width() / 2.0f)
2422 + (twf->leftCornerWidgetSize.width() / 2)
2423 - (twf->rightCornerWidgetSize.width() / 2), 0));
2426 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width()
2427 - twf->rightCornerWidgetSize.width(), 0));
2434 r.setWidth(
qMin(
r.width(), twf->rect.width()
2435 - twf->leftCornerWidgetSize.width()
2436 - twf->rightCornerWidgetSize.width()));
2440 r.moveTopLeft(
QPoint(twf->leftCornerWidgetSize.width(),
2441 twf->rect.height() - twf->tabBarSize.height()));
2444 r.moveTopLeft(
QPoint(twf->rect.center().x() -
qRound(
r.width() / 2.0f)
2445 + (twf->leftCornerWidgetSize.width() / 2)
2446 - (twf->rightCornerWidgetSize.width() / 2),
2447 twf->rect.height() - twf->tabBarSize.height()));
2450 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width()
2451 - twf->rightCornerWidgetSize.width(),
2452 twf->rect.height() - twf->tabBarSize.height()));
2459 r.setHeight(
qMin(
r.height(), twf->rect.height()
2460 - twf->leftCornerWidgetSize.height()
2461 - twf->rightCornerWidgetSize.height()));
2465 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2466 twf->leftCornerWidgetSize.height()));
2469 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2470 twf->rect.center().y() -
r.height() / 2));
2473 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2474 twf->rect.height() - twf->tabBarSize.height()
2475 - twf->rightCornerWidgetSize.height()));
2481 r.setHeight(
qMin(
r.height(), twf->rect.height()
2482 - twf->leftCornerWidgetSize.height()
2483 - twf->rightCornerWidgetSize.height()));
2487 r.moveTopLeft(
QPoint(0, twf->leftCornerWidgetSize.height()));
2490 r.moveTopLeft(
QPoint(0, twf->rect.center().y() -
r.height() / 2));
2493 r.moveTopLeft(
QPoint(0, twf->rect.height() - twf->tabBarSize.height()
2494 - twf->rightCornerWidgetSize.height()));
2505 tabopt.
shape = twf->shape;
2507 if (twf->lineWidth == 0)
2509 switch (twf->shape) {
2513 QSize(twf->rect.width(),
qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height())));
2517 r =
QRect(
QPoint(0,0),
QSize(twf->rect.width(),
qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height())));
2521 r =
QRect(
QPoint(0, 0),
QSize(
qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height()));
2526 QSize(
qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height()));
2530 r.adjust(2, 2, -2, -2);
2536 switch (twf->shape) {
2539 r =
QRect(
QPoint(paneRect.
x(), paneRect.
y() - twf->leftCornerWidgetSize.height()),
2540 twf->leftCornerWidgetSize);
2555 switch (twf->shape) {
2559 paneRect.
y() - twf->rightCornerWidgetSize.height()),
2560 twf->rightCornerWidgetSize);
2565 paneRect.
height()), twf->rightCornerWidgetSize);
2575 QRect dummyIconRect;
2576 d->tabLayout(tab, &
r, &dummyIconRect);
2586 hpadding =
qMax(hpadding, 4);
2595 verticalShift = -verticalShift;
2597 qSwap(horizontalShift, verticalShift);
2598 horizontalShift *= -1;
2599 verticalShift *= -1;
2602 horizontalShift = -horizontalShift;
2604 tr.adjust(0, 0, horizontalShift, verticalShift);
2607 tr.setBottom(
tr.bottom() - verticalShift);
2608 tr.setRight(
tr.right() - horizontalShift);
2612 int w =
size.width();
2613 int h =
size.height();
2614 int midHeight =
static_cast<int>(
qCeil(
float(
tr.height() -
h) / 2));
2615 int midWidth = ((
tr.width() -
w) / 2);
2617 bool atTheTop =
true;
2618 switch (tab->shape) {
2629 r =
QRect(tab->rect.x() + hpadding, midHeight,
w,
h);
2631 r =
QRect(tab->rect.right() -
w - hpadding, midHeight,
w,
h);
2636 r =
QRect(midWidth,
tr.y() + tab->rect.height() - hpadding -
h,
w,
h);
2638 r =
QRect(midWidth,
tr.y() + hpadding,
w,
h);
2645 switch (tab->shape) {
2650 r.setRect(tab->rect.left(), tab->rect.top(), 8,
opt->
rect.
height());
2656 r.setRect(tab->rect.left(), tab->rect.top(),
opt->
rect.
width(), 8);
2686 r =
f->rect.adjusted(
f->lineWidth,
f->lineWidth, -
f->lineWidth, -
f->lineWidth);
2699 int frameShape =
f->frameShape;
2709 switch (frameShape) {
2717 switch (frameShadow) {
2719 frameWidth =
f->lineWidth;
2723 frameWidth = (short)(
f->lineWidth*2 +
f->midLineWidth);
2738 switch (frameShadow) {
2742 frameWidth =
f->lineWidth;
2747 r =
f->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
2759 = qstyleoption_cast<const QStyleOptionDockWidget*>(
opt);
2760 bool canClose = dwOpt ==
nullptr ? true : dwOpt->
closable;
2768 if (verticalTitleBar)
2779 sz +=
QSize(buttonMargin, buttonMargin);
2780 if (verticalTitleBar)
2796 sz +=
QSize(buttonMargin, buttonMargin);
2797 if (verticalTitleBar)
2824 if (verticalTitleBar) {
2827 r.height(),
r.width());
2834 if (!qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
2843 if (!
d->isViewItemCached(*vopt)) {
2844 d->viewItemLayout(vopt, &
d->checkRect, &
d->decorationRect, &
d->displayRect,
false);
2845 if (
d->cachedOption) {
2846 delete d->cachedOption;
2847 d->cachedOption =
nullptr;
2854 r =
d->decorationRect;
2864 const QMargins margins(2, 2, 2, 2);
2869 tbopt->rect.height() - (margins.
top() + margins.
bottom()));
2873 tbopt->rect.width() - (margins.
left() + margins.
right()),
2908 a = (startAngle - (currentSliderPosition - dial->
minimum) * spanAngle
2923 0.5 + yc - back *
qSin(
a +
Q_PI * 5 / 6)),
2925 0.5 + yc - back *
qSin(
a -
Q_PI * 5 / 6)),
2937 int ticks = slider->tickPosition;
2941 int interval = slider->tickInterval;
2942 if (interval <= 0) {
2943 interval = slider->singleStep;
2948 interval = slider->pageStep;
2952 int fudge =
len / 2;
2956 p->translate(slider->rect.x(), slider->rect.y());
2957 p->setPen(slider->palette.windowText().color());
2958 int v = slider->minimum;
2959 while (v <= slider->maximum + 1) {
2960 if (
v == slider->maximum + 1 && interval == 1)
2962 const int v_ =
qMin(
v, slider->maximum);
2964 v_, available) + fudge;
2967 p->drawLine(
pos, 0,
pos, tickOffset - 2);
2969 p->drawLine(
pos, tickOffset + thickness + 1,
pos,
2970 slider->rect.height()-1);
2973 p->drawLine(0,
pos, tickOffset - 2,
pos);
2975 p->drawLine(tickOffset + thickness + 1,
pos,
2976 slider->rect.width()-1,
pos);
2979 int nextInterval =
v + interval;
2980 if (nextInterval <
v)
2992 State saveFlags = scrollbar->state;
2995 newScrollbar.
state = saveFlags;
3004 newScrollbar.
rect = scrollbar->rect;
3005 newScrollbar.
state = saveFlags;
3014 newScrollbar.
rect = scrollbar->rect;
3015 newScrollbar.
state = saveFlags;
3024 newScrollbar.
rect = scrollbar->rect;
3025 newScrollbar.
state = saveFlags;
3034 newScrollbar.
rect = scrollbar->rect;
3035 newScrollbar.
state = saveFlags;
3044 newScrollbar.
rect = scrollbar->rect;
3045 newScrollbar.
state = saveFlags;
3054 newScrollbar.
rect = scrollbar->rect;
3055 newScrollbar.
state = saveFlags;
3064 fropt.QStyleOption::operator=(newScrollbar);
3089 copy.state &= ~State_Enabled;
3092 copy.palette = pal2;
3099 copy.state &= ~State_Sunken;
3106 copy.rect.adjust(3, 0, -4, 0);
3112 copy.state = sb->state;
3116 copy.state &= ~State_Enabled;
3118 copy.palette = pal2;
3125 copy.state &= ~State_Sunken;
3132 copy.rect.adjust(3, 0, -4, 0);
3139 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
3144 State bflags = toolbutton->state & ~State_Sunken;
3148 bflags &= ~State_Raised;
3151 State mflags = bflags;
3162 tool.
state = bflags;
3169 fr.QStyleOption::operator=(*toolbutton);
3183 tool.
rect = menuarea;
3184 tool.
state = mflags;
3190 QRect ir = toolbutton->rect;
3202 QColor left = tb->palette.highlight().color();
3207 QPoint p1(tb->rect.x(), tb->rect.top() + tb->rect.height()/2);
3208 QPoint p2(tb->rect.right(), tb->rect.top() + tb->rect.height()/2);
3219 p->setPen(tb->palette.highlightedText().color());
3290 if (drawNormalButton) {
3358 if (!tb->icon.isNull()) {
3359 tb->icon.paint(
p, ir);
3380 int width = dial->rect.width();
3381 int height = dial->rect.height();
3384 qreal dx = dial->rect.x() + d_ + (
width - 2 *
r) / 2 + 1;
3385 qreal dy = dial->rect.y() + d_ + (
height - 2 *
r) / 2 + 1;
3386 QRect br =
QRect(
int(dx),
int(dy),
int(
r * 2 - 2 * d_ - 2),
int(
r * 2 - 2 * d_ - 2));
3402 p->drawArc(br, 60 * 16, 180 * 16);
3404 p->drawArc(br, 240 * 16, 180 * 16);
3416 if (a <= 0 || a > 200) {
3418 p->drawLine(arrow[2], arrow[0]);
3419 p->drawLine(arrow[1], arrow[2]);
3421 p->drawLine(arrow[0], arrow[1]);
3422 }
else if (
a > 0 &&
a < 45) {
3424 p->drawLine(arrow[2], arrow[0]);
3426 p->drawLine(arrow[1], arrow[2]);
3427 p->drawLine(arrow[0], arrow[1]);
3428 }
else if (
a >= 45 &&
a < 135) {
3430 p->drawLine(arrow[2], arrow[0]);
3431 p->drawLine(arrow[1], arrow[2]);
3433 p->drawLine(arrow[0], arrow[1]);
3434 }
else if (
a >= 135 &&
a < 200) {
3436 p->drawLine(arrow[2], arrow[0]);
3438 p->drawLine(arrow[0], arrow[1]);
3439 p->drawLine(arrow[1], arrow[2]);
3444 fropt.
rect = dial->rect;
3445 fropt.
state = dial->state;
3446 fropt.
palette = dial->palette;
3448 br.adjust(0, 0, 2, 2);
3451 br.translate(-
r / 6, -
r / 6);
3452 br.setWidth(br.width() +
r / 3);
3453 br.setHeight(br.height() +
r / 3);
3468 frame.QStyleOption::operator=(*groupBox);
3480 finalRect.
adjust(ltr ? -4 : 0, 0, ltr ? 0 : 4, 0);
3484 region -= finalRect;
3486 p->setClipRegion(region);
3495 p->setPen(textColor);
3506 fropt.QStyleOption::operator=(*groupBox);
3515 box.QStyleOption::operator=(*groupBox);
3516 box.rect = checkBoxRect;
3524 btnOpt.QStyleOption::operator=(*opt);
3525 btnOpt.
state &= ~State_MouseOver;
3529 const QSize buttonIconSize(buttonIconMetric, buttonIconMetric);
3533 btnOpt.
state &= ~State_Raised;
3538 btnOpt.
state &= ~State_Sunken;
3550 btnOpt.
state &= ~State_Raised;
3555 btnOpt.
state &= ~State_Sunken;
3567 btnOpt.
state &= ~State_Raised;
3572 btnOpt.
state &= ~State_Sunken;
3584 qWarning(
"QCommonStyle::drawComplexControl: Control %d not handled", cc);
3598 if (
r.isValid() &&
r.contains(pt)) {
3602 if (
r.isValid() &&
r.contains(pt))
3613 if (
r.isValid() &&
r.contains(pt)) {
3627 if (
r.isValid() &&
r.contains(pt)) {
3641 if (
r.isValid() &&
r.contains(pt)) {
3656 if (
r.isValid() &&
r.contains(pt)) {
3670 if (
r.isValid() &&
r.contains(pt)) {
3684 if (
r.isValid() &&
r.contains(pt)) {
3698 if (
r.isValid() &&
r.contains(pt) && (
opt->subControls & ctrl)) {
3707 qWarning(
"QCommonStyle::hitTestComplexControl: Case %d not handled", cc);
3730 slider->sliderPosition,
3731 (horizontal ? slider->rect.width()
3732 : slider->rect.height()) -
len,
3733 slider->upsideDown);
3735 ret.setRect(slider->rect.x() + sliderPos, slider->rect.y() + tickOffset,
len, thickness);
3737 ret.setRect(slider->rect.x() + tickOffset, slider->rect.y() + sliderPos, thickness,
len);
3741 ret.setRect(slider->rect.x(), slider->rect.y() + tickOffset,
3742 slider->rect.width(), thickness);
3744 ret.setRect(slider->rect.x() + tickOffset, slider->rect.y(),
3745 thickness, slider->rect.height());
3755 const QRect scrollBarRect = scrollbar->rect;
3760 scrollBarRect.
width() : scrollBarRect.
height()) - (sbextent * 2);
3764 if (scrollbar->maximum != scrollbar->minimum) {
3765 uint range = scrollbar->maximum - scrollbar->minimum;
3766 sliderlen = (
qint64(scrollbar->pageStep) * maxlen) / (
range + scrollbar->pageStep);
3769 if (sliderlen < slidermin || range > INT_MAX / 2)
3770 sliderlen = slidermin;
3771 if (sliderlen > maxlen)
3779 scrollbar->sliderPosition,
3781 scrollbar->upsideDown);
3786 int buttonWidth =
qMin(scrollBarRect.
width() / 2, sbextent);
3787 ret.setRect(0, 0, buttonWidth, scrollBarRect.
height());
3789 int buttonHeight =
qMin(scrollBarRect.
height() / 2, sbextent);
3790 ret.setRect(0, 0, scrollBarRect.
width(), buttonHeight);
3795 int buttonWidth =
qMin(scrollBarRect.
width()/2, sbextent);
3796 ret.setRect(scrollBarRect.
width() - buttonWidth, 0, buttonWidth, scrollBarRect.
height());
3798 int buttonHeight =
qMin(scrollBarRect.
height()/2, sbextent);
3799 ret.setRect(0, scrollBarRect.
height() - buttonHeight, scrollBarRect.
width(), buttonHeight);
3804 ret.setRect(sbextent, 0, sliderstart - sbextent, scrollBarRect.
height());
3806 ret.setRect(0, sbextent, scrollBarRect.
width(), sliderstart - sbextent);
3810 ret.setRect(sliderstart + sliderlen, 0,
3811 maxlen - sliderstart - sliderlen + sbextent, scrollBarRect.
height());
3813 ret.setRect(0, sliderstart + sliderlen, scrollBarRect.
width(),
3814 maxlen - sliderstart - sliderlen + sbextent);
3818 ret.setRect(sbextent, 0, scrollBarRect.
width() - sbextent * 2,
3821 ret.setRect(0, sbextent, scrollBarRect.
width(),
3822 scrollBarRect.
height() - sbextent * 2);
3826 ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.
height());
3828 ret.setRect(0, sliderstart, scrollBarRect.
width(), sliderlen);
3843 int y = fw + spinbox->rect.y();
3845 x = spinbox->rect.x() + spinbox->rect.width() - fw - bs.
width();
3862 ret =
QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw);
3864 ret =
QRect(lx, fw,
rx, spinbox->rect.height() - 2*fw);
3868 ret = spinbox->rect;
3884 ret.adjust(0, 0, -mbi, 0);
3890 ret.adjust(
ret.width() - mbi, 0, 0, 0);
3901 const int x =
cb->rect.x(),
y =
cb->rect.y(), wi =
cb->rect.width(), he =
cb->rect.height();
3928 const int controlMargin = 2;
3929 const int controlHeight = tb->rect.height() - controlMargin *2;
3930 const int delta = controlHeight + controlMargin;
3941 ret.adjust(delta, 0, -delta, 0);
3943 ret.adjust(0, 0, -delta, 0);
3945 ret.adjust(0, 0, -delta, 0);
3947 ret.adjust(0, 0, -delta, 0);
3949 ret.adjust(0, 0, -delta, 0);
3993 ret.setRect(tb->rect.right() -
offset, tb->rect.top() + controlMargin,
3994 controlHeight, controlHeight);
3998 ret.setRect(tb->rect.left() + controlMargin, tb->rect.top() + controlMargin,
3999 controlHeight, controlHeight);
4021 topMargin = topHeight / 2;
4023 topMargin = topHeight;
4027 frameRect.
setTop(topMargin);
4037 ret = frameRect.
adjusted(frameWidth, frameWidth + topHeight - topMargin,
4038 -frameWidth, -frameWidth);
4053 int checkBoxWidth = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0;
4054 int checkBoxHeight = hasCheckBox ? indicatorHeight : 0;
4056 int h =
qMax(th, checkBoxHeight);
4069 left = ltr ? totalRect.
left() : (totalRect.
right() - indicatorWidth);
4070 int top = totalRect.
top() + (
h - checkBoxHeight) / 2;
4074 left = ltr ? (totalRect.
left() + checkBoxWidth - 2) : totalRect.
left();
4075 int top = totalRect.
top() + (
h - th) / 2;
4090 int numSubControls = 0;
4097 if (numSubControls == 0)
4100 int buttonWidth =
opt->
rect.
width() / numSubControls - 1;
4105 if (numSubControls == 1)
4107 offset += buttonWidth + 2;
4113 if (numSubControls == 1 || (numSubControls == 2 && !(
opt->subControls &
SC_MdiMinButton)))
4125 if (numSubControls == 1)
4130 qWarning(
"QCommonStyle::subControlRect: Case %d not handled", cc);
4228 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height()
4231 int ticks = sl->tickPosition;
4234 ret = (space - thickness) / 2;
4236 ret = space - thickness;
4513 sz +=
QSize(
w + margins, 4);
4514 sz.setHeight(
qMax(sz.height(),
h));
4519 bool checkable = mi->menuHasCheckableItems;
4520 int maxpmw = mi->maxIconWidth;
4521 int w = sz.width(),
h = sz.height();
4526 h = mi->fontMetrics.height() + 8;
4527 if (!mi->icon.isNull()) {
4536 if (checkable && maxpmw < 20)
4538 if (checkable || maxpmw > 0)
4545 sz =
QSize(sz.width() + 6, sz.height() + 5);
4553 sz =
QSize(sz.width() + fw +
other, sz.height() + fw);
4558 bool nullIcon = hdr->icon.isNull();
4561 QSize txt = hdr->fontMetrics.size(0, hdr->text);
4563 sz.setWidth((nullIcon ? 0 : margin) +
iconSize
4564 + (hdr->text.isNull() ? 0 : margin) +
txt.width() + margin);
4568 sz.rwidth() += sz.height() + margin;
4570 sz.rheight() += sz.width() + margin;
4579 const int borderSize = 2 *
f->lineWidth;
4580 sz +=
QSize(borderSize, borderSize);
4581 const int minSize = 10;
4582 if (sz.width() < minSize)
4583 sz.rwidth() = minSize;
4584 if (sz.height() < minSize)
4585 sz.rheight() = minSize;
4600 width += buttonSize + 1;
4602 width += buttonSize + 1;
4604 width += buttonSize + 1;
4608 sz =
QSize(1 + 3 * (buttonSize + 1), buttonSize);
4613 QRect decorationRect, displayRect, checkRect;
4614 d->viewItemLayout(vopt, &checkRect, &decorationRect, &displayRect,
true);
4615 sz = (decorationRect|displayRect|checkRect).
size();
4616 if (decorationRect.
isValid() && sz.height() == decorationRect.
height())
4628 sz +=
QSize(buttonWidth + 2*fw, 1 + 2*fw);
4631 const int upAndDownTogetherHeight = buttonSize.
height() * 2;
4632 sz +=
QSize(buttonSize.
width(), upAndDownTogetherHeight);
4645 const int ninePatchSplit = 1;
4646 int w =
qMax(10, (
option->lineWidth * 2) + ninePatchSplit);
4765#if defined(Q_OS_DARWIN)
4921 vret->variant =
fmt;
5003#if QT_CONFIG(imageformat_xpm)
5004static QPixmap cachedPixmapFromXPM(
const char *
const *xpm)
5015static inline QPixmap titleBarMenuCachedPixmapFromXPM() {
return cachedPixmapFromXPM(
qt_menu_xpm); }
5020 return QStringLiteral(
":/qt-project.org/styles/commonstyle/images/cleartext-16.png");
5023#if defined(Q_OS_WIN) || QT_CONFIG(imageformat_png)
5024static QIcon clearTextIcon(
bool rtl)
5026 const QString directionalThemeName = rtl
5035#ifndef QT_NO_IMAGEFORMAT_PNG
5037 Q_ASSERT(!clearText16.size().isEmpty());
5040 Q_ASSERT(!clearText32.size().isEmpty());
5042 clearText32.setDevicePixelRatio(2);
5052#if QT_CONFIG(imageformat_png)
5198 if (!fileIcon.
isNull()) {
5217 pixmap = clearTextIcon(rtl).pixmap(16);
5228#ifndef QT_NO_IMAGEFORMAT_XPM
5243#ifndef QT_NO_IMAGEFORMAT_PNG
5264 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"));
5266 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"));
5270 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/filecontents-16.png"));
5282 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/networkdrive-16.png"));
5304 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"));
5306 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"));
5308 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"));
5310 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"));
5312 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"));
5314 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"));
5316 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"));
5318 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"));
5320 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"));
5322 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"));
5324 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"));
5332 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-pause-32.png"));
5336 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"));
5338 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"));
5340 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"));
5342 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"));
5344 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
5346 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"));
5354#ifndef QT_NO_IMAGEFORMAT_XPM
5357 return titleBarMenuCachedPixmapFromXPM();
5387#if !QT_CONFIG(imageformat_png) && !QT_CONFIG(imageformat_xpm)
5394#if QT_CONFIG(imageformat_png)
5395static inline QString iconResourcePrefix() {
return QStringLiteral(
":/qt-project.org/styles/commonstyle/images/"); }
5404static const int dockTitleIconSizes[] = {10, 16, 20, 32, 48, 64};
5405static const int titleBarSizes[] = {16, 32, 48};
5406static const int toolBarExtHSizes[] = {8, 16, 32};
5407static const int toolBarExtVSizes[] = {5, 10, 20};
5452 pixmap = theme->standardPixmap(spOn, pixSize);
5458 icon = clearTextIcon(rtl);
5611 if (!linkIcon.
isNull()) {
5615 for (
int i = 0 ;
i <
sizes.size() ; ++
i) {
5629 if (!linkIcon.
isNull()) {
5633 for (
int i = 0 ;
i <
sizes.size() ; ++
i) {
5652#if defined(Q_OS_MAC)
5670 titleBarIcon.
addFile(
QLatin1String(
":/qt-project.org/styles/macstyle/images/closedock-16.png"));
5673 titleBarIcon.
addFile(
QLatin1String(
":/qt-project.org/styles/macstyle/images/dockdock-16.png"));
5676 return titleBarIcon;
5723#ifndef QT_NO_IMAGEFORMAT_PNG
5725 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-min-"),
5726 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5729 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-max-"),
5730 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5733 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-shade-"),
5734 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5738 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-unshade-"),
5739 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5742 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-contexthelp-"),
5743 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5940 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"closedock-"),
5941 dockTitleIconSizes,
sizeof(dockTitleIconSizes)/
sizeof(dockTitleIconSizes[0]),
icon);
5944# ifndef QT_NO_IMAGEFORMAT_XPM
5950 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"normalizedockup-"),
5951 dockTitleIconSizes,
sizeof(dockTitleIconSizes)/
sizeof(dockTitleIconSizes[0]),
icon);
5957 addIconFiles(prefix, toolBarExtHSizes,
sizeof(toolBarExtHSizes)/
sizeof(toolBarExtHSizes[0]),
icon);
5961 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"toolbar-ext-v-"),
5962 toolBarExtVSizes,
sizeof(toolBarExtVSizes)/
sizeof(toolBarExtVSizes[0]),
icon);
5975 return (77 *
r + 150 *
g + 28 *
b) / 255;
5991 uchar reds[256], greens[256], blues[256];
5992 for (
int i=0;
i<128; ++
i) {
5997 for (
int i=0;
i<128; ++
i) {
6004 const int factor = 191;
6012 intensity =
qMin(255, intensity + 91);
6013 else if (intensity <= 128)
6019 QRgb pixel = *scanLine;
6023 *scanLine =
qRgba(reds[ci], greens[ci], blues[ci],
qAlpha(pixel));
6033 color.setAlphaF(0.3f);
6051#include "moc_qquickcommonstyle.cpp"
const QColor & color() const
Returns the brush color.
constexpr char16_t unicode() const noexcept
Returns the numeric Unicode value of the QChar.
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.
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.
\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
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
static QPlatformTheme * platformTheme()
static QFont font()
Returns the default application font.
static bool isRightToLeft()
Returns true if the application's layout direction is Qt::RightToLeft; otherwise returns false.
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.; otherwise returns false.
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.
QList< QSize > availableSizes(Mode mode=Normal, State state=Off) const
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 &
T value(qsizetype i) const
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.
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 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 setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
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.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
@ CompositionMode_SourceAtop
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
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 & 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 & 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.
QImage toImage() const
Converts the pixmap to a QImage.
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.
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
constexpr qreal & ry() noexcept
Returns a reference to the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
The QPolygon class provides a list of points using integer precision.
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
QString toolButtonElideText(const QStyleOptionToolButton *toolbutton, const QRect &textRect, int flags) const
void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const
virtual void tabLayout(const QStyleOptionTab *opt, QRect *textRect, QRect *pixmapRect) const
QSize viewItemSize(const QStyleOptionViewItem *option, int role) const
void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override
QMargins ninePatchMargins(ControlElement ce, const QStyleOption *opt, const QSize &imageSize) const override
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt) const override
\reimp
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc) const override
\reimp
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
QFont font(ControlElement element, const QStyle::State state) const override
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
\reimp
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override
\reimp
const QStyle * proxy() const
virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt=nullptr) const =0
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...
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 int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr) const =0
virtual ~QStyle()
Destroys the style object.
@ SC_TitleBarNormalButton
@ SC_TitleBarUnshadeButton
@ SC_ComboBoxListBoxPopup
@ SC_TitleBarContextHelpButton
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...
@ SE_DockWidgetTitleBarText
@ SE_TabBarScrollLeftButton
@ SE_TabWidgetRightCorner
@ SE_ItemViewItemDecoration
@ SE_RadioButtonIndicator
@ SE_ItemViewItemFocusRect
@ SE_TabBarTabRightButton
@ SE_RadioButtonFocusRect
@ SE_RadioButtonClickRect
@ SE_DockWidgetCloseButton
@ SE_TabBarScrollRightButton
@ SE_DockWidgetFloatButton
@ SE_TreeViewDisclosureItem
@ SE_TabWidgetTabContents
@ SE_ItemViewItemCheckIndicator
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const =0
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 void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const =0
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
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.
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option) const =0
@ SH_Splitter_OpaqueResize
@ SH_TitleBar_ModifyNotification
@ SH_DialogButtonBox_ButtonsHaveIcons
@ SH_TabBar_SelectMouseType
@ SH_Menu_SubMenuSloppyCloseTimeout
@ SH_ItemView_EllipsisLocation
@ SH_BlinkCursorWhenTextSelected
@ SH_LineEdit_PasswordMaskDelay
@ SH_ToolBox_SelectedPageTitleBold
@ SH_Slider_AbsoluteSetButtons
@ SH_ItemView_ArrowKeysNavigateIntoChildren
@ SH_FormLayoutWrapPolicy
@ SH_ItemView_MovementWithoutUpdatingSelection
@ SH_Menu_FillScreenWithScroll
@ SH_TitleBar_ShowToolTipsOnButtons
@ SH_GroupBox_TextLabelColor
@ SH_Header_ArrowAlignment
@ SH_FormLayoutLabelAlignment
@ SH_ScrollBar_RollBetweenButtons
@ SH_TabWidget_DefaultTabPosition
@ SH_GroupBox_TextLabelVerticalAlignment
@ SH_MessageBox_TextInteractionFlags
@ SH_ItemView_ShowDecorationSelected
@ SH_ComboBox_LayoutDirection
@ SH_ProgressDialog_TextLabelAlignment
@ SH_RequestSoftwareInputPanel
@ SH_ToolTip_FallAsleepDelay
@ SH_ItemView_ActivateItemOnSingleClick
@ SH_SpinBox_ClickAutoRepeatThreshold
@ SH_ComboBox_PopupFrameStyle
@ SH_FormLayoutFormAlignment
@ SH_TextControl_FocusIndicatorTextCharFormat
@ SH_ScrollBar_ContextMenu
@ SH_Slider_PageSetButtons
@ SH_Menu_SubMenuUniDirectionFailCount
@ SH_ListViewExpand_SelectMouseType
@ SH_FormLayoutFieldGrowthPolicy
@ SH_ToolButton_PopupDelay
@ SH_SpellCheckUnderlineStyle
@ SH_SpinBox_ButtonsInsideFrame
@ SH_MessageBox_UseBorderForButtonSpacing
@ SH_TabBar_CloseButtonPosition
@ SH_Menu_SubMenuSloppySelectOtherActions
@ SH_MessageBox_CenterButtons
@ SH_DockWidget_ButtonsHaveFrame
@ SH_SpinBox_ClickAutoRepeatRate
@ SH_FocusFrame_AboveWidget
@ SH_Widget_Animation_Duration
@ SH_SpinControls_DisableOnBounds
@ SH_Menu_SupportsSections
@ SH_ItemView_DrawDelegateFrame
@ SH_ComboBox_AllowWheelScrolling
@ SH_Menu_SubMenuDontStartSloppyOnLeave
@ SH_TabBar_ChangeCurrentDelay
@ SH_LineEdit_PasswordCharacter
@ SH_Menu_SubMenuResetWhenReenteringParent
@ SH_ToolTipLabel_Opacity
@ SH_Menu_SubMenuUniDirection
@ SH_SpinBox_StepModifier
@ SH_SpinBox_KeyPressAutoRepeatRate
@ SH_Menu_SubMenuPopupDelay
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, QStyleHintReturn *returnData=nullptr) const =0
@ State_KeyboardFocusChange
@ PE_IndicatorItemViewItemCheck
@ PE_IndicatorHeaderArrow
@ PE_IndicatorRadioButton
@ PE_PanelScrollAreaCorner
@ PE_IndicatorToolBarHandle
@ PE_IndicatorButtonDropDown
@ PE_IndicatorColumnViewArrow
@ PE_IndicatorMenuCheckMark
@ PE_IndicatorToolBarSeparator
@ PE_IndicatorItemViewItemDrop
@ PE_IndicatorProgressChunk
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr) const =0
@ PM_TabBarTabShiftHorizontal
@ PM_DialogButtonsButtonWidth
@ PM_LayoutVerticalSpacing
@ PM_RadioButtonLabelSpacing
@ PM_DefaultLayoutSpacing
@ PM_ToolBarSeparatorExtent
@ PM_ButtonDefaultIndicator
@ PM_ScrollView_ScrollBarOverlap
@ PM_TabCloseIndicatorWidth
@ PM_DialogButtonsSeparator
@ PM_TitleBarButtonIconSize
@ PM_DefaultTopLevelMargin
@ PM_ToolBarExtensionExtent
@ PM_HeaderDefaultSectionSizeHorizontal
@ PM_SliderTickmarkOffset
@ PM_MdiSubWindowFrameWidth
@ PM_SliderSpaceAvailable
@ PM_ScrollView_ScrollBarSpacing
@ PM_ProgressBarChunkWidth
@ PM_CheckBoxLabelSpacing
@ PM_TabBarScrollButtonWidth
@ PM_MenuDesktopFrameWidth
@ PM_DockWidgetHandleExtent
@ PM_TabCloseIndicatorHeight
@ PM_DockWidgetTitleBarButtonMargin
@ PM_TabBar_ScrollButtonOverlap
@ PM_DialogButtonsButtonHeight
@ PM_ExclusiveIndicatorHeight
@ PM_LayoutHorizontalSpacing
@ PM_MdiSubWindowMinimizedWidth
@ PM_ExclusiveIndicatorWidth
@ PM_ButtonShiftHorizontal
@ PM_SliderControlThickness
@ PM_DockWidgetFrameWidth
@ PM_DockWidgetSeparatorExtent
@ PM_ToolTipLabelFrameWidth
@ PM_TabBarTabShiftVertical
@ PM_HeaderDefaultSectionSizeVertical
@ 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_TitleBarContextHelpButton
@ SP_MessageBoxInformation
@ SP_FileDialogDetailedView
@ SP_FileDialogContentsView
@ SP_ToolBarVerticalExtensionButton
@ SP_TitleBarNormalButton
@ SP_TitleBarUnshadeButton
@ SP_DockWidgetCloseButton
@ SP_ToolBarHorizontalExtensionButton
\inmodule QtCore\reentrant
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
\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.
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 QSize size() const noexcept
Returns the size of the rectangle.
constexpr QRect transposed() const noexcept
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.
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
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 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.
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 QSize toSize() const noexcept
Returns an integer based copy of this size.
constexpr QSize boundedTo(const QSize &) const noexcept
Returns a size holding the minimum width and height of this size and the given otherSize.
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 QSize transposed() const noexcept
constexpr int & rwidth() noexcept
Returns a reference to the 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 & replace(qsizetype i, qsizetype len, QChar after)
void chop(qsizetype n)
Removes n characters from the end of the string.
bool isNull() const
Returns true if this string is null; otherwise returns false.
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 endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; 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
Qt::LayoutDirection direction
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.
QChar toChar() const
Returns the variant as a QChar if the variant has userType() \l QMetaType::QChar, \l QMetaType::Int,...
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
QStyleOptionButton subopt
[2]
const QStyleOptionButton * btn
[3]
struct wl_display * display
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
int calcBigLineSize(int radius)
QPolygonF calcLines(const QStyleOptionSlider *dial)
qreal dpi(const QStyleOption *option)
qreal dpiScaled(qreal value, qreal dpi)
qreal angle(const QPointF &p1, const QPointF &p2)
static const char *const question_xpm[]
static uint qt_intensity(uint r, uint g, uint b)
static const char *const filedialog_end_xpm[]
static const char *const dock_widget_close_xpm[]
static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbutton, const QRect &rect, QPainter *painter)
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 qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill)
static const char *const qt_close_xpm[]
static const char *const qt_help_xpm[]
static const char *const qt_menu_xpm[]
static const char *const qt_unshade_xpm[]
static const char *const qt_normalizeup_xpm[]
static StaticPolygonF< 3 > calcArrow(const QStyleOptionSlider *dial, qreal &a)
static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth, int maxHeight=-1, int *lastVisibleLine=nullptr)
static const char *const information_xpm[]
static const char *const qt_shade_xpm[]
static const char *const qt_maximize_xpm[]
static const char *const qt_minimize_xpm[]
static const char *const critical_xpm[]
static const char *const warning_xpm[]
static QString clearText16IconPath()
static const char *const filedialog_start_xpm[]
static const char *const tb_extension_arrow_h_xpm[]
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
static const char *const tb_extension_arrow_v_xpm[]
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.
@ WindowContextHelpButtonHint
@ WindowMaximizeButtonHint
@ WindowMinimizeButtonHint
@ ToolButtonTextUnderIcon
static jboolean copy(JNIEnv *, jobject)
static QString wrapText(const QString &names, int optionNameMaxWidth, const QString &description)
AudioChannelLayoutTag tag
static QString header(const QString &name)
int qRound(qfloat16 d) noexcept
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()
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 GLenum GLsizei GLsizei GLsizei GLint border
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * label
[43]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei const GLint * box
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLfloat GLfloat GLfloat GLfloat h
GLfixed GLfixed GLint GLint GLfixed points
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLsizei const GLchar *const * path
static const QRectF boundingRect(const QPointF *points, int pointCount)
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
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)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
constexpr bool verticalTabs(QTabBar::Shape shape) noexcept
QVideoFrameFormat::PixelFormat fmt
const char className[16]
[1]
obj metaObject() -> className()
\inmodule QtCore \reentrant
Q_DECL_CONSTEXPR int size() const
Q_DECL_CONSTEXPR const QPointF & operator[](int idx) const
Q_DECL_CONSTEXPR const QPointF * cbegin() const