45 #if !defined(QT_NO_STYLE_MOTIF) || defined(QT_PLUGIN) 72 #include <QtGui/qgraphicsproxywidget.h> 73 #include <QtGui/qgraphicsview.h> 161 #ifndef QT_NO_PROGRESSBAR 166 if (
QProgressBar *bar = qobject_cast<QProgressBar *>(o)) {
168 if (
d->bars.size() == 1) {
178 if (
QProgressBar *bar = reinterpret_cast<QProgressBar *>(o)) {
179 d->bars.removeAll(bar);
180 if (
d->bars.isEmpty() &&
d->animateTimer) {
188 #endif // QT_NO_PROGRESSBAR 206 #ifndef QT_NO_PROGRESSBAR 208 if (event->
timerId() ==
d->animateTimer) {
210 d->animateStep =
d->startTime.elapsed() / (1000 /
d->animationFps);
216 #endif // QT_NO_PROGRESSBAR 222 #ifndef QT_NO_PROGRESSBAR 223 : animationFps(25), animateTimer(0), animateStep(0)
295 #ifndef QT_NO_PROGRESSBAR 296 if (qobject_cast<QProgressBar *>(widget))
312 #ifndef QT_NO_PROGRESSBAR 313 if (qobject_cast<QProgressBar *>(widget)) {
316 d->bars.removeAll(static_cast<QProgressBar*>(widget));
352 for (
int i = 0; i < (int)a.
size(); i++) {
354 case 1: r.
setPoint(i,-a[i].y(),a[i].x());
break;
355 case 2: r.setPoint(i,-a[i].x(),-a[i].y());
break;
356 case 3: r.setPoint(i,a[i].y(),-a[i].x());
break;
372 if (lv->items.isEmpty())
384 for (
int i = 0; i < 3; i++) {
385 a.
setPoints(4, cx-e, cy, cx, cy-e, cx+e, cy, cx, cy+e);
398 a.
setPoints(4, cx-e, cy, cx, cy-e, cx+e, cy, cx, cy+e);
434 for (i=0; 2*i < a.
size(); ++i) {
441 for (i=0; 2*i < a.
size(); i++) {
462 for (i=0; 2*i < a.
size(); ++i) {
469 for (i=0; 2*i < a.
size(); ++i) {
502 bool showUp = !(down ^ on);
518 #define INTARRLEN(x) sizeof(x)/(sizeof(int)*2) 549 bool showUp = !(down ^ on);
590 bool horizontal = !vertical;
592 int colspec = 0x0000;
600 if (rect.
width() > dim) {
601 rect.
setX(rect.
x() + ((rect.
width() - dim) / 2));
604 if (rect.
height() > dim) {
611 bFill.
resize( dim & 1 ? 3 : 4 );
616 bTop.
putPoints( 0, 2, 1, 0, dim-1, dim/2 );
617 bBot.
putPoints( 0, 2, 1, dim-1, dim-1, dim/2 );
622 bFill.
setPoint( 2, dim - 1, dim / 2 );
624 bFill.
putPoints( 2, 2, dim-1, dim/2-1, dim-1, dim/2 );
628 bFill.
resize(dim & 1 ? 3 : 4);
630 bBot.
resize(dim & 1 ? dim + 1 : dim);
631 bLeft.
resize(dim > 4 ? 4 : 2);
635 bTop.
putPoints(0, 4, 1,0, 1,1, 2,1, 3,1);
636 bBot.
putPoints(0, 4, 1,dim-1, 1,dim-2, 2,dim-2, 3,dim-2);
638 for(
int i=0; i<dim/2-2 ; i++) {
639 bTop.
putPoints(i*2+4, 2, 2+i*2,2+i, 5+i*2, 2+i);
640 bBot.
putPoints(i*2+4, 2, 2+i*2,dim-3-i, 5+i*2,dim-3-i);
643 bBot.
putPoints(dim-1, 2, dim-3,dim/2, dim-1,dim/2);
647 bFill.
setPoint(2, dim - 3, dim / 2);
649 bFill.
putPoints(2, 2, dim-4,dim/2-1, dim-4,dim/2);
690 colspec = horizontal ? 0x2334 : 0x2343;
692 colspec = horizontal ? 0x1443 : 0x1434;
705 colspec = horizontal ? 0x2443 : 0x2434;
707 colspec = horizontal ? 0x1334 : 0x1343;
729 #define CMID *cols[(colspec>>12) & 0xf] 730 #define CLEFT *cols[(colspec>>8) & 0xf] 731 #define CTOP *cols[(colspec>>4) & 0xf] 732 #define CBOT *cols[colspec & 0xf] 762 const int motifOffset = 10;
766 int kPos = opt->
rect.
right() - motifOffset - sw;
775 int kPos = motifOffset;
798 for (i=0; i<3; i++) {
804 for (i=3; i<7; i++) {
813 for (pnt = 0; pnt < (int)a.
size(); pnt++)
816 for (pnt = 0; pnt < (int)a.
size(); pnt++)
831 bool vertical =
false;
902 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
914 fropt.QStyleOption::operator=(*btn);
922 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
929 fropt.QStyleOption::operator=(*btn);
936 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
937 int diw, x1, y1, x2, y2;
952 x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1,
953 x2-1, y1+1, x2-1, y2-1, x1+1, y2-1, x1+1, y1+1);
967 newOpt.
rect =
QRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1);
973 QRect ir = btn->rect;
983 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
985 const int frame_offset = (default_frame > 1) ? 1 : 0;
995 -default_frame, -default_frame),
996 tab->palette.background());
1016 if (default_frame > 1) {
1023 if (tabRect.
left() == 0)
1033 tabRect.
width()-3, 2),
1035 p->
setPen(tab->palette.background().color());
1037 tabRect.
left()+1, tabRect.
top()+2);
1043 tabRect.
left(), tabRect.
top() + 2);
1046 tabRect.
right() - 2, tabRect.
top());
1049 if (default_frame > 1) {
1051 tabRect.
left()+1, tabRect.
top() + 2);
1053 tabRect.
right() - 2, tabRect.
top()+1);
1060 if (default_frame > 1) {
1073 #endif // QT_NO_TABBAR 1081 QRect rect = pb->rect;
1082 bool vertical =
false;
1083 bool invert =
false;
1084 bool bottomToTop =
false;
1087 invert = pb2->invertedAppearance;
1088 bottomToTop = pb2->bottomToTop;
1103 int u = rect.
width() / unit_width;
1104 int p_v = pb->progress - pb->minimum;
1105 int t_s =
qMax(0, pb->maximum - pb->minimum);
1106 if (u > 0 && pb->progress >=
INT_MAX / u && t_s >= u) {
1111 if (pb->textVisible && t_s) {
1112 int nu = (u * p_v + t_s/2) / t_s;
1113 int x = unit_width * nu;
1126 if (pb->progress != pb->maximum) {
1157 if (
const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
1158 int maxpmw = menuitem->maxIconWidth;
1159 if(menuitem->menuHasCheckableItems)
1167 if (!menuitem->text.isEmpty()) {
1172 menuitem->palette, menuitem->state &
State_Enabled, menuitem->text,
1174 textWidth = menuitem->fontMetrics.width(menuitem->text) + 10;
1175 y += menuitem->fontMetrics.height() / 2;
1180 p->
drawLine(x + 5 + textWidth, y, x+w, y);
1182 p->
drawLine(x, y + 1, x + 5, y + 1);
1183 p->
drawLine(x + 5 + textWidth, y + 1, x+w, y + 1);
1202 int xvis = vrect.
x();
1203 if (menuitem->checked) {
1204 if(!menuitem->icon.isNull())
1212 if(!menuitem->icon.isNull()) {
1222 int pixw = pixmap.
width();
1223 int pixh = pixmap.
height();
1224 QRect pmr(0, 0, pixw, pixh);
1240 newMenuItem.
rect.
setRect(xvis + 2, y + motifItemFrame + mh / 4, 11, 11);
1243 newMenuItem.
rect.
setRect(xvis + 5, y + motifItemFrame + mh / 4, 9, 9);
1277 QRect tr(xv, y+m, menuitem->tabWidth, h-2*m);
1283 QRect tr(xvis, y+m, w - xm - menuitem->tabWidth + 1, h-2*m);
1295 y+h/2-dim/2, dim, dim));
1323 QPainter pixmapPainter(&tiledPixmap);
1329 pixmapPainter.
end();
1342 #ifndef QT_NO_PROGRESSBAR 1345 QRect rect = pb->rect;
1346 bool vertical =
false;
1347 bool inverted =
false;
1371 int w = rect.
width();
1372 if (pb->minimum == 0 && pb->maximum == 0) {
1376 int x = (
d->animateStep*8)% (w * 2);
1379 x = reverse ? rect.
right() - x : x + rect.
x();
1388 #endif // QT_NO_PROGRESSBAR 1400 }
else if (h < 14) {
1405 tmp = (awh * 3) / 2;
1418 int &ew,
int &awh,
int &ax,
1419 int &ay,
int &sh,
int &dh,
1429 ay = r.
y() + (r.
height()-awh-sh-dh)/2;
1437 ax = r.
x() + r.
width() - ew;
1450 = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
1451 QRect button, menuarea;
1461 State mflags = bflags;
1469 tool.
palette = toolbutton->palette;
1473 tool.
state = bflags;
1480 fr.QStyleOption::operator=(*toolbutton);
1485 label.
state = bflags;
1491 tool.
rect = menuarea;
1492 tool.
state = mflags;
1498 QRect ir = toolbutton->rect;
1505 #ifndef QT_NO_SPINBOX 1507 if (
const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
1518 lineOpt.QStyleOption::operator=(*opt);
1552 copy.
state = spinbox->state;
1575 #endif // QT_NO_SPINBOX 1576 #ifndef QT_NO_SLIDER 1578 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
1595 bevelOpt.
rect = handle;
1602 int mid = handle.x() + handle.width() / 2;
1603 qDrawShadeLine(p, mid, handle.y(), mid, handle.y() + handle.height() - 2,
1606 int mid = handle.y() + handle.height() / 2;
1623 #endif // QT_NO_SLIDER 1627 int awh, ax, ay, sh, sy, dh, ew;
1632 btn.QStyleOption::operator=(*cb);
1640 tr.
adjust(fw, fw, -fw, -fw);
1656 p->
drawLine(ar.
x()+1, sy+sh-1, ar.
x()+awh-1, sy+sh-1);
1657 p->
drawLine(ar.
x()+awh-1, sy+1, ar.
x()+awh-1, sy+sh-1);
1661 focus.QStyleOption::operator=(*opt);
1680 #ifndef QT_NO_SCROLLBAR 1687 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
1689 if (scrollbar->minimum == scrollbar->maximum)
1703 int y = opt->
rect.
y();
1712 int linetop = 0, linebot = 0;
1718 for (i = 1; i < lv->items.size(); ++i) {
1720 if (child.
height + y > 0)
1728 while (i < lv->items.size() && y < lv->rect.height()) {
1744 p->
drawRect(bx-4, linebot-4, 9, 9);
1758 dotlines[c++] =
QPoint(bx, linetop);
1759 dotlines[c++] =
QPoint(bx, linebot - 5);
1760 dotlines[c++] =
QPoint(bx + 5, linebot);
1762 linetop = linebot + 5;
1765 dotlines[c++] =
QPoint(bx+1, linebot);
1775 while (i < lv->items.size() && lv->items.at(i).height <= 0)
1777 if (i < lv->items.size())
1780 if (linetop < linebot) {
1781 dotlines[c++] =
QPoint(bx, linetop);
1782 dotlines[c++] =
QPoint(bx, linebot);
1789 p->
drawLine(dotlines[line].x(), dotlines[line].y(),
1790 dotlines[line+1].x(), dotlines[line+1].y());
1842 #ifndef QT_NO_SLIDER 1844 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
1845 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height() : sl->rect.width();
1846 int ticks = sl->tickPosition;
1862 thick += (space * 2) / (n + 2);
1868 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
1875 #endif // QT_NO_SLIDER 1919 #ifndef QT_NO_SPINBOX 1921 if (
const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
1927 int y = fw + spinbox->rect.y();
1932 const int margin = spinbox->frame ? 4 : 0;
1937 return visualRect(spinbox->direction, spinbox->rect,
1942 return visualRect(spinbox->direction, spinbox->rect,
1946 return visualRect(spinbox->direction, spinbox->rect,
1947 QRect(lx + margin, y + margin,
1948 spinbox->rect.width() - 2*fw - 2*margin,
1949 spinbox->rect.height() - 2*fw - 2*margin));
1951 return visualRect(spinbox->direction, spinbox->rect,
1952 QRect(lx + margin, y + margin, rx - margin,
1953 spinbox->rect.height() - 2*fw - 2 * margin));
1955 return visualRect(spinbox->direction, spinbox->rect, spinbox->rect);
1960 #endif // QT_NO_SPINBOX 1961 #ifndef QT_NO_SLIDER 1963 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
1971 horizontal ? slider->rect.width() - len - 2 * motifBorder
1972 : slider->rect.height() - len - 2 * motifBorder,
1973 slider->upsideDown);
1975 return visualRect(slider->direction, slider->rect,
1976 QRect(sliderPos + motifBorder, tickOffset + motifBorder, len,
1977 thickness - 2 * motifBorder));
1978 return visualRect(slider->direction, slider->rect,
1979 QRect(tickOffset + motifBorder, sliderPos + motifBorder,
1980 thickness - 2 * motifBorder, len));
1984 #endif // QT_NO_SLIDER 1985 #ifndef QT_NO_SCROLLBAR 1987 if (
const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
1993 rect.
adjust(-dfw, dfw, dfw, -dfw);
1995 rect.
adjust(dfw, -dfw, -dfw, dfw);
1998 rect.
adjust(0, dfw, 0, -dfw);
2000 rect.
adjust(dfw, 0, -dfw, 0);
2002 return visualRect(scrollbar->direction, scrollbar->rect, rect);
2005 #endif // QT_NO_SCROLLBAR 2006 #ifndef QT_NO_COMBOBOX 2011 int ew, awh, sh, dh, ax, ay, sy;
2014 cr.
adjust(fw, fw, -fw, -fw);
2022 rect.
adjust(fw, fw, -fw, -fw);
2024 rect.
adjust(1, 1, -1-ew, -1);
2025 return visualRect(cb->direction, cb->rect, rect);
2033 #endif // QT_NO_SCROLLBAR 2047 QSize sz(contentsSize);
2057 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
2077 h = (mi->text.isEmpty()) ?
motifSepHeight : mi->fontMetrics.height();
2083 if (!mi->text.isNull() && mi->text.indexOf(
QLatin1Char(
'\t')) >= 0)
2090 int checkColumn = mi->maxIconWidth;
2091 if (mi->menuHasCheckableItems)
2093 if (checkColumn > 0)
2120 rect.
adjust(2, 2, -2, -2);
2135 int awh, ax, ay, sh, sy, dh, ew;
2139 tr.
adjust(fw, fw, -fw, -fw);
2141 rect.
setRect(ax-2, ay-2, awh+4, awh+sh+dh+4);
2147 if (!dw->docked || !dw->closeEnabled)
2155 rect =
visualRect(dw->direction, dw->rect, rect);
2164 if (pb->textVisible)
2178 rect.
adjust(2, 2, -2, -2);
2179 rect =
visualRect(pb->direction, pb->rect, rect);
2193 #ifndef QT_NO_IMAGEFORMAT_XPM 2222 "................"};
2276 #if 0 // ### not used??? 2277 static const char *
const qt_normalize_xpm[] = {
2313 "12 12 2 1",
"# c #000000",
2373 "...........********.............",
2374 "........***aaaaaaaa***..........",
2375 "......**aaaaaaaaaaaaaa**........",
2376 ".....*aaaaaaaaaaaaaaaaaa*.......",
2377 "....*aaaaaaaabbbbaaaaaaaac......",
2378 "...*aaaaaaaabbbbbbaaaaaaaac.....",
2379 "..*aaaaaaaaabbbbbbaaaaaaaaac....",
2380 ".*aaaaaaaaaaabbbbaaaaaaaaaaac...",
2381 ".*aaaaaaaaaaaaaaaaaaaaaaaaaac*..",
2382 "*aaaaaaaaaaaaaaaaaaaaaaaaaaaac*.",
2383 "*aaaaaaaaaabbbbbbbaaaaaaaaaaac*.",
2384 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
2385 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
2386 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
2387 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
2388 "*aaaaaaaaaaaabbbbbaaaaaaaaaaac**",
2389 ".*aaaaaaaaaaabbbbbaaaaaaaaaac***",
2390 ".*aaaaaaaaaaabbbbbaaaaaaaaaac***",
2391 "..*aaaaaaaaaabbbbbaaaaaaaaac***.",
2392 "...caaaaaaabbbbbbbbbaaaaaac****.",
2393 "....caaaaaaaaaaaaaaaaaaaac****..",
2394 ".....caaaaaaaaaaaaaaaaaac****...",
2395 "......ccaaaaaaaaaaaaaacc****....",
2396 ".......*cccaaaaaaaaccc*****.....",
2397 "........***cccaaaac*******......",
2398 "..........****caaac*****........",
2399 ".............*caaac**...........",
2400 "...............caac**...........",
2401 "................cac**...........",
2402 ".................cc**...........",
2403 "..................***...........",
2404 "...................**..........."};
2412 ".............***................",
2413 "............*aaa*...............",
2414 "...........*aaaaa*b.............",
2415 "...........*aaaaa*bb............",
2416 "..........*aaaaaaa*bb...........",
2417 "..........*aaaaaaa*bb...........",
2418 ".........*aaaaaaaaa*bb..........",
2419 ".........*aaaaaaaaa*bb..........",
2420 "........*aaaaaaaaaaa*bb.........",
2421 "........*aaaa***aaaa*bb.........",
2422 ".......*aaaa*****aaaa*bb........",
2423 ".......*aaaa*****aaaa*bb........",
2424 "......*aaaaa*****aaaaa*bb.......",
2425 "......*aaaaa*****aaaaa*bb.......",
2426 ".....*aaaaaa*****aaaaaa*bb......",
2427 ".....*aaaaaa*****aaaaaa*bb......",
2428 "....*aaaaaaaa***aaaaaaaa*bb.....",
2429 "....*aaaaaaaa***aaaaaaaa*bb.....",
2430 "...*aaaaaaaaa***aaaaaaaaa*bb....",
2431 "...*aaaaaaaaaa*aaaaaaaaaa*bb....",
2432 "..*aaaaaaaaaaa*aaaaaaaaaaa*bb...",
2433 "..*aaaaaaaaaaaaaaaaaaaaaaa*bb...",
2434 ".*aaaaaaaaaaaa**aaaaaaaaaaa*bb..",
2435 ".*aaaaaaaaaaa****aaaaaaaaaa*bb..",
2436 "*aaaaaaaaaaaa****aaaaaaaaaaa*bb.",
2437 "*aaaaaaaaaaaaa**aaaaaaaaaaaa*bb.",
2438 "*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb",
2439 "*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb",
2440 ".*aaaaaaaaaaaaaaaaaaaaaaaaa*bbbb",
2441 "..*************************bbbbb",
2442 "....bbbbbbbbbbbbbbbbbbbbbbbbbbb.",
2443 ".....bbbbbbbbbbbbbbbbbbbbbbbbb.."};
2451 "...........********.............",
2452 ".........************...........",
2453 ".......****************.........",
2454 "......******************........",
2455 ".....********************a......",
2456 "....**********************a.....",
2457 "...************************a....",
2458 "..*******b**********b*******a...",
2459 "..******bbb********bbb******a...",
2460 ".******bbbbb******bbbbb******a..",
2461 ".*******bbbbb****bbbbb*******a..",
2462 "*********bbbbb**bbbbb*********a.",
2463 "**********bbbbbbbbbb**********a.",
2464 "***********bbbbbbbb***********aa",
2465 "************bbbbbb************aa",
2466 "************bbbbbb************aa",
2467 "***********bbbbbbbb***********aa",
2468 "**********bbbbbbbbbb**********aa",
2469 "*********bbbbb**bbbbb*********aa",
2470 ".*******bbbbb****bbbbb*******aa.",
2471 ".******bbbbb******bbbbb******aa.",
2472 "..******bbb********bbb******aaa.",
2473 "..*******b**********b*******aa..",
2474 "...************************aaa..",
2475 "....**********************aaa...",
2476 "....a********************aaa....",
2477 ".....a******************aaa.....",
2478 "......a****************aaa......",
2479 ".......aa************aaaa.......",
2480 ".........aa********aaaaa........",
2481 "...........aaaaaaaaaaa..........",
2482 ".............aaaaaaa............"};
2491 "...........********.............",
2492 "........***aaaaaaaa***..........",
2493 "......**aaaaaaaaaaaaaa**........",
2494 ".....*aaaaaaaaaaaaaaaaaa*.......",
2495 "....*aaaaaaaaaaaaaaaaaaaac......",
2496 "...*aaaaaaaabbbbbbaaaaaaaac.....",
2497 "..*aaaaaaaabaaabbbbaaaaaaaac....",
2498 ".*aaaaaaaabbaaaabbbbaaaaaaaac...",
2499 ".*aaaaaaaabbbbaabbbbaaaaaaaac*..",
2500 "*aaaaaaaaabbbbaabbbbaaaaaaaaac*.",
2501 "*aaaaaaaaaabbaabbbbaaaaaaaaaac*.",
2502 "*aaaaaaaaaaaaabbbbaaaaaaaaaaac**",
2503 "*aaaaaaaaaaaaabbbaaaaaaaaaaaac**",
2504 "*aaaaaaaaaaaaabbaaaaaaaaaaaaac**",
2505 "*aaaaaaaaaaaaabbaaaaaaaaaaaaac**",
2506 "*aaaaaaaaaaaaaaaaaaaaaaaaaaaac**",
2507 ".*aaaaaaaaaaaabbaaaaaaaaaaaac***",
2508 ".*aaaaaaaaaaabbbbaaaaaaaaaaac***",
2509 "..*aaaaaaaaaabbbbaaaaaaaaaac***.",
2510 "...caaaaaaaaaabbaaaaaaaaaac****.",
2511 "....caaaaaaaaaaaaaaaaaaaac****..",
2512 ".....caaaaaaaaaaaaaaaaaac****...",
2513 "......ccaaaaaaaaaaaaaacc****....",
2514 ".......*cccaaaaaaaaccc*****.....",
2515 "........***cccaaaac*******......",
2516 "..........****caaac*****........",
2517 ".............*caaac**...........",
2518 "...............caac**...........",
2519 "................cac**...........",
2520 ".................cc**...........",
2521 "..................***...........",
2522 "...................**...........",
2533 #ifndef QT_NO_IMAGEFORMAT_XPM 2534 switch (standardPixmap) {
2540 return QPixmap(qt_unshade_xpm);
2542 return QPixmap(qt_normalizeup_xpm);
2544 return QPixmap(qt_minimize_xpm);
2546 return QPixmap(qt_maximize_xpm);
2550 return QPixmap(dock_window_close_xpm);
2557 const char *
const * xpm_data;
2558 switch (standardPixmap) {
2577 QImage image((
const char **) xpm_data);
2580 switch (standardPixmap) {
2627 #ifndef QT_NO_GRAPHICSVIEW 2628 if (
QGraphicsView *graphicsView = qobject_cast<QGraphicsView *>(focusWidget)) {
2662 ret = Qt::MotifStyle;
2719 QColor background(0xcf, 0xcf, 0xcf);
2721 background =
QColor(0xc0, 0xc0, 0xc0);
2739 #endif // !defined(QT_NO_STYLE_MOTIF) || defined(QT_PLUGIN)
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
void setTransform(const QTransform &transform, bool combine=false)
Sets the world transformation matrix.
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.
int height
the height of the item
static const int motifCheckMarkHMargin
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.
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 ...
static const char *const information_xpm[]
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.
static void get_combo_parameters(const QRect &r, int &ew, int &awh, int &ax, int &ay, int &sh, int &dh, int &sy)
SubControl
This enum describes the available sub controls.
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue. ...
StyleHint
This enum describes the available style hints.
The QStyleHintReturn class provides style hints that return more than basic data types.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
const QTransform & transform() const
Returns the world transformation matrix.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
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
void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill)
static int get_combo_extra_width(int h, int w, int *return_awh=0)
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.
const QBrush & background() const
Returns the current background brush.
QStyle::State state
the style flags that are used when drawing the control
void unpolish(QWidget *)
Keep QStyle::polish() visible.
static int appDepth(int screen=-1)
Returns the color depth (bits per pixel) used by the application on the given screen.
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...
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.
static const char *const qt_normalizeup_xpm[]
ComplexControl
This enum describes the available complex controls.
static const char *const qt_menu_xpm[]
The QStyleOptionQ3ListView class is used to describe the parameters for drawing a Q3ListView...
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...
QPalette standardPalette() const
Reimplemented Function
Qt::Orientation orientation
the progress bar's orientation (horizontal or vertical); the default orentation is Qt::Horizontal ...
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
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...
static const int motifCheckMarkSpace
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
int childCount
the number of children the item has
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const QBrush & foreground() const
Use windowText() instead.
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.
void setWidget(QWidget *widget)
QFocusFrame will track changes to widget and resize itself automatically.
void putPoints(int index, int nPoints, const int *points)
Copies nPoints points from the points coord array into this point array, and resizes the point array ...
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
The QPolygon class provides a vector of points using integer precision.
static const int motifSepHeight
void timerEvent(QTimerEvent *event)
Reimplemented Function
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
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.
void setY(int y)
Sets the top edge of the rectangle to the given y coordinate.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
The QString class provides a Unicode character string.
void setHeight(int h)
Sets the height to the given height.
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
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
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).
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.
static int sliderPositionFromValue(int min, int max, int val, int space, bool upsideDown=false)
Converts the given logicalValue to a pixel position.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void save()
Saves the current painter state (pushes the state onto a stack).
static const char *const qt_shade_xpm[]
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
StandardPixmap
This enum describes the available standard pixmaps.
void resize(int size)
Sets the size of the vector to size.
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.
QColor darker(int f=200) const
Returns a darker (or lighter) color, but does not change this object.
void getCoords(int *x1, int *y1, int *x2, int *y2) const
Extracts the position of the rectangle's top-left corner to *x1 and *y1, and the position of the bott...
int lineWidth
the line width for drawing the frame
The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progre...
int width() const
Returns the width.
void translate(int dx, int dy)
Translates all points in the polygon by ({dx}, {dy}).
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.
virtual ~QMotifStyle()
Destroys the style.
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
static const char *const qt_close_xpm[]
The QStyleOptionQ3ListViewItem class is used to describe an item drawn in a Q3ListView.
QGraphicsItem * focusItem() const
When the scene is active, this functions returns the scene's current focus item, or 0 if no item curr...
static const int motifItemHMargin
QPoint bottomRight() const
Returns the position of the rectangle's bottom-right corner.
QPoint brushOrigin() const
Returns the currently set brush origin.
const QBrush & light() const
Returns the light brush of the current color group.
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
static const char * dock_window_close_xpm[]
The QStyleOption class stores the parameters used by QStyle functions.
static void rot(QPolygon &a, int n)
ContentsType
This enum describes the available contents types.
The QStyleOptionSpinBox class is used to describe the parameters necessary for drawing a spin box...
const QFont & font() const
Returns the currently set font used for drawing text.
QMotifStyle(bool useHighlightCols=false)
Constructs a QMotifStyle.
bool eventFilter(QObject *o, QEvent *e)
Mode
This enum type describes the mode for which a pixmap is intended to be used.
The QStyleOptionQ3DockWindow class is used to describe the parameters for drawing various parts of a ...
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
int maximum
the progress bar's maximum value
const QBrush & mid() const
Returns the mid brush of the current color group.
virtual int type() const
Returns the type of an item as an int.
static const int motifArrowHMargin
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
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
The QImage class provides a hardware-independent image representation that allows direct access to th...
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
void setUseHighlightColors(bool)
If arg is false, the style will polish the application's color palette to emulate the Motif way of hi...
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 polish(QPalette &)
Reimplemented Function
The State element defines configurations of objects and properties.
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its botto...
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
void setX(int x)
Sets the left edge of the rectangle to the given x coordinate.
The QMotifStyle class provides Motif look and feel.
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...
void moveCenter(const QPoint &p)
Moves the rectangle, leaving the center point at the given position.
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
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.
bool isNull() const
Returns true if this string is null; otherwise returns false.
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...
The QStyleHintReturnMask class provides style hints that return a QRegion.
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...
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.
static const int motifItemFrame
The QTimerEvent class contains parameters that describe a timer event.
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
int midLineWidth
the mid-line width for drawing the frame
T qstyleoption_cast(const QStyleOption *opt)
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
int x() const
Returns the x-coordinate of the rectangle's left edge.
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...
QPointer< QFocusFrame > focus
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
static const char *const qt_unshade_xpm[]
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.
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...
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
static const char *const qt_maximize_xpm[]
if(void) toggleToolbarShown
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}).
void getRect(int *x, int *y, int *w, int *h) const
Extracts the position of the rectangle's top-left corner to *x and *y, and its dimensions to *width a...
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
const QStyle * proxy() const
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
void polish(QPalette &)
Reimplemented Function
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QStyleOptionTab class is used to describe the parameters for drawing a tab bar.
The QFocusFrame widget provides a focus frame which can be outside of a widget's normal paintable are...
virtual void polish(QWidget *)
Initializes the appearance of the given widget.
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
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.
static const char *const critical_xpm[]
ControlElement
This enum represents a control element.
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=0) const
Reimplemented Function
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.
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt=0, const QWidget *widget=0) const
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
QRegion region
the region for style hints that return a QRegion
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
int minimum
the progress bar's minimum value
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
static const char *const warning_xpm[]
The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress...
QColor lighter(int f=150) const
Returns a lighter (or darker) color, but does not change this object.
int height() const
Returns the height of the font.
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
bool event(QEvent *)
Reimplemented Function
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...
int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
const QBrush & button() const
Returns the button brush of the current color group.
void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
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...
Type type() const
Returns the event type.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
int styleHint(StyleHint hint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
int size() const
Returns the number of items in the vector.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt=0, const QWidget *widget=0) const
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 const int motifItemVMargin
static const int motifTabSpacing
bool useHighlightColors() const
Returns true if the style treats the highlight colors of the palette in a Motif-like manner...
QStyle::SubControls subControls
This variable holds a bitwise OR of the sub-controls to be drawn for the complex control.
QRgb rgb() const
Returns the RGB value of the color.
void setBackground(const QBrush &bg)
Sets the background brush of the painter to the given brush.
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
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
static const char *const qt_minimize_xpm[]
void killTimer(int id)
Kills the timer with timer identifier, id.
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
static const char *const question_xpm[]
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.