44 #ifndef QT_NO_STYLE_STYLESHEET 47 #include "private/qcssutil_p.h" 59 #include "private/qcssparser_p.h" 60 #include "private/qmath_p.h" 62 #include "private/qabstractscrollarea_p.h" 74 #include <private/qwindowsstyle_p.h> 76 #include <QMetaProperty> 81 #include <private/qwidget_p.h> 82 #include <QAbstractSpinBox> 87 #include <QtGui/qtoolbar.h> 118 : guarded(globalStyleSheetStyle == 0)
120 if (guarded) globalStyleSheetStyle = that;
125 #define RECURSION_GUARD(RETURN) \ 126 if (globalStyleSheetStyle != 0 && globalStyleSheetStyle != this) { RETURN; } \ 127 QStyleSheetStyleRecursionGuard recursion_guard(this); 129 #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) 309 for (
int i = 0; i < 4; i++)
322 : brush(b), pixmap(p), repeat(r),
position(a), origin(o), attachment(t), clip(c) { }
326 return !brush.isOpaque();
327 return pixmap.isNull() ? false : pixmap.hasAlpha();
342 for (
int i = 0; i < 4; i++) {
350 for (
int i = 0; i < 4; i++) {
371 for (
int i = 0; i < 4; i++) {
377 if (!colors[i].isOpaque())
393 for (
int i = 0; i < 4; i++) {
401 for (
int i = 0; i < 4; i++) {
413 for (
int i = 0; i < 4; i++) {
429 : foreground(fg), selectionForeground(sfg), selectionBackground(sbg),
430 alternateBackground(abg) { }
441 : minWidth(minw), minHeight(minh), width(w), height(h), maxWidth(maxw), maxHeight(maxh) { }
443 int minWidth, minHeight,
width, height, maxWidth, maxHeight;
449 :
left(l), top(t), bottom(b),
right(r), origin(o),
position(p), mode(m), textAlignment(
a) { }
461 : icon(i), alignment(a), size(sz) { }
471 QRenderRule() : features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0) { }
481 QRect boxRect(
const QRect &r,
int flags = All)
const;
482 QSize boxSize(
const QSize &s,
int flags = All)
const;
521 if (!hasBackground() || (background()->brush.style() ==
Qt::NoBrush && bg->pixmap.isNull()))
523 if (bg && !bg->pixmap.isNull())
525 if (hasGradientBackground())
535 bool hasDrawable()
const {
return !hasNativeBorder() || hasBackground() || hasImage(); }
539 {
return geo ?
QSize(geo->minWidth, geo->minHeight) : QSize(0, 0); }
541 {
return boxSize(minimumContentsSize()); }
544 {
return geo ?
QSize(geo->width, geo->height)
545 : ((img && img->size.isValid()) ? img->size : QSize()); }
548 QSize csz = contentsSize();
554 {
return (geo && (geo->width != -1 || geo->height != -1)) || (img && img->size.isValid()); }
562 QSize csz = contentsSize();
565 if (geo->maxWidth != -1 && csz.
width() > geo->maxWidth) csz.
setWidth(geo->maxWidth);
566 if (geo->maxHeight != -1 && csz.
height() > geo->maxHeight) csz.
setHeight(geo->maxHeight);
580 void fixupBorder(
int);
600 "activate-on-singleclick",
602 "arrow-keys-navigate-into-children",
606 "combobox-list-mousetracking",
611 "dialog-cancel-icon",
613 "dialog-discard-icon",
621 "dialogbuttonbox-buttons-have-icons",
622 "directory-closed-icon",
624 "directory-link-icon",
625 "directory-open-icon",
626 "dither-disable-text",
627 "dockwidget-close-icon",
630 "etch-disabled-text",
633 "filedialog-backward-icon",
634 "filedialog-contentsview-icon",
635 "filedialog-detailedview-icon",
636 "filedialog-end-icon",
637 "filedialog-infoview-icon",
638 "filedialog-listview-icon",
639 "filedialog-new-directory-icon",
640 "filedialog-parent-directory-icon",
641 "filedialog-start-icon",
649 "lineedit-password-character",
650 "mdi-fill-space-on-maximize",
652 "menubar-altkey-navigation",
654 "messagebox-critical-icon",
655 "messagebox-information-icon",
656 "messagebox-question-icon",
657 "messagebox-text-interaction-flags",
658 "messagebox-warning-icon",
662 "paint-alternating-row-colors-for-empty-area",
664 "scrollbar-contextmenu",
665 "scrollbar-leftclick-absolute-position",
666 "scrollbar-middleclick-absolute-position",
667 "scrollbar-roll-between-buttons",
668 "scrollbar-scroll-when-pointer-leaves-control",
669 "scrollview-frame-around-contents",
670 "show-decoration-selected",
671 "spinbox-click-autorepeat-rate",
672 "spincontrol-disable-on-bounds",
674 "tabbar-prefer-no-arrows",
675 "titlebar-close-icon",
676 "titlebar-contexthelp-icon",
677 "titlebar-maximize-icon",
678 "titlebar-menu-icon",
679 "titlebar-minimize-icon",
680 "titlebar-normal-icon",
681 "titlebar-shade-icon",
682 "titlebar-unshade-icon",
683 "toolbutton-popup-delay",
693 for (
int i = 0; i < layout.
count(); i++) {
694 int button = layout[i].
toAscii();
752 int offsets[3] = { 0, 0, 0 };
755 for (
int i = 0; i < layout.
count(); i++) {
757 info.element = layout[i].toInt();
758 if (info.element ==
'(') {
760 }
else if (info.element ==
')') {
763 switch (info.element) {
802 subRule = renderRule(w, tb, info.element);
806 info.offset = offsets[where];
810 offsets[where] += info.width;
814 for (
int i = 0; i < infos.
count(); i++) {
815 ButtonInfo
info = infos[i];
817 switch (info.where) {
823 r.setLeft(r.left()+info.offset);
824 r.setWidth(info.width);
839 layoutRects[control] = positionRect(w, info.rule, info.element, lr, tb->
direction);
864 : features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0)
870 int w = -1, h = -1, minw = -1, minh = -1, maxw = -1, maxh = -1;
874 int left = 0, top = 0,
right = 0, bottom = 0;
878 Qt::Alignment textAlignment = 0;
882 int margins[4], paddings[4], spacing = -1;
883 for (
int i = 0; i < 4; i++)
884 margins[i] = paddings[i] = 0;
885 if (v.
extractBox(margins, paddings, &spacing))
892 for (
int i = 0; i < 4; i++) {
900 for (
int i = 0; i < 4; i++) {
901 borders[i] = offsets[i] = 0;
914 if (v.
extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip))
931 #ifndef QT_NO_TOOLTIP 936 for (
int i = 0; i < declarations.
count(); i++) {
955 for (
int i = 0; i < 4; i++)
956 bi->
cuts[i] = cuts[i];
963 int role = decl.
d->values.at(0).variant.toInt();
969 bool knownStyleHint =
false;
972 if (decl.
d->property.compare(styleHint) == 0) {
984 && decl.
d->values.count() != 0 && decl.
d->values.at(0).type ==
Value::String) {
992 knownStyleHint =
true;
1087 for (
int i = 0; i < 4; i++) {
1113 if (bi->
cuts[0] == -1) {
1114 for (
int i = 0; i < 4; i++)
1127 const int *sourceBorders = borderImageData->
cuts;
1130 QMargins targetMargins(targetBorders[LeftEdge], targetBorders[TopEdge],
1131 targetBorders[RightEdge], targetBorders[BottomEdge]);
1183 inter.x() - aligned.
x() + off.
x(),
1188 bgp.
width() - int(aligned.
x() - r.
x())%bgp.
width() + off.
x(),
1189 inter.y() - aligned.
y() + off.
y());
1198 p->
drawPixmap(inter.x(), inter.y(), bgp, inter.x() - aligned.
x() + off.
x(),
1199 inter.y() - aligned.
y() + off.
y(), inter.width(), inter.height());
1226 if (
border()->hasBorderImage()) {
1242 QSize tlr, trr, blr, brr;
1409 #define WIDGET(x) (static_cast<QWidget *>(x.ptr)) 1428 if (isNullNode(node))
1431 #ifndef QT_NO_TOOLTIP 1439 }
while (metaObject != 0);
1444 if (isNullNode(node))
1450 return cacheIt.
value();
1464 cache[
name] = styleName;
1474 cache[
name] = valueStr;
1479 if (isNullNode(node))
1482 #ifndef QT_NO_TOOLTIP 1490 while (*c && uc != e && (*uc == *c || (*c ==
':' && *uc ==
'-'))) {
1497 }
while (metaObject != 0);
1505 {
return node.
ptr == 0; }
1523 return cacheIt.
value();
1525 if (!initWidget(w)) {
1534 defaultSs = getDefaultStyleSheet();
1535 QStyle *bs = baseStyle();
1539 defaultSs = defaultCacheIt.
value();
1541 styleSelector.styleSheets += defaultSs;
1543 if (!
qApp->styleSheet().isEmpty()) {
1550 parser.init(ss,
qApp->styleSheet() != ss);
1551 if (!parser.parse(&appSs))
1552 qWarning(
"Could not parse application stylesheet");
1557 appSs = appCacheIt.
value();
1559 styleSelector.styleSheets += appSs;
1564 if (wid->styleSheet().isEmpty())
1569 parser.init(wid->styleSheet());
1570 if (!parser.parse(&ss)) {
1572 if (!parser.parse(&ss))
1573 qWarning(
"Could not parse stylesheet of widget %p", wid);
1578 ss = widCacheIt.
value();
1583 for (
int i = 0; i < widgetSs.
count(); i++)
1584 widgetSs[i].depth = widgetSs.
count() - i + 2;
1586 styleSelector.styleSheets += widgetSs;
1600 for (
int i = 0; i < styleRules.
count(); i++) {
1609 || ((((cssClass &
pseudoClass) == cssClass)) && ((negated & pseudoClass) == 0)))
1619 #ifndef QT_NO_SPINBOX 1620 if (qobject_cast<const QAbstractSpinBox *>(w))
1624 #ifndef QT_NO_COMBOBOX 1625 if (qobject_cast<const QComboBox *>(w))
1630 if (qobject_cast<const QMenu *>(w))
1634 #ifndef QT_NO_MENUBAR 1635 if (qobject_cast<const QMenuBar *>(w))
1639 if (
const QFrame *frame = qobject_cast<const QFrame *>(w)) {
1693 #ifdef QT_KEYPAD_NAVIGATION 1694 if (state & QStyle::State_HasEditFocus)
1702 #ifdef QT_NO_DOCKWIDGET 1706 if (*w &&
qstrcmp((*w)->metaObject()->className(),
"QDockWidgetTitleButton") == 0) {
1707 if ((*w)->objectName() ==
QLatin1String(
"qt_dockwidget_closebutton")) {
1709 }
else if ((*w)->objectName() ==
QLatin1String(
"qt_dockwidget_floatbutton")) {
1723 return cacheIt.
value();
1730 for (
int i = 0; i < rules.
count(); i++) {
1734 stateMask |= negated;
1737 cacheIt = cache.
constFind(state & stateMask);
1740 cache[state] = newRule;
1748 cache[state] = newRule;
1749 if ((state & stateMask) != state)
1750 cache[state&stateMask] = newRule;
1759 if (
const QStyleOptionComplex *complex = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
1764 if (!(complex->activeSubControls & subControl))
1768 switch (pseudoElement) {
1777 #ifndef QT_NO_SPINBOX 1778 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
1788 #endif // QT_NO_SPINBOX 1808 if (
const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
1819 if (!combo->editable)
1823 #ifndef QT_NO_SPINBOX 1824 }
else if (
const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
1827 #endif // QT_NO_SPINBOX 1828 }
else if (
const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
1831 if (gb->lineWidth == 0)
1833 }
else if (
const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
1852 }
else if (
const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
1868 #ifndef QT_NO_TABWIDGET 1870 switch (tab->shape) {
1891 #ifndef QT_NO_TABBAR 1892 }
else if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
1907 switch (tab->shape) {
1927 #endif // QT_NO_TABBAR 1928 }
else if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
1933 }
else if (
const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
1934 if (frm->lineWidth == 0)
1936 if (
const QStyleOptionFrameV2 *frame2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(opt)) {
1941 #ifndef QT_NO_TOOLBAR 1942 else if (
const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
1961 #endif // QT_NO_TOOLBAR 1962 #ifndef QT_NO_TOOLBOX 1963 else if (
const QStyleOptionToolBoxV2 *tab = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(opt)) {
1978 #endif // QT_NO_TOOLBOX 1979 #ifndef QT_NO_DOCKWIDGET 1981 if (dw->verticalTitleBar)
1992 #endif // QT_NO_DOCKWIDGET 1993 #ifndef QT_NO_ITEMVIEWS 2009 #ifndef QT_NO_LINEEDIT 2011 if (
const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(w)) {
2012 state &= ~
QStyle::State_Sunken;
2013 if (lineEdit->hasFrame()) {
2020 if (
const QFrame *frm = qobject_cast<const QFrame *>(w)) {
2021 if (frm->lineWidth() == 0)
2026 return renderRule(w, pseudoElement,
pseudoClass(state) | extraClass);
2034 return cacheIt.
value();
2042 bool result = w && !rules.
isEmpty();
2043 cache[part] = result;
2049 for (
int i = 0; i < rules.
count(); i++) {
2057 cache[part] =
false;
2167 if (sz.
width() == -1)
2175 if (sz.
width() == -1)
2182 int pm = base->
pixelMetric(PM_MenuButtonIndicator, 0, w);
2183 if (sz.
width() == -1)
2191 if (sz.
width() == -1)
2200 if (sz.
width() == -1)
2208 if (sz.
width() == -1)
2215 if (sz.
width() == -1)
2221 int pm = base->
pixelMetric(PM_HeaderMargin, 0, w);
2222 if (sz.
width() == -1)
2235 if (sz.
width() == -1)
2244 int iconSize = pixelMetric(PM_SmallIconSize, 0, w);
2245 return QSize(iconSize, iconSize);
2255 if (sz.
width() == -1)
2317 return positionRect(w, rule2, pe, originRect, dir);
2327 #ifndef QT_NO_COMBOBOX 2328 if (
QComboBox *cmb = qobject_cast<QComboBox *>(w)) {
2329 if (cmb->isEditable())
2330 return cmb->lineEdit();
2336 #ifndef QT_NO_SPINBOX 2341 #ifndef QT_NO_SCROLLAREA 2343 return sa->viewport();
2358 #ifndef QT_NO_LINEEDIT 2359 if (qobject_cast<const QLineEdit *>(w)) {
2361 #ifndef QT_NO_COMBOBOX 2362 if (qobject_cast<const QComboBox *>(w->
parentWidget()))
2365 #ifndef QT_NO_SPINBOX 2366 if (qobject_cast<const QAbstractSpinBox *>(w->
parentWidget()))
2370 #endif // QT_NO_LINEEDIT 2372 #ifndef QT_NO_SCROLLAREA 2374 if (sa->viewport() == w)
2379 return const_cast<QWidget *
>(w);
2398 else if (qobject_cast<const QFrame *>(w)) {
2413 if (
const QAbstractSlider *slider = qobject_cast<const QAbstractSlider *>(w)) {
2416 #ifndef QT_NO_COMBOBOX 2417 if (
const QComboBox *combo = qobject_cast<const QComboBox *>(w)) {
2418 if (combo->isEditable())
2422 #ifndef QT_NO_LINEEDIT 2423 if (
const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)) {
2491 for (
int i = 0; i < decls.
count(); i++) {
2493 QString property = decl.
d->property;
2496 property.remove(0, 10);
2510 switch (value.
type()) {
2518 #ifndef QT_NO_SHORTCUT 2521 default: v = decl.
d->values.at(0).variant;
break;
2527 for (
int i = 0; i < properties.
count(); i++) {
2528 const QString &
property = properties.
at(i);
2535 struct RuleRoleMap {
2547 for (
int i = 0; i < 3; i++) {
2551 saveWidgetFont(w, w->
font());
2553 updateStyleSheetFont(w);
2555 updateStyleSheetFont(ew);
2579 w->
setFont(qvariant_cast<QFont>(oldFont));
2590 for (
int i = 0; i < widgets.
size(); ++i) {
2597 for (
int i = 0; i < widgets.
size(); ++i) {
2640 styleRulesCache.remove((
const QWidget *)o);
2641 hasStyleRuleCache.remove((
const QWidget *)o);
2642 renderRulesCache.remove((
const QWidget *)o);
2643 customPaletteWidgets.remove((
const QWidget *)o);
2644 styleSheetCache.remove((
const QWidget *)o);
2645 autoFillDisabledWidgets.remove((
const QWidget *)o);
2650 styleSheetCache.remove(o);
2694 for (
int i = 0; i < rules.
count(); i++) {
2705 #ifndef QT_NO_SCROLLAREA 2718 #ifndef QT_NO_PROGRESSBAR 2719 if (
QProgressBar *pb = qobject_cast<QProgressBar *>(w)) {
2727 #ifndef QT_NO_ITEMVIEWS 2731 || qobject_cast<QTabBar *>(w)
2737 || qobject_cast<QMainWindow *>(w)
2739 #ifndef QT_NO_MDIAREA 2743 || qobject_cast<QMenuBar *>(w)
2810 #ifndef QT_NO_SCROLLAREA 2813 sa,
SLOT(update()));
2815 sa,
SLOT(update()));
2818 #ifndef QT_NO_PROGRESSBAR 2819 if (
QProgressBar *pb = qobject_cast<QProgressBar *>(w))
2835 #ifndef QT_NO_TABBAR 2843 #endif // QT_NO_TABBAR 2856 cmbOpt.
rect = rule.borderRect(opt->
rect);
2857 if (rule.hasNativeBorder()) {
2858 rule.drawBackgroundImage(p, cmbOpt.
rect);
2864 if (rule.baseStyleCanDraw()) {
2869 if (!customDropDown)
2872 rule.drawRule(p, opt->
rect);
2893 #ifndef QT_NO_SPINBOX 2895 if (
const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
2899 spinOpt.
rect = rule.borderRect(opt->
rect);
2900 bool customUp =
true, customDown =
true;
2905 if (rule.hasNativeBorder() && !upRuleMatch && !downRuleMatch) {
2906 rule.drawBackgroundImage(p, spinOpt.
rect);
2915 if (rule.baseStyleCanDraw()) {
2920 if (!customUp && !customDown)
2923 rule.drawRule(p, opt->
rect);
2956 #endif // QT_NO_SPINBOX 2961 QRect labelRect, checkBoxRect, titleRect, frameRect;
2969 rule.drawBackground(p, opt->
rect);
2972 bool clipSet =
false;
2980 titleRect = titleRule.
boxRect(checkBoxRect.
united(labelRect));
2982 titleRect = titleRule.
boxRect(labelRect);
2993 frame.QStyleOption::operator=(*gb);
2997 frame.
rect = frameRect;
3010 box.QStyleOption::operator=(*gb);
3011 box.
rect = checkBoxRect;
3016 if (!gb->text.isEmpty()) {
3023 if (gb->textColor.isValid())
3031 fropt.QStyleOption::operator=(*gb);
3032 fropt.
rect = labelRect;
3046 toolOpt.
rect = rule.borderRect(opt->
rect);
3049 if (rule.hasNativeBorder()) {
3060 rule.drawBackground(p, toolOpt.
rect);
3075 if (!customArrow && !customDropDown)
3078 rule.drawRule(p, opt->
rect);
3079 toolOpt.
rect = rule.contentsRect(opt->
rect);
3081 toolOpt.
font = rule.font;
3087 if (customDropDown) {
3101 QRect r2 = customDropDown
3116 #ifndef QT_NO_SCROLLBAR 3118 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
3120 if (!rule.hasDrawable()) {
3121 sbOpt.
rect = rule.borderRect(opt->
rect);
3122 rule.drawBackgroundImage(p, opt->
rect);
3125 rule.drawRule(p, opt->
rect);
3131 #endif // QT_NO_SCROLLBAR 3133 #ifndef QT_NO_SLIDER 3135 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
3136 rule.drawRule(p, opt->
rect);
3187 #endif // QT_NO_SLIDER 3199 for (
int i = 0; i < layout.
count(); i++) {
3200 int layoutButton = layout[i].toInt();
3248 if (!tb->icon.isNull()) {
3249 tb->icon.paint(p, ir);
3279 for (
unsigned int i = 0; i <
sizeof(pes)/
sizeof(
int); i++) {
3327 if (!rule.hasNativeBorder()) {
3328 rule.drawBorder(p, opt->
rect);
3334 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3335 if (rule.hasDrawable() || rule.hasBox() || rule.hasPosition() || rule.hasPalette() ||
3343 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3345 btnOpt.
rect = rule.borderRect(opt->
rect);
3346 if (rule.hasNativeBorder()) {
3347 rule.drawBackgroundImage(p, btnOpt.
rect);
3353 if (rule.baseStyleCanDraw()) {
3361 rule.drawRule(p, opt->
rect);
3378 if (
const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3386 if (rule.hasPosition() && rule.position()->textAlignment != 0) {
3387 Qt::Alignment textAlignment = rule.position()->textAlignment;
3388 QRect textRect = button->rect;
3391 tf |= (textAlignment & verticalAlignMask) ? (textAlignment & verticalAlignMask) :
Qt::AlignVCenter;
3394 if (!button->icon.isNull()) {
3404 QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state);
3405 int labelWidth = pixmap.
width();
3406 int labelHeight = pixmap.
height();
3407 int iconSpacing = 4;
3408 int textWidth = button->fontMetrics.boundingRect(opt->
rect, tf, button->text).width();
3409 if (!button->text.isEmpty())
3410 labelWidth += (textWidth + iconSpacing);
3414 iconRect =
QRect(textRect.
x(), textRect.
y() + (textRect.
height() - labelHeight) / 2,
3417 iconRect =
QRect(textRect.
x() + (textRect.
width() - labelWidth) / 2,
3418 textRect.
y() + (textRect.
height() - labelHeight) / 2,
3421 iconRect =
QRect(textRect.
x() + textRect.
width() - labelWidth,
3422 textRect.
y() + (textRect.
height() - labelHeight) / 2,
3426 iconRect =
visualRect(button->direction, textRect, iconRect);
3440 tf |= textAlignment;
3449 textRect = textRect.
adjusted(0, 0, -indicatorSize, 0);
3451 textRect = textRect.
adjusted(indicatorSize, 0, 0, 0);
3467 rule.drawRule(p, opt->
rect);
3470 }
else if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3479 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3491 if (rule.hasBackground()) {
3492 rule.drawBackground(p, opt->
rect);
3494 if (rule.hasBorder()) {
3495 rule.drawBorder(p, rule.borderRect(opt->
rect));
3497 #ifndef QT_NO_TOOLBAR 3498 if (
const QStyleOptionToolBar *tb = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
3500 newTb.
rect = rule.borderRect(opt->
rect);
3503 #endif // QT_NO_TOOLBAR 3509 if (rule.hasDrawable()) {
3567 bool checked = checkable ? mi.
checked :
false;
3581 int pixw = pixmap.
width();
3582 int pixh = pixmap.
height();
3592 QRect pmr(0, 0, pixw, pixh);
3595 }
else if (checkable) {
3616 p->
drawText(vShortcutRect, text_flags, s.
mid(t + 1));
3692 #ifndef QT_NO_COMBOBOX 3700 if (!cb->currentIcon.isNull()) {
3701 int spacing = rule.hasBox() ? rule.box()->spacing : -1;
3705 QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);
3706 QRect iconRect(editRect);
3707 iconRect.
setWidth(cb->iconSize.width());
3710 iconRect.
size(), editRect);
3714 editRect.
translate(-spacing - cb->iconSize.width(), 0);
3716 editRect.
translate(cb->iconSize.width() + spacing, 0);
3718 if (!cb->currentText.isEmpty() && !cb->editable) {
3719 QPalette styledPalette(cb->palette);
3728 #endif // QT_NO_COMBOBOX 3746 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
3765 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
3780 if (rule.hasDrawable()) {
3790 if (!rule.hasNativeBorder()) {
3791 rule.drawRule(p, rule.boxRect(opt->
rect,
Margin));
3807 bool inverted = pb->invertedAppearance;
3810 QRect rect = pb->rect;
3820 const bool indeterminate = pb->minimum == pb->maximum;
3821 qreal fillRatio = indeterminate ?
qreal(0.50) :
qreal(progress - minimum)/(maximum - minimum);
3822 int fillWidth = int(rect.
width() * fillRatio);
3823 int chunkWidth = fillWidth;
3830 if (pb->minimum == 0 && pb->maximum == 0) {
3832 int chunkCount = fillWidth/chunkWidth;
3833 int offset = (
d->animateStep*8%rect.
width());
3834 int x = reverse ? r.
left() + r.
width() - offset - chunkWidth : r.
x() + offset;
3835 while (chunkCount > 0) {
3839 x += reverse ? -chunkWidth : chunkWidth;
3840 if (reverse ? x < rect.
left() : x > rect.
right())
3846 x = reverse ? r.
right() - (r.
left() - x - chunkWidth)
3847 : r.
left() + (x - r.
right() - chunkWidth);
3848 while (chunkCount > 0) {
3852 x += reverse ? -chunkWidth : chunkWidth;
3856 int x = reverse ? r.
left() + r.
width() - chunkWidth : r.
x();
3858 for (
int i = 0; i <
ceil(
qreal(fillWidth)/chunkWidth); ++i) {
3862 x += reverse ? -chunkWidth : chunkWidth;
3888 if (
const QStyleOptionSizeGrip *sgOpt = qstyleoption_cast<const QStyleOptionSizeGrip *>(opt)) {
3889 if (rule.hasDrawable()) {
3890 rule.drawFrame(p, opt->
rect);
3892 switch (sgOpt->corner) {
3899 rule.drawImage(p, opt->
rect);
3903 sg.
rect = rule.contentsRect(opt->
rect);
3924 if (
const QStyleOptionToolBox *box = qstyleoption_cast<const QStyleOptionToolBox *>(opt)) {
3972 #ifndef QT_NO_ITEMVIEWS 3989 #endif // QT_NO_ITEMVIEWS 3991 #ifndef QT_NO_TABBAR 4001 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
4026 #endif // QT_NO_TABBAR 4029 if (rule.hasDrawable()) {
4030 rule.drawRule(p, opt->
rect);
4048 if (!dwOpt->title.isEmpty()) {
4050 if (dwOpt->verticalTitleBar) {
4061 Qt::Alignment alignment = 0;
4071 if (dwOpt->verticalTitleBar)
4079 if (
const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
4080 if (rule.hasNativeBorder()) {
4083 frmOpt.
rect = rule.borderRect(frmOpt.
rect);
4101 }
else if (fallback) {
4171 if (
const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
4180 if (qobject_cast<const QAbstractButton *>(w) && rule.hasBackground() && rule.hasNativeBorder()) {
4183 if (!rule.background()->pixmap.isNull() || rule.hasImage()) {
4188 if (!rule.hasNativeBorder()) {
4197 rule.drawBorder(p, opt->
rect);
4204 if (rule.hasNativeBorder()) {
4205 if (rule.baseStyleCanDraw())
4214 if (
const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
4215 if (rule.hasNativeBorder()) {
4218 if (!qstyleoption_cast<const QStyleOptionFrameV3 *>(opt))
4219 frmOpt.
rect = rule.borderRect(frmOpt.
rect);
4222 rule.drawBorder(p, rule.borderRect(opt->
rect));
4228 if (
const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
4229 #ifndef QT_NO_SPINBOX 4230 if (w && qobject_cast<const QAbstractSpinBox *>(w->
parentWidget())) {
4237 if (rule.hasNativeBorder()) {
4240 frmOpt.
rect = rule.borderRect(frmOpt.
rect);
4241 if (rule.baseStyleCanDraw()) {
4242 rule.drawBackgroundImage(p, opt->
rect);
4245 rule.drawBackground(p, opt->
rect);
4250 rule.drawRule(p, opt->
rect);
4256 if (w && !rule.hasDrawable()) {
4266 #ifndef QT_NO_SCROLLAREA 4270 if (rule.hasBorder()) {
4271 QRect brect = rule.borderRect(opt->
rect);
4273 QRect r = brect.
adjusted(0, 0, sa->verticalScrollBar()->isVisible() ? -sa->verticalScrollBar()->width() : 0,
4274 sa->horizontalScrollBar()->isVisible() ? -sa->horizontalScrollBar()->height() : 0);
4277 rule.drawBorder(p, brect);
4285 if(rule.hasDrawable()) {
4286 rule.drawRule(p, opt->
rect);
4292 if (rule.hasDrawable()) {
4299 if (rule.hasDrawable()) {
4329 if (
const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
4342 p->
fillRect(v2->rect, v2->palette.highlight());
4344 p->
fillRect(v2->rect, v2->palette.alternateBase());
4353 if (!rule.hasDrawable())
4356 if (
const QStyleOptionFrame *frmOpt = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
4357 if (rule.hasNativeBorder()) {
4358 rule.drawBackground(p, opt->
rect);
4360 optCopy.
rect = rule.borderRect(opt->
rect);
4364 rule.drawRule(p, opt->
rect);
4370 if (rule.hasNativeBorder())
4372 rule.drawBorder(p, opt->
rect);
4375 #ifndef QT_NO_TABWIDGET 4390 #endif // QT_NO_TABWIDGET 4401 if (!rule.hasNativeOutline()) {
4402 rule.drawOutline(p, opt->
rect);
4428 #ifndef QT_NO_TABBAR 4529 #ifndef QT_NO_TOOLBUTTON 4641 if (qobject_cast<const QCheckBox *>(w)) {
4651 #ifndef QT_NO_SCROLLBAR 4655 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt))
4665 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt))
4675 #endif // QT_NO_SCROLLBAR 4686 #ifndef QT_NO_TABWIDGET 4717 #endif // QT_NO_TABWIDGET 4836 if (
const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
4841 QSize nativeContentsSize;
4842 bool nullIcon = hdr->icon.
isNull();
4844 QSize txt = hdr->fontMetrics.size(0, hdr->text);
4849 return subRule.
size(sz);
4858 #ifndef QT_NO_SPINBOX 4875 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
4907 int width = csz.
width();
4936 #ifndef QT_NO_TABBAR 4940 int spaceForIcon = 0;
4941 bool vertical =
false;
4942 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
4943 if (!tab->icon.isNull())
4944 spaceForIcon = 6 + 4 + 2 ;
4947 sz = csz +
QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0);
4960 #endif // QT_NO_TABBAR 4963 if (
const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
4973 int width = 0, height = 0;
4974 for (
int i = 0; i < layout.
count(); i++) {
4975 int layoutButton = layout[i].toInt();
4980 if (!(ccOpt->subControls & sc))
4984 width += sz.
width();
4988 return QSize(width, height);
4992 #ifndef QT_NO_ITEMVIEWS 5001 #endif // QT_NO_ITEMVIEWS 5082 return qvariant_cast<QIcon>(rule.
styleHint(s));
5101 return icon.
pixmap(16, 16);
5168 #ifndef QT_NO_TABWIDGET 5169 if (qobject_cast<const QTabWidget *>(w)) {
5174 #endif // QT_NO_TABWIDGET 5177 #ifndef QT_NO_TABBAR 5192 #ifndef QT_NO_COMBOBOX 5193 if (qobject_cast<const QComboBox *>(w)) {
5202 #endif // QT_NO_COMBOBOX 5268 #ifndef QT_NO_SPINBOX 5270 if (
const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
5276 if (ruleMatch || upRuleMatch || downRuleMatch) {
5284 Qt::Alignment upAlign, downAlign;
5297 (downAlign & Qt::AlignLeft) ? downSize : 0);
5299 (downAlign & Qt::AlignRight) ? downSize : 0);
5327 #endif // QT_NO_SPINBOX 5360 tw = tw + iw + spacing;
5413 #ifndef QT_NO_SCROLLBAR 5415 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
5435 QRect contentRect = grooveRect;
5443 if (sb->maximum != sb->minimum) {
5444 uint range = sb->maximum - sb->minimum;
5445 sliderlen = (
qint64(sb->pageStep) * maxlen) / (range + sb->pageStep);
5448 if (sliderlen < slidermin || range >
INT_MAX / 2)
5449 sliderlen = slidermin;
5450 if (sliderlen > maxlen)
5458 maxlen - sliderlen, sb->upsideDown);
5461 ?
QRect(sliderstart, contentRect.
top(), sliderlen, contentRect.
height())
5462 :
QRect(contentRect.
left(), sliderstart, contentRect.
width(), sliderlen);
5482 QRect originRect = grooveRect;
5495 #endif // QT_NO_SCROLLBAR 5497 #ifndef QT_NO_SLIDER 5499 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
5516 int thickness = horizontal ? cr.
height() : cr.
width();
5518 (horizontal ? cr.
width() : cr.
height()) - len, slider->upsideDown);
5519 cr = horizontal ?
QRect(cr.
x() + sliderPos, cr.
y(), len, thickness)
5520 :
QRect(cr.
x(), cr.
y() + sliderPos, thickness, len);
5530 #endif // QT_NO_SLIDER 5540 int x = 0, width = 0;
5542 for (
int i = 0; i < layout.
count(); i++) {
5543 int layoutButton = layout[i].toInt();
5567 return layoutRects.
value(sc);
5583 #ifndef QT_NO_TABBAR 5590 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
5649 #ifndef QT_NO_ITEMVIEWS 5651 if (!qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
5678 #endif // QT_NO_ITEMVIEWS 5704 QSize sz = pb->fontMetrics.size(0, pb->text);
5711 #ifndef QT_NO_TABBAR 5746 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
5747 switch (tab->shape) {
5778 #endif // QT_NO_TABBAR 5790 #ifndef QT_NO_TOOLBAR 5795 #endif //QT_NO_TOOLBAR 5819 font = font.
resolve(static_cast<QWidget *>(w->
parent())->font());
5829 #if defined(Q_WS_X11) 5857 if (!w || !opt || !pal)
5904 #include "moc_qstylesheetstyle_p.cpp" 5906 #endif // QT_NO_STYLE_STYLESHEET
The QVariant class acts like a union for the most common Qt data types.
T qobject_cast(QObject *object)
virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const =0
Returns a copy of the given pixmap, styled to conform to the specified iconMode and taking into accou...
const quint64 PseudoClass_Off
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QPainter class performs low-level painting on widgets and other paint devices.
QRect borderRect(const QRect &r) const
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
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...
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
virtual void unpolish(QWidget *)
Uninitialize the given {widget}'s appearance.
const quint64 PseudoClass_Open
void polish(QApplication *)
Reimplemented Function
QColor colorValue(const QPalette &=QPalette()) const
void unpolish(QApplication *)
Reimplemented Function
QString attribute(NodePtr node, const QString &name) const
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
const quint64 PseudoClass_Closed
const quint64 PseudoClass_Last
The QApplication class manages the GUI application's control flow and main settings.
const quint64 PseudoClass_Enabled
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
int width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
qreal right() const
Returns the x-coordinate of the rectangle's right edge.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
SubControl
This enum describes the available sub controls.
QVariant styleHint(const QString &sh) const
const QStyleSheetBorderImageData * borderImage() const
StyleHint
This enum describes the available style hints.
void drawBorder(QPainter *, const QRect &)
The QStyleHintReturn class provides style hints that return more than basic data types.
void setClip(QPainter *p, const QRect &rect)
static mach_timebase_info_data_t info
QString pseudoElement() const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
QSharedDataPointer< QStyleSheetOutlineData > ou
int width() const
Returns the width of the pixmap.
QPointer< QWidget > widget
const quint64 PseudoClass_Any
QSize size() const
Returns the size of the pixmap.
void clear()
Removes all items from the hash.
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
static QList< QVariant > subControlLayout(const QString &layout)
int remove(const Key &key)
Removes all the items that have the key from the hash.
void moveLeft(int pos)
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate...
bool hasStyleRule(const QWidget *w, int part) const
const quint64 PseudoClass_Exclusive
NodePtr parentNode(NodePtr node) const
QHash< const QWidget *, QPalette > customPaletteWidgets
static const int numKnownStyleHints
QStyle::State state
the style flags that are used when drawing the control
QStyle * baseStyle() const
The QDialog class is the base class of dialog windows.
static bool unstylable(const QWidget *w)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
int count(const T &t) const
Returns the number of occurrences of value in the vector.
~QStyleSheetStyleRecursionGuard()
static QLatin1String propertyNameForStandardPixmap(QStyle::StandardPixmap sp)
QStyleSheetOutlineData(int *b, QBrush *c, QCss::BorderStyle *s, QSize *r, int *o)
QSharedDataPointer< QStyleSheetGeometryData > geo
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
NodePtr duplicateNode(NodePtr node) const
QStyleSheetBorderData(int *b, QBrush *c, QCss::BorderStyle *s, QSize *r)
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 resolveAlignment(Qt::LayoutDirection, Qt::Alignment)
const quint64 PseudoClass_Focus
QBrush selectionBackground
QBrush selectionForeground
void rotate(qreal a)
Rotates the coordinate system the given angle clockwise.
const quint64 PseudoClass_Hover
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
QCss::Attachment attachment
const quint64 PseudoClass_Vertical
ComplexControl
This enum describes the available complex controls.
QString & replace(int i, int len, QChar after)
bool hasNativeOutline() const
bool remove(const T &value)
QRect united(const QRect &other) const
Returns the bounding rectangle of this rectangle and the given rectangle.
static C reverse(const C &l)
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
bool hasGradientBackground() const
int length() const
Returns the number of characters in this string.
void setPalette(QWidget *)
static bool verticalTabs(QTabBar::Shape shape)
const quint64 PseudoClass_Active
void polish(QWidget *widget)
Reimplemented Function
const quint64 PseudoClass_Middle
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
const QStyleSheetBackgroundData * background() const
qreal left() const
Returns the x-coordinate of the rectangle's left edge.
The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar...
static Qt::MouseButtons buttons
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
void restore()
Restores the current painter state (pops a saved state off the stack).
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
State
This enum describes the state for which a pixmap is intended to be used.
PixelMetric
This enum describes the various available pixel metrics.
QStyleSheetBackgroundData(const QBrush &b, const QPixmap &p, QCss::Repeat r, Qt::Alignment a, QCss::Origin o, Attachment t, QCss::Origin c)
const quint64 PseudoClass_Minimized
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int left() const
Returns the x-coordinate of the rectangle's left edge.
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
QHash< const QWidget *, QHash< int, bool > > hasStyleRuleCache
int width() const
Returns the width of the rectangle.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
bool hasBackground() const
void drawItemText(QPainter *painter, const QRect &rect, int alignment, 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.
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
QSize minimumSize() const
quint64 pseudoClass(quint64 *negated=0) const
QSharedDataPointer< QStyleSheetPositionData > p
void styleDestroyed(QObject *)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
QString text
the text of the title bar
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.
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
static QPalette palette()
Returns the application palette.
const QStyleSheetBoxData * box() const
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
QStringList nodeNames(NodePtr node) const
static QStyle * style()
Returns the application's style object.
QHash< const void *, QCss::StyleSheet > styleSheetCache
void qNormalizeRadii(const QRect &br, const QSize *radii, QSize *tlr, QSize *trr, QSize *blr, QSize *brr)
bool isTransparent() const
void unpolish(QWidget *widget)
Reimplemented Function
The QProgressBar widget provides a horizontal or vertical progress bar.
int height() const
Returns the height of the rectangle.
QRect boxRect(const QRect &r, int flags=All) const
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
QFontMetrics fontMetrics
the font metrics that should be used when drawing text in the control
void setHeight(int h)
Sets the height to the given height.
T * qobject_cast(QObject *object)
QSize minimumContentsSize() const
QHash< const QWidget *, QRenderRules > renderRulesCache
bool styleSheetPalette(const QWidget *w, const QStyleOption *opt, QPalette *pal)
void drawBorderImage(QPainter *, const QRect &)
void configurePalette(QPalette *, QPalette::ColorGroup, const QWidget *, bool)
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
QSize contentsSize() const
QStyle::SubControl subControl
const quint64 PseudoClass_Pressed
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
QPainterPath borderClip(QRect rect)
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
The QStyleOptionSizeGrip class is used to describe the parameter for drawing a size grip...
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
static QStyle::StandardPixmap subControlIcon(int pe)
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
const quint64 PseudoClass_ReadOnly
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QStyleSheetBorderImageData()
const T value(const Key &key) const
Returns the value associated with the key.
void save()
Saves the current painter state (pushes the state onto a stack).
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void unsetClip(QPainter *)
StandardPixmap
This enum describes the available standard pixmaps.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
QStyleSheetPositionData(int l, int t, int r, int b, Origin o, Qt::Alignment p, QCss::PositionMode m, Qt::Alignment a=0)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QSharedDataPointer< QStyleSheetBorderData > bd
const quint64 PseudoClass_Checked
The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in ...
const quint64 PseudoClass_Unchecked
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=0, const QWidget *widget=0) const
Returns the spacing that should be used between control1 and control2 in a layout.
QRect contentsRect(const QRect &r) const
void setWidth(int w)
Sets the width to the given width.
QExplicitlySharedDataPointer< DeclarationData > d
QRect originRect(const QRect &rect, Origin origin) const
static void setClip(QPainter *painter, QGraphicsItem *item)
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const
Reimplemented Function
virtual ~QStyle()
Destroys the style object.
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
Q_CORE_EXPORT void qDebug(const char *,...)
const QStyleSheetPaletteData * palette() const
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
static QStyleSheetStyleCaches * styleSheetCaches
void drawBackground(QPainter *, const QRect &, const QPoint &=QPoint(0, 0))
QSharedDataPointer< QStyleSheetBackgroundData > bg
void drawImage(QPainter *p, const QRect &rect)
int lineWidth
the line width for drawing the frame
The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progre...
int width() const
Returns the width.
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
void append(const T &t)
Inserts value at the end of the list.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
QCss::BorderStyle styles[4]
const quint64 PseudoClass_Horizontal
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
#define QT_BEGIN_NAMESPACE
This macro expands to.
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...
The QRectF class defines a rectangle in the plane using floating point precision. ...
QStyleSheetStyle(QStyle *baseStyle)
Shape
This enum type lists the built-in shapes supported by QTabBar.
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...
bool event(QEvent *e)
This virtual function receives events to an object and should return true if the event e was recogniz...
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
static bool isEmpty(const char *str)
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, using the provided painter.
QPoint bottomRight() const
Returns the position of the rectangle's bottom-right corner.
const QStyleSheetPositionData * position() const
const QBrush & light() const
Returns the light brush of the current color group.
void fillPath(const QPainterPath &path, const QBrush &brush)
Fills the given path using the given brush.
const quint64 PseudoClass_Window
static QWidget * embeddedWidget(QWidget *w)
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
QCss::TileMode vertStretch
virtual QPalette standardPalette() const
Returns the style's standard palette.
bool contains(const T &value) const
The QStyleOption class stores the parameters used by QStyle functions.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
const quint64 PseudoClass_Left
QVector< Selector > selectors
const quint64 PseudoClass_Sibling
void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const
ContentsType
This enum describes the available contents types.
void unsetPalette(QWidget *)
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
void setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
const QFont & font() const
Returns the currently set font used for drawing text.
QStyleSheetStyleRecursionGuard(const QStyleSheetStyle *that)
void drawOutline(QPainter *, const QRect &)
QSize size() const
Returns the size of the rectangle.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
const T & at(int i) const
Returns the item at index position i in the list.
bool nodeNameEquals(NodePtr node, const QString &nodeName) const
static Origin defaultOrigin(int pe)
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
The QStringList class provides a list of strings.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
void setRight(int pos)
Sets the right edge of the rectangle to the given x coordinate.
void drawBackgroundImage(QPainter *, const QRect &, QPoint=QPoint(0, 0))
The QComboBox widget is a combined button and popup list.
const quint64 PseudoClass_Movable
bool isEmpty() const
Returns true if the hash contains no items; otherwise returns false.
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
void append(const T &t)
Inserts value at the end of the vector.
The QStyleOptionFocusRect class is used to describe the parameters for drawing a focus rectangle with...
QRect positionRect(const QWidget *, const QRenderRule &, const QRenderRule &, int, const QRect &, Qt::LayoutDirection) const
const quint64 PseudoClass_NonExclusive
const T & value() const
Returns the current item's value.
Q_CORE_EXPORT void qWarning(const char *,...)
bool intValue(int *i, const char *unit=0) const
QSharedDataPointer< QStyleSheetImageData > img
QSize defaultSize(const QWidget *, QSize, const QRect &, int) const
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
QStringList nodeIds(NodePtr node) const
const_iterator insert(const T &value)
static QVector< Declaration > declarations(const QVector< StyleRule > &styleRules, const QString &part, quint64 pseudoClass=PseudoClass_Unspecified)
The QImage class provides a hardware-independent image representation that allows direct access to th...
void transpose()
Swaps the width and height values.
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
const quint64 PseudoClass_Right
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
const quint64 PseudoClass_Bottom
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
const_iterator constFind(const Key &key) const
Returns an iterator pointing to the item with the key in the hash.
T findChild(const QString &aName=QString()) const
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object.
const quint64 PseudoClass_Selected
QSharedDataPointer< QStyleSheetBoxData > b
QHash< const QWidget *, QHash< QString, QString > > m_attributeCache
void drawFrame(QPainter *, const QRect &)
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
The BorderImage element provides an image that can be used as a border.
const quint64 PseudoClass_Flat
The QRegion class specifies a clip region for a painter.
static PositionMode defaultPositionMode(int pe)
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=0) const =0
Draws the given control using the provided painter with the style options specified by option...
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
QHash< QString, QVariant > styleHints
QVector< Declaration > declarations
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
const quint64 PseudoClass_Alternate
const quint64 PseudoClass_Frameless
Qt::BrushStyle style() const
Returns the brush style.
The State element defines configurations of objects and properties.
void setGeometry(QWidget *)
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
static bool isNaturalChild(const QWidget *w)
void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
Draws the indicated sourceRect rectangle from the given pixmap into the given targetRect rectangle...
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
const QStyleSheetGeometryData * geometry() const
QSize toSize() const
Returns the variant as a QSize if the variant has type() Size ; otherwise returns an invalid QSize...
FrameFeatures features
a bitwise OR of the features that describe this frame.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
QStyleSheetStylePrivate()
const quint64 PseudoClass_Editable
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
const T & at(int i) const
Returns the item at index position i in the vector.
static QWidget * parentWidget(const QWidget *w)
const QStyleSheetOutlineData * outline() const
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=0, const QWidget *widget=0) const
void moveCenter(const QPoint &p)
Moves the rectangle, leaving the center point at the given position.
QPoint topRight() const
Returns the position of the rectangle's top-right corner.
QSharedDataPointer< QStyleSheetBorderImageData > bi
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
void drawTiledPixmap(const QRectF &rect, const QPixmap &pm, const QPointF &offset=QPointF())
Draws a tiled pixmap, inside the given rectangle with its origin at the given position.
QStyleSheetPaletteData(const QBrush &fg, const QBrush &sfg, const QBrush &sbg, const QBrush &abg)
QStyleSheetImageData(const QIcon &i, Qt::Alignment a, const QSize &sz)
void freeNode(NodePtr) const
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
QPalette palette
the palette that should be used when painting the control
The QBrush class defines the fill pattern of shapes drawn by QPainter.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
QPoint center() const
Returns the center point of the rectangle.
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
QVector< QCss::StyleRule > styleRules(const QWidget *w) const
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
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, using the provided painter.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
QRect itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const
Returns the area within the given rectangle in which to draw the specified pixmap according to the de...
The QAbstractItemView class provides the basic functionality for item view classes.
bool hasNativeBorder() const
int top() const
Returns the y-coordinate of the rectangle's top edge.
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...
bool hasContentsSize() const
QRect outlineRect(const QRect &r) const
#define Q_DECLARE_PUBLIC(Class)
QHash< QStyle::SubControl, QRect > titleBarLayout(const QWidget *w, const QStyleOptionTitleBar *tb) const
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=0) const =0
Returns the sub-area for the given element as described in the provided style option.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
int compare(const QString &s) const
const quint64 PseudoClass_OnlyOne
int right() const
Returns the x-coordinate of the rectangle's right edge.
QPoint bottomLeft() const
Returns the position of the rectangle's bottom-left corner.
QBrush brushValue(const QPalette &=QPalette()) const
bool baseStyleCanDraw() const
const quint64 PseudoClass_EditFocus
PrimitiveElement
This enum describes the various primitive elements.
QPalette standardPalette() const
Returns the style's standard palette.
static Qt::Alignment defaultPosition(int pe)
The QSharedData class is a base class for shared data objects.
const quint64 PseudoClass_PreviousSelected
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
QSet< const QWidget * > autoFillDisabledWidgets
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
static const QStyleSheetStyle * globalStyleSheetStyle
QBrush alternateBackground
const quint64 PseudoClass_Unspecified
bool hasAlpha() const
Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false...
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
const quint64 PseudoClass_Children
Holds the rules used to draw a pixmap or image split into nine segments, similar to [CSS3 border-imag...
QCss::TileMode horizStretch
int midLineWidth
the mid-line width for drawing the frame
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=0) const
Reimplemented Function
const quint64 PseudoClass_Maximized
Qt::Alignment textAlignment
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
QRect itemTextRect(const QFontMetrics &metrics, const QRect &rect, int alignment, bool enabled, const QString &text) const
Returns the area within the given rectangle in which to draw the provided text according to the speci...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Type type() const
Returns the storage type of the value stored in the variant.
void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength)
Creates an arc that occupies the given rectangle, beginning at the specified startAngle and extending...
void setProperties(QWidget *)
int x() const
Returns the x-coordinate of the rectangle's left edge.
The QStyleOptionFrameV3 class is used to describe the parameters necessary for drawing a frame in Qt ...
QObject * parent() const
Returns a pointer to the parent object.
void setRect(int x, int y, int w, int h)
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
QSize size(const QSize &sz) const
The QPoint class defines a point in the plane using integer precision.
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...
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const =0
Draws the given element with the provided painter with the style options specified by option...
const QStyleSheetBorderData * border() const
int size() const
Returns the number of items in the list.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
The QStyleOptionGroupBox class describes the parameters for drawing a group box.
The QStyleOptionComboBox class is used to describe the parameter for drawing a combobox.
void setWidth(int w)
Sets the width of the rectangle to the given width.
QByteArray toAscii() const Q_REQUIRED_RESULT
Returns an 8-bit representation of the string as a QByteArray.
bool initWidget(const QWidget *w) const
Make sure that the cache will be clean by connecting destroyed if needed.
#define RECURSION_GUARD(RETURN)
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
const quint64 PseudoClass_Indeterminate
static void qt_check_if_internal_widget(const QWidget **w, int *element)
QString objectName() const
bool hasAttributes(NodePtr) const
void qDrawBorder(QPainter *p, const QRect &rect, const QCss::BorderStyle *styles, const int *borders, const QBrush *colors, const QSize *radii)
static const PseudoElementInfo knownPseudoElements[NumPseudoElements]
The QStyleOptionTabV3 class is used to describe the parameters necessary for drawing a tabs in Qt 4...
int height() const
Returns the height.
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
The QAbstractSlider class provides an integer value within a range.
bool hasStyleHint(const QString &sh) const
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const
Reimplemented Function
void saveWidgetFont(QWidget *w, const QFont &font) const
const QObjectList & children() const
Returns a list of child objects.
int styleHint(StyleHint sh, const QStyleOption *opt=0, const QWidget *w=0, QStyleHintReturn *shret=0) const
Reimplemented Function
The QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt ...
T qvariant_cast(const QVariant &)
QSize adjustSize(const QSize &sz)
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=0) const =0
Returns the sub control at the given position in the given complex control (with the style options sp...
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt=0, const QWidget *widget=0) const
static const QCssKnownValue properties[NumProperties - 1]
int y() const
Returns the y coordinate of this point.
The QLineEdit widget is a one-line text editor.
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
Qt::Orientation orientation
the slider's orientation (horizontal or vertical)
QVariant property(const char *name) const
Returns the value of the object's name property.
static quint64 pseudoClass(QStyle::State state)
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
const quint64 PseudoClass_First
qreal top() const
Returns the y-coordinate of the rectangle's top edge.
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.
bool isNull() const
Returns true if both the width and height is 0; otherwise returns false.
QRenderRule renderRule(const QWidget *, int, quint64=0) const
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...
int height() const
Returns the height of the pixmap.
bool hasBorderImage() const
ControlElement
This enum represents a control element.
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
QRect paddingRect(const QRect &r) const
The QSize class defines the size of a two-dimensional object using integer point precision.
void setFont(const QFont &f)
Sets the painter's font to the given font.
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const
Reimplemented Function
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
const QBrush & buttonText() const
Returns the button text foreground brush of the current color group.
int qstrcmp(const QByteArray &str1, const char *str2)
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
RenderHints renderHints() const
Returns a flag that specifies the rendering hints that are set for this painter.
Qt::WindowFlags titleBarFlags
the widget flags for the title bar
void setClipPath(const QPainterPath &path, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip path for the painter to the given path, with the clip operation...
int x() const
Returns the x coordinate of this point.
const quint64 PseudoClass_Top
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
qreal bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
const quint64 PseudoClass_Default
The QMargins class defines the four margins of a rectangle.
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
const quint64 PseudoClass_Closable
QHash< const QWidget *, QVector< QCss::StyleRule > > styleRulesCache
void drawRule(QPainter *, const QRect &)
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
int height() const
Returns the height of the font.
QSize boxSize(const QSize &s, int flags=All) const
NodePtr previousSiblingNode(NodePtr) const
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
static quint64 extendedPseudoClass(const QWidget *w)
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
QStyleSheetBoxData(int *m, int *p, int s)
bool isNullNode(NodePtr node) const
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
static QWidget * containerWidget(const QWidget *w)
static const char * knownStyleHints[]
static void updateWidgets(const QList< const QWidget *> &widgets)
int titleBarState
the state of the title bar
The QEvent class is the base class of all event classes.
#define qPrintable(string)
The QFrame class is the base class of widgets that can have a frame.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
const quint64 PseudoClass_Disabled
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
int layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=0, const QWidget *widget=0) const
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
void repolish(QWidget *widget)
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
QStyleSheetStyleSelector()
QSharedDataPointer< QStyleSheetPaletteData > pal
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt=0, const QWidget *widget=0) const =0
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
QRect rect
the area that should be used for various calculations and painting
void updateStyleSheetFont(QWidget *w) const
int nativeFrameWidth(const QWidget *)
const QChar * constData() const
Returns a pointer to the data stored in the QString.
The QMdiSubWindow class provides a subwindow class for QMdiArea.
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option=0, const QWidget *w=0) const
Reimplemented Function
Qt::Alignment alignmentValue() const
const quint64 PseudoClass_Floatable
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
void widgetDestroyed(QObject *)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=0) const
Reimplemented Function
const QBrush & text() const
Returns the text foreground brush of the current color group.
SubElement
This enum represents a sub-area of a widget.
void clearWidgetFont(QWidget *w) const
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
Uses the painter to paint the icon with specified alignment, required mode, and state into the rectan...
const quint64 PseudoClass_On
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
QStyleSheetGeometryData(int w, int h, int minw, int minh, int maxw, int maxh)
QSize contentsSize(const QSize &sz) const
const quint64 PseudoClass_NextSelected
const quint64 PseudoClass_Item
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.