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;
479 for (
int jags = 1; jags <=
count; ++jags, rtl = !rtl)
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)
507#if QT_CONFIG(quick_itemview)
509 if (
const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
513 int x = viewOpt->rect.x() + 1;
514 int offset = (viewOpt->rect.height() / 3);
520 x = viewOpt->rect.x() + viewOpt->rect.width() - 1;
528 if (viewOpt->showDecorationSelected) {
562 p->drawLine(
rect.topLeft(),
rect.topRight());
567 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
574 else if (vopt->features & QStyleOptionViewItem::Alternate)
579 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
587 if (vopt->backgroundBrush.style() !=
Qt::NoBrush) {
589 p->setBrushOrigin(vopt->rect.topLeft());
590 p->fillRect(vopt->rect, vopt->backgroundBrush);
591 p->setBrushOrigin(oldBO);
618 % HexString<uint>(pe);
620 qreal pixelRatio =
p->device()->devicePixelRatioF();
653 QRect bounds =
a.boundingRect();
654 int sx = sqsize / 2 - bounds.
center().x() - 1;
655 int sy = sqsize / 2 - bounds.
center().y() - 1;
656 imagePainter.translate(sx + bsx, sy + bsy);
661 imagePainter.translate(1, 1);
664 imagePainter.drawPolygon(
a);
665 imagePainter.translate(-1, -1);
670 imagePainter.drawPolygon(
a);
673 pixmap.setDevicePixelRatio(pixelRatio);
676 int xOffset =
r.x() + (
r.width() -
size)/2;
677 int yOffset =
r.y() + (
r.height() -
size)/2;
678 p->drawPixmap(xOffset, yOffset,
pixmap);
690 switch (toolbutton->arrowType) {
714 *lastVisibleLine = -1;
723 line.setLineWidth(lineWidth);
726 widthUsed =
qMax(widthUsed,
line.naturalTextWidth());
728 if (maxHeight > 0 && lastVisibleLine &&
height +
line.height() > maxHeight) {
730 *lastVisibleLine = nextLine.
isValid() ?
i : -1;
742 bool lastVisibleLineShouldBeElided,
QPointF *paintStartPosition)
const
750 const bool vAlignmentOptimization = paintStartPosition && valign.testFlag(
Qt::AlignVCenter);
752 int lastVisibleLine = -1;
760 if (paintStartPosition)
765 const int lineCount = textLayout.
lineCount();
766 for (
int i = 0;
i < lineCount; ++
i) {
772 if (paintStartPosition)
773 paintStartPosition->ry() +=
line.height();
780 bool elideLastVisibleLine = lastVisibleLine ==
i;
781 if (!drawElided &&
i + 1 < lineCount && lastVisibleLineShouldBeElided) {
786 elideLastVisibleLine =
true;
790 if (drawElided || elideLastVisibleLine) {
791 if (elideLastVisibleLine) {
803 if (
i < lineCount - 1 &&
804 !
ret.endsWith(QChar::LineSeparator))
805 ret += QChar::LineSeparator;
812 (lastVisibleLine >= 0 && lastVisibleLine ==
i))
818#if QT_CONFIG(quick_itemview)
819QSize QCommonStylePrivate::viewItemSize(
const QStyleOptionViewItem *
option,
int role)
const
823 if (
option->features & QStyleOptionViewItem::HasCheckIndicator)
828 if (
option->features & QStyleOptionViewItem::HasDisplay) {
833 const bool wrapText =
option->features & QStyleOptionViewItem::WrapText;
836 switch (
option->decorationPosition) {
837 case QStyleOptionViewItem::Left:
838 case QStyleOptionViewItem::Right: {
841 if (
option->features & QStyleOptionViewItem::HasDecoration)
842 width -=
option->decorationSize.width() + 2 * textMargin;
848 case QStyleOptionViewItem::Top:
849 case QStyleOptionViewItem::Bottom:
859 if (
wrapText &&
option->features & QStyleOptionViewItem::HasCheckIndicator)
862 const int lineWidth = bounds.
width();
868 if (
option->features & QStyleOptionViewItem::HasDecoration) {
869 return option->decorationSize;
884 const bool wrapText =
option->features & QStyleOptionViewItem::WrapText;
894 true, &paintPosition);
910void QCommonStylePrivate::viewItemLayout(
const QStyleOptionViewItem *
opt,
QRect *checkRect,
918 const bool hasCheck = checkRect->isValid();
919 const bool hasPixmap = pixmapRect->isValid();
921 const bool hasMargin = (hasText | hasPixmap | hasCheck);
922 const int frameHMargin = hasMargin ?
924 const int textMargin = hasText ? frameHMargin : 0;
925 const int pixmapMargin = hasPixmap ? frameHMargin : 0;
926 const int checkMargin = hasCheck ? frameHMargin : 0;
938 pm = pixmapRect->size();
939 pm.rwidth() += 2 * pixmapMargin;
943 if (
opt->decorationPosition == QStyleOptionViewItem::Left
944 ||
opt->decorationPosition == QStyleOptionViewItem::Right) {
957 cw = checkRect->width() + 2 * checkMargin;
958 if (sizehint)
w +=
cw;
968 switch (
opt->decorationPosition) {
969 case QStyleOptionViewItem::Top: {
971 pm.setHeight(pm.height() + pixmapMargin);
982 case QStyleOptionViewItem::Bottom: {
995 case QStyleOptionViewItem::Left: {
1004 case QStyleOptionViewItem::Right: {
1014 qWarning(
"doLayout: decoration position is invalid");
1021 checkRect->size(), check);
1025 if (
opt->showDecorationSelected)
1071 tr.setRect(0, 0,
tr.height(),
tr.width());
1078 verticalShift = -verticalShift;
1079 tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding);
1082 tr.setTop(
tr.top() - verticalShift);
1083 tr.setRight(
tr.right() - horizontalShift);
1087 if (!
opt->leftButtonSize.isEmpty()) {
1088 tr.setLeft(
tr.left() + 4 +
1092 if (!
opt->rightButtonSize.isEmpty()) {
1093 tr.setRight(
tr.right() - 4 -
1110 const int offsetX = (
iconSize.width() - tabIconSize.width()) / 2;
1111 *iconRect =
QRect(
tr.left() + offsetX,
tr.center().y() - tabIconSize.height() / 2,
1112 tabIconSize.width(), tabIconSize.height());
1115 tr.setLeft(
tr.left() + tabIconSize.width() + 4);
1165 newBtn.
rect =
QRect(ir.right() - mbi + 2, ir.height()/2 - mbi/2 + 3, mbi - 6, mbi - 6);
1170 fropt.QStyleOption::operator=(*btn);
1194 int pixmapHeight =
pixmap.height() /
pixmap.devicePixelRatio();
1195 int labelWidth = pixmapWidth;
1196 int labelHeight = pixmapHeight;
1197 int iconSpacing = 4;
1200 labelWidth += (textWidth + iconSpacing);
1205 pixmapWidth, pixmapHeight);
1220 p->drawPixmap(iconRect,
pixmap);
1253 fropt.QStyleOption::operator=(*btn);
1321 = qstyleoption_cast<const QStyleOptionProgressBar *>(
opt)) {
1327 if (pb->textVisible) {
1345 QRect shadowRect(pb->rect);
1346 shadowRect.translate(1,1);
1347 QColor shadowColor = (pb->palette.color(textRole).value() <= 128)
1349 QPalette shadowPalette = pb->palette;
1350 shadowPalette.
setColor(textRole, shadowColor);
1362 const bool inverted = pb->invertedAppearance;
1369 if (pal2.highlight() == pal2.window())
1375 int w =
rect.width();
1376 if (pb->minimum == 0 && pb->maximum == 0) {
1378 int x = (progress - minimum) % (
w * 2);
1382 p->setPen(
QPen(pal2.highlight().color(), 4));
1391 u = ((
rect.width() + unit_width) / unit_width);
1394 qint64 p_v = progress - minimum;
1395 qint64 t_s = (maximum - minimum) ? (maximum - minimum) :
qint64(1);
1397 if (u > 0 && p_v >= INT_MAX / u && t_s >= u) {
1405 tnu = nu = p_v * u / t_s;
1407 if (nu * unit_width >
w)
1415 int x0 = reverse ?
rect.right() - ((unit_width > 1) ? unit_width : 0)
1420 pbBits.palette = pal2;
1421 int myY = pbBits.rect.
y();
1422 int myHeight = pbBits.rect.height();
1424 for (
int i = 0;
i < nu; ++
i) {
1425 pbBits.rect.setRect(
x0 +
x, myY, unit_width, myHeight);
1427 x += reverse ? -unit_width : unit_width;
1433 int pixels_left =
w - (nu * unit_width);
1434 int offset = reverse ?
x0 +
x + unit_width-pixels_left :
x0 +
x;
1435 pbBits.rect.setRect(
offset, myY, pixels_left, myHeight);
1444 if (!
header->icon.isNull()) {
1453 p->drawPixmap(inter.x(), inter.y(),
pixmap,
1460 rect.setLeft(
rect.left() + pixw + margin);
1462 rect.setRight(
rect.right() - pixw - margin);
1475 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
1485 if (((!hasArrow && toolbutton->icon.isNull()) && !toolbutton->text.isEmpty())
1490 rect.translate(shiftX, shiftY);
1491 p->setFont(toolbutton->font);
1497 QSize pmSize = toolbutton->iconSize;
1498 if (!toolbutton->icon.isNull()) {
1507 pm = toolbutton->icon.pixmap(toolbutton->rect.size().boundedTo(toolbutton->iconSize),
1513 p->setFont(toolbutton->font);
1521 pr.setHeight(pmSize.height() + 4);
1522 tr.adjust(0, pr.height() - 1, 0, -1);
1523 pr.translate(shiftX, shiftY);
1531 pr.setWidth(pmSize.width() + 4);
1532 tr.adjust(pr.width(), 0, 0, 0);
1533 pr.translate(shiftX, shiftY);
1541 tr.translate(shiftX, shiftY);
1547 rect.translate(shiftX, shiftY);
1565 p->setPen(tb->palette.mid().color().darker(150));
1566 int d = 20 + tb->rect.height() - 3;
1569 QPoint(-1, tb->rect.height() + 1),
1571 QPoint(tb->rect.width() -
d, 1),
1572 QPoint(tb->rect.width() - 20, tb->rect.height() - 2),
1573 QPoint(tb->rect.width() - 1, tb->rect.height() - 2),
1574 QPoint(tb->rect.width() - 1, tb->rect.height() + 1),
1575 QPoint(-1, tb->rect.height() + 1),
1580 QPoint(tb->rect.width(), tb->rect.height() + 1),
1581 QPoint(tb->rect.width(), 1),
1583 QPoint(20 - 1, tb->rect.height() - 2),
1584 QPoint(0, tb->rect.height() - 2),
1585 QPoint(0, tb->rect.height() + 1),
1586 QPoint(tb->rect.width(), tb->rect.height() + 1),
1590 p->setPen(tb->palette.light().color());
1592 p->drawLine(0, 2, tb->rect.width() -
d, 2);
1593 p->drawLine(tb->rect.width() -
d - 1, 2, tb->rect.width() - 21, tb->rect.height() - 1);
1594 p->drawLine(tb->rect.width() - 20, tb->rect.height() - 1,
1595 tb->rect.width(), tb->rect.height() - 1);
1597 p->drawLine(tb->rect.width() - 1, 2,
d - 1, 2);
1598 p->drawLine(
d, 2, 20, tb->rect.height() - 1);
1599 p->drawLine(19, tb->rect.height() - 1,
1600 -1, tb->rect.height() - 1);
1621 switch (tab->shape) {
1623 rect.adjust(0, 0, 0, -tabOverlap);
1625 rect.adjust(1, 1, -1, 0);
1628 rect.adjust(0, tabOverlap, 0, 0);
1630 rect.adjust(1, 0, -1, -1);
1633 rect.adjust(tabOverlap, 0, 0, 0);
1635 rect.adjust(0, 1, -1, -1);
1638 rect.adjust(0, 0, -tabOverlap, 0);
1640 rect.adjust(1, 1, 0, -1);
1647 p->setPen(
QPen(tab->palette.windowText(), 0));
1649 p->setBrush(tab->palette.base());
1651 p->setBrush(tab->palette.window());
1657 switch (tab->shape) {
1660 a.setPoint(0, 0, -1);
1661 a.setPoint(1, 0, 0);
1662 y =
rect.height() - 2;
1664 a.setPoint(2,
x++,
y - 1);
1666 a.setPoint(3,
x++,
y++);
1667 a.setPoint(4,
x,
y);
1671 for (
i = 0;
i < 5; ++
i)
1672 a.setPoint(9 -
i,
right -
a.point(
i).x(),
a.point(
i).y());
1674 for (
i = 0;
i < 10; ++
i)
1675 a.setPoint(
i,
a.point(
i).x(),
rect.height() - 1 -
a.point(
i).y());
1679 p->translate(0, 0.5);
1687 a.setPoint(0, -1, 0);
1688 a.setPoint(1, 0, 0);
1689 x =
rect.width() - 2;
1691 a.setPoint(2,
x - 1,
y++);
1693 a.setPoint(3,
x++,
y++);
1694 a.setPoint(4,
x,
y);
1697 for (
i = 0;
i < 5; ++
i)
1698 a.setPoint(9 -
i,
a.point(
i).x(),
bottom -
a.point(
i).y());
1700 for (
i = 0;
i < 10; ++
i)
1701 a.setPoint(
i,
rect.width() - 1 -
a.point(
i).x(),
a.point(
i).y());
1704 p->translate(0.5, 0);
1728 tr.adjust(4, 0, -8, 0);
1745 p->drawPixmap(ir.left(), (tb->rect.height() - ih) / 2, pm);
1775 int newX, newY, newRot;
1777 newX =
tr.width() +
tr.x();
1782 newY =
tr.y() +
tr.height();
1787 p->setTransform(
m,
true);
1790 d->tabLayout(tab, &
tr, &iconRect);
1793 if (!tab->icon.isNull()) {
1794 QPixmap tabIcon = tab->icon.pixmap(tab->iconSize,
dpr(
opt->window),
1799 p->drawPixmap(iconRect.x(), iconRect.y(), tabIcon);
1810 x1 = tab->rect.left();
1811 x2 = tab->rect.right() - 1;
1814 fropt.QStyleOption::operator=(*tab);
1816 x2 -
x1 - 2*OFFSET, tab->rect.height() - 2*OFFSET);
1828 p->translate(0,
h -
w);
1830 p->translate(
w -
h, 0);
1838 corner = sgOpt->corner;
1846 for (
int i = 0;
i < 4; ++
i) {
1848 p->drawLine(
x, sy - 1 , sx + 1, sw);
1850 p->drawLine(
x, sy, sx, sw);
1852 p->drawLine(
x, sy + 1, sx - 1, sw);
1857 for (
int i = 0;
i < 4; ++
i) {
1859 p->drawLine(sx - 1, sw, sw, sy - 1);
1861 p->drawLine(sx, sw, sw, sy);
1863 p->drawLine(sx + 1, sw, sw, sy + 1);
1869 for (
int i = 0;
i < 4; ++
i) {
1871 p->drawLine(sx - 1,
y, sw, sy + 1);
1873 p->drawLine(sx,
y, sw, sy);
1875 p->drawLine(sx + 1,
y, sw, sy - 1);
1880 for (
int i = 0;
i < 4; ++
i) {
1882 p->drawLine(
x, sy - 1, sx - 1,
y);
1884 p->drawLine(
x, sy, sx,
y);
1886 p->drawLine(
x, sy + 1, sx + 1,
y);
1896 QPainter pixmapPainter(&tiledPixmap);
1901 pixmapPainter.drawRect(0, 0, tiledPixmap.width(), tiledPixmap.height());
1902 pixmapPainter.end();
1910 p->setClipRegion(
mask.region);
1911 p->drawTiledPixmap(
r.x(),
r.y(),
r.width(),
r.height(), tiledPixmap);
1914 p->drawRect(
r.adjusted(0, 0, -1, -1));
1916 p->drawRect(
r.adjusted(3, 3, -4, -4));
1923 if (dwOpt->movable) {
1928 if (!dwOpt->title.isEmpty()) {
1929 const bool verticalTitleBar = dwOpt->verticalTitleBar;
1931 if (verticalTitleBar) {
1935 p->translate(
r.left(),
r.top() +
r.width());
1937 p->translate(-
r.left(), -
r.top());
1940 const int indent =
p->fontMetrics().descent();
1946 if (verticalTitleBar)
1953 QRegion clipRegion =
p->clipRegion();
1964 p->setClipRegion(clipRegion);
1982 p->setClipRect(editRect);
1983 if (!
cb->currentIcon.isNull()) {
1987 QRect iconRect(editRect);
1988 iconRect.setWidth(
cb->iconSize.width() + 4);
1991 iconRect.size(), editRect);
1997 editRect.translate(-4 -
cb->iconSize.width(), 0);
1999 editRect.translate(
cb->iconSize.width() + 4, 0);
2001 if (!
cb->currentText.isEmpty() && !
cb->editable) {
2013 frame.QStyleOption::operator=(*toolBar);
2018 qDrawShadePanel(
p, toolBar->rect, toolBar->palette,
false, toolBar->lineWidth,
2039 p->drawLine(line1starting,
top, line1starting,
bottom);
2040 p->drawLine(line2starting,
top, line2starting,
bottom);
2043#if QT_CONFIG(quick_itemview)
2045 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
2057 if (vopt->features & QStyleOptionViewItem::HasCheckIndicator) {
2058 QStyleOptionViewItem
option(*vopt);
2062 switch (vopt->checkState) {
2083 vopt->icon.paint(
p, iconRect, vopt->decorationAlignment,
mode,
state);
2086 if (!vopt->text.isEmpty()) {
2108 o.QStyleOption::operator=(*vopt);
2125 int frameShape =
f->frameShape;
2133 int lw =
f->lineWidth;
2134 int mlw =
f->midLineWidth;
2137 switch (frameShape) {
2173 QPen oldPen =
p->pen();
2175 p->drawLine(
p1,
p2);
2209 int dbw1 = 0, dbw2 = 0;
2248 r.adjust(1, 1, -1, -1);
2298 r.adjust(1, 1, -1, -1);
2325 r.setRect(0, tickOffset - 1, slider->rect.width(), thickness + 2);
2327 r.setRect(tickOffset - 1, 0, thickness + 2, slider->rect.height());
2328 r =
r.intersected(slider->rect);
2337 if (pb->textVisible)
2338 textw =
qMax(pb->fontMetrics.horizontalAdvance(pb->text), pb->fontMetrics.horizontalAdvance(
QLatin1String(
"100%"))) + 6;
2342 r.setCoords(pb->rect.left(), pb->rect.top(),
2343 pb->rect.right() - textw, pb->rect.bottom());
2345 r.setCoords(pb->rect.right() - textw, pb->rect.top(),
2346 pb->rect.right(), pb->rect.bottom());
2355 int margin =
cb->frame ? 3 : 0;
2376 r.setHeight(
r.height() - (
opt->
rect.
width() / 2) - (margin * 2));
2389 int horiz_size =
h / 2;
2390 r.setRect(
x +
w - margin * 2 - horiz_size,
y + 5,
2391 horiz_size,
h - margin * 2 - 5);
2393 int vert_size =
w / 2;
2394 r.setRect(
x + 5,
y +
h - margin * 2 - vert_size,
2395 w - margin * 2 - 5, vert_size);
2410 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
2411 r.setSize(twf->tabBarSize);
2413 switch (twf->shape) {
2418 r.setWidth(
qMin(
r.width(), twf->rect.width()
2419 - twf->leftCornerWidgetSize.width()
2420 - twf->rightCornerWidgetSize.width()));
2424 r.moveTopLeft(
QPoint(twf->leftCornerWidgetSize.width(), 0));
2427 r.moveTopLeft(
QPoint(twf->rect.center().x() -
qRound(
r.width() / 2.0f)
2428 + (twf->leftCornerWidgetSize.width() / 2)
2429 - (twf->rightCornerWidgetSize.width() / 2), 0));
2432 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width()
2433 - twf->rightCornerWidgetSize.width(), 0));
2440 r.setWidth(
qMin(
r.width(), twf->rect.width()
2441 - twf->leftCornerWidgetSize.width()
2442 - twf->rightCornerWidgetSize.width()));
2446 r.moveTopLeft(
QPoint(twf->leftCornerWidgetSize.width(),
2447 twf->rect.height() - twf->tabBarSize.height()));
2450 r.moveTopLeft(
QPoint(twf->rect.center().x() -
qRound(
r.width() / 2.0f)
2451 + (twf->leftCornerWidgetSize.width() / 2)
2452 - (twf->rightCornerWidgetSize.width() / 2),
2453 twf->rect.height() - twf->tabBarSize.height()));
2456 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width()
2457 - twf->rightCornerWidgetSize.width(),
2458 twf->rect.height() - twf->tabBarSize.height()));
2465 r.setHeight(
qMin(
r.height(), twf->rect.height()
2466 - twf->leftCornerWidgetSize.height()
2467 - twf->rightCornerWidgetSize.height()));
2471 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2472 twf->leftCornerWidgetSize.height()));
2475 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2476 twf->rect.center().y() -
r.height() / 2));
2479 r.moveTopLeft(
QPoint(twf->rect.width() - twf->tabBarSize.width(),
2480 twf->rect.height() - twf->tabBarSize.height()
2481 - twf->rightCornerWidgetSize.height()));
2487 r.setHeight(
qMin(
r.height(), twf->rect.height()
2488 - twf->leftCornerWidgetSize.height()
2489 - twf->rightCornerWidgetSize.height()));
2493 r.moveTopLeft(
QPoint(0, twf->leftCornerWidgetSize.height()));
2496 r.moveTopLeft(
QPoint(0, twf->rect.center().y() -
r.height() / 2));
2499 r.moveTopLeft(
QPoint(0, twf->rect.height() - twf->tabBarSize.height()
2500 - twf->rightCornerWidgetSize.height()));
2511 tabopt.
shape = twf->shape;
2513 if (twf->lineWidth == 0)
2515 switch (twf->shape) {
2519 QSize(twf->rect.width(),
qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height())));
2523 r =
QRect(
QPoint(0,0),
QSize(twf->rect.width(),
qMin(twf->rect.height() - twf->tabBarSize.height() + overlap, twf->rect.height())));
2527 r =
QRect(
QPoint(0, 0),
QSize(
qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height()));
2532 QSize(
qMin(twf->rect.width() - twf->tabBarSize.width() + overlap, twf->rect.width()), twf->rect.height()));
2536 r.adjust(2, 2, -2, -2);
2542 switch (twf->shape) {
2545 r =
QRect(
QPoint(paneRect.x(), paneRect.y() - twf->leftCornerWidgetSize.height()),
2546 twf->leftCornerWidgetSize);
2550 r =
QRect(
QPoint(paneRect.x(), paneRect.height()), twf->leftCornerWidgetSize);
2561 switch (twf->shape) {
2564 r =
QRect(
QPoint(paneRect.width() - twf->rightCornerWidgetSize.width(),
2565 paneRect.y() - twf->rightCornerWidgetSize.height()),
2566 twf->rightCornerWidgetSize);
2570 r =
QRect(
QPoint(paneRect.width() - twf->rightCornerWidgetSize.width(),
2571 paneRect.height()), twf->rightCornerWidgetSize);
2581 QRect dummyIconRect;
2582 d->tabLayout(tab, &
r, &dummyIconRect);
2592 hpadding =
qMax(hpadding, 4);
2601 verticalShift = -verticalShift;
2603 qSwap(horizontalShift, verticalShift);
2604 horizontalShift *= -1;
2605 verticalShift *= -1;
2608 horizontalShift = -horizontalShift;
2610 tr.adjust(0, 0, horizontalShift, verticalShift);
2613 tr.setBottom(
tr.bottom() - verticalShift);
2614 tr.setRight(
tr.right() - horizontalShift);
2618 int w =
size.width();
2619 int h =
size.height();
2620 int midHeight =
static_cast<int>(
qCeil(
float(
tr.height() -
h) / 2));
2621 int midWidth = ((
tr.width() -
w) / 2);
2623 bool atTheTop =
true;
2624 switch (tab->shape) {
2635 r =
QRect(tab->rect.x() + hpadding, midHeight,
w,
h);
2637 r =
QRect(tab->rect.right() -
w - hpadding, midHeight,
w,
h);
2642 r =
QRect(midWidth,
tr.y() + tab->rect.height() - hpadding -
h,
w,
h);
2644 r =
QRect(midWidth,
tr.y() + hpadding,
w,
h);
2651 switch (tab->shape) {
2656 r.setRect(tab->rect.left(), tab->rect.top(), 8,
opt->
rect.
height());
2662 r.setRect(tab->rect.left(), tab->rect.top(),
opt->
rect.
width(), 8);
2692 r =
f->rect.
adjusted(
f->lineWidth,
f->lineWidth, -
f->lineWidth, -
f->lineWidth);
2705 int frameShape =
f->frameShape;
2715 switch (frameShape) {
2723 switch (frameShadow) {
2725 frameWidth =
f->lineWidth;
2729 frameWidth = (short)(
f->lineWidth*2 +
f->midLineWidth);
2744 switch (frameShadow) {
2748 frameWidth =
f->lineWidth;
2753 r =
f->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth);
2765 = qstyleoption_cast<const QStyleOptionDockWidget*>(
opt);
2766 bool canClose = dwOpt ==
nullptr ? true : dwOpt->closable;
2767 bool canFloat = dwOpt ==
nullptr ?
false : dwOpt->floatable;
2769 const bool verticalTitleBar = dwOpt && dwOpt->verticalTitleBar;
2774 if (verticalTitleBar)
2785 sz +=
QSize(buttonMargin, buttonMargin);
2786 if (verticalTitleBar)
2791 right = closeRect.left() - 1;
2802 sz +=
QSize(buttonMargin, buttonMargin);
2803 if (verticalTitleBar)
2808 right = floatRect.left() - 1;
2830 if (verticalTitleBar) {
2833 r.height(),
r.width());
2839#if QT_CONFIG(quick_itemview)
2841 if (!qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
2849 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
2850 if (!
d->isViewItemCached(*vopt)) {
2851 d->viewItemLayout(vopt, &
d->checkRect, &
d->decorationRect, &
d->displayRect,
false);
2852 if (
d->cachedOption) {
2853 delete d->cachedOption;
2854 d->cachedOption =
nullptr;
2856 d->cachedOption =
new QStyleOptionViewItem(*vopt);
2861 r =
d->decorationRect;
2872 const QMargins margins(2, 2, 2, 2);
2877 tbopt->rect.height() - (margins.
top() + margins.
bottom()));
2881 tbopt->rect.width() - (margins.
left() + margins.
right()),
2906 int width = dial->rect.width();
2907 int height = dial->rect.height();
2909 int currentSliderPosition = dial->upsideDown ? dial->sliderPosition : (dial->maximum - dial->sliderPosition);
2911 qreal startAngle = (90. - dial->startAngle) *
Q_PI / 180.;
2912 qreal spanAngle = (dial->endAngle - dial->startAngle) *
Q_PI / 180.;
2913 if (dial->maximum == dial->minimum)
2916 a = (startAngle - (currentSliderPosition - dial->minimum) * spanAngle
2917 / (dial->maximum - dial->minimum));
2927 StaticPolygonF<3> arrow = {{
2931 0.5 + yc - back *
qSin(
a +
Q_PI * 5 / 6)),
2933 0.5 + yc - back *
qSin(
a -
Q_PI * 5 / 6)),
2945 int ticks = slider->tickPosition;
2949 int interval = slider->tickInterval;
2950 if (interval <= 0) {
2951 interval = slider->singleStep;
2956 interval = slider->pageStep;
2960 int fudge =
len / 2;
2964 p->translate(slider->rect.x(), slider->rect.y());
2965 p->setPen(slider->palette.windowText().color());
2966 int v = slider->minimum;
2967 while (v <= slider->maximum + 1) {
2968 if (
v == slider->maximum + 1 && interval == 1)
2970 const int v_ =
qMin(
v, slider->maximum);
2972 v_, available) + fudge;
2975 p->drawLine(
pos, 0,
pos, tickOffset - 2);
2977 p->drawLine(
pos, tickOffset + thickness + 1,
pos,
2978 slider->rect.height()-1);
2981 p->drawLine(0,
pos, tickOffset - 2,
pos);
2983 p->drawLine(tickOffset + thickness + 1,
pos,
2984 slider->rect.width()-1,
pos);
2987 int nextInterval =
v + interval;
2988 if (nextInterval <
v)
3000 State saveFlags = scrollbar->state;
3003 newScrollbar.state = saveFlags;
3005 if (newScrollbar.rect.isValid()) {
3012 newScrollbar.rect = scrollbar->rect;
3013 newScrollbar.state = saveFlags;
3015 if (newScrollbar.rect.isValid()) {
3022 newScrollbar.rect = scrollbar->rect;
3023 newScrollbar.state = saveFlags;
3025 if (newScrollbar.rect.isValid()) {
3032 newScrollbar.rect = scrollbar->rect;
3033 newScrollbar.state = saveFlags;
3035 if (newScrollbar.rect.isValid()) {
3042 newScrollbar.rect = scrollbar->rect;
3043 newScrollbar.state = saveFlags;
3045 if (newScrollbar.rect.isValid()) {
3052 newScrollbar.rect = scrollbar->rect;
3053 newScrollbar.state = saveFlags;
3055 if (newScrollbar.rect.isValid()) {
3062 newScrollbar.rect = scrollbar->rect;
3063 newScrollbar.state = saveFlags;
3065 if (newScrollbar.rect.isValid()) {
3072 fropt.QStyleOption::operator=(newScrollbar);
3073 fropt.
rect.
setRect(newScrollbar.rect.x() + 2, newScrollbar.rect.y() + 2,
3074 newScrollbar.rect.width() - 5,
3075 newScrollbar.rect.height() - 5);
3097 copy.state &= ~State_Enabled;
3100 copy.palette = pal2;
3107 copy.state &= ~State_Sunken;
3114 copy.rect.adjust(3, 0, -4, 0);
3120 copy.state = sb->state;
3124 copy.state &= ~State_Enabled;
3126 copy.palette = pal2;
3133 copy.state &= ~State_Sunken;
3140 copy.rect.adjust(3, 0, -4, 0);
3147 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
3152 State bflags = toolbutton->state & ~State_Sunken;
3156 bflags &= ~State_Raised;
3159 State mflags = bflags;
3170 tool.
state = bflags;
3177 fr.QStyleOption::operator=(*toolbutton);
3191 tool.
rect = menuarea;
3192 tool.
state = mflags;
3198 QRect ir = toolbutton->rect;
3200 newBtn.
rect =
QRect(ir.right() + 5 - mbi, ir.y() + ir.height() - mbi + 4, mbi - 6, mbi - 6);
3210 QColor left = tb->palette.highlight().color();
3215 QPoint p1(tb->rect.x(), tb->rect.top() + tb->rect.height()/2);
3216 QPoint p2(tb->rect.right(), tb->rect.top() + tb->rect.height()/2);
3218 lg.setColorAt(0,
left);
3219 lg.setColorAt(1,
right);
3227 p->setPen(tb->palette.highlightedText().color());
3228 p->drawText(ir.x() + 2, ir.y(), ir.width() - 2, ir.height(),
3298 if (drawNormalButton) {
3366 if (!tb->icon.isNull()) {
3367 tb->icon.paint(
p, ir);
3388 int width = dial->rect.width();
3389 int height = dial->rect.height();
3392 qreal dx = dial->rect.x() + d_ + (
width - 2 *
r) / 2 + 1;
3393 qreal dy = dial->rect.y() + d_ + (
height - 2 *
r) / 2 + 1;
3394 QRect br =
QRect(
int(dx),
int(dy),
int(
r * 2 - 2 * d_ - 2),
int(
r * 2 - 2 * d_ - 2));
3410 p->drawArc(br, 60 * 16, 180 * 16);
3412 p->drawArc(br, 240 * 16, 180 * 16);
3415 const StaticPolygonF<3> arrow =
calcArrow(dial,
a);
3419 p->drawPolygon(arrow.cbegin(), arrow.size());
3424 if (a <= 0 || a > 200) {
3426 p->drawLine(arrow[2], arrow[0]);
3427 p->drawLine(arrow[1], arrow[2]);
3429 p->drawLine(arrow[0], arrow[1]);
3430 }
else if (
a > 0 &&
a < 45) {
3432 p->drawLine(arrow[2], arrow[0]);
3434 p->drawLine(arrow[1], arrow[2]);
3435 p->drawLine(arrow[0], arrow[1]);
3436 }
else if (
a >= 45 &&
a < 135) {
3438 p->drawLine(arrow[2], arrow[0]);
3439 p->drawLine(arrow[1], arrow[2]);
3441 p->drawLine(arrow[0], arrow[1]);
3442 }
else if (
a >= 135 &&
a < 200) {
3444 p->drawLine(arrow[2], arrow[0]);
3446 p->drawLine(arrow[0], arrow[1]);
3447 p->drawLine(arrow[1], arrow[2]);
3452 fropt.
rect = dial->rect;
3453 fropt.state = dial->state;
3454 fropt.palette = dial->palette;
3456 br.adjust(0, 0, 2, 2);
3459 br.translate(-
r / 6, -
r / 6);
3460 br.setWidth(br.width() +
r / 3);
3461 br.setHeight(br.height() +
r / 3);
3463 fropt.rect = br.adjusted(-2, -2, 2, 2);
3476 frame.QStyleOption::operator=(*groupBox);
3488 finalRect.
adjust(ltr ? -4 : 0, 0, ltr ? 0 : 4, 0);
3492 region -= finalRect;
3494 p->setClipRegion(region);
3503 p->setPen(textColor);
3514 fropt.QStyleOption::operator=(*groupBox);
3523 box.QStyleOption::operator=(*groupBox);
3532 btnOpt.QStyleOption::operator=(*opt);
3533 btnOpt.
state &= ~State_MouseOver;
3537 const QSize buttonIconSize(buttonIconMetric, buttonIconMetric);
3541 btnOpt.state &= ~State_Raised;
3546 btnOpt.state &= ~State_Sunken;
3558 btnOpt.state &= ~State_Raised;
3563 btnOpt.state &= ~State_Sunken;
3575 btnOpt.state &= ~State_Raised;
3580 btnOpt.state &= ~State_Sunken;
3592 qWarning(
"QCommonStyle::drawComplexControl: Control %d not handled", cc);
3606 if (
r.isValid() &&
r.contains(pt)) {
3610 if (
r.isValid() &&
r.contains(pt))
3621 if (
r.isValid() &&
r.contains(pt)) {
3635 if (
r.isValid() &&
r.contains(pt)) {
3649 if (
r.isValid() &&
r.contains(pt)) {
3664 if (
r.isValid() &&
r.contains(pt)) {
3678 if (
r.isValid() &&
r.contains(pt)) {
3692 if (
r.isValid() &&
r.contains(pt)) {
3706 if (
r.isValid() &&
r.contains(pt) && (
opt->subControls & ctrl)) {
3715 qWarning(
"QCommonStyle::hitTestComplexControl: Case %d not handled", cc);
3738 slider->sliderPosition,
3739 (horizontal ? slider->rect.width()
3740 : slider->rect.height()) -
len,
3741 slider->upsideDown);
3743 ret.setRect(slider->rect.x() + sliderPos, slider->rect.y() + tickOffset,
len, thickness);
3745 ret.setRect(slider->rect.x() + tickOffset, slider->rect.y() + sliderPos, thickness,
len);
3749 ret.setRect(slider->rect.x(), slider->rect.y() + tickOffset,
3750 slider->rect.width(), thickness);
3752 ret.setRect(slider->rect.x() + tickOffset, slider->rect.y(),
3753 thickness, slider->rect.height());
3763 const QRect scrollBarRect = scrollbar->rect;
3768 scrollBarRect.width() : scrollBarRect.height()) - (sbextent * 2);
3772 if (scrollbar->maximum != scrollbar->minimum) {
3773 uint range = scrollbar->maximum - scrollbar->minimum;
3774 sliderlen = (
qint64(scrollbar->pageStep) * maxlen) / (
range + scrollbar->pageStep);
3777 if (sliderlen < slidermin || range > INT_MAX / 2)
3778 sliderlen = slidermin;
3779 if (sliderlen > maxlen)
3787 scrollbar->sliderPosition,
3789 scrollbar->upsideDown);
3794 int buttonWidth =
qMin(scrollBarRect.width() / 2, sbextent);
3795 ret.setRect(0, 0, buttonWidth, scrollBarRect.height());
3797 int buttonHeight =
qMin(scrollBarRect.height() / 2, sbextent);
3798 ret.setRect(0, 0, scrollBarRect.width(), buttonHeight);
3803 int buttonWidth =
qMin(scrollBarRect.width()/2, sbextent);
3804 ret.setRect(scrollBarRect.width() - buttonWidth, 0, buttonWidth, scrollBarRect.height());
3806 int buttonHeight =
qMin(scrollBarRect.height()/2, sbextent);
3807 ret.setRect(0, scrollBarRect.height() - buttonHeight, scrollBarRect.width(), buttonHeight);
3812 ret.setRect(sbextent, 0, sliderstart - sbextent, scrollBarRect.height());
3814 ret.setRect(0, sbextent, scrollBarRect.width(), sliderstart - sbextent);
3818 ret.setRect(sliderstart + sliderlen, 0,
3819 maxlen - sliderstart - sliderlen + sbextent, scrollBarRect.height());
3821 ret.setRect(0, sliderstart + sliderlen, scrollBarRect.width(),
3822 maxlen - sliderstart - sliderlen + sbextent);
3826 ret.setRect(sbextent, 0, scrollBarRect.width() - sbextent * 2,
3827 scrollBarRect.height());
3829 ret.setRect(0, sbextent, scrollBarRect.width(),
3830 scrollBarRect.height() - sbextent * 2);
3834 ret.setRect(sliderstart, 0, sliderlen, scrollBarRect.height());
3836 ret.setRect(0, sliderstart, scrollBarRect.width(), sliderlen);
3848 bs.setHeight(
qMax(8, spinbox->rect.height()/2 - fw));
3850 bs.setWidth(
qMax(16,
qMin(bs.height() * 8 / 5, spinbox->rect.width() / 4)));
3851 int y = fw + spinbox->rect.y();
3853 x = spinbox->rect.x() + spinbox->rect.width() - fw - bs.width();
3866 ret =
QRect(
x,
y + bs.height(), bs.width(), bs.height());
3870 ret =
QRect(lx, fw, spinbox->rect.width() - 2*fw, spinbox->rect.height() - 2*fw);
3872 ret =
QRect(lx, fw,
rx, spinbox->rect.height() - 2*fw);
3876 ret = spinbox->rect;
3893 ret.adjust(0, 0, -mbi, 0);
3899 ret.adjust(
ret.width() - mbi, 0, 0, 0);
3910 const int x =
cb->rect.x(),
y =
cb->rect.y(), wi =
cb->rect.width(), he =
cb->rect.height();
3937 const int controlMargin = 2;
3938 const int controlHeight = tb->rect.height() - controlMargin *2;
3939 const int delta = controlHeight + controlMargin;
3950 ret.adjust(delta, 0, -delta, 0);
3952 ret.adjust(0, 0, -delta, 0);
3954 ret.adjust(0, 0, -delta, 0);
3956 ret.adjust(0, 0, -delta, 0);
3958 ret.adjust(0, 0, -delta, 0);
4002 ret.setRect(tb->rect.right() -
offset, tb->rect.top() + controlMargin,
4003 controlHeight, controlHeight);
4007 ret.setRect(tb->rect.left() + controlMargin, tb->rect.top() + controlMargin,
4008 controlHeight, controlHeight);
4030 topMargin = topHeight / 2;
4032 topMargin = topHeight;
4036 frameRect.
setTop(topMargin);
4046 ret = frameRect.
adjusted(frameWidth, frameWidth + topHeight - topMargin,
4047 -frameWidth, -frameWidth);
4062 int checkBoxWidth = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0;
4063 int checkBoxHeight = hasCheckBox ? indicatorHeight : 0;
4065 int h =
qMax(th, checkBoxHeight);
4078 left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth);
4079 int top = totalRect.top() + (
h - checkBoxHeight) / 2;
4080 totalRect.setRect(
left,
top, indicatorWidth, indicatorHeight);
4083 left = ltr ? (totalRect.left() + checkBoxWidth - 2) : totalRect.left();
4084 int top = totalRect.top() + (
h - th) / 2;
4085 totalRect.setRect(
left,
top, totalRect.width() - checkBoxWidth, th);
4099 int numSubControls = 0;
4106 if (numSubControls == 0)
4109 int buttonWidth =
opt->
rect.
width() / numSubControls - 1;
4114 if (numSubControls == 1)
4116 offset += buttonWidth + 2;
4122 if (numSubControls == 1 || (numSubControls == 2 && !(
opt->subControls &
SC_MdiMinButton)))
4134 if (numSubControls == 1)
4139 qWarning(
"QCommonStyle::subControlRect: Case %d not handled", cc);
4237 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height()
4240 int ticks = sl->tickPosition;
4243 ret = (space - thickness) / 2;
4245 ret = space - thickness;
4521 sz +=
QSize(
w + margins, 4);
4522 sz.setHeight(
qMax(sz.height(),
h));
4527 bool checkable = mi->menuHasCheckableItems;
4528 int maxpmw = mi->maxIconWidth;
4529 int w = sz.width(),
h = sz.height();
4534 h = mi->fontMetrics.height() + 8;
4535 if (!mi->icon.isNull()) {
4544 if (checkable && maxpmw < 20)
4546 if (checkable || maxpmw > 0)
4553 sz =
QSize(sz.width() + 6, sz.height() + 5);
4561 sz =
QSize(sz.width() + fw +
other, sz.height() + fw);
4566 bool nullIcon = hdr->icon.isNull();
4569 QSize txt = hdr->fontMetrics.size(0, hdr->text);
4571 sz.setWidth((nullIcon ? 0 : margin) +
iconSize
4572 + (hdr->text.isNull() ? 0 : margin) +
txt.width() + margin);
4576 sz.rwidth() += sz.height() + margin;
4578 sz.rheight() += sz.width() + margin;
4587 const int borderSize = 2 *
f->lineWidth;
4588 sz +=
QSize(borderSize, borderSize);
4589 const int minSize = 10;
4590 if (sz.width() < minSize)
4591 sz.rwidth() = minSize;
4592 if (sz.height() < minSize)
4593 sz.rheight() = minSize;
4608 width += buttonSize + 1;
4610 width += buttonSize + 1;
4612 width += buttonSize + 1;
4616 sz =
QSize(1 + 3 * (buttonSize + 1), buttonSize);
4619#if QT_CONFIG(quick_itemview)
4621 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
4623 QRect decorationRect, displayRect, checkRect;
4624 d->viewItemLayout(vopt, &checkRect, &decorationRect, &displayRect,
true);
4625 sz = (decorationRect|displayRect|checkRect).
size();
4626 if (decorationRect.isValid() && sz.height() == decorationRect.height())
4639 sz +=
QSize(buttonWidth + 2*fw, 1 + 2*fw);
4642 const int upAndDownTogetherHeight = buttonSize.height() * 2;
4643 sz +=
QSize(buttonSize.width(), upAndDownTogetherHeight);
4656 const int ninePatchSplit = 1;
4657 int w =
qMax(10, (
option->lineWidth * 2) + ninePatchSplit);
4776#if defined(Q_OS_DARWIN)
4793 ret =
hint.toChar().unicode();
4932 vret->variant =
fmt;
4988#if QT_CONFIG(quick_itemview)
4990 ret = QStyleOptionViewItem::ScrollPerItem;
5016#if QT_CONFIG(imageformat_xpm)
5017static QPixmap cachedPixmapFromXPM(
const char *
const *xpm)
5028static inline QPixmap titleBarMenuCachedPixmapFromXPM() {
return cachedPixmapFromXPM(
qt_menu_xpm); }
5033 return QStringLiteral(
":/qt-project.org/styles/commonstyle/images/cleartext-16.png");
5036#if defined(Q_OS_WIN) || QT_CONFIG(imageformat_png)
5037static QIcon clearTextIcon(
bool rtl)
5039 const QString directionalThemeName = rtl
5048#ifndef QT_NO_IMAGEFORMAT_PNG
5050 Q_ASSERT(!clearText16.size().isEmpty());
5053 Q_ASSERT(!clearText32.size().isEmpty());
5055 clearText32.setDevicePixelRatio(2);
5065#if QT_CONFIG(imageformat_png)
5211 if (!fileIcon.
isNull()) {
5222 if (!dirIcon.isNull()) {
5230 pixmap = clearTextIcon(rtl).pixmap(16);
5241#ifndef QT_NO_IMAGEFORMAT_XPM
5256#ifndef QT_NO_IMAGEFORMAT_PNG
5277 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/newdirectory-16.png"));
5279 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/viewdetailed-16.png"));
5283 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/filecontents-16.png"));
5295 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/networkdrive-16.png"));
5317 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-ok-16.png"));
5319 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-cancel-16.png"));
5321 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-help-16.png"));
5323 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-open-16.png"));
5325 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-save-16.png"));
5327 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-close-16.png"));
5329 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-apply-16.png"));
5331 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-clear-16.png"));
5333 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-delete-16.png"));
5335 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-yes-16.png"));
5337 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/standardbutton-no-16.png"));
5345 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-pause-32.png"));
5349 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-seek-forward-32.png"));
5351 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-seek-backward-32.png"));
5353 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-skip-forward-32.png"));
5355 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-skip-backward-32.png"));
5357 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-volume-16.png"));
5359 return QPixmap(
QLatin1String(
":/qt-project.org/styles/commonstyle/images/media-volume-muted-16.png"));
5367#ifndef QT_NO_IMAGEFORMAT_XPM
5370 return titleBarMenuCachedPixmapFromXPM();
5400#if !QT_CONFIG(imageformat_png) && !QT_CONFIG(imageformat_xpm)
5407#if QT_CONFIG(imageformat_png)
5408static inline QString iconResourcePrefix() {
return QStringLiteral(
":/qt-project.org/styles/commonstyle/images/"); }
5417static const int dockTitleIconSizes[] = {10, 16, 20, 32, 48, 64};
5418static const int titleBarSizes[] = {16, 32, 48};
5419static const int toolBarExtHSizes[] = {8, 16, 32};
5420static const int toolBarExtVSizes[] = {5, 10, 20};
5465 pixmap = theme->standardPixmap(spOn, pixSize);
5471 icon = clearTextIcon(rtl);
5624 if (!linkIcon.isNull()) {
5628 for (
int i = 0 ;
i <
sizes.size() ; ++
i) {
5642 if (!linkIcon.isNull()) {
5646 for (
int i = 0 ;
i <
sizes.size() ; ++
i) {
5665#if defined(Q_OS_MAC)
5683 titleBarIcon.
addFile(
QLatin1String(
":/qt-project.org/styles/macstyle/images/closedock-16.png"));
5686 titleBarIcon.addFile(
QLatin1String(
":/qt-project.org/styles/macstyle/images/dockdock-16.png"));
5689 return titleBarIcon;
5723 retIcon.addPixmap(mainIcon);
5725 if (!retIcon.isNull())
5736#ifndef QT_NO_IMAGEFORMAT_PNG
5738 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-min-"),
5739 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5742 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-max-"),
5743 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5746 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-shade-"),
5747 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5751 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-unshade-"),
5752 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5755 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"titlebar-contexthelp-"),
5756 titleBarSizes,
sizeof(titleBarSizes)/
sizeof(titleBarSizes[0]),
icon);
5953 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"closedock-"),
5954 dockTitleIconSizes,
sizeof(dockTitleIconSizes)/
sizeof(dockTitleIconSizes[0]),
icon);
5957# ifndef QT_NO_IMAGEFORMAT_XPM
5963 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"normalizedockup-"),
5964 dockTitleIconSizes,
sizeof(dockTitleIconSizes)/
sizeof(dockTitleIconSizes[0]),
icon);
5970 addIconFiles(prefix, toolBarExtHSizes,
sizeof(toolBarExtHSizes)/
sizeof(toolBarExtHSizes[0]),
icon);
5974 addIconFiles(iconResourcePrefix() +
QStringLiteral(
"toolbar-ext-v-"),
5975 toolBarExtVSizes,
sizeof(toolBarExtVSizes)/
sizeof(toolBarExtVSizes[0]),
icon);
5988 return (77 *
r + 150 *
g + 28 *
b) / 255;
6004 uchar reds[256], greens[256], blues[256];
6005 for (
int i=0;
i<128; ++
i) {
6010 for (
int i=0;
i<128; ++
i) {
6017 const int factor = 191;
6025 intensity =
qMin(255, intensity + 91);
6026 else if (intensity <= 128)
6032 QRgb pixel = *scanLine;
6036 *scanLine =
qRgba(reds[ci], greens[ci], blues[ci],
qAlpha(pixel));
6064#include "moc_qquickcommonstyle.cpp"
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.
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
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.
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.
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 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.
@ 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.
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.
Q_GUI_EXPORT void setPoints(int nPoints, const int *points)
Resizes the polygon to nPoints and populates it with the given points.
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
virtual void tabLayout(const QStyleOptionTab *opt, QRect *textRect, QRect *pixmapRect) 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
\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 QSize size() const noexcept
Returns the size of the rectangle.
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 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 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
Qt::LayoutDirection direction
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
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 QByteArray cacheKey(Args &&...args)
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 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
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)
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()
\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