45 #if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN) 47 #include <private/qsystemlibrary_p.h> 54 #include <private/qmenubar_p.h> 69 #include <private/qmath_p.h> 75 #include <private/qt_x11_p.h> 78 #include <private/qstylehelper_p.h> 87 # ifndef COLOR_GRADIENTACTIVECAPTION 88 # define COLOR_GRADIENTACTIVECAPTION 27 90 # ifndef COLOR_GRADIENTINACTIVECAPTION 91 # define COLOR_GRADIENTINACTIVECAPTION 28 101 WCHAR szPath[MAX_PATH];
104 #define _SHGFI_SMALLICON 0x000000001 105 #define _SHGFI_LARGEICON 0x000000000 106 #define _SHGFI_ICON 0x000000100 107 #define _SIID_SHIELD 77 124 : alt_down(false), menuBarTimer(0), animationFps(10), animateTimer(0), animateStep(0)
126 #if defined(Q_WS_WIN) && !defined(Q_OS_WINCE) 159 widget = widget->
window();
168 #ifndef QT_NO_PROGRESSBAR 170 if (event->
timerId() ==
d->animateTimer) {
172 d->animateStep =
d->startTime.elapsed() / (1000 /
d->animationFps);
176 #endif // QT_NO_PROGRESSBAR 193 if (static_cast<QKeyEvent *>(e)->key() ==
Qt::Key_Alt) {
194 widget = widget->
window();
198 for (
int pos=0 ; pos < l.
size() ;) {
208 d->seenAlt.append(widget);
212 for (
int pos = 0; pos < l.
size(); ++pos)
218 widget = widget->
window();
222 #ifndef QT_NO_MENUBAR 224 for (
int i = 0; i < l.
size(); ++i)
231 d->seenAlt.removeAll(widget);
232 d->seenAlt.removeAll(widget->
window());
234 #ifndef QT_NO_PROGRESSBAR 238 if (
QProgressBar *bar = qobject_cast<QProgressBar *>(o)) {
241 if (bar->minimum() == bar->maximum())
242 d->startAnimation(
this, bar);
244 d->stopAnimation(
this, bar);
252 d->stopAnimation(
this, static_cast<QProgressBar *>(o));
254 #endif // QT_NO_PROGRESSBAR 304 return qRgb(GetRValue(col), GetGValue(col), GetBValue(col));
323 #if defined(Q_WS_WIN) //fetch native title bar colors 325 DWORD activeCaption = GetSysColor(COLOR_ACTIVECAPTION);
327 DWORD inactiveCaption = GetSysColor(COLOR_INACTIVECAPTION);
329 DWORD inactiveCaptionText = GetSysColor(COLOR_INACTIVECAPTIONTEXT);
350 #ifndef QT_NO_PROGRESSBAR 351 if (qobject_cast<QProgressBar *>(widget))
360 #ifndef QT_NO_PROGRESSBAR 361 if (
QProgressBar *bar=qobject_cast<QProgressBar *>(widget)) {
364 d->stopAnimation(
this, bar);
401 #if defined(Q_WS_WIN) 403 HDC hdcScreen = GetDC(0);
404 int dpi = GetDeviceCaps(hdcScreen, LOGPIXELSX);
405 ReleaseDC(0, hdcScreen);
406 ret = (int)(dpi * 1.375);
422 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
423 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height() : sl->rect.width();
424 int ticks = sl->tickPosition;
441 thick += (space * 2) / (n + 2);
447 #endif // QT_NO_SLIDER 480 #if defined(Q_WS_WIN) 482 #if defined(Q_OS_WINCE) 483 ret = GetSystemMetrics(SM_CXDLGFRAME);
485 ret = GetSystemMetrics(SM_CXFRAME);
498 #if defined(Q_WS_WIN) 502 if (widget && widget->
inherits(
"Q3DockWindowTitleBar")) {
503 ret = GetSystemMetrics(SM_CYSMCAPTION) - 1;
508 #if defined(Q_OS_WINCE) 509 ret = GetSystemMetrics(SM_CYCAPTION) - 1;
511 ret = GetSystemMetrics(SM_CYSMCAPTION) - 1;
514 ret = GetSystemMetrics(SM_CYCAPTION) - 1;
522 NONCLIENTMETRICS ncm;
523 ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) +
sizeof(LOGFONT);
524 if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS), &ncm, 0))
525 ret =
qMax(ncm.iScrollHeight, ncm.iScrollWidth);
537 #if defined(Q_WS_WIN) 539 #if defined(Q_OS_WINCE) 540 ret = GetSystemMetrics(SM_CYDLGFRAME);
542 ret = GetSystemMetrics(SM_CYFRAME);
546 DWORD caretWidth = 1;
547 #if defined(SPI_GETCARETWIDTH) 548 SystemParametersInfo(SPI_GETCARETWIDTH, 0, &caretWidth, 0);
550 ret = (int)caretWidth;
570 #ifndef QT_NO_IMAGEFORMAT_XPM 790 "...........********.............",
791 "........***aaaaaaaa***..........",
792 "......**aaaaaaaaaaaaaa**........",
793 ".....*aaaaaaaaaaaaaaaaaa*.......",
794 "....*aaaaaaaabbbbaaaaaaaac......",
795 "...*aaaaaaaabbbbbbaaaaaaaac.....",
796 "..*aaaaaaaaabbbbbbaaaaaaaaac....",
797 ".*aaaaaaaaaaabbbbaaaaaaaaaaac...",
798 ".*aaaaaaaaaaaaaaaaaaaaaaaaaac*..",
799 "*aaaaaaaaaaaaaaaaaaaaaaaaaaaac*.",
800 "*aaaaaaaaaabbbbbbbaaaaaaaaaaac*.",
801 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
802 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
803 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
804 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
805 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
806 ".*aaaaaaaaaaabbbbbaaaaaaaaaac***",
807 ".*aaaaaaaaaaabbbbbaaaaaaaaaac***",
808 "..*aaaaaaaaaabbbbbaaaaaaaaac***.",
809 "...caaaaaaabbbbbbbbbaaaaaac****.",
810 "....caaaaaaaaaaaaaaaaaaaac****..",
811 ".....caaaaaaaaaaaaaaaaaac****...",
812 "......ccaaaaaaaaaaaaaacc****....",
813 ".......*cccaaaaaaaaccc*****.....",
814 "........***cccaaaac*******......",
815 "..........****caaac*****........",
816 ".............*caaac**...........",
817 "...............caac**...........",
818 "................cac**...........",
819 ".................cc**...........",
820 "..................***...........",
821 "...................**..........."};
829 ".............***................",
830 "............*aaa*...............",
831 "...........*aaaaa*b.............",
832 "...........*aaaaa*bb............",
833 "..........*aaaaaaa*bb...........",
834 "..........*aaaaaaa*bb...........",
835 ".........*aaaaaaaaa*bb..........",
836 ".........*aaaaaaaaa*bb..........",
837 "........*aaaaaaaaaaa*bb.........",
838 "........*aaaa***aaaa*bb.........",
839 ".......*aaaa*****aaaa*bb........",
840 ".......*aaaa*****aaaa*bb........",
841 "......*aaaaa*****aaaaa*bb.......",
842 "......*aaaaa*****aaaaa*bb.......",
843 ".....*aaaaaa*****aaaaaa*bb......",
844 ".....*aaaaaa*****aaaaaa*bb......",
845 "....*aaaaaaaa***aaaaaaaa*bb.....",
846 "....*aaaaaaaa***aaaaaaaa*bb.....",
847 "...*aaaaaaaaa***aaaaaaaaa*bb....",
848 "...*aaaaaaaaaa*aaaaaaaaaa*bb....",
849 "..*aaaaaaaaaaa*aaaaaaaaaaa*bb...",
850 "..*aaaaaaaaaaaaaaaaaaaaaaa*bb...",
851 ".*aaaaaaaaaaaa**aaaaaaaaaaa*bb..",
852 ".*aaaaaaaaaaa****aaaaaaaaaa*bb..",
853 "*aaaaaaaaaaaa****aaaaaaaaaaa*bb.",
854 "*aaaaaaaaaaaaa**aaaaaaaaaaaa*bb.",
855 "*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb",
856 "*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb",
857 ".*aaaaaaaaaaaaaaaaaaaaaaaaa*bbbb",
858 "..*************************bbbbb",
859 "....bbbbbbbbbbbbbbbbbbbbbbbbbbb.",
860 ".....bbbbbbbbbbbbbbbbbbbbbbbbb.."};
868 "...........********.............",
869 ".........************...........",
870 ".......****************.........",
871 "......******************........",
872 ".....********************a......",
873 "....**********************a.....",
874 "...************************a....",
875 "..*******b**********b*******a...",
876 "..******bbb********bbb******a...",
877 ".******bbbbb******bbbbb******a..",
878 ".*******bbbbb****bbbbb*******a..",
879 "*********bbbbb**bbbbb*********a.",
880 "**********bbbbbbbbbb**********a.",
881 "***********bbbbbbbb***********aa",
882 "************bbbbbb************aa",
883 "************bbbbbb************aa",
884 "***********bbbbbbbb***********aa",
885 "**********bbbbbbbbbb**********aa",
886 "*********bbbbb**bbbbb*********aa",
887 ".*******bbbbb****bbbbb*******aa.",
888 ".******bbbbb******bbbbb******aa.",
889 "..******bbb********bbb******aaa.",
890 "..*******b**********b*******aa..",
891 "...************************aaa..",
892 "....**********************aaa...",
893 "....a********************aaa....",
894 ".....a******************aaa.....",
895 "......a****************aaa......",
896 ".......aa************aaaa.......",
897 ".........aa********aaaaa........",
898 "...........aaaaaaaaaaa..........",
899 ".............aaaaaaa............"};
908 "...........********.............",
909 "........***aaaaaaaa***..........",
910 "......**aaaaaaaaaaaaaa**........",
911 ".....*aaaaaaaaaaaaaaaaaa*.......",
912 "....*aaaaaaaaaaaaaaaaaaaac......",
913 "...*aaaaaaaabbbbbbaaaaaaaac.....",
914 "..*aaaaaaaabaaabbbbaaaaaaaac....",
915 ".*aaaaaaaabbaaaabbbbaaaaaaaac...",
916 ".*aaaaaaaabbbbaabbbbaaaaaaaac*..",
917 "*aaaaaaaaabbbbaabbbbaaaaaaaaac*.",
918 "*aaaaaaaaaabbaabbbbaaaaaaaaaac*.",
919 "*aaaaaaaaaaaaabbbbaaaaaaaaaaac**",
920 "*aaaaaaaaaaaaabbbaaaaaaaaaaaac**",
921 "*aaaaaaaaaaaaabbaaaaaaaaaaaaac**",
922 "*aaaaaaaaaaaaabbaaaaaaaaaaaaac**",
923 "*aaaaaaaaaaaaaaaaaaaaaaaaaaaac**",
924 ".*aaaaaaaaaaaabbaaaaaaaaaaaac***",
925 ".*aaaaaaaaaaabbbbaaaaaaaaaaac***",
926 "..*aaaaaaaaaabbbbaaaaaaaaaac***.",
927 "...caaaaaaaaaabbaaaaaaaaaac****.",
928 "....caaaaaaaaaaaaaaaaaaaac****..",
929 ".....caaaaaaaaaaaaaaaaaac****...",
930 "......ccaaaaaaaaaaaaaacc****....",
931 ".......*cccaaaaaaaaccc*****.....",
932 "........***cccaaaac*******......",
933 "..........****caaac*****........",
934 ".............*caaac**...........",
935 "...............caac**...........",
936 "................cac**...........",
937 ".................cc**...........",
938 "..................***...........",
939 "...................**..........."};
941 #endif //QT_NO_IMAGEFORMAT_XPM 947 HMODULE hmod = LoadLibrary(L
"ceshell");
952 HICON iconHandle = (HICON)LoadImage(hmod, MAKEINTRESOURCE(resourceId), IMAGE_ICON, size, size, 0);
955 DestroyIcon(iconHandle);
969 #if defined(Q_WS_WIN) && !defined(Q_OS_WINCE) 971 switch(standardPixmap) {
1051 HICON iconHandle = LoadIcon(NULL, IDI_INFORMATION);
1053 DestroyIcon(iconHandle);
1058 HICON iconHandle = LoadIcon(NULL, IDI_WARNING);
1060 DestroyIcon(iconHandle);
1065 HICON iconHandle = LoadIcon(NULL, IDI_ERROR);
1067 DestroyIcon(iconHandle);
1072 HICON iconHandle = LoadIcon(NULL, IDI_QUESTION);
1074 DestroyIcon(iconHandle);
1085 memset(&iconInfo, 0,
sizeof(iconInfo));
1086 iconInfo.
cbSize =
sizeof(iconInfo);
1089 DestroyIcon(iconInfo.
hIcon);
1098 if (!desktopIcon.
isNull()) {
1102 #ifndef QT_NO_IMAGEFORMAT_XPM 1103 switch (standardPixmap) {
1133 #endif //QT_NO_IMAGEFORMAT_XPM 1159 #ifndef QT_NO_LISTVIEW 1160 if (qobject_cast<const QListView*>(widget))
1171 #if defined(Q_WS_WIN) 1180 if (!ret && widget &&
d) {
1181 #ifndef QT_NO_MENUBAR 1183 if (!menuBar && qobject_cast<const QMenu *>(widget)) {
1185 if (w && w != widget)
1190 if (menuBar->d_func()->keyboardState ||
d->altDown())
1194 #endif // QT_NO_MENUBAR 1195 if (
d->hasSeenAlt(widget)) {
1202 #ifndef QT_NO_RUBBERBAND 1209 mask->region = opt->
rect;
1213 mask->region -= opt->
rect.
adjusted(size, size, -size, -size);
1218 #endif // QT_NO_RUBBERBAND 1234 #ifndef QT_NO_WIZARD 1257 bool doRestore =
false;
1260 #ifndef QT_NO_TOOLBAR 1264 const int margin = 2;
1267 const int offset = rect.
width()/2;
1280 const int offset = rect.
height()/2;
1320 #endif // QT_NO_TOOLBAR 1324 #ifndef QT_NO_DOCKWIDGET 1325 if (w && w->
inherits(
"QDockWidgetTitleButton")) {
1327 if (dw->isWindow()){
1334 #endif // QT_NO_DOCKWIDGET 1373 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
1387 }
else if (flags & (
State_Raised | State_Sunken | State_On | State_Sunken)) {
1399 rect.
adjust(0, 0, -1, -1);
1418 int border = size/5;
1419 int sqsize = 2*(size/2);
1427 a.
setPoints(3, border, sqsize/2, sqsize/2, border, sqsize - border, sqsize/2);
1430 a.
setPoints(3, border, sqsize/2, sqsize/2, sqsize - border, sqsize - border, sqsize/2);
1433 a.
setPoints(3, sqsize - border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border);
1436 a.
setPoints(3, border, sqsize/2, sqsize/2, border, sqsize/2, sqsize - border);
1451 int sx = sqsize / 2 - bounds.
center().
x() - 1;
1452 int sy = sqsize / 2 - bounds.
center().
y() - 1;
1453 imagePainter.
translate(sx + bsx, sy + bsy);
1472 int xOffset = r.
x() + (r.
width() - size)/2;
1473 int yOffset = r.
y() + (r.
height() - size)/2;
1515 xx = opt->
rect.
x() + 3;
1516 yy = opt->
rect.
y() + 5;
1517 for (i = 0; i < 3; ++i) {
1518 lines[i] =
QLineF(xx, yy, xx, yy + 2);
1523 for (i = 3; i < 7; ++i) {
1524 lines[i] =
QLineF(xx, yy, xx, yy + 2);
1541 QColor bg_col = fropt->backgroundColor;
1545 QColor patternCol((bg_col.
red() ^ 0xff) & 0xff,
1546 (bg_col.
green() ^ 0xff) & 0xff,
1547 (bg_col.
blue() ^ 0xff) & 0xff);
1560 #define PTSARRLEN(x) sizeof(x)/(sizeof(QPoint)) 1561 static const QPoint pts1[] = {
1562 QPoint(1, 9),
QPoint(1, 8),
QPoint(0, 7),
QPoint(0, 4),
QPoint(1, 3),
QPoint(1, 2),
1563 QPoint(2, 1),
QPoint(3, 1),
QPoint(4, 0),
QPoint(7, 0),
QPoint(8, 1),
QPoint(9, 1)
1565 static const QPoint pts2[] = {
1566 QPoint(2, 8),
QPoint(1, 7),
QPoint(1, 4),
QPoint(2, 3),
QPoint(2, 2),
QPoint(3, 2),
1569 static const QPoint pts3[] = {
1570 QPoint(2, 9),
QPoint(3, 9),
QPoint(4, 10),
QPoint(7, 10),
QPoint(8, 9),
QPoint(9, 9),
1573 static const QPoint pts4[] = {
1574 QPoint(2, 10),
QPoint(3, 10),
QPoint(4, 11),
QPoint(7, 11),
QPoint(8, 10),
1575 QPoint(9, 10),
QPoint(10, 9),
QPoint(10, 8),
QPoint(11, 7),
QPoint(11, 4),
1578 static const QPoint pts5[] = {
1579 QPoint(4, 2),
QPoint(7, 2),
QPoint(9, 4),
QPoint(9, 7),
QPoint(7, 9),
QPoint(4, 9),
1605 if (ir.
width() > indicatorWidth)
1606 xOffset += (ir.
width() - indicatorWidth)/2;
1607 if (ir.
height() > indicatorHeight)
1608 yOffset += (ir.
height() - indicatorHeight)/2;
1646 if (
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
1647 if (frame->lineWidth == 2 || pe ==
PE_Frame) {
1648 QPalette popupPal = frame->palette;
1672 #endif // QT_NO_FRAME 1675 static const int decoration_size = 9;
1683 int delta = decoration_size / 2;
1688 p->
drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4);
1690 p->
drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6);
1693 p->
drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1);
1734 #ifndef QT_NO_DOCKWIDGET 1760 if (qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
1764 #endif // QT_NO_DOCKWIDGET 1770 #ifndef QT_NO_PROGRESSBAR 1773 bool vertical =
false, inverted =
false;
1776 inverted = pb2->invertedAppearance;
1804 #endif // QT_NO_PROGRESSBAR 1820 #ifndef QT_NO_RUBBERBAND 1822 if (qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
1825 QPainter pixmapPainter(&tiledPixmap);
1831 pixmapPainter.
end();
1843 #endif // QT_NO_RUBBERBAND 1845 #if !defined(QT_NO_MENU) && !defined(QT_NO_MAINWINDOW) 1847 if (widget && qobject_cast<const QMainWindow *>(widget->
parentWidget())) {
1858 if (
const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
1860 menuitem->rect.getRect(&x, &y, &w, &h);
1861 int tab = menuitem->tabWidth;
1864 ? menuitem->checked :
false;
1871 p->
fillRect(menuitem->rect.adjusted(0, 0, -1, 0), fill);
1874 int yoff = y-1 + h / 2;
1875 p->
setPen(menuitem->palette.dark().color());
1876 p->
drawLine(x + 2, yoff, x + w - 4, yoff);
1877 p->
setPen(menuitem->palette.light().color());
1878 p->
drawLine(x + 2, yoff + 1, x + w - 4, yoff + 1);
1882 QRect vCheckRect =
visualRect(opt->
direction, menuitem->rect,
QRect(menuitem->rect.x(), menuitem->rect.y(), checkcol, menuitem->rect.height()));
1883 if (!menuitem->icon.isNull() && checked) {
1886 menuitem->palette,
true, 1,
1887 &menuitem->palette.brush(QPalette::Button));
1893 p->
fillRect(vCheckRect, menuitem->palette.brush(QPalette::Button));
1899 if (!menuitem->icon.isNull()) {
1908 int pixw = pixmap.
width();
1909 int pixh = pixmap.
height();
1910 if (act && !dis && !checked)
1912 &menuitem->palette.brush(QPalette::Button));
1913 QRect pmr(0, 0, pixw, pixh);
1914 pmr.moveCenter(vCheckRect.
center());
1915 p->
setPen(menuitem->palette.text().color());
1917 }
else if (checked) {
1930 p->
setPen(act ? menuitem->palette.highlightedText().color() : menuitem->palette.buttonText().color());
1934 discol = menuitem->palette.text().color();
1939 int xpos = menuitem->rect.x() + xm;
1955 p->
setPen(menuitem->palette.light().color());
1959 p->
drawText(vShortcutRect, text_flags, s.
mid(t + 1));
1962 QFont font = menuitem->font;
1967 p->
setPen(menuitem->palette.light().color());
1981 newMI.
rect = vSubMenuRect;
1991 #endif // QT_NO_MENU 1992 #ifndef QT_NO_MENUBAR 2000 if (active || hasFocus) {
2004 if (active && hasFocus)
2005 qDrawShadeRect(p, mbi->rect.x(), mbi->rect.y(), mbi->rect.width(),
2006 mbi->rect.height(), mbi->palette, active && down, 1, 0, &b);
2007 if (active && down) {
2016 #endif // QT_NO_MENUBAR 2017 #ifndef QT_NO_TABBAR 2019 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
2027 bool firstTab = ((!rtlHorTabs
2032 bool previousSelected =
2041 && tab->selectedPosition
2044 bool leftAligned = (!rtlHorTabs && tabBarAlignment ==
Qt::AlignLeft)
2048 bool rightAligned = (!rtlHorTabs && tabBarAlignment ==
Qt::AlignRight)
2054 QColor shadow = tab->palette.shadow().color();
2057 borderThinkness /= 2;
2060 int x2 = r2.
right();
2063 switch (tab->shape) {
2070 x1 += onlyOne || firstTab ? borderThinkness : 0;
2071 x2 -= onlyOne || lastTab ? borderThinkness : 0;
2074 p->
fillRect(
QRect(x1 + 1, y1 + 1, (x2 - x1) - 1, (y2 - y1) - 2), tab->palette.background());
2078 p->
fillRect(
QRect(x1,y2-1,x2-x1,1), tab->palette.background());
2079 p->
fillRect(
QRect(x1,y2,x2-x1,1), tab->palette.background());
2082 if (firstTab || selected || onlyOne || !previousSelected) {
2084 p->
drawLine(x1, y1 + 2, x1, y2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));
2089 int beg = x1 + (previousSelected ? 0 : 2);
2090 int end = x2 - (nextSelected ? 0 : 2);
2095 if (lastTab || selected || onlyOne || !nextSelected) {
2097 p->
drawLine(x2, y1 + 2, x2, y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
2100 p->
drawLine(x2 - 1, y1 + 2, x2 - 1, y2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
2106 x1 += firstTab ? borderThinkness : 0;
2107 x2 -= lastTab ? borderThinkness : 0;
2110 p->
fillRect(
QRect(x1 + 1, y1 + 2, (x2 - x1) - 1, (y2 - y1) - 1), tab->palette.background());
2114 p->
fillRect(
QRect(x1, y1 + 1, (x2 - 1)-x1, 1), tab->palette.background());
2115 p->
fillRect(
QRect(x1, y1, (x2 - 1)-x1, 1), tab->palette.background());
2118 if (firstTab || selected || onlyOne || !previousSelected) {
2120 p->
drawLine(x1, y2 - 2, x1, y1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness));
2125 int beg = x1 + (previousSelected ? 0 : 2);
2126 int end = x2 - (nextSelected ? 0 : 2);
2130 p->
drawLine(beg, y2 - 1, end, y2 - 1);
2133 if (lastTab || selected || onlyOne || !nextSelected) {
2135 p->
drawLine(x2, y2 - 2, x2, y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
2138 p->
drawLine(x2 - 1, y2 - 2, x2 - 1, y1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness));
2144 y1 += firstTab ? borderThinkness : 0;
2145 y2 -= lastTab ? borderThinkness : 0;
2148 p->
fillRect(
QRect(x1 + 1, y1 + 1, (x2 - x1) - 2, (y2 - y1) - 1), tab->palette.background());
2152 p->
fillRect(
QRect(x2 - 1, y1, 1, y2-y1), tab->palette.background());
2153 p->
fillRect(
QRect(x2, y1, 1, y2-y1), tab->palette.background());
2156 if (firstTab || selected || onlyOne || !previousSelected) {
2158 p->
drawLine(x1 + 2, y1, x2 - ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1);
2163 int beg = y1 + (previousSelected ? 0 : 2);
2164 int end = y2 - (nextSelected ? 0 : 2);
2169 if (lastTab || selected || onlyOne || !nextSelected) {
2171 p->
drawLine(x1 + 3, y2, x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2);
2174 p->
drawLine(x1 + 3, y2 - 1, x2 - ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2 - 1);
2182 y1 += firstTab ? borderThinkness : 0;
2183 y2 -= lastTab ? borderThinkness : 0;
2186 p->
fillRect(
QRect(x1 + 2, y1 + 1, (x2 - x1) - 1, (y2 - y1) - 1), tab->palette.background());
2190 p->
fillRect(
QRect(x1 + 1, y1, 1, (y2 - 1)-y1),tab->palette.background());
2191 p->
fillRect(
QRect(x1, y1, 1, (y2-1)-y1), tab->palette.background());
2194 if (firstTab || selected || onlyOne || !previousSelected) {
2196 p->
drawLine(x2 - 2, y1, x1 + ((onlyOne || firstTab) && selected && leftAligned ? 0 : borderThinkness), y1);
2201 int beg = y1 + (previousSelected ? 0 : 2);
2202 int end = y2 - (nextSelected ? 0 : 2);
2206 p->
drawLine(x2 - 1, beg, x2 - 1, end);
2209 if (lastTab || selected || onlyOne || !nextSelected) {
2211 p->
drawLine(x2 - 2, y2, x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2);
2214 p->
drawLine(x2 - 2, y2 - 1, x1 + ((onlyOne || lastTab) && selected && rightAligned ? 0 : borderThinkness), y2 - 1);
2220 #endif // QT_NO_TABBAR 2226 #ifndef QT_NO_SPLITTER 2230 #endif // QT_NO_SPLITTER 2231 #ifndef QT_NO_SCROLLBAR 2296 buttonOpt.QStyleOption::operator=(*opt);
2305 #endif // QT_NO_SCROLLBAR 2319 #ifndef QT_NO_TOOLBAR 2324 bool paintLeftBorder =
true;
2325 bool paintRightBorder =
true;
2326 bool paintBottomBorder =
true;
2328 switch (
toolbar->toolBarArea){
2330 switch(
toolbar->positionOfLine){
2333 paintBottomBorder =
false;
2338 switch(
toolbar->positionWithinLine){
2340 paintLeftBorder =
false;
2343 paintRightBorder =
false;
2346 paintRightBorder =
false;
2347 paintLeftBorder =
false;
2352 bool tmp = paintLeftBorder;
2353 paintRightBorder=paintLeftBorder;
2354 paintLeftBorder=tmp;
2358 switch (
toolbar->positionOfLine){
2361 paintRightBorder =
false;
2368 switch (
toolbar->positionOfLine){
2371 paintLeftBorder =
false;
2389 if (paintLeftBorder){
2397 if (paintRightBorder){
2405 if (paintBottomBorder){
2416 #endif // QT_NO_TOOLBAR 2417 #ifndef QT_NO_PROGRESSBAR 2420 QRect rect = pb->rect;
2424 bool vertical =
false;
2425 bool inverted =
false;
2447 int w = rect.
width();
2448 if (pb->minimum == 0 && pb->maximum == 0) {
2457 int chunkCount = w / unit_width + 1;
2458 int step =
d->animateStep%chunkCount;
2459 int chunksInRow = 5;
2460 int myY = pbBits.
rect.
y();
2462 int chunksToDraw = chunksInRow;
2464 if(step > chunkCount - 5)chunksToDraw = (chunkCount - step);
2468 int x0 = reverse ? rect.
left() + rect.
width() - unit_width*(step) - unit_width : rect.
left() + unit_width * step;
2471 for (
int i = 0; i < chunksToDraw ; ++i) {
2472 pbBits.
rect.
setRect(x0 + x, myY, unit_width, myHeight);
2475 x += reverse ? -unit_width : unit_width;
2478 if( step > chunkCount-5){
2479 x0 = reverse ? rect.
left() + rect.
width() - unit_width : rect.
left() ;
2481 int chunksToDraw = step - (chunkCount - chunksInRow);
2482 for (
int i = 0; i < chunksToDraw ; ++i) {
2483 pbBits.
rect.
setRect(x0 + x, myY, unit_width, myHeight);
2486 x += reverse ? -unit_width : unit_width;
2496 #endif // QT_NO_PROGRESSBAR 2498 #ifndef QT_NO_DOCKWIDGET 2508 QRect rect = dwOpt->rect;
2511 if (verticalTitleBar) {
2522 bool floating =
false;
2524 QColor inactiveCaptionTextColor =
d->inactiveCaptionText;
2525 if (dwOpt->movable) {
2529 if (widget && widget->
isWindow()) {
2532 left =
d->activeCaptionColor;
2533 right =
d->activeGradientCaptionColor;
2535 left =
d->inactiveCaptionColor;
2536 right =
d->inactiveGradientCaptionColor;
2539 if (left != right) {
2543 lg.setColorAt(0, left);
2544 lg.setColorAt(1, right);
2550 if (!widget || !widget->
isWindow()) {
2555 if (!dwOpt->title.isEmpty()) {
2558 QFont font = oldFont;
2565 if (verticalTitleBar) {
2577 if (verticalTitleBar)
2581 #endif // QT_NO_DOCKWIDGET 2602 if (verticalTitleBar) {
2632 #ifndef QT_NO_SLIDER 2634 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
2637 int ticks = slider->tickPosition;
2642 int mid = thickness / 2;
2649 p->
setPen(slider->palette.shadow().color());
2652 groove.
width(), 4, slider->palette,
true);
2653 p->
drawLine(groove.
x() + 1, groove.
y() + mid - 1,
2654 groove.
x() + groove.
width() - 3, groove.
y() + mid - 1);
2657 4, groove.
height(), slider->palette,
true);
2658 p->
drawLine(groove.
x() + mid - 1, groove.
y() + 1,
2659 groove.
x() + mid - 1, groove.
y() + groove.
height() - 3);
2679 const QColor c0 = slider->palette.shadow().color();
2680 const QColor c1 = slider->palette.
dark().color();
2682 const QColor c3 = slider->palette.midlight().color();
2683 const QColor c4 = slider->palette.
light().color();
2694 int x = handle.
x(), y = handle.
y(),
2708 fropt.QStyleOption::operator=(*slider);
2713 if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) {
2741 d = (wi + 1) / 2 - 1;
2742 a.
setPoints(5, x1,y1, x1,y2, x2,y2, x2,y1, x1+d,y1-d);
2746 d = (wi + 1) / 2 - 1;
2747 a.
setPoints(5, x1,y1, x1,y2, x1+d,y2+d, x2,y2, x2,y1);
2750 d = (he + 1) / 2 - 1;
2752 a.
setPoints(5, x1,y1, x1-d,y1+d, x1,y2, x2,y2, x2,y1);
2755 d = (he + 1) / 2 - 1;
2757 a.
setPoints(5, x1,y1, x1,y2, x2,y2, x2+d,y1+d, x2,y1);
2766 p->
drawRect(x1, y1, x2-x1+1, y2-y1+1);
2787 p->
drawLine(x2-1, y1+1, x2-1, y2-1);
2793 p->
drawLine(x1+1, y2-1, x2-1, y2-1);
2805 p->
drawLine(x1+1, y1, x1+1+d, y1-d);
2807 p->
drawLine(x2-1, y1, x2-1-d, y1-d);
2817 p->
drawLine(x1+1, y2, x1+1+d, y2+d);
2819 p->
drawLine(x2-1, y2, x2-1-d, y2+d);
2829 p->
drawLine(x1, y1+1, x1-d, y1+1+d);
2831 p->
drawLine(x1, y2-1, x1-d, y2-1-d);
2841 p->
drawLine(x2, y1+1, x2+d, y1+1+d);
2843 p->
drawLine(x2, y2-1, x2+d, y2-1-d);
2849 #endif // QT_NO_SLIDER 2850 #ifndef QT_NO_SCROLLBAR 2852 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
2854 if (scrollbar->minimum == scrollbar->maximum)
2859 #endif // QT_NO_SCROLLBAR 2867 if (lv->items.isEmpty())
2870 int y = lv->
rect.
y();
2877 dotlines[0] =
QPoint(lv->rect.right(), lv->rect.top());
2878 dotlines[1] =
QPoint(lv->rect.right(), lv->rect.bottom());
2880 int linetop = 0, linebot = 0;
2887 for (i = 1; i < lv->items.size(); ++i) {
2889 if (child.
height + y > 0)
2893 int bx = lv->rect.width() / 2;
2896 while (i < lv->items.size() && y < lv->rect.height()) {
2907 linebot = y + lh / 2;
2911 p->
setPen(lv->palette.mid().color());
2912 p->
drawRect(bx - 4, linebot - 4, 8, 8);
2914 p->
setPen(lv->palette.text().color());
2915 p->
drawLine(bx - 2, linebot, bx + 2, linebot);
2917 p->
drawLine(bx, linebot - 2, bx, linebot + 2);
2919 p->
setPen(lv->palette.mid().color());
2920 dotlines[c++] =
QPoint(bx, linetop);
2921 dotlines[c++] =
QPoint(bx, linebot - 4);
2922 dotlines[c++] =
QPoint(bx + 5, linebot);
2923 dotlines[c++] =
QPoint(lv->rect.width(), linebot);
2924 linetop = linebot + 5;
2927 dotlines[c++] =
QPoint(bx+1, linebot -1);
2928 dotlines[c++] =
QPoint(lv->rect.width(), linebot -1);
2937 while (i < lv->items.size() && lv->items.at(i).height <= 0)
2939 if (i < lv->items.size())
2940 linebot = lv->rect.height();
2942 if (linetop < linebot) {
2943 dotlines[c++] =
QPoint(bx, linetop);
2944 dotlines[c++] =
QPoint(bx, linebot);
2947 p->
setPen(lv->palette.text().color());
2948 QBitmap *verticalLine = globalVerticalLine();
2949 QBitmap *horizontalLine = globalHorizontalLine();
2950 static bool isInit =
false;
2955 verticalLine->
clear();
2956 horizontalLine->
clear();
2959 p.
begin(verticalLine);
2960 for(i = 0; i < 64; ++i)
2966 verticalLine->
setMask(*verticalLine);
2967 p.
begin(horizontalLine);
2968 for(i = 0; i < 64; ++i)
2974 horizontalLine->
setMask(*horizontalLine);
2986 if (dotlines[line].y() == dotlines[line+1].y()) {
2987 int end = dotlines[line + 1].x();
2988 int point = dotlines[line].x();
2989 int other = dotlines[line].y();
2990 while (point < end) {
2992 if (i + point > end)
2994 p->
drawPixmap(point, other, *horizontalLine, 0, 0, i, 1);
2998 int end = dotlines[line + 1].y();
2999 int point = dotlines[line].y();
3000 int other = dotlines[line].x();
3001 int pixmapoffset = ((point & 1) != dotoffset) ? 1 : 0;
3002 while(point < end) {
3004 if (i + point > end)
3006 p->
drawPixmap(other, point, *verticalLine, 0, pixmapoffset, 1, i);
3014 #endif // QT3_SUPPORT 3015 #ifndef QT_NO_COMBOBOX 3036 p->
setPen(cmb->palette.dark().color());
3058 arrowOpt.
palette = cmb->palette;
3059 arrowOpt.
state = flags;
3070 p->
setPen(cmb->palette.highlightedText().color());
3074 p->
setPen(cmb->palette.text().color());
3080 focus.QStyleOption::operator=(*cmb);
3089 #endif // QT_NO_COMBOBOX 3090 #ifndef QT_NO_SPINBOX 3092 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
3145 copy.
state = sb->state;
3179 #endif // QT_NO_SPINBOX 3193 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3203 #ifndef QT_QWS_SMALL_PUSHBUTTON 3204 if (w < minwidth + defwidth && !btn->
text.isEmpty())
3205 w = minwidth + defwidth;
3206 if (h < minheight + defwidth)
3207 h = minheight + defwidth;
3221 else if (mi->icon.isNull()) {
3229 mi->icon.actualSize(
QSize(iconExtent, iconExtent)).height()
3232 int maxpmw = mi->maxIconWidth;
3233 int tabSpacing = 20;
3242 QFont fontBold = mi->font;
3245 w += fmBold.
width(mi->text) - fm.
width(mi->text);
3254 #endif // QT_NO_MENU 3255 #ifndef QT_NO_MENUBAR 3263 if (qstyleoption_cast<const QStyleOptionToolButton *>(opt))
3264 return sz +=
QSize(7, 6);
3282 switch (standardIcon) {
3285 for (
int size = 16 ; size <= 32 ; size += 16) {
3293 for (
int size = 16 ; size <= 32 ; size += 16) {
3300 for (
int size = 16 ; size <= 32 ; size += 16) {
3308 for (
int size = 16 ; size <= 32 ; size += 16) {
3326 for (
int size = 16 ; size <= 32 ; size += 16) {
3332 for (
int size = 16 ; size <= 32 ; size += 16) {
3339 for (
int size = 16 ; size <= 32 ; size += 16) {
3346 for (
int size = 16 ; size <= 32 ; size += 16) {
3352 for (
int size = 16 ; size <= 32 ; size += 16) {
3358 for (
int size = 16 ; size <= 32 ; size += 16) {
3364 for (
int size = 16 ; size <= 32 ; size += 16) {
3370 for (
int size = 16 ; size <= 32 ; size += 16) {
3389 memset(&iconInfo, 0,
sizeof(iconInfo));
3390 iconInfo.
cbSize =
sizeof(iconInfo);
3393 DestroyIcon(iconInfo.
hIcon);
3412 #endif // QT_NO_STYLE_WINDOWS
T qobject_cast(QObject *object)
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
void setBackgroundMode(Qt::BGMode mode)
Sets the background mode of the painter to the given mode.
The QPainter class performs low-level painting on widgets and other paint devices.
The QColor class provides colors based on RGB, HSV or CMYK values.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
int height
the height of the item
void polish(QApplication *)
Reimplemented Function
void unpolish(QApplication *)
Reimplemented Function
QColor inactiveGradientCaptionColor
QImage toImage() const
Converts the pixmap to a QImage.
const QBrush & highlight() const
Returns the highlight brush of the current color group.
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 width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
static const char *const qt_close_xpm[]
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.
StyleHint
This enum describes the available style hints.
The QStyleHintReturn class provides style hints that return more than basic data types.
void addPixmap(const QPixmap &pixmap, Mode mode=Normal, State state=Off)
Adds pixmap to the icon, as a specialization for mode and state.
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.
static QPixmap fromWinHICON(HICON hicon)
int width() const
Returns the width of the pixmap.
QPointer< QWidget > widget
static const char *const information_xpm[]
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
const QBrush & dark() const
Returns the dark brush of the current color group.
void drawPoints(const QPointF *points, int pointCount)
Draws the first pointCount points in the array points using the current pen's color.
static const char *const qt_menu_xpm[]
void startAnimation(QObject *o, QProgressBar *bar)
const QBrush & background() const
Returns the current background brush.
The QMatrix class specifies 2D transformations of a coordinate system.
QStyle::State state
the style flags that are used when drawing the control
static const char *const question_xpm[]
void qDrawShadeRect(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size)
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...
void setMask(const QBitmap &)
Sets a mask bitmap.
static QSize globalStrut()
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.
ComplexControl
This enum describes the available complex controls.
The QStyleOptionQ3ListView class is used to describe the parameters for drawing a Q3ListView...
void fill(uint pixel)
Fills the entire image with the given pixelValue.
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...
~QWindowsStyle()
Destroys the QWindowsStyle object.
static QWidget * activeWindow()
Returns the application top-level window that has the keyboard input focus, or 0 if no application wi...
Qt::Orientation orientation
the progress bar's orientation (horizontal or vertical); the default orentation is Qt::Horizontal ...
bool eventFilter(QObject *o, QEvent *e)
Reimplemented Function
void removeEventFilter(QObject *)
Removes an event filter object obj from this object.
void restore()
Restores the current painter state (pops a saved state off the stack).
PixelMetric
This enum describes the various available pixel metrics.
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...
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
int childCount
the number of children the item has
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
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
static QPalette palette()
Returns the application palette.
The QPolygon class provides a vector of points using integer precision.
void drawLine(const QLineF &line)
Draws a line defined by line.
ushort red
Returns the red color component of this color.
The QProgressBar widget provides a horizontal or vertical progress bar.
int height() const
Returns the height of the rectangle.
static const char *const qt_shade_xpm[]
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.
bool hasSeenAlt(const QWidget *widget) const
void setHeight(int h)
Sets the height to the given height.
T * qobject_cast(QObject *object)
static const char *const qt_maximize_xpm[]
The QObject class is the base class of all Qt objects.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
bool load(bool onlySystemDirectory=true)
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
QMatrix & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
static const char *const qt_help_xpm[]
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).
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt=0, const QWidget *widget=0) const
Reimplemented Function
void drawPoint(const QPointF &pt)
Draws a single point at the given position using the current pen's color.
The QChar class provides a 16-bit Unicode character.
static const char * dock_widget_close_xpm[]
QColor inactiveCaptionColor
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
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)
StandardPixmap
This enum describes the available standard pixmaps.
static QPixmap * find(const QString &key)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void resize(int size)
Sets the size of the vector to size.
bool begin(QPaintDevice *)
Begins painting the paint device and returns true if successful; otherwise returns false...
#define COLOR_GRADIENTINACTIVECAPTION
The QLineF class provides a two-dimensional vector using floating point precision.
void setWidth(int w)
Sets the width to the given width.
QColor backgroundColor
the background color on which the focus rectangle is being drawn
void setCurrentColorGroup(ColorGroup cg)
Set the palette's current color group to cg.
The QBitmap class provides monochrome (1-bit depth) pixmaps.
The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progre...
int width() const
Returns the width.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
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...
int totalHeight
the total height of the item, including its children
The QRectF class defines a rectangle in the plane using floating point precision. ...
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
The QStyleOptionQ3ListViewItem class is used to describe an item drawn in a Q3ListView.
QMatrix & rotate(qreal a)
Rotates the coordinate system the given degrees counterclockwise.
QPoint bottomRight() const
Returns the position of the rectangle's bottom-right corner.
QPoint brushOrigin() const
Returns the currently set brush origin.
QColor inactiveCaptionText
const QBrush & light() const
Returns the light brush of the current color group.
static const char *const qt_normalizeup_xpm[]
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
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.
void qDrawWinPanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static const char *const warning_xpm[]
ContentsType
This enum describes the available contents types.
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.
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.
static QRgb colorref2qrgb(COLORREF col)
const T & at(int i) const
Returns the item at index position i in the list.
QColor dark(int f=200) const
Use darker(factor) instead.
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.
QColor activeGradientCaptionColor
const QBrush & midlight() const
Returns the midlight brush of the current color group.
const QBrush & mid() const
Returns the mid brush of the current color group.
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...
The QStyleOptionFocusRect class is used to describe the parameters for drawing a focus rectangle with...
Q3ListViewItemFeatures features
the features for this item
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
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.
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
QColor activeCaptionColor
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
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
bool inFont(QChar) const
Returns true if character ch is a valid character in the font; otherwise returns false.
void qDrawWinButton(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
QList< const QWidget * > seenAlt
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
int pixelMetric(PixelMetric m, const QStyleOption *opt=0, const QWidget *widget=0) const
Reimplemented Function
void timerEvent(QTimerEvent *event)
Reimplemented Function
void polish(QPalette &)
Reimplemented Function
The State element defines configurations of objects and properties.
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
The QStyleOptionRubberBand class is used to describe the parameters needed for drawing a rubber band...
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...
void unpolish(QWidget *widget)
Reimplemented Function
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
int styleHint(StyleHint hint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
qreal dpiScaled(qreal value)
QPoint topRight() const
Returns the position of the rectangle's top-right corner.
const QBrush & brush() const
Returns the painter's current brush.
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.
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.
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...
QWindowsStyle()
Constructs a QWindowsStyle object.
The QStyleHintReturnMask class provides style hints that return a QRegion.
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
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...
static const char *const critical_xpm[]
void * resolve(const char *symbol)
ushort blue
Returns the blue color component of this color.
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.
QPoint bottomLeft() const
Returns the position of the rectangle's bottom-left corner.
PrimitiveElement
This enum describes the various primitive elements.
The QTimerEvent class contains parameters that describe a timer event.
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush...
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
Qt::BGMode backgroundMode() const
Returns the current background mode.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
#define SPI_GETKEYBOARDCUES
T qstyleoption_cast(const QStyleOption *opt)
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
void eraseRect(const QRectF &)
Erases the area inside the given rectangle.
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 bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
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...
void installEventFilter(QObject *)
Installs an event filter filterObj on this object.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
int size() const
Returns the number of items in the list.
static bool desktopSettingsAware()
Returns true if Qt is set to use the system's standard colors, fonts, etc.
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.
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.
void setPoint(int index, int x, int y)
Sets the point at the given index to the point specified by ({x}, {y}).
QRect boundingRect() const
Returns the bounding rectangle of the polygon, or QRect(0, 0, 0, 0) if the polygon is empty...
#define COLOR_GRADIENTACTIVECAPTION
static const char *const qt_minimize_xpm[]
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.
const QStyle * proxy() const
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
The QPixmap class is an off-screen image representation that can be used as a paint device...
void clear()
Clears the bitmap, setting all its bits to Qt::color0.
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.
static QPixmap loadIconFromShell32(int resourceId, int size)
static const char *const qt_unshade_xpm[]
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.
int itemY
the Y-coordinate for the item
ControlElement
This enum represents a control element.
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
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.
void setPoints(int nPoints, const int *points)
Resizes the polygon to nPoints and populates it with the given points.
const QBrush & buttonText() const
Returns the button text foreground brush of the current color group.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt=0, const QWidget *widget=0) const
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
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 * PtrSHGetStockIconInfo)(int siid, int uFlags, QSHSTOCKICONINFO *psii)
QList< QProgressBar * > animatedProgressBars
bool isValid() const
Returns true if the color is valid; otherwise returns false.
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
QRegion region
the region for style hints that return a QRegion
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
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...
int height() const
Returns the height of the font.
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
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 const KeyPair *const end
const QBrush & button() const
Returns the button brush of the current color group.
bool invertedAppearance
whether the progress bar's appearance is inverted
The QEvent class is the base class of all event classes.
void drawPolyline(const QPointF *points, int pointCount)
Draws the polyline defined by the first pointCount points in points using the current pen...
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
Type type() const
Returns the event type.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
ushort green
Returns the green color component of this color.
void start()
Starts this timer.
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.
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
Declares a global static variable with the specified type and name.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QRect rect
the area that should be used for various calculations and painting
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
void setBackground(const QBrush &bg)
Sets the background brush of the painter to the given brush.
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
static void flush()
Flushes the platform specific event queues.
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
const QBrush & text() const
Returns the text foreground brush of the current color group.
SubElement
This enum represents a sub-area of a widget.
int styleHint(StyleHint sh, const QStyleOption *opt=0, const QWidget *w=0, QStyleHintReturn *shret=0) const
Reimplemented Function
QColor light(int f=150) const
Use lighter(factor) instead.
static PtrSHGetStockIconInfo pSHGetStockIconInfo
void killTimer(int id)
Kills the timer with timer identifier, id.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
void stopAnimation(QObject *o, QProgressBar *bar)
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.
void removeAt(int i)
Removes the item at index position i.