44 #include <private/qstylehelper_p.h> 45 #include <private/qsystemlibrary_p.h> 47 #if !defined(QT_NO_STYLE_WINDOWSVISTA) || defined(QT_PLUGIN) 57 #ifndef TMT_CONTENTMARGINS 58 # define TMT_CONTENTMARGINS 3602 60 #ifndef TMT_SIZINGMARGINS 61 # define TMT_SIZINGMARGINS 3601 64 # define LISS_NORMAL 1 66 # define LISS_SELECTED 3 67 # define LISS_DISABLED 4 68 # define LISS_SELECTEDNOTFOCUS 5 69 # define LISS_HOTSELECTED 6 71 #ifndef BP_COMMANDLINK 72 # define BP_COMMANDLINK 6 73 # define BP_COMMANDLINKGLYPH 7 74 # define CMDLGS_NORMAL 1 76 # define CMDLGS_PRESSED 3 77 # define CMDLGS_DISABLED 4 79 #ifndef PP_TRANSPARENTBAR 80 # define PP_TRANSPARENTBAR 11 81 # define PP_TRANSPARENTBARVERT 12 93 typedef HRESULT (WINAPI *
PtrGetCurrentThemeName)(OUT LPWSTR pszThemeFileName,
int cchMaxNameChars, OUT OPTIONAL LPWSTR pszColorBuff,
int cchMaxColorChars, OUT OPTIONAL LPWSTR pszSizeBuff,
int cchMaxSizeChars);
97 typedef HRESULT (WINAPI *
PtrGetThemeFilename)(HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId, OUT LPWSTR pszThemeFileName,
int cchMaxBuffChars);
98 typedef HRESULT (WINAPI *
PtrGetThemeFont)(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId,
int iStateId,
int iPropId, OUT LOGFONT *pFont);
99 typedef HRESULT (WINAPI *
PtrGetThemeInt)(HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId, OUT
int *piVal);
101 typedef HRESULT (WINAPI *
PtrGetThemeMargins)(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId,
int iStateId,
int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins);
102 typedef HRESULT (WINAPI *
PtrGetThemeMetric)(HTHEME hTheme, OPTIONAL HDC hdc,
int iPartId,
int iStateId,
int iPropId, OUT
int *piVal);
103 typedef HRESULT (WINAPI *
PtrGetThemePartSize)(HTHEME hTheme, HDC hdc,
int iPartId,
int iStateId, OPTIONAL RECT *prc,
enum THEMESIZE eSize, OUT
SIZE *psz);
106 typedef HRESULT (WINAPI *
PtrGetThemeString)(HTHEME hTheme,
int iPartId,
int iStateId,
int iPropId, OUT LPWSTR pszBuff,
int cchMaxBuffChars);
173 if (partId == BP_RADIOBUTTON || partId == BP_CHECKBOX) {
175 stateId = RBS_UNCHECKEDDISABLED;
177 stateId = RBS_UNCHECKEDPRESSED;
179 stateId = RBS_UNCHECKEDHOT;
181 stateId = RBS_UNCHECKEDNORMAL;
184 stateId += RBS_CHECKEDNORMAL-1;
186 }
else if (partId == BP_PUSHBUTTON) {
188 stateId = PBS_DISABLED;
190 stateId = PBS_PRESSED;
194 stateId = PBS_NORMAL;
217 if (_secondaryImage.isNull() || _primaryImage.isNull())
220 if (_tempImage.isNull())
221 _tempImage = _secondaryImage;
223 const int a =
qRound(alpha*256);
224 const int ia = 256 -
a;
225 const int sw = _primaryImage.width();
226 const int sh = _primaryImage.height();
227 const int bpl = _primaryImage.bytesPerLine();
228 switch(_primaryImage.depth()) {
231 uchar *mixed_data = _tempImage.bits();
232 const uchar *back_data = _primaryImage.bits();
233 const uchar *front_data = _secondaryImage.bits();
234 for (
int sy = 0; sy < sh; sy++) {
238 for (
int sx = 0; sx < sw; sx++) {
271 if (_startTime > current)
272 _startTime = current;
274 int timeDiff = _startTime.
msecsTo(current);
275 alpha = timeDiff/(float)_duration;
276 if (timeDiff > _duration) {
284 drawBlendedImage(painter, option->
rect, alpha);
301 if (_startTime > current)
302 _startTime = current;
304 int timeDiff = _startTime.
msecsTo(current) % _duration*2;
305 if (timeDiff > _duration)
306 timeDiff = _duration*2 - timeDiff;
307 alpha = timeDiff/(float)_duration;
311 drawBlendedImage(painter, option->
rect, alpha);
350 int state = option->
state;
365 #endif // QT_NO_LINEEDIT 381 bool doTransition = oldState &&
386 if (oldRect != newRect ||
391 #ifndef QT_NO_LINEEDIT 392 if (
const QLineEdit *edit = qobject_cast<const QLineEdit *>(widget))
394 doTransition =
false;
395 #endif // QT_NO_LINEEDIT 421 anim->
paint(&startPainter, &opt);
448 if (oldState & State_MouseOver)
451 fromState = ETS_FOCUSED;
453 fromState = ETS_NORMAL;
455 if (state & State_MouseOver)
457 else if (state & State_HasFocus)
458 toState = ETS_FOCUSED;
460 toState = ETS_NORMAL;
465 partId = BP_RADIOBUTTON;
467 partId = BP_CHECKBOX;
469 partId = BP_PUSHBUTTON;
491 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
492 int stateId = HSAS_SORTEDDOWN;
494 stateId = HSAS_SORTEDUP;
503 static int decoration_size = 0;
504 if (theme.isValid() && !decoration_size) {
507 decoration_size =
qMax(size.cx, size.cy);
516 int delta = decoration_size / 2;
517 theme.rect =
QRect(bef_h - delta, bef_v - delta, decoration_size, decoration_size);
521 theme.mirrorHorizontally =
true;
549 a->paint(painter, option);
564 #ifndef QT_NO_TEXTEDIT 565 if (
const QTextEdit *edit = qobject_cast<const QTextEdit*>(widget)) {
567 int stateId = ETS_NORMAL;
569 stateId = ETS_DISABLED;
570 else if (edit->isReadOnly())
571 stateId = ETS_READONLY;
573 stateId = ETS_SELECTED;
580 clipRegion ^= content;
585 #endif // QT_NO_TEXTEDIT 590 if (
const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(option)) {
592 bool usePalette =
false;
594 uint resolve_mask = panel->palette.resolve();
597 #ifndef QT_NO_SPINBOX 599 resolve_mask = spinbox->palette().resolve();
600 #endif // QT_NO_SPINBOX 635 PROPERTYORIGIN origin = PO_NOTFOUND;
638 if ((origin == PO_PART || origin == PO_STATE)) {
641 fillColor =
QBrush(
qRgb(GetRValue(bgRef), GetGValue(bgRef), GetBValue(bgRef)));
647 if (panel->lineWidth > 0)
655 anim->paint(painter, option);
670 int stateId = ETS_NORMAL;
672 stateId = ETS_DISABLED;
674 stateId = ETS_READONLY;
678 stateId = ETS_SELECTED;
734 bool newStyle =
true;
736 if (qobject_cast<const QTableView*>(widget))
739 if (newStyle && view && (vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))) {
773 if (hover || selected) {
774 if (sectionSize.
width() > 0 && sectionSize.
height() > 0) {
776 .arg(sectionSize.
height()).arg(selected).
arg(active).
arg(hover);
782 if (selected && hover)
784 else if (selected && !active)
793 LVP_LISTITEM, state,
QRect(0, 0, sectionSize.
width(), sectionSize.
height()));
813 painter->
drawPixmap(pixmapRect.topLeft(), pixmap);
814 else if (reverse ? rightSection : leftSection){
816 QSize(frame, pixmapRect.height())), pixmap,
818 painter->
drawPixmap(pixmapRect.adjusted(frame, 0, 0, 0),
819 pixmap, srcRect.
adjusted(frame, 0, -frame, 0));
820 }
else if (reverse ? leftSection : rightSection) {
822 QSize(frame, pixmapRect.height())), pixmap,
824 QSize(frame, pixmapRect.height())));
825 painter->
drawPixmap(pixmapRect.adjusted(0, 0, -frame, 0),
826 pixmap, srcRect.
adjusted(frame, 0, -frame, 0));
829 srcRect.
adjusted(frame, 0, -frame, 0));
845 if (qobject_cast<const QMessageBox *> (widget))
847 #ifndef QT_NO_INPUTDIALOG 848 else if (qobject_cast<const QInputDialog *> (widget))
850 #endif // QT_NO_INPUTDIALOG 857 theme.
rect = toprect;
863 theme.
rect = buttonRect;
895 int state = option->
state;
907 if (
const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) {
925 if (oldRect != newRect || (wasDefault && !isDefault))
927 doTransition =
false;
947 anim->paint(&startPainter, &opt);
974 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option))
979 anim->
paint(painter, option);
982 partId = BP_PUSHBUTTON;
987 stateId = PBS_DISABLED;
991 stateId = PBS_PRESSED;
995 stateId = PBS_DEFAULTED;
997 stateId = PBS_NORMAL;
1005 if (!anim && widget) {
1009 alternateImage.
fill(0);
1012 pulse->
setWidget(const_cast<QWidget*>(widget));
1014 QPainter startPainter(&startImage);
1015 stateId = PBS_DEFAULTED;
1016 XPThemeData theme(widget, &startPainter, name, partId, stateId, rect);
1019 QPainter alternatePainter(&alternateImage);
1021 theme.
painter = &alternatePainter;
1032 anim->
paint(painter, option);
1034 XPThemeData theme(widget, painter, name, partId, stateId, rect);
1040 XPThemeData theme(widget, painter, name, partId, stateId, rect);
1046 int mbiw = 0, mbih = 0;
1060 mbiw + 1, mbih + 1));
1066 #ifndef QT_NO_PROGRESSBAR 1071 orient = pb2->orientation;
1076 XPThemeData theme(widget, painter, name, partId, stateId, rect);
1082 = qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
1083 bool isIndeterminate = (bar->minimum == 0 && bar->maximum == 0);
1084 bool vertical =
false;
1085 bool inverted =
false;
1088 inverted = pb2->invertedAppearance;
1091 if (
const QProgressBar *progressbar = qobject_cast<const QProgressBar *>(widget)) {
1092 if (isIndeterminate || (progressbar->value() > 0 && (progressbar->value() < progressbar->maximum()) && d->
transitionsEnabled())) {
1095 a->
setWidget(const_cast<QWidget*>(widget));
1109 if (isIndeterminate) {
1112 int animationWidth = glowSize * 2 + (vertical ? theme.
rect.
height() : theme.
rect.
width());
1113 int animOffset =
a->startTime().msecsTo(current) / 4;
1114 if (animOffset > animationWidth)
1119 QSize pixmapSize(14, 14);
1122 inverted ? rect.
top() - glowSize + animOffset :
1123 rect.
bottom() + glowSize - animOffset,
1124 rect.
width(), glowSize);
1127 animRect =
QRect(rect.
left() - glowSize + animOffset,
1130 option->
rect, animRect);
1139 theme.
painter = &imagePainter;
1143 vertical ? image.
height() : 0);
1145 alphaGradient.setColorAt(0.5,
QColor(0, 0, 0, 220));
1146 alphaGradient.setColorAt(1,
QColor(0, 0, 0, 0));
1159 qint64 progress = qMax<qint64>(bar->progress, bar->minimum);
1164 double vc6_workaround = ((progress -
qint64(bar->minimum)) /
qMax(
double(1.0), double(
qint64(bar->maximum) -
qint64(bar->minimum))) * maxHeight);
1165 int height = isIndeterminate ? maxHeight:
qMax(
int(vc6_workaround), minHeight);
1172 double vc6_workaround = ((progress -
qint64(bar->minimum)) /
qMax(
double(1.0), double(
qint64(bar->maximum) -
qint64(bar->minimum))) * maxWidth);
1173 int width = isIndeterminate ? maxWidth :
qMax(
int(vc6_workaround), minWidth);
1182 int animationWidth = glowSize * 2 + (vertical ? theme.
rect.
height() : theme.
rect.
width());
1183 int animOffset =
a->startTime().msecsTo(current) / 4;
1185 if (animOffset > animationWidth) {
1186 if (bar->progress < bar->maximum)
1196 inverted ? rect.
top() - glowSize + animOffset :
1197 rect.
bottom() + glowSize - animOffset,
1198 rect.
width(), glowSize);
1209 #endif // QT_NO_PROGRESSBAR 1249 if (
const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
1258 checkcol =
qMax(menuitem->maxIconWidth,
int(3 + size.cx + margins.cxLeftWidth + margins.cxRightWidth));
1264 checkcol += rect.
x();
1267 QRect gutterRect(p1.
x(), p1.
y(), 3, p2.
y() - p1.
y() + 1);
1272 menuitem->rect.getRect(&x, &y, &w, &h);
1273 int tab = menuitem->tabWidth;
1276 ? menuitem->checked :
false;
1280 int yoff = y-2 + h / 2;
1284 QRect subRect(p1.
x(), p1.
y(), p2.
x() - p1.
x(), 6);
1292 menuitem->rect.y(), checkcol - 6, menuitem->rect.height()));
1308 QRect checkRect(0, 0, size.cx + margins.cxLeftWidth + margins.cxRightWidth ,
1309 size.cy + margins.cyBottomHeight + margins.cyTopHeight);
1310 checkRect.moveCenter(vCheckRect.
center());
1311 theme.rect = checkRect;
1315 if (menuitem->icon.isNull()) {
1316 checkRect =
QRect(0, 0, size.cx, size.cy);
1317 checkRect.moveCenter(theme.rect.center());
1318 theme.rect = checkRect;
1330 if (!menuitem->icon.isNull()) {
1339 int pixw = pixmap.
width();
1340 int pixh = pixmap.
height();
1341 QRect pmr(0, 0, pixw, pixh);
1343 painter->
setPen(menuitem->palette.text().color());
1347 painter->
setPen(menuitem->palette.buttonText().color());
1349 const QColor textColor = menuitem->palette.text().color();
1351 painter->
setPen(textColor);
1354 int xpos = menuitem->rect.x() + xm;
1368 painter->
drawText(vShortcutRect, text_flags, s.
mid(t + 1));
1371 QFont font = menuitem->font;
1375 painter->
setPen(textColor);
1386 newMI.
rect = vSubMenuRect;
1392 #endif // QT_NO_MENU 1394 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
1396 partId = HP_HEADERITEM;
1398 stateId = HIS_PRESSED;
1402 stateId = HIS_NORMAL;
1407 XPThemeData theme(widget, painter, name, partId, stateId, option->
rect);
1430 if (
const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(widget)) {
1432 if (dockWidget->isFloating()) {
1443 if (verticalTitleBar) {
1457 int buttonMargin = 4;
1461 bool isFloating = dw != 0 && dw->
isFloating();
1464 QRect titleRect = r;
1466 if (dwOpt->closable) {
1468 titleRect.
adjust(0, 0, -sz.
width() - mw - buttonMargin, 0);
1471 if (dwOpt->floatable) {
1473 titleRect.
adjust(0, 0, -sz.
width() - mw - buttonMargin, 0);
1477 titleRect.
adjust(0, -fw, 0, 0);
1481 titleRect.
adjust(mw, 0, 0, 0);
1482 if (!dwOpt->floatable && !dwOpt->closable)
1483 titleRect.
adjust(0, 0, -mw, 0);
1485 if (!verticalTitleBar)
1486 titleRect =
visualRect(dwOpt->direction, r, titleRect);
1488 if (!dwOpt->title.isEmpty()) {
1490 verticalTitleBar ? titleRect.
height() : titleRect.
width());
1500 #ifndef QT_NO_ITEMVIEWS 1505 bool newStyle =
true;
1507 if (qobject_cast<const QTableView*>(widget))
1510 if (newStyle && view && (vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))) {
1523 adjustedOption.
palette = palette;
1534 #endif // QT_NO_ITEMVIEWS 1569 if ((qobject_cast<const QScrollBar *>(widget) && control ==
CC_ScrollBar)
1570 #ifndef QT_NO_SPINBOX 1572 #endif // QT_NO_SPINBOX 1573 #ifndef QT_NO_COMBOBOX 1575 #endif // QT_NO_COMBOBOX 1581 int oldActiveControls = w->
property(
"_q_stylecontrols").
toInt();
1593 if (qstyleoption_cast<const QStyleOptionSlider *>(option)) {
1597 if (oldSliderPos != currentPos) {
1598 doTransition =
false;
1607 if (oldRect != option->
rect) {
1608 doTransition =
false;
1619 if (
const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox*>(option)) {
1622 QPainter startPainter(&startImage);
1628 }
else if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option)) {
1631 QPainter startPainter(&startImage);
1646 QPainter startPainter(&startImage);
1647 anim->paint(&startPainter, option);
1657 if (option->
state & State_MouseOver || option->
state & State_Sunken)
1664 anim->paint(painter, option);
1675 if (cmb->editable) {
1679 stateId = ETS_DISABLED;
1683 stateId = ETS_FOCUSED;
1685 stateId = ETS_NORMAL;
1694 theme.
rect = subRect;
1698 stateId = CBXS_DISABLED;
1700 stateId = CBXS_PRESSED;
1704 stateId = CBXS_NORMAL;
1714 btn.QStyleOption::operator=(*option);
1724 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option))
1728 bool maxedOut = (scrollbar->maximum == scrollbar->minimum);
1736 partId = SBP_ARROWBTN;
1738 stateId = (isHorz ? (isRTL ? ABS_LEFTDISABLED : ABS_RIGHTDISABLED) : ABS_DOWNDISABLED);
1739 else if (scrollbar->activeSubControls & SC_ScrollBarAddLine && (scrollbar->state &
State_Sunken))
1740 stateId = (isHorz ? (isRTL ? ABS_LEFTPRESSED : ABS_RIGHTPRESSED) : ABS_DOWNPRESSED);
1741 else if (scrollbar->activeSubControls & SC_ScrollBarAddLine && (scrollbar->state &
State_MouseOver))
1742 stateId = (isHorz ? (isRTL ? ABS_LEFTHOT : ABS_RIGHTHOT) : ABS_DOWNHOT);
1746 stateId = (isHorz ? (isRTL ? ABS_LEFTNORMAL : ABS_RIGHTNORMAL) : ABS_DOWNNORMAL);
1753 partId = SBP_ARROWBTN;
1755 stateId = (isHorz ? (isRTL ? ABS_RIGHTDISABLED : ABS_LEFTDISABLED) : ABS_UPDISABLED);
1756 else if (scrollbar->activeSubControls & SC_ScrollBarSubLine && (scrollbar->state &
State_Sunken))
1757 stateId = (isHorz ? (isRTL ? ABS_RIGHTPRESSED : ABS_LEFTPRESSED) : ABS_UPPRESSED);
1758 else if (scrollbar->activeSubControls & SC_ScrollBarSubLine && (scrollbar->state &
State_MouseOver))
1759 stateId = (isHorz ? (isRTL ? ABS_RIGHTHOT : ABS_LEFTHOT) : ABS_UPHOT);
1763 stateId = (isHorz ? (isRTL ? ABS_RIGHTNORMAL : ABS_LEFTNORMAL) : ABS_UPNORMAL);
1772 partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
1773 stateId = SCRBS_DISABLED;
1780 partId = flags & State_Horizontal ? SBP_UPPERTRACKHORZ : SBP_UPPERTRACKVERT;
1782 stateId = SCRBS_DISABLED;
1783 else if (scrollbar->activeSubControls & SC_ScrollBarSubPage && (scrollbar->state &
State_Sunken))
1784 stateId = SCRBS_PRESSED;
1785 else if (scrollbar->activeSubControls & SC_ScrollBarSubPage && (scrollbar->state &
State_MouseOver))
1786 stateId = SCRBS_HOT;
1788 stateId = SCRBS_NORMAL;
1795 partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
1797 stateId = SCRBS_DISABLED;
1798 else if (scrollbar->activeSubControls & SC_ScrollBarAddPage && (scrollbar->state &
State_Sunken))
1799 stateId = SCRBS_PRESSED;
1800 else if (scrollbar->activeSubControls & SC_ScrollBarAddPage && (scrollbar->state &
State_MouseOver))
1801 stateId = SCRBS_HOT;
1803 stateId = SCRBS_NORMAL;
1811 stateId = SCRBS_DISABLED;
1812 else if (scrollbar->activeSubControls & SC_ScrollBarSlider && (scrollbar->state &
State_Sunken))
1813 stateId = SCRBS_PRESSED;
1814 else if (scrollbar->activeSubControls & SC_ScrollBarSlider && (scrollbar->state &
State_MouseOver))
1815 stateId = SCRBS_HOT;
1819 stateId = SCRBS_NORMAL;
1823 theme.
partId = flags & State_Horizontal ? SBP_THUMBBTNHORZ : SBP_THUMBBTNVERT;
1831 MARGINS contentsMargin;
1836 theme.
partId = flags & State_Horizontal ? SBP_GRIPPERHORZ : SBP_GRIPPERVERT;
1838 int gw = size.cx, gh = size.cy;
1841 QRect gripperBounds;
1842 if (flags & State_Horizontal && ((swidth - contentsMargin.cxLeftWidth - contentsMargin.cxRightWidth) > gw)) {
1847 }
else if ((sheight - contentsMargin.cyTopHeight - contentsMargin.cyBottomHeight) > gh) {
1858 grippBackground.
partId = flags & State_Horizontal ? SBP_LOWERTRACKHORZ : SBP_LOWERTRACKVERT;
1859 theme.
rect = gripperBounds;
1870 #ifndef QT_NO_SPINBOX 1872 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
1878 stateId = ETS_DISABLED;
1882 stateId = ETS_SELECTED;
1884 stateId = ETS_NORMAL;
1894 stateId = UPS_DISABLED;
1895 else if (sb->activeSubControls == SC_SpinBoxUp && (sb->state &
State_Sunken))
1896 stateId = UPS_PRESSED;
1897 else if (sb->activeSubControls == SC_SpinBoxUp && (sb->state &
State_MouseOver))
1900 stateId = UPS_NORMAL;
1909 stateId = DNS_DISABLED;
1910 else if (sb->activeSubControls == SC_SpinBoxDown && (sb->state &
State_Sunken))
1911 stateId = DNS_PRESSED;
1912 else if (sb->activeSubControls == SC_SpinBoxDown && (sb->state &
State_MouseOver))
1915 stateId = DNS_NORMAL;
1922 #endif // QT_NO_SPINBOX 1949 minimumHeight = qMax<qint32>(size.cy + margins.cyBottomHeight+ margins.cyTopHeight, sz.
height());
1950 sz.
rwidth() += size.cx + margins.cxLeftWidth + margins.cxRightWidth;
1953 if (
const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
1958 #ifndef QT_NO_MENUBAR 1974 sz -=
QSize(2*border, 2*border);
1995 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
1999 int stateId = PBS_NORMAL;
2001 stateId = PBS_DISABLED;
2003 stateId = PBS_PRESSED;
2007 stateId = PBS_DEFAULTED;
2010 rect = option->
rect.
adjusted(border, border, -border, -border);
2020 if (result == S_OK) {
2021 rect.
adjust(borderSize.cxLeftWidth, borderSize.cyTopHeight,
2022 -borderSize.cxRightWidth, -borderSize.cyBottomHeight);
2034 int x = option->
rect.
x();
2035 int y = option->
rect.
y();
2040 int arrowWidth = 13;
2041 int arrowHeight = 5;
2045 arrowWidth = size.cx;
2046 arrowHeight = size.cy;
2050 r.
setRect(x + w/2 - arrowWidth/2, y , arrowWidth, arrowHeight);
2052 int vert_size = w / 2;
2053 r.
setRect(x + 5, y + h - margin * 2 - vert_size,
2054 w - margin * 2 - 5, vert_size);
2066 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
2080 if (qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))
2081 rect.
adjust(-2, 0, 2, 0);
2087 if (!vopt->icon.isNull())
2088 rect = textRect.
united(displayRect);
2110 bool retVal =
false;
2121 if (isMinimized && (flags & Qt::WindowMinimizeButtonHint))
2127 if (!isMaximized && (flags & Qt::WindowMaximizeButtonHint))
2135 if (isMinimized && flags & Qt::WindowShadeButtonHint)
2143 if (flags & Qt::WindowSystemMenuHint)
2168 mask->region = d->
region(themeData);
2197 #ifndef QT_NO_COMBOBOX 2199 if (
const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
2200 int x = cb->rect.x(),
2202 wi = cb->rect.width(),
2203 he = cb->rect.height();
2205 int margin = cb->frame ? 3 : 0;
2206 int bmarg = cb->frame ? 2 : 0;
2207 int arrowButtonWidth = bmarg + 16;
2208 xpos += wi - arrowButtonWidth;
2210 switch (subControl) {
2215 rect.
setRect(xpos, y , arrowButtonWidth, he);
2218 rect.
setRect(x + margin, y + margin, wi - 2 * margin - 16, he - 2 * margin);
2226 rect =
visualRect(cb->direction, cb->rect, rect);
2229 #endif // QT_NO_COMBOBOX 2231 if (
const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) {
2234 const bool isToolTitle =
false;
2235 const int height = tb->rect.
height();
2236 const int width = tb->rect.width();
2237 int buttonWidth = GetSystemMetrics(SM_CXSIZE) - 4;
2246 switch (subControl) {
2248 rect =
QRect(frameWidth, 0, width - (buttonWidth + frameWidth + 10), height);
2251 rect.
adjust(0, 0, -buttonWidth - 3, 0);
2253 if (minimizeHint || maximizeHint)
2254 rect.
adjust(0, 0, -buttonWidth - 2, 0);
2257 const int leftOffset = height - 8;
2258 rect.
adjust(leftOffset, 0, 0, 4);
2261 rect.
adjust(0, 0, -buttonWidth - 2, 0);
2263 rect.
adjust(0, 0, -buttonWidth - 2, 0);
2265 rect.
adjust(0, 0, -buttonWidth - 2, 0);
2267 rect.
adjust(0, 0, -buttonWidth - 2, 0);
2274 const int controlTop = 6;
2275 const int controlHeight = height - controlTop - 3;
2277 QSize iconSize = tb->icon.actualSize(
QSize(iconExtent, iconExtent));
2278 if (tb->icon.isNull())
2279 iconSize =
QSize(controlHeight, controlHeight);
2280 int hPad = (controlHeight - iconSize.
height())/2;
2281 int vPad = (controlHeight - iconSize.
width())/2;
2282 rect =
QRect(frameWidth + hPad, controlTop + vPad, iconSize.
width(), iconSize.
height());
2304 switch (e->
type()) {
2308 if (
d->animationTimer.timerId() == timerEvent->
timerId()) {
2380 #ifndef QT_NO_LINEEDIT 2381 if (qobject_cast<QLineEdit*>(widget))
2384 #endif // QT_NO_LINEEDIT 2385 if (qobject_cast<QGroupBox*>(widget))
2387 else if (qobject_cast<QCommandLinkButton*>(widget)) {
2392 else if (widget->
inherits(
"QTipLabel")){
2406 }
else if (qobject_cast<QMessageBox *> (widget)) {
2412 #ifndef QT_NO_INPUTDIALOG 2413 else if (qobject_cast<QInputDialog *> (widget)) {
2419 #endif // QT_NO_INPUTDIALOG 2420 else if (
QTreeView *tree = qobject_cast<QTreeView *> (widget)) {
2423 else if (
QListView *list = qobject_cast<QListView *> (widget)) {
2438 #ifndef QT_NO_LINEEDIT 2439 if (qobject_cast<QLineEdit*>(widget))
2442 #endif // QT_NO_LINEEDIT 2443 if (qobject_cast<QGroupBox*>(widget))
2445 else if (qobject_cast<QMessageBox *> (widget)) {
2451 #ifndef QT_NO_INPUTDIALOG 2452 else if (qobject_cast<QInputDialog *> (widget)) {
2458 #endif // QT_NO_INPUTDIALOG 2459 else if (
QTreeView *tree = qobject_cast<QTreeView *> (widget)) {
2461 }
else if (qobject_cast<QCommandLinkButton*>(widget)) {
2556 BOOL animEnabled =
false;
2587 static bool tried =
false;
2644 switch(standardIcon) {
2645 case SP_CommandLink:
2656 theme.
rect =
QRect(0, 0, size.cx, size.cy);
2686 #endif //QT_NO_WINDOWSVISTA void setDuration(int duration)
QPixmap standardPixmap(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
Reimplemented Function
The QPainter class performs low-level painting on widgets and other paint devices.
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
The QColor class provides colors based on RGB, HSV or CMYK values.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
The QWindowsVistaStyle class provides a look and feel suitable for applications on Microsoft Windows ...
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
void polish(QApplication *)
Reimplemented Function
virtual void paint(QPainter *painter, const QStyleOption *option)
#define MC_CHECKMARKDISABLED
void unpolish(QWidget *widget)
The QApplication class manages the GUI application's control flow and main settings.
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.
int styleHint(StyleHint hint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
QRect subElementRect(SubElement r, const QStyleOption *option, const QWidget *widget=0) const
Reimplemented Function
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 setHeight(int h)
Sets the height of the rectangle to the given height.
const QBrush & base() const
Returns the base brush of the current color group.
SubControl
This enum describes the available sub controls.
StyleHint
This enum describes the available style hints.
virtual void paint(QPainter *painter, const QStyleOption *option)
Paints a pulse.
The QStyleHintReturn class provides style hints that return more than basic data types.
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
void setWidget(QWidget *widget)
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
static PtrGetThemeBool pGetThemeBool
int width() const
Returns the width of the pixmap.
QPointer< QWidget > widget
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
static PtrGetThemeTransitionDuration pGetThemeTransitionDuration
static QPoint visualPos(Qt::LayoutDirection direction, const QRect &boundingRect, const QPoint &logicalPos)
Returns the given logicalPosition converted to screen coordinates based on the specified direction...
static PtrGetThemeFilename pGetThemeFilename
const QBrush & dark() const
Returns the dark brush of the current color group.
HRESULT(WINAPI * PtrDrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const RECT *pClipRect)
#define BP_COMMANDLINKGLYPH
HRESULT(WINAPI * PtrGetThemeColor)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT COLORREF *pColor)
QIcon icon
The icon (if any) to be drawn in the view item.
QStyle::State state
the style flags that are used when drawing the control
HRESULT(WINAPI * PtrCloseThemeData)(HTHEME hTheme)
static PtrGetThemeRect pGetThemeRect
int descent() const
Returns the descent of the font.
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
HRESULT(WINAPI * PtrSetWindowTheme)(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
static const int windowsItemVMargin
#define PP_TRANSPARENTBAR
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...
QWidget * treeViewHelper()
void rotate(qreal a)
Rotates the coordinate system the given angle clockwise.
const QBrush & background() const
Use window() instead.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
int msecsTo(const QTime &) const
Returns the number of milliseconds from this time to t.
static PtrGetThemeInt pGetThemeInt
ComplexControl
This enum describes the available complex controls.
HTHEME(WINAPI * PtrOpenThemeData)(HWND hwnd, LPCWSTR pszClassList)
void fill(uint pixel)
Fills the entire image with the given pixelValue.
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...
QBrush backgroundBrush
The QBrush that should be used to paint the view items background.
void drawBlendedImage(QPainter *painter, QRect rect, float value)
The QPointF class defines a point in the plane using floating point precision.
#define LISS_SELECTEDNOTFOCUS
#define CP_DROPDOWNBUTTONLEFT
HRESULT(WINAPI * PtrDrawThemeBackgroundEx)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, OPTIONAL const DTBGOPTS *pOptions)
The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar...
static PtrOpenThemeData pOpenThemeData
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.
PixelMetric
This enum describes the various available pixel metrics.
virtual void paint(QPainter *painter, const QStyleOption *option)
Paints a transition state.
~QWindowsVistaStylePrivate()
int left() const
Returns the x-coordinate of the rectangle's left edge.
#define SPI_GETCLIENTAREAANIMATION
bool isActive() const
Returns true if the timer is running and has not been stopped; otherwise returns false.
int width() const
Returns the width of the rectangle.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
static PtrDrawThemeBackground pDrawThemeBackground
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
QWidget * m_treeViewHelper
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
void drawBackground(XPThemeData &themeData)
Main theme drawing function.
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
void drawLine(const QLineF &line)
Draws a line defined by line.
The QProgressBar widget provides a horizontal or vertical progress bar.
int height() const
Returns the height of the rectangle.
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
void setHeight(int h)
Sets the height to the given height.
T * qobject_cast(QObject *object)
#define MENU_POPUPSEPARATOR
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *option, SubControl sc, const QWidget *widget=0) const
Reimplemented Function
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
void setBrushOrigin(int x, int y)
Sets the brush's origin to point (x, y).
static PtrIsThemePartDefined pIsThemePartDefined
void stopAnimation(const QWidget *)
#define SIZE(large, small, mini)
#define MENU_BARBACKGROUND
static PtrGetCurrentThemeName pGetCurrentThemeName
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)
SelectionMode selectionMode
which selection mode the view operates in
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags=0) const
If the string text is wider than width, returns an elided version of the string (i.
#define EP_EDITBORDER_HVSCROLL
StandardPixmap
This enum describes the available standard pixmaps.
static QPixmap * find(const QString &key)
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
static QFont font()
Returns the default application font.
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
void setFamily(const QString &)
Sets the family name of the font.
void setWidth(int w)
Sets the width to the given width.
HRESULT(WINAPI * PtrGetThemeBool)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT BOOL *pfVal)
HRESULT(WINAPI * PtrGetThemeFilename)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT LPWSTR pszThemeFileName, int cchMaxBuffChars)
#define PBS_DEFAULTED_ANIMATING
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progre...
int width() const
Returns the width.
static QIcon windowIcon()
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.
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
The QTime class provides clock time functions.
const QPen & pen() const
Returns the painter's current pen.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QFontMetrics fontMetrics() const
Returns the font metrics for the painter if the painter is active.
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...
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
ViewItemFeatures features
a bitwise OR of the features that describe this view item
#define TDLG_SECONDARYPANEL
QPoint brushOrigin() const
Returns the currently set brush origin.
HRESULT(WINAPI * PtrIsThemePartDefined)(HTHEME hTheme, int iPartId, int iStateId)
void drawControl(ControlElement element, const QStyleOption *option, QPainter *p, const QWidget *wwidget=0) const
Reimplemented Function
static PtrDrawThemeBackgroundEx pDrawThemeBackgroundEx
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
The QStyleOption class stores the parameters used by QStyle functions.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
#define TMT_TRANSITIONDURATIONS
#define PP_TRANSPARENTBARVERT
HRESULT(WINAPI * PtrGetThemePosition)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT POINT *pPoint)
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=0) const
ContentsType
This enum describes the available contents types.
The QTreeView class provides a default model/view implementation of a tree view.
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.
void drawPrimitive(PrimitiveElement pe, const QStyleOption *option, QPainter *p, const QWidget *widget=0) const
Reimplemented Function
QBasicTimer animationTimer
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.
HRESULT(WINAPI * PtrGetThemeString)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT LPWSTR pszBuff, int cchMaxBuffChars)
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
The QComboBox widget is a combined button and popup list.
HRESULT(WINAPI * PtrGetThemeMargins)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OPTIONAL RECT *prc, OUT MARGINS *pMargins)
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...
int styleHint(StyleHint hint, const QStyleOption *option=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
bool transitionsEnabled() const
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
void unpolish(QApplication *)
Reimplemented Function
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
bool showDecorationSelected
whether the decoration should be highlighted on selected items
The QImage class provides a hardware-independent image representation that allows direct access to th...
void transpose()
Swaps the width and height values.
void setEndImage(const QImage &image)
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static int buttonStateId(int flags, int partId)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
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.
int pixelMetric(PixelMetric pm, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
The QGroupBox widget provides a group box frame with a title.
HRESULT(WINAPI * PtrGetCurrentThemeName)(OUT LPWSTR pszThemeFileName, int cchMaxNameChars, OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars, OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars)
static const int windowsItemHMargin
QSize sizeFromContents(ContentsType ct, const QStyleOption *option, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
HRESULT(WINAPI * PtrGetThemePropertyOrigin)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT enum PROPERTYORIGIN *pOrigin)
#define MENU_POPUPCHECKBACKGROUND
The QRegion class specifies a clip region for a painter.
HRESULT(WINAPI * PtrGetThemeTransitionDuration)(HTHEME hTheme, int iPartId, int iStateFromId, int iStateToId, int iPropId, int *pDuration)
static bool isItemViewDelegateLineEdit(const QWidget *widget)
static PtrGetThemeFont pGetThemeFont
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...
The QAbstractSpinBox class provides a spinbox and a line edit to display values.
void timerEvent(QTimerEvent *event)
Reimplemented Function
Qt::BrushStyle style() const
Returns the brush style.
The State element defines configurations of objects and properties.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
HRESULT(WINAPI * PtrGetThemeIntList)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT INTLIST *pIntList)
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
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...
static PtrGetThemeString pGetThemeString
static PtrGetThemeEnumValue pGetThemeEnumValue
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
#define CP_DROPDOWNBUTTONRIGHT
bool event(QEvent *event)
void stop()
Stops the timer.
void moveCenter(const QPoint &p)
Moves the rectangle, leaving the center point at the given position.
The QWindowsXPStyle class provides a Microsoft Windows XP-like look and feel.
static PtrGetThemeColor pGetThemeColor
ViewItemPosition viewItemPosition
Gives the position of this view item relative to other items.
qreal dpiScaled(qreal value)
QPoint topRight() const
Returns the position of the rectangle's top-right corner.
RECT toRECT(const QRect &qr)
static PtrCloseThemeData pCloseThemeData
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
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.
QPoint center() const
Returns the center point of the rectangle.
static bool buttonVisible(const QStyle::SubControl sc, const QStyleOptionTitleBar *tb)
const QBrush & shadow() const
Returns the shadow brush of the current color group.
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.
The QAbstractItemView class provides the basic functionality for item view classes.
The QStyleHintReturnMask class provides style hints that return a QRegion.
int top() const
Returns the y-coordinate of the rectangle's top edge.
int width() const
Returns the width of the image.
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
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...
static PtrGetThemePropertyOrigin pGetThemePropertyOrigin
HRESULT(WINAPI * PtrGetThemeInt)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT int *piVal)
void * resolve(const char *symbol)
The QListView class provides a list or icon view onto a model.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option, QPainter *p, const QWidget *widget=0) const
Reimplemented Function
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
int right() const
Returns the x-coordinate of the rectangle's right edge.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
PrimitiveElement
This enum describes the various primitive elements.
void polish(QWidget *widget)
The QTimerEvent class contains parameters that describe a timer event.
HRESULT(WINAPI * PtrGetThemeEnumValue)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT int *piVal)
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
QRegion region(XPThemeData &themeData)
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush...
qint64 cacheKey() const
Returns a number that identifies the contents of this QIcon object.
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const
static QTime currentTime()
Returns the current time as reported by the system clock.
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
int pixelMetric(PixelMetric pm, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
QWindowsVistaStylePrivate()
T qstyleoption_cast(const QStyleOption *opt)
void setPrimaryImage(const QImage &image)
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QString family() const
Returns the requested font family name, i.e.
SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget=0) const
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.
void setAlternateImage(const QImage &image)
void startAnimation(QWindowsVistaAnimation *)
QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
int x() const
Returns the x-coordinate of the rectangle's left edge.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
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...
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
static const QStyle::SubControl SubControls[]
static HWND winId(const QWidget *widget)
This function will always return a valid window handle, and might create a limbo widget to do so...
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
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...
static PtrSetWindowTheme pSetWindowTheme
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
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...
int size() const
Returns the number of items in the list.
static const int windowsArrowHMargin
The QStyleOptionComboBox class is used to describe the parameter for drawing a combobox.
int & rheight()
Returns a reference to the height.
void setWidth(int w)
Sets the width of the rectangle to the given width.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
int height() const
Returns the height.
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
The QRect class defines a rectangle in the plane using integer precision.
static bool useXP(bool update=false)
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const
Reimplemented Function
#define MC_CHECKMARKNORMAL
static PtrGetThemeMetric pGetThemeMetric
int height() const
Returns the height of the image.
T takeAt(int i)
Removes the item at index position i and returns it.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
int y() const
Returns the y coordinate of this point.
The QLineEdit widget is a one-line text editor.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
const QStyle * proxy() const
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const
QVariant property(const char *name) const
Returns the value of the object's name property.
The QPixmap class is an off-screen image representation that can be used as a paint device...
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
static QColor fromRgb(QRgb rgb)
Static convenience function that returns a QColor constructed from the given QRgb value rgb...
static const int windowsRightBorder
static const int windowsItemFrame
HRESULT(WINAPI * PtrGetThemePartSize)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, OPTIONAL RECT *prc, enum THEMESIZE eSize, OUT SIZE *psz)
HRESULT(WINAPI * PtrGetThemeMetric)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OUT int *piVal)
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.
ControlElement
This enum represents a control element.
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
const QBrush & alternateBase() const
Returns the alternate base brush of the current color group.
static PtrGetThemeMargins pGetThemeMargins
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
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.
static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1)
Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by Q...
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
Qt::WindowFlags titleBarFlags
the widget flags for the title bar
int x() const
Returns the x coordinate of this point.
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
HRESULT(WINAPI * PtrGetThemeRect)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, OUT RECT *pRect)
static PtrGetThemePartSize pGetThemePartSize
int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
void polish(QApplication *)
Reimplemented Function
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
QList< QWindowsVistaAnimation * > animations
#define MC_BULLETDISABLED
#define TMT_SIZINGMARGINS
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress...
#define EP_EDITBORDER_NOSCROLL
void setStartImage(const QImage &image)
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const
#define MENU_POPUPBORDERS
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...
void setDuration(int duration)
The QCheckBox widget provides a checkbox with a text label.
int titleBarState
the state of the title bar
SelectionBehavior selectionBehavior
which selection behavior the view uses
The QEvent class is the base class of all event classes.
QPalette standardPalette() const
Reimplemented Function
Type type() const
Returns the event type.
#define PP_MOVEOVERLAYVERT
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
QPalette standardPalette() const
#define TDLG_PRIMARYPANEL
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QRect rect
the area that should be used for various calculations and painting
static PtrGetThemeIntList pGetThemeIntList
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
QWindowsVistaStyle()
Constructs a QWindowsVistaStyle object.
void setStartTime(const QTime &startTime)
QRgb rgb() const
Returns the RGB value of the color.
Q_DECL_CONSTEXPR int qRound(qreal d)
void start(int msec, QObject *obj)
Starts (or restarts) the timer with a msec milliseconds timeout.
The QTextEdit class provides a widget that is used to edit and display both plain and rich text...
QWindowsVistaAnimation * widgetAnimation(const QWidget *) const
int & rwidth()
Returns a reference to the width.
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
SubElement
This enum represents a sub-area of a widget.
QString text
The text (if any) to be drawn in the view item.
HRESULT(WINAPI * PtrGetThemeFont)(HTHEME hTheme, OPTIONAL HDC hdc, int iPartId, int iStateId, int iPropId, OUT LOGFONT *pFont)
static bool resolveSymbols()
Returns true if all the necessary theme engine symbols were resolved.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
static PtrGetThemePosition pGetThemePosition
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.
#define TMT_CONTENTMARGINS