49 #if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) 50 #define QMAC_QAQUASTYLE_SIZE_CONSTRAIN 53 #include <private/qapplication_p.h> 54 #include <private/qcombobox_p.h> 55 #include <private/qmacstylepixmaps_mac_p.h> 56 #include <private/qpaintengine_mac_p.h> 57 #include <private/qpainter_p.h> 58 #include <private/qprintengine_mac_p.h> 100 #include <QtGui/qgraphicsproxywidget.h> 101 #include <QtGui/qgraphicsview.h> 102 #include <private/qt_cocoa_helpers_mac_p.h> 104 #include <private/qstylehelper_p.h> 137 typedef HIRect * (*PtrHIShapeGetBounds)(
HIShapeRef, HIRect *);
158 background =
QColor(124, 124, 124);
162 background =
QColor(104, 104, 104);
164 background =
QColor(83, 83, 83);
167 background =
QColor(144, 144, 144);
169 background =
QColor(114, 114, 114);
191 int newX, newY, newRot;
194 newX = tabRect.
width();
199 newY = tabRect.
y() + tabRect.
height();
219 int width = tabRect.
width();
225 QRect rect(1, 0, width - 2, height);
235 gradient.setColorAt(0.5,
QColor(206 + d, 206 + d, 206 + d));
236 gradient.setColorAt(1,
QColor(201 + d, 201 + d, 201 + d));
244 borderSides =
QColor(88, 88, 88);
245 borderBottom =
QColor(88, 88, 88);
247 borderSides =
QColor(121, 121, 121);
248 borderBottom =
QColor(116, 116, 116);
257 p->
drawLine(width-1, 1, width-1, bottom-2);
262 p->
drawLine(3, bottom-1, width-3, bottom-1);
265 p->
drawLine(2, bottom, width-2, bottom);
268 QRectF rectangleLeft(1, height - w, w, w);
269 QRectF rectangleRight(width - 2, height - 1, w, w);
270 int startAngle = 180 * 16;
271 int spanAngle = 90 * 16;
273 p->
drawArc(rectangleLeft, startAngle, spanAngle);
274 p->
drawArc(rectangleRight, startAngle, -spanAngle);
279 QRect rect(1, 2, width - 1, height - 1);
285 bool drawOnRight = !west;
289 QColor borderHighlightColor;
291 borderColor =
QColor(64, 64, 64);
292 borderHighlightColor =
QColor(140, 140, 140);
294 borderColor =
QColor(135, 135, 135);
295 borderHighlightColor =
QColor(178, 178, 178);
298 int x = drawOnRight ? width : 0;
305 p->
setPen(borderHighlightColor);
306 p->
drawLine(x-1, 2, x-1, height + 1);
307 p->
drawLine(x+1, 2, x+1, height + 1);
321 int width = tabRect.
width();
322 int height = tabRect.
height();
326 QColor borderHighlightTop;
329 borderTop =
QColor(64, 64, 64);
330 borderHighlightTop =
QColor(174, 174, 174);
332 borderTop =
QColor(135, 135, 135);
333 borderHighlightTop =
QColor(207, 207, 207);
335 p->
setPen(borderHighlightTop);
341 QRect centralRect(tabRect.
x(), 2, width, height - 2);
344 p->
fillRect(centralRect, mainColor);
346 QLinearGradient gradient(centralRect.topLeft(), centralRect.bottomLeft());
348 gradient.setColorAt(0.5,
QColor(164, 164, 164));
349 gradient.setColorAt(1,
QColor(158, 158, 158));
354 QColor borderHighlightBottom;
357 borderHighlightBottom =
QColor(153, 153, 153);
358 borderBottom =
QColor(64, 64, 64);
360 borderHighlightBottom =
QColor(177, 177, 177);
361 borderBottom =
QColor(127, 127, 127);
363 p->
setPen(borderHighlightBottom);
364 p->
drawLine(tabRect.
x(), height - 2, width, height - 2);
366 p->
drawLine(tabRect.
x(), height - 1, width, height - 1);
406 && (l == 1 || original.
at(currPos + 1) !=
QLatin1Char(
'&'))) {
412 returnText[finalDest] = original.
at(currPos);
417 returnText.truncate(finalDest);
423 ThemeTabDirection ttd;
427 ttd = kThemeTabSouth;
432 ttd = kThemeTabNorth;
447 #include "moc_qmacstyle_mac.cpp" 448 #include "moc_qmacstyle_mac_p.cpp" 480 return CGRectMake(convertRect.
x() + rect.x(), convertRect.
y() + rect.y(),
481 convertRect.
width() - rect.width(), convertRect.
height() - rect.height());
486 return QRect(
QPoint(
int(hirect.origin.x),
int(hirect.origin.y)),
487 QSize(
int(hirect.size.width),
int(hirect.size.height)));
498 if (w->d_func()->isOpaque)
507 GetThemeMetric(met, &ret);
516 qDebug(
"Not sure how to return this...");
528 if (qobject_cast<const QPushButton *>(widg))
530 else if (qobject_cast<const QRadioButton *>(widg))
532 else if (qobject_cast<const QCheckBox *>(widg))
534 else if (qobject_cast<const QComboBox *>(widg))
536 else if (qobject_cast<const QToolButton *>(widg))
538 else if (qobject_cast<const QSlider *>(widg))
540 else if (qobject_cast<const QProgressBar *>(widg))
542 else if (qobject_cast<const QLineEdit *>(widg))
544 else if (qobject_cast<const QHeaderView *>(widg)
550 else if (qobject_cast<const QMenuBar *>(widg)
556 else if (qobject_cast<const QSizeGrip *>(widg))
605 #if 0 //Not sure we are applying the rules correctly for RadioButtons/CheckBoxes --Sam 609 if (rdo->
text().find(
'\n') != -1)
630 HIPoint p = { 0, 0 };
631 HIThemeGrowBoxDrawInfo gbi;
633 gbi.state = kThemeStateActive;
634 gbi.kind = kHIThemeGrowBoxKindNormal;
636 : kThemeGrowRight | kThemeGrowDown;
637 gbi.size = sz ==
QAquaSizeSmall ? kHIThemeGrowBoxSizeSmall : kHIThemeGrowBoxSizeNormal;
638 if (HIThemeGetGrowBoxBounds(&p, &gbi, &r) == noErr)
639 ret =
QSize(r.size.width, r.size.height);
659 int width = 0, height = 0;
660 if (szHint ==
QSize(-1, -1)) {
674 width =
qMax(width, text_width);
675 height += text_height;
678 width =
qMax(height, text_height);
683 width = szHint.
width();
687 width = szHint.
width();
690 width =
qMax(20, width + 5);
691 height =
qMax(20, height + 5);
692 ret =
QSize(width, height);
748 if (
const QProgressBar *pb = qobject_cast<const QProgressBar *>(widg))
749 orient = pb->orientation();
764 if (!widg || !qobject_cast<QComboBox *>(widg->
parentWidget())) {
778 #ifndef QT_MAC_USE_COCOA 780 if (!GetThemeMenuBarHeight(&size))
781 ret =
QSize(-1, size);
783 ret =
QSize(-1, [[NSApp mainMenu] menuBarHeight]);
800 #if defined(QMAC_QAQUASTYLE_SIZE_CONSTRAIN) || defined(DEBUG_SIZE_CONSTRAINT) 803 if (large ==
QSize(-1, -1)) {
804 if (small !=
QSize(-1, -1))
806 if (mini !=
QSize(-1, -1))
809 }
else if (small ==
QSize(-1, -1)) {
810 if (mini !=
QSize(-1, -1))
813 }
else if (mini ==
QSize(-1, -1)) {
817 #ifndef QT_NO_MAINWINDOW 818 if (qobject_cast<QDockWidget *>(widg->
window()) || !
qgetenv(
"QWIDGET_ALL_SMALL").
isNull()) {
831 if (large.
width() != -1) {
833 large_delta += delta * delta;
835 if (large.
height() != -1) {
837 large_delta += delta * delta;
840 if (small.
width() != -1) {
842 small_delta += delta * delta;
844 if (small.
height() != -1) {
846 small_delta += delta * delta;
849 if (mini.
width() != -1) {
851 mini_delta += delta * delta;
853 if (mini.
height() != -1) {
855 mini_delta += delta * delta;
857 if (mini_delta < small_delta && mini_delta < large_delta)
859 else if (small_delta < large_delta)
869 #if defined(QMAC_QAQUASTYLE_SIZE_CONSTRAIN) || defined(DEBUG_SIZE_CONSTRAINT) 889 bool guess_size =
false;
911 *insz = sz ? *sz :
QSize(-1, -1);
912 #ifdef DEBUG_SIZE_CONSTRAINT 914 const char *size_desc =
"Unknown";
917 else if (sz == &large)
919 else if (sz == &mini)
921 qDebug(
"%s - %s: %s taken (%d, %d) [%d, %d]",
943 const HIThemeButtonDrawInfo *bdi)
const 948 if (bdi->kind == kThemePushButton || bdi->kind == kThemePushButtonSmall){
951 }
else if (bdi->kind == kThemePushButtonMini) {
955 HIRect contentBounds;
956 HIThemeGetButtonContentBounds(&outerBounds, bdi, &contentBounds);
957 return contentBounds;
984 HIThemeButtonDrawInfo *bdi,
985 ThemeButtonKind buttonKindToCheck)
const 987 ThemeButtonKind tmp = bdi->kind;
988 bdi->kind = buttonKindToCheck;
992 return freeContentRect.
contains(
QRect(freeContentRect.
x(), freeContentRect.
y(),
1004 const ThemeDrawState tds,
1005 HIThemeButtonDrawInfo *bdi)
const 1008 ThemeDrawState tdsModified = tds;
1010 tdsModified = kThemeStatePressed;
1012 bdi->state = tdsModified;
1013 bdi->value = kThemeButtonOff;
1015 if (drawColorless && tdsModified == kThemeStateInactive)
1016 bdi->state = kThemeStateActive;
1018 bdi->adornment = kThemeAdornmentFocus;
1020 bdi->adornment = kThemeAdornmentNone;
1024 bdi->kind = kThemeBevelButton;
1028 bdi->kind = kThemePushButtonSmall;
1031 bdi->kind = kThemePushButtonMini;
1042 bdi->kind = kThemeBevelButton;
1047 bdi->kind = kThemePushButtonMini;
1050 bdi->kind = kThemePushButtonSmall;
1052 bdi->kind = kThemePushButton;
1055 bdi->kind = kThemePushButton;
1067 HIThemeButtonDrawInfo bdi;
1069 return bdi.kind == kThemeBevelButton;
1082 bdi->adornment = kThemeAdornmentArrowLeftArrow;
1083 bdi->value = kThemeButtonOff;
1085 bdi->adornment = kThemeAdornmentFocus;
1088 bdi->state = kThemeStatePressed;
1089 else if (drawColorless)
1090 bdi->state = kThemeStateActive;
1097 bdi->kind = combo->
editable ? ThemeButtonKind(kThemeComboBoxMini)
1098 : ThemeButtonKind(kThemePopupButtonMini);
1101 bdi->kind = combo->
editable ? ThemeButtonKind(kThemeComboBoxSmall)
1102 : ThemeButtonKind(kThemePopupButtonSmall);
1114 bdi->kind = kThemeComboBoxMini;
1116 bdi->kind = kThemeComboBoxSmall;
1118 bdi->kind = kThemeComboBox;
1126 bdi->kind = kThemePopupButtonMini;
1128 bdi->kind = kThemePopupButtonSmall;
1130 bdi->kind = kThemePopupButton;
1142 HIRect innerBounds = outerBounds;
1146 switch (buttonKind){
1147 case kThemePopupButton:
1148 innerBounds.origin.x += 2;
1149 innerBounds.origin.y += 2;
1150 innerBounds.size.width -= 5;
1151 innerBounds.size.height -= 6;
1153 case kThemePopupButtonSmall:
1154 innerBounds.origin.x += 3;
1155 innerBounds.origin.y += 3;
1156 innerBounds.size.width -= 6;
1157 innerBounds.size.height -= 7;
1159 case kThemePopupButtonMini:
1160 innerBounds.origin.x += 2;
1161 innerBounds.origin.y += 2;
1162 innerBounds.size.width -= 5;
1163 innerBounds.size.height -= 6;
1165 case kThemeComboBox:
1166 innerBounds.origin.x += 3;
1167 innerBounds.origin.y += 2;
1168 innerBounds.size.width -= 6;
1169 innerBounds.size.height -= 8;
1171 case kThemeComboBoxSmall:
1172 innerBounds.origin.x += 3;
1173 innerBounds.origin.y += 3;
1174 innerBounds.size.width -= 7;
1175 innerBounds.size.height -= 8;
1177 case kThemeComboBoxMini:
1178 innerBounds.origin.x += 3;
1179 innerBounds.origin.y += 3;
1180 innerBounds.size.width -= 4;
1181 innerBounds.size.height -= 8;
1195 QRect ret = outerBounds;
1197 case kThemeComboBox:
1198 ret.
adjust(5, 5, -22, -5);
1200 case kThemeComboBoxSmall:
1201 ret.
adjust(4, 6, -20, 0);
1204 case kThemeComboBoxMini:
1205 ret.
adjust(4, 5, -18, -1);
1208 case kThemePopupButton:
1209 ret.
adjust(10, 2, -23, -4);
1211 case kThemePopupButtonSmall:
1212 ret.
adjust(9, 3, -20, -3);
1214 case kThemePopupButtonMini:
1215 ret.
adjust(8, 3, -19, 0);
1229 if (!(bdi.kind == kThemeComboBox && outerBounds.size.height > 28)){
1232 HIThemeDrawButton(&innerBounds, &bdi,
QMacCGContext(p), kHIThemeOrientationNormal, 0);
1237 HIRect innerBoundsSmallCombo = {{3, 3}, {29, 25}};
1241 HIThemeDrawButton(&innerBoundsSmallCombo, &bdi,
QMacCGContext(&buffPainter), kHIThemeOrientationNormal, 0);
1246 const int bwidth = 20;
1247 const int fwidth = 10;
1248 const int fheight = 10;
1249 int w =
qRound(outerBounds.size.width);
1250 int h =
qRound(outerBounds.size.height);
1251 int bstart = w - bwidth;
1252 int blower = fheight + 1;
1253 int flower = h - fheight;
1254 int sheight = flower - fheight;
1255 int center =
qRound(outerBounds.size.height + outerBounds.origin.y) / 2;
1258 p->
drawPixmap(fwidth, 0, bstart - fwidth, fheight, buffer, fwidth, 0, 1, fheight);
1259 p->
drawPixmap(fwidth, flower, bstart - fwidth, fheight, buffer, fwidth, buffer.
height() - fheight, 1, fheight);
1261 p->
drawPixmap(0, fheight, fwidth, sheight, buffer, 0, fheight, fwidth, 1);
1262 p->
drawPixmap(bstart, fheight, bwidth, center - fheight, buffer, buffer.
width() - bwidth, fheight - 1, bwidth, 1);
1263 p->
drawPixmap(bstart, center, bwidth, sheight / 2, buffer, buffer.
width() - bwidth, fheight + 6, bwidth, 1);
1265 p->
drawPixmap(bstart, center - 4, bwidth - 3, 6, buffer, buffer.
width() - bwidth, fheight, bwidth - 3, 6);
1267 p->
drawPixmap(0, 0, fwidth, fheight, buffer, 0, 0, fwidth, fheight);
1268 p->
drawPixmap(bstart, 0, bwidth, fheight, buffer, buffer.
width() - bwidth, 0, bwidth, fheight);
1269 p->
drawPixmap(0, flower, fwidth, fheight, buffer, 0, buffer.
height() - fheight, fwidth, fheight);
1270 p->
drawPixmap(bstart, h - blower, bwidth, blower, buffer, buffer.
width() - bwidth, buffer.
height() - blower, bwidth, blower);
1279 bool drawTopBorder,
bool drawLeftBorder,
const HIThemeButtonDrawInfo &bdi,
QPainter *p)
1281 static SInt32 headerHeight = 0;
1282 static OSStatus err = GetThemeMetric(kThemeMetricListHeaderHeight, &headerHeight);
1288 HIRect headerNormalRect = {{0., 0.}, {16.,
CGFloat(headerHeight)}};
1289 buffer =
QPixmap(headerNormalRect.size.width, headerNormalRect.size.height);
1292 HIThemeDrawButton(&headerNormalRect, &bdi,
QMacCGContext(&buffPainter), kHIThemeOrientationNormal, 0);
1296 const int buttonw =
qRound(outerBounds.size.width);
1297 const int buttonh =
qRound(outerBounds.size.height);
1298 const int framew = 1;
1299 const int frameh_n = 4;
1300 const int frameh_s = 3;
1301 const int transh = buffer.
height() - frameh_n - frameh_s;
1302 int center = buttonh - frameh_s - int(transh / 2.0f) + 1;
1304 int skipTopBorder = 0;
1308 p->
translate(outerBounds.origin.x, outerBounds.origin.y);
1311 p->
drawPixmap(
QRect(0, buttonh - frameh_s, buttonw - framew, frameh_s), buffer,
QRect(framew, buffer.
height() - frameh_s, 1, frameh_s));
1313 p->
drawPixmap(
QRect(0, frameh_n - skipTopBorder, buttonw - framew, center - frameh_n + skipTopBorder), buffer,
QRect(framew, frameh_n, 1, 1));
1314 p->
drawPixmap(
QRect(0, center, buttonw - framew, buttonh - center - frameh_s), buffer,
QRect(framew, buffer.
height() - frameh_s, 1, 1));
1316 p->
drawPixmap(
QRect(buttonw - framew, frameh_n - skipTopBorder, framew, center - frameh_n), buffer,
QRect(buffer.
width() - framew, frameh_n, framew, 1));
1317 p->
drawPixmap(
QRect(buttonw - framew, center, framew, buttonh - center - 1), buffer,
QRect(buffer.
width() - framew, buffer.
height() - frameh_s, framew, 1));
1319 p->
drawPixmap(
QRect(buttonw - framew, -skipTopBorder, framew, frameh_n), buffer,
QRect(buffer.
width() - framew, 0, framew, frameh_n));
1320 p->
drawPixmap(
QRect(buttonw - framew, buttonh - frameh_s, framew, frameh_s), buffer,
QRect(buffer.
width() - framew, buffer.
height() - frameh_s, framew, frameh_s));
1322 p->
drawPixmap(
QRect(0, center -
qRound(transh / 2.0f), buttonw - framew, buffer.
height() - frameh_n - frameh_s), buffer,
QRect(framew, frameh_n + 1, 1, transh));
1324 p->
drawPixmap(
QRect(buttonw - framew, center -
qRound(transh / 2.0f), framew, buffer.
height() - frameh_n - frameh_s), buffer,
QRect(buffer.
width() - framew, frameh_n + 1, framew, transh));
1325 if (drawLeftBorder){
1327 p->
drawPixmap(
QRect(0, frameh_n - skipTopBorder, framew, center - frameh_n + skipTopBorder), buffer,
QRect(0, frameh_n, framew, 1));
1330 p->
drawPixmap(
QRect(0, -skipTopBorder, framew, frameh_n), buffer,
QRect(0, 0, framew, frameh_n));
1331 p->
drawPixmap(
QRect(0, buttonh - frameh_s, framew, frameh_s), buffer,
QRect(0, buffer.
height() - frameh_s, framew, frameh_s));
1336 p->
translate(-outerBounds.origin.x, -outerBounds.origin.y);
1352 static const int sizeTable[2][2] = { { 61, 56 }, { 49, 44 } };
1353 return sizeTable[sizeIndex][cutoffType];
1357 HIThemeTrackDrawInfo *tdi,
const QWidget *needToRemoveMe)
1359 memset(tdi, 0,
sizeof(HIThemeTrackDrawInfo));
1368 tdi->kind = kThemeMediumScrollBar;
1370 tdi->kind = kThemeMediumSlider;
1374 tdi->kind = kThemeSmallScrollBar;
1376 tdi->kind = kThemeMiniSlider;
1380 tdi->kind = kThemeSmallScrollBar;
1382 tdi->kind = kThemeSmallSlider;
1389 tdi->attributes = kThemeTrackShowThumb;
1391 tdi->attributes |= kThemeTrackRightToLeft;
1393 tdi->attributes |= kThemeTrackHorizontal;
1396 tdi->attributes |= kThemeTrackRightToLeft;
1398 tdi->attributes &= ~kThemeTrackRightToLeft;
1403 if (isScrollbar && (tdi->attributes & kThemeTrackRightToLeft)) {
1404 tdi->attributes &= ~kThemeTrackRightToLeft;
1409 : kThemeTrackDisabled;
1411 tdi->enableState = kThemeTrackInactive;
1413 if (slider->
state & QStyle::QStyle::State_HasFocus)
1414 tdi->attributes |= kThemeTrackHasFocus;
1416 tdi->trackInfo.slider.thumbDir = kThemeThumbPlain;
1418 tdi->trackInfo.slider.thumbDir = kThemeThumbUpward;
1420 tdi->trackInfo.slider.thumbDir = kThemeThumbDownward;
1422 tdi->trackInfo.scrollbar.viewsize = slider->
pageStep;
1496 if (
QPushButton *btn = qobject_cast<QPushButton *>(w)) {
1497 btn->installEventFilter(
this);
1498 if (btn->isDefault() || (btn->autoDefault() && btn->hasFocus()))
1507 if (isProgressBar) {
1525 }
else if (qobject_cast<QProgressBar *>(w)
1536 ThemeDrawState tds = kThemeStateActive;
1538 tds = kThemeStatePressed;
1541 tds = kThemeStateUnavailable;
1544 tds = kThemeStateInactive;
1546 tds = kThemeStateUnavailableInactive;
1565 if (!maybeProgress) {
1568 if (
QProgressBar *pb = qobject_cast<QProgressBar *>(maybeProgress)) {
1569 if (pb->maximum() == 0 || (pb->value() > 0 && pb->value() < pb->maximum())) {
1580 int intProgress = progress.
toInt();
1581 int intTotalSteps = totalSteps.
toInt();
1582 if (intTotalSteps == 0 || intProgress > 0 && intProgress < intTotalSteps) {
1597 if (animated <= 0) {
1606 if (
QProgressBar *pb = qobject_cast<QProgressBar *>(o)) {
1607 switch (e->
type()) {
1618 }
else if (
QPushButton *btn = qobject_cast<QPushButton *>(o)) {
1619 switch (e->
type()) {
1623 if (btn->autoDefault())
1645 for (
int i = 0; i < list.
size(); ++i) {
1686 int width = int(macRect.size.width) + extraWidth;
1687 int height = int(macRect.size.height) + extraHeight;
1689 if (width <= 0 || height <= 0)
1697 QPixmap activePixmap(width, height);
1703 QPainter tmpPainter(&activePixmap);
1708 HIRect newRect = CGRectMake(xoff, yoff, macRect.size.width, macRect.size.height);
1709 HIThemeDrawButton(&newRect, bdi, cg, kHIThemeOrientationNormal, 0);
1713 if (!combo && bdi->value == kThemeButtonOff) {
1718 for (
int y = 0; y < height; ++y) {
1721 for (
int x = 0; x < width; ++x) {
1722 QRgb &pixel = scanLine[x];
1724 int darkest =
qRed(pixel);
1726 int lightest =
qBlue(pixel);
1729 qSwap(darkest, mid);
1731 qSwap(mid, lightest);
1733 qSwap(darkest, mid);
1735 int gray = (mid + 2 * lightest) / 3;
1744 QPixmap colorlessPixmap(width, height);
1748 HIRect newRect = CGRectMake(xoff, yoff, macRect.size.width, macRect.size.height);
1749 int oldValue = bdi->value;
1750 bdi->value = kThemeButtonOff;
1751 HIThemeDrawButton(&newRect, bdi, cg, kHIThemeOrientationNormal, 0);
1752 bdi->value = oldValue;
1753 colorlessImage = colorlessPixmap.
toImage();
1756 for (
int y = 0; y < height; ++y) {
1757 QRgb *colorlessScanLine =
reinterpret_cast<QRgb *
>(colorlessImage.
scanLine(y));
1758 const QRgb *activeScanLine =
reinterpret_cast<const QRgb *
>(activeImage.
scanLine(y));
1760 for (
int x = 0; x < width; ++x) {
1761 QRgb &colorlessPixel = colorlessScanLine[x];
1762 QRgb activePixel = activeScanLine[x];
1764 if (activePixel != colorlessPixel) {
1766 qBlue(activePixel));
1770 colorlessPixel = newPixel;
1778 p->
drawPixmap(
int(macRect.origin.x),
int(macRect.origin.y) + finalyoff, width, height, pm);
1790 qt_mac_backgroundPattern = 0;
1801 HIThemeSetFill(kThemeBrushDialogBackgroundActive, 0, cg, kHIThemeOrientationNormal);
1803 CGContextFillRect(cg, cgRect);
1816 const bool usePainter = redirected && redirected != target;
1818 if (!usePainter && qt_mac_backgroundPattern
1824 CGContextSaveGState(cg);
1825 HIThemeSetFill(kThemeBrushDialogBackgroundActive, 0, cg, kHIThemeOrientationInverted);
1828 for (
int i = 0; i < rects.
size(); ++i) {
1829 const QRect rect(rects.
at(i));
1831 CGContextSetPatternPhase(cg, CGSizeMake(rect.width(), rect.height()));
1832 CGRect mac_rect = CGRectMake(rect.x(), rect.y(), rect.width(), rect.height());
1833 CGContextFillRect(cg, mac_rect);
1836 CGContextRestoreGState(cg);
1846 if (!qt_mac_backgroundPattern) {
1854 QBrush background(pc, *qt_mac_backgroundPattern);
1859 const OSErr err = CopyThemeIdentifier(&theme);
1860 if (err == noErr && CFStringCompare(theme, kThemeAppearanceAquaGraphite, 0) == kCFCompareEqualTo) {
1888 if (qobject_cast<QMenu*>(w) || qobject_cast<QComboBoxPrivateContainer *>(w)) {
1893 HIThemeMenuDrawInfo mtinfo;
1895 mtinfo.menuType = kThemeMenuTypePopUp;
1896 HIRect rect = CGRectMake(0, 0, px.
width(), px.
height());
1898 kHIThemeOrientationNormal);
1908 if (
QTabBar *tb = qobject_cast<QTabBar*>(w)) {
1909 if (tb->documentMode()) {
1920 if (
QRubberBand *rubber = qobject_cast<QRubberBand*>(w)) {
1921 rubber->setWindowOpacity(0.25);
1937 if (
QComboBox *combo = qobject_cast<QComboBox *>(w)) {
1938 if (!combo->isEditable()) {
1944 if (
QRubberBand *rubber = ::qobject_cast<QRubberBand*>(w)) {
1945 rubber->setWindowOpacity(1.0);
1950 if (
QFocusFrame *frame = qobject_cast<QFocusFrame *>(w))
1971 GetThemeMetric(kThemeMetricFocusRectOutset, &ret);
1979 if (sz ==
QSize(-1, -1))
1988 GetThemeMetric(kThemeMetricCheckBoxWidth, &ret);
1991 GetThemeMetric(kThemeMetricMiniCheckBoxWidth, &ret);
1994 GetThemeMetric(kThemeMetricSmallCheckBoxWidth, &ret);
2001 if (sz ==
QSize(-1, -1))
2026 GetThemeMenuItemExtra(kThemeMenuItemScrollUpArrow, &ash, &asw);
2033 #ifndef QT_NO_MAINWINDOW 2041 || widget->
inherits(
"QWorkspaceChild")))
2046 if (qstyleoption_cast<const QStyleOptionComboBox *>(opt) != 0)
2049 else if (qobject_cast<const QLineEdit *>(widget) != 0)
2061 GetThemeMetric(kThemeMetricEditTextFrameOutset, &ret);
2083 HIThemeWindowDrawInfo wdi;
2085 wdi.state = kThemeStateActive;
2087 if (tb->titleBarState)
2088 wdi.attributes = kThemeWindowHasFullZoom | kThemeWindowHasCloseBox
2089 | kThemeWindowHasCollapseBox;
2091 wdi.attributes = kThemeWindowHasCloseBox;
2094 wdi.titleHeight = tb->rect.height();
2095 wdi.titleWidth = tb->rect.width();
2098 if (hirect.size.width <= 0)
2099 hirect.size.width = 100;
2100 if (hirect.size.height <= 0)
2101 hirect.size.height = 30;
2103 HIThemeGetWindowShape(&hirect, &wdi, kWindowTitleBarRgn, ®ion);
2106 ret = int(rect.size.height);
2141 GetThemeMetric(kThemeMetricScrollBarWidth, &ret);
2145 GetThemeMetric(kThemeMetricSmallScrollBarWidth, &ret);
2153 GetThemeMetric(kThemeMetricCheckBoxHeight, &ret);
2156 GetThemeMetric(kThemeMetricMiniCheckBoxHeight, &ret);
2159 GetThemeMetric(kThemeMetricSmallCheckBoxHeight, &ret);
2167 GetThemeMetric(kThemeMetricCheckBoxWidth, &ret);
2170 GetThemeMetric(kThemeMetricMiniCheckBoxWidth, &ret);
2173 GetThemeMetric(kThemeMetricSmallCheckBoxWidth, &ret);
2182 GetThemeMetric(kThemeMetricRadioButtonHeight, &ret);
2185 GetThemeMetric(kThemeMetricMiniRadioButtonHeight, &ret);
2188 GetThemeMetric(kThemeMetricSmallRadioButtonHeight, &ret);
2196 GetThemeMetric(kThemeMetricRadioButtonWidth, &ret);
2199 GetThemeMetric(kThemeMetricMiniRadioButtonWidth, &ret);
2202 GetThemeMetric(kThemeMetricSmallRadioButtonWidth, &ret);
2254 bool isWindow =
false;
2257 }
else if (widget) {
2325 if (mainWindow->unifiedTitleAndToolBarOnMac())
2388 ret = kBulletUnicode;
2436 ret = !cmb->editable;
2450 if (
const QTabWidget *tab = qobject_cast<const QTabWidget*>(w)) {
2451 if (tab->documentMode()) {
2456 if (
const QTabBar *tab = qobject_cast<const QTabBar*>(w)) {
2457 if (tab->documentMode()) {
2479 const uchar fillR = 192, fillG = 191, fillB = 190;
2494 const int w = sbpl/4, h = img.
height();
2498 const int dbpl = img_mask.bytesPerLine();
2500 for (
int y = 0; y < h; ++y) {
2501 srow = sptr+((y*sbpl)/4);
2502 drow = dptr+((y*dbpl)/4);
2503 for (
int x = 0; x < w; ++x) {
2504 const int diff = (((
qRed(*srow)-fillR)*(
qRed(*srow)-fillR)) +
2506 ((
qBlue(*srow)-fillB)*((
qBlue(*srow)-fillB))));
2507 (*drow++) = (diff < 100) ? 0xffffffff : 0xff000000;
2512 mask->region =
QRegion(qmask);
2539 mask->region = opt->
rect;
2606 HIRect menuRect = CGRectMake(opt->
rect.
x(), opt->
rect.
y() + 4,
2608 HIThemeMenuDrawInfo mdi;
2611 mdi.menuType = kThemeMenuTypeHierarchical;
2613 mdi.menuType = kThemeMenuTypePopUp;
2615 HIThemeGetMenuBackgroundShape(&menuRect, &mdi, &shape);
2616 mask->region = QRegion::fromHIShapeRef(shape);
2643 int imgw = img.
width();
2645 for (
int y = 0; y < imgh; ++y) {
2646 for (
int x = 0; x < imgw; ++x) {
2647 pixel = img.
pixel(x, y);
2669 static bool recursionGuard =
false;
2674 recursionGuard =
true;
2676 recursionGuard =
false;
2678 switch (standardPixmap) {
2689 return icon.
pixmap(size, size);
2773 = qstyleoption_cast<const QStyleOptionTabBarBaseV2 *>(opt)) {
2774 if (tbb->documentMode) {
2782 region -= tbb->tabBarRect;
2786 twf.QStyleOption::operator=(*tbb);
2787 twf.
shape = tbb->shape;
2789 case kThemeTabNorth:
2792 case kThemeTabSouth:
2810 if (
const QStyleOptionFrame *groupBox = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
2815 HIThemeGroupBoxDrawInfo gdi;
2819 gdi.kind = kHIThemeGroupBoxKindSecondary;
2821 gdi.kind = kHIThemeGroupBoxKindPrimary;
2823 HIThemeDrawGroupBox(&hirect, &gdi, cg, kHIThemeOrientationNormal);
2862 int x = opt->
rect.
x() + 6;
2863 int y = opt->
rect.
y() + 5;
2864 static const int RectHeight = 2;
2866 while (y < opt->rect.height() - RectHeight - 6) {
2868 path.
addRect(x, y, RectHeight, RectHeight);
2872 while (x < opt->rect.width() - RectHeight - 6) {
2874 path.
addRect(x, y, RectHeight, RectHeight);
2897 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
2906 const int checkw = 8;
2907 const int checkh = 8;
2910 const int x1 = xoff + opt->
rect.
x();
2911 const int y1 = yoff + opt->
rect.
y() + checkw/2;
2912 const int x2 = xoff + opt->
rect.
x() + checkw/4;
2913 const int y2 = yoff + opt->
rect.
y() + checkh;
2914 const int x3 = xoff + opt->
rect.
x() + checkw;
2915 const int y3 = yoff + opt->
rect.
y();
2918 a <<
QLineF(x1, y1, x2, y2);
2919 a << QLineF(x2, y2, x3, y3);
2940 HIThemeButtonDrawInfo bdi;
2943 if (drawColorless && tds == kThemeStateInactive)
2944 bdi.state = kThemeStateActive;
2945 bdi.adornment = kThemeDrawIndicatorOnly;
2947 bdi.adornment |= kThemeAdornmentFocus;
2954 bdi.kind = kThemeRadioButton;
2956 bdi.kind = kThemeCheckBox;
2960 bdi.kind = kThemeMiniRadioButton;
2962 bdi.kind = kThemeMiniCheckBox;
2966 bdi.kind = kThemeSmallRadioButton;
2968 bdi.kind = kThemeSmallCheckBox;
2972 bdi.value = kThemeButtonMixed;
2974 bdi.value = kThemeButtonOn;
2976 bdi.value = kThemeButtonOff;
2983 HIThemeDrawButton(&macRect, &bdi, cg, kHIThemeOrientationNormal, 0);
2993 HIThemeButtonDrawInfo bi;
2997 bi.state = kThemeStateActive;
2999 bi.state |= kThemeStatePressed;
3000 bi.kind = kThemeDisclosureButton;
3002 bi.value = kThemeDisclosureDown;
3005 bi.adornment = kThemeAdornmentNone;
3007 HIThemeDrawButton(&hirect, &bi, cg, kHIThemeOrientationNormal, 0);
3020 if (
const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
3022 QColor baseColor(frame->palette.background().color());
3023 HIThemeFrameDrawInfo fdi;
3028 fdi.kind = kHIThemeFrameTextFieldSquare;
3029 GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
3031 fdi.state = kThemeStateInactive;
3033 baseColor =
QColor(150, 150, 150);
3034 fdi.kind = kHIThemeFrameListBox;
3035 GetThemeMetric(kThemeMetricListBoxFrameOutset, &frame_size);
3038 int lw = frame->lineWidth;
3049 QRect(frame_size, frame_size,
3050 frame_size * 2, frame_size * 2));
3052 HIThemeDrawFrame(&hirect, &fdi, cg, kHIThemeOrientationNormal);
3062 if (
const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
3067 focusFrame.
rect = panel->rect.
adjusted(-hmargin, -vmargin, hmargin, vmargin);
3075 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
3077 HIThemeTabPaneDrawInfo tpdi;
3081 tpdi.size = kHIThemeTabSizeNormal;
3082 tpdi.kind = kHIThemeTabKindNormal;
3083 tpdi.adornment = kHIThemeTabPaneAdornmentNormal;
3084 HIThemeDrawTabPane(&hirect, &tpdi, cg, kHIThemeOrientationNormal);
3110 qobject_cast<QMainWindow *>(w->
parent())->unifiedTitleAndToolBarOnMac() == false ) {
3146 int imgw = img.
width();
3149 for (
int y = 0; y < imgh; ++y) {
3150 for (
int x = 0; x < imgw; ++x) {
3151 pixel = img.
pixel(x, y);
3154 hsvColor.
getHsv(&h, &s, &v);
3155 s =
qMin(100, s * 2);
3157 hsvColor.
setHsv(h, s, v);
3158 pixel = hsvColor.
rgb();
3174 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
3175 HIThemeButtonDrawInfo bdi;
3177 State flags = header->state;
3178 QRect ir = header->rect;
3179 bdi.kind = kThemeListHeaderButton;
3180 bdi.adornment = kThemeAdornmentNone;
3181 bdi.state = kThemeStateActive;
3184 bdi.value = kThemeButtonOn;
3186 bdi.value = kThemeButtonOff;
3189 switch (header->position) {
3207 ? kThemeAdornmentHeaderButtonLeftNeighborSelected
3208 : kThemeAdornmentHeaderButtonRightNeighborSelected;
3214 bdi.state = kThemeStateUnavailable;
3216 bdi.state = kThemeStatePressed;
3219 bdi.state = kThemeStateInactive;
3221 bdi.state = kThemeStateUnavailableInactive;
3225 bdi.value = kThemeButtonOn;
3227 bdi.adornment = kThemeAdornmentHeaderButtonSortUp;
3230 bdi.adornment = kThemeAdornmentFocus;
3232 ir =
visualRect(header->direction, header->rect, ir);
3235 bool noVerticalHeader =
true;
3238 noVerticalHeader = !table->verticalHeader()->isVisible();
3241 bool drawLeftBorder = header->orientation ==
Qt::Vertical 3248 if (
const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
3249 QRect textr = header->rect;
3250 if (!header->icon.isNull()) {
3256 QRect pixr = header->rect;
3257 pixr.
setY(header->rect.center().y() - (pixmap.
height() - 1) / 2);
3270 if (w && qobject_cast<QToolBar *>(w->
parentWidget())) {
3271 QRect cr = tb->rect;
3274 bool needText =
false;
3287 if (tb->icon.isNull() && !tb->text.isEmpty())
3303 QPixmap pixmap = tb->icon.pixmap(tb->rect.size().boundedTo(tb->iconSize), iconMode, iconState);
3378 if (
const QStyleOptionButton *btn = ::qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3387 HIThemeButtonDrawInfo bdi;
3391 bdi.adornment |= kThemeAdornmentDefault;
3393 bdi.animation.time.current = CFAbsoluteTimeGetCurrent();
3401 if (bdi.kind == kThemePushButton || bdi.kind == kThemePushButtonSmall) {
3406 }
else if (bdi.kind == kThemePushButtonMini) {
3411 HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
3415 QRect ir = btn->rect;
3419 if (drawColorless && tds == kThemeStateInactive)
3420 tds = kThemeStateActive;
3422 HIThemePopupArrowDrawInfo pdi;
3425 pdi.orientation = kThemeArrowDown;
3426 if (arrowRect.size.width < 8.)
3427 pdi.size = kThemeArrow5pt;
3429 pdi.size = kThemeArrow9pt;
3430 HIThemeDrawPopupArrow(&arrowRect, &pdi, cg, kHIThemeOrientationNormal);
3435 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
3441 bool hasIcon = !btn->icon.isNull();
3442 bool hasText = !btn->text.isEmpty();
3443 if (!hasIcon && !hasMenu) {
3448 ThemeFontID themeId = kThemePushButtonFont;
3449 if (oldFont == newFont) {
3454 themeId = kThemeSmallSystemFont;
3457 themeId = kThemeMiniSystemFont;
3461 if (themeId == kThemePushButtonFont) {
3465 CGContextSetShouldAntialias(cg,
true);
3466 CGContextSetShouldSmoothFonts(cg,
true);
3467 HIThemeTextInfo tti;
3470 QColor textColor = btn->palette.buttonText().color();
3474 CGContextSetFillColor(cg, colorComp);
3475 tti.fontID = themeId;
3476 tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
3477 tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
3478 tti.options = kHIThemeTextBoxOptionNone;
3479 tti.truncationPosition = kHIThemeTextTruncationNone;
3480 tti.truncationMaxLines = 1 + btn->text.count(
QLatin1Char(
'\n'));
3482 QRect r = btn->rect;
3484 HIThemeDrawTextBox(buttonText, &bounds, &tti,
3485 cg, kHIThemeOrientationNormal);
3489 if (hasIcon && !hasText) {
3492 QRect freeContentRect = btn->rect;
3496 textRect.
adjust(-1, 0, -1, 0);
3499 int contentW = textRect.
width();
3509 QPixmap pixmap = btn->icon.pixmap(btn->iconSize, mode, state);
3511 int iconLeftOffset = freeContentRect.
x() + (freeContentRect.
width() - contentW) / 2;
3512 int iconTopOffset = freeContentRect.
y() + (freeContentRect.
height() - pixmap.
height()) / 2;
3513 QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmap.
width(), pixmap.
height());
3514 QRect visualIconDestRect =
visualRect(btn->direction, freeContentRect, iconDestRect);
3516 int newOffset = iconDestRect.x() + iconDestRect.width()
3518 textRect.
adjust(newOffset, 0, newOffset, 0);
3522 textRect =
visualRect(btn->direction, freeContentRect, textRect);
3538 if (
const QStyleOptionTab *tabOpt = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
3540 if (
const QStyleOptionTabV3 *tabOptV3 = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
3541 if (tabOptV3->documentMode) {
3543 QRect tabRect = tabOptV3->rect;
3549 HIThemeTabDrawInfo tdi;
3551 tdi.style = kThemeTabNonFront;
3557 tdi.size = kHIThemeTabSizeNormal;
3560 tdi.size = kHIThemeTabSizeSmall;
3563 tdi.size = kHIThemeTabSizeMini;
3566 bool verticalTabs = tdi.direction == kThemeTabWest || tdi.direction == kThemeTabEast;
3567 QRect tabRect = tabOpt->rect;
3572 tdi.style = kThemeTabFrontUnavailable;
3574 tdi.style = kThemeTabFrontInactive;
3576 tdi.style = kThemeTabFront;
3578 tdi.style = kThemeTabNonFrontUnavailable;
3580 tdi.style = kThemeTabNonFrontInactive;
3582 tdi.style = kThemeTabFrontInactive;
3585 tdi.adornment = kHIThemeTabAdornmentFocus;
3587 tdi.adornment = kHIThemeTabAdornmentNone;
3588 tdi.kind = kHIThemeTabKindNormal;
3590 tabRect.
setY(tabRect.
y() - 1);
3592 tabRect.
setX(tabRect.
x() - 1);
3611 bool stretchTabs = (!verticalTabs && tabRect.
height() > 22) || (verticalTabs && tabRect.
width() > 22);
3615 tdi.position = kHIThemeTabPositionFirst;
3617 tdi.adornment |= kHIThemeTabAdornmentTrailingSeparator;
3620 tdi.position = kHIThemeTabPositionMiddle;
3622 tdi.adornment |= kHIThemeTabAdornmentLeadingSeparator;
3624 tdi.adornment |= kHIThemeTabAdornmentTrailingSeparator;
3627 tdi.position = kHIThemeTabPositionLast;
3629 tdi.adornment |= kHIThemeTabAdornmentLeadingSeparator;
3632 tdi.position = kHIThemeTabPositionOnly;
3637 HIRect hirect = CGRectMake(0, 0, 23, 23);
3642 HIThemeDrawTab(&hirect, &tdi, pmcg, kHIThemeOrientationNormal, 0);
3647 HIThemeDrawTab(&hirect, &tdi, cg, kHIThemeOrientationNormal, 0);
3652 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) {
3655 bool verticalTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
3667 if ((usingModernOSX && selected) || verticalTabs || nonDefaultFont || !tab->icon.isNull()
3669 int heightOffset = 0;
3672 }
else if (nonDefaultFont) {
3678 if (myTab.
documentMode || (usingModernOSX && selected)) {
3698 CGContextSetShouldAntialias(cg,
true);
3699 CGContextSetShouldSmoothFonts(cg,
true);
3700 HIThemeTextInfo tti;
3707 CGContextSetFillColor(cg, colorComp);
3712 tti.fontID = kThemeSystemFont;
3715 tti.fontID = kThemeSmallSystemFont;
3718 tti.fontID = kThemeMiniSystemFont;
3721 tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
3722 tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
3723 tti.options = verticalTabs ? kHIThemeTextBoxOptionStronglyVertical : kHIThemeTextBoxOptionNone;
3724 tti.truncationPosition = kHIThemeTextTruncationNone;
3729 HIThemeDrawTextBox(tabText, &bounds, &tti, cg, kHIThemeOrientationNormal);
3735 if (
const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(w)) {
3736 bool floating = dockWidget->isFloating();
3739 HIThemeWindowDrawInfo wdi;
3742 wdi.windowType = kThemeMovableDialogWindow;
3747 HIRect titleBarRect;
3752 HIThemeGetWindowShape(&tmpRect, &wdi, kWindowTitleBarRgn, &titleRegion);
3754 newr.
translate(newr.
x() - int(tmpRect.origin.x), newr.
y() - int(tmpRect.origin.y));
3758 HIThemeDrawWindowFrame(&titleBarRect, &wdi, cg, kHIThemeOrientationNormal, 0);
3778 if (!dwOpt->title.isEmpty()) {
3784 if (verticalTitleBar) {
3785 QRect rect = dwOpt->rect;
3816 HIRect hirect = CGRectMake(xOff+opt->
rect.
x(), yOff+opt->
rect.
y(), opt->
rect.
width() - 2 * xOff,
3818 HIThemeDrawFocusRect(&hirect,
true,
QMacCGContext(p), kHIThemeOrientationNormal);
3825 int tabwidth = mi->tabWidth;
3826 int maxpmw = mi->maxIconWidth;
3831 HIThemeMenuItemDrawInfo mdi;
3833 mdi.itemType = kThemeMenuItemPlain;
3834 if (!mi->icon.isNull())
3835 mdi.itemType |= kThemeMenuItemHasIcon;
3837 mdi.itemType |= kThemeMenuItemHierarchical | kThemeMenuItemHierBackground;
3839 mdi.itemType |= kThemeMenuItemPopUpBackground;
3841 mdi.state = kThemeMenuActive;
3843 mdi.state = kThemeMenuDisabled;
3845 mdi.state |= kThemeMenuSelected;
3849 HIThemeDrawMenuSeparator(&itemRect, &itemRect, &mdi,
3850 cg, kHIThemeOrientationNormal);
3857 CGContextSaveGState(cg);
3858 CGContextSetAlpha(cg, 0.0);
3860 HIThemeDrawMenuItem(&menuRect, &itemRect, &mdi,
3861 cg, kHIThemeOrientationNormal, &cr);
3863 CGContextRestoreGState(cg);
3868 int xpos = contentRect.
x() + 18;
3869 int checkcol = maxpmw;
3871 p->
setPen(mi->palette.text().color());
3873 p->
setPen(mi->palette.highlightedText().color());
3875 p->
setPen(mi->palette.buttonText().color());
3882 CGContextSetShouldAntialias(cg,
true);
3883 CGContextSetShouldSmoothFonts(cg,
true);
3888 CGContextSetFillColor(cg, colorComp);
3889 HIThemeTextInfo tti;
3892 if (active && enabled)
3893 tti.state = kThemeStatePressed;
3894 switch (widgetSize) {
3897 tti.fontID = kThemeMenuItemMarkFont;
3900 tti.fontID = kThemeSmallSystemFont;
3903 tti.fontID = kThemeMiniSystemFont;
3906 tti.horizontalFlushness = kHIThemeTextHorizontalFlushLeft;
3907 tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
3908 tti.options = kHIThemeTextBoxOptionNone;
3909 tti.truncationPosition = kHIThemeTextTruncationNone;
3910 tti.truncationMaxLines = 1;
3920 int xp = contentRect.
x();
3922 CGFloat outWidth, outHeight, outBaseline;
3923 HIThemeGetTextDimensions(checkmark, 0, &tti, &outWidth, &outHeight,
3927 QRect r(xp, contentRect.
y(), mw, mh);
3930 HIThemeDrawTextBox(checkmark, &bounds, &tti,
3931 cg, kHIThemeOrientationNormal);
3934 if (!mi->icon.isNull()) {
3939 QSize iconSize(smallIconSize, smallIconSize);
3940 if (
const QComboBox *comboBox = qobject_cast<const QComboBox *>(w)) {
3941 iconSize = comboBox->iconSize();
3943 QPixmap pixmap = mi->icon.pixmap(iconSize, mode);
3944 int pixw = pixmap.
width();
3945 int pixh = pixmap.
height();
3946 QRect cr(xpos, contentRect.
y(), checkcol, contentRect.
height());
3947 QRect pmr(0, 0, pixw, pixh);
3948 pmr.moveCenter(cr.center());
3958 int yPos = contentRect.
y();
3966 p->
drawText(xp, yPos, tabwidth, contentRect.
height(), text_flags,
3972 QFont myFont = mi->font;
3980 p->
drawText(xpos, yPos, contentRect.
width() - xm - tabwidth + 1,
3995 HIThemeMenuItemDrawInfo mdi;
3998 mdi.state = kThemeMenuDisabled;
4000 mdi.state = kThemeMenuSelected;
4002 mdi.state = kThemeMenuActive;
4005 mdi.itemType = kThemeMenuItemScrollDownArrow;
4007 mdi.itemType = kThemeMenuItemScrollUpArrow;
4009 mdi.itemType = kThemeMenuItemPlain;
4011 HIThemeDrawMenuItem(&menuRect, &itemRect, &mdi,
4013 kHIThemeOrientationNormal, 0);
4016 p->
drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2 - 1,
4017 mi->rect.x() + mi->rect.width() - 4,
4018 mi->rect.y() + mi->rect.height() / 2 - 1);
4020 p->
drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2,
4021 mi->rect.x() + mi->rect.width() - 4,
4022 mi->rect.y() + mi->rect.height() / 2);
4033 HIThemeMenuItemDrawInfo mdi;
4035 mdi.state = kThemeMenuSelected;
4036 mdi.itemType = kThemeMenuItemPlain;
4037 HIThemeDrawMenuItem(&menuRect, &itemRect, &mdi, cg, kHIThemeOrientationNormal, 0);
4040 HIThemeMenuBarDrawInfo bdi;
4042 bdi.state = kThemeMenuBarNormal;
4044 HIThemeDrawMenuBarBackground(&menuRect, &bdi, cg, kHIThemeOrientationNormal);
4047 if (!mi->icon.isNull()) {
4064 HIThemeMenuBarDrawInfo bdi;
4066 bdi.state = kThemeMenuBarNormal;
4069 HIThemeDrawMenuBarBackground(&hirect, &bdi, cg,
4070 kHIThemeOrientationNormal);
4075 HIThemeTrackDrawInfo tdi;
4078 bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
4079 bool vertical =
false;
4080 bool inverted =
false;
4083 inverted = pb2->invertedAppearance;
4091 tdi.kind = !isIndeterminate ? kThemeLargeProgressBar
4092 : kThemeLargeIndeterminateBar;
4096 tdi.kind = !isIndeterminate ? kThemeProgressBar : kThemeIndeterminateBar;
4100 tdi.max = pb->maximum;
4101 tdi.min = pb->minimum;
4102 tdi.value = pb->progress;
4103 tdi.attributes = vertical ? 0 : kThemeTrackHorizontal;
4106 tdi.enableState = kThemeTrackInactive;
4108 tdi.enableState = kThemeTrackDisabled;
4110 tdi.enableState = kThemeTrackActive;
4111 HIThemeOrientation drawOrientation = kHIThemeOrientationNormal;
4114 drawOrientation = kHIThemeOrientationInverted;
4116 CGContextSaveGState(cg);
4117 CGContextTranslateCTM(cg, pb->rect.width(), 0);
4118 CGContextScaleCTM(cg, -1, 1);
4121 HIThemeDrawTrack(&tdi, 0, cg, drawOrientation);
4122 if (reverse && !vertical)
4123 CGContextRestoreGState(cg);
4131 HIThemeGrowBoxDrawInfo gdi;
4134 gdi.kind = kHIThemeGrowBoxKindNormal;
4135 gdi.direction = kThemeGrowRight | kThemeGrowDown;
4136 gdi.size = kHIThemeGrowBoxSizeNormal;
4137 HIPoint pt = CGPointMake(opt->
rect.
x(), opt->
rect.
y());
4138 HIThemeDrawGrowBox(&pt, &gdi, cg, kHIThemeOrientationNormal);
4143 QPen lineColor = metal ?
QColor(236, 236, 236) : QColor(82, 82, 82, 192);
4144 QPen metalHighlight = QColor(5, 5, 5, 192);
4150 const int NumLines = metal ? 4 : 3;
4151 for (
int l = 0;
l < NumLines; ++
l) {
4152 const int offset = (
l * 4 + (metal ? 2 : 3));
4163 p->
setPen(metalHighlight);
4175 HIThemeSplitterDrawInfo sdi;
4179 : kHIThemeSplitterAdornmentNone;
4181 HIThemeDrawPaneSplitter(&hirect, &sdi, cg, kHIThemeOrientationNormal);
4186 if (!rubber->opaque) {
4189 strokeColor.
setHsvF(0, 0, 0.86, 1.0);
4190 fillColor.setHsvF(0, 0, 0.53, 0.25);
4196 QPen pen(strokeColor);
4212 if (mainWindow->unifiedTitleAndToolBarOnMac())
4254 rect->
adjust(-right, top, -left, bottom);
4256 rect->
adjust(left, top, right, bottom);
4273 rect.
adjust(-fw, 0, 0, 0);
4280 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
4284 HIThemeButtonDrawInfo bdi;
4291 if (qstyleoption_cast<const QStyleOptionHeader *>(opt)) {
4293 if (widget && widget->
height() <= 22){
4308 HIRect inRect = CGRectMake(opt->
rect.
x(), opt->
rect.
y(),
4310 HIThemeButtonDrawInfo bdi;
4312 bdi.state = kThemeStateActive;
4313 bdi.kind = kThemeDisclosureButton;
4314 bdi.value = kThemeDisclosureRight;
4315 bdi.adornment = kThemeAdornmentNone;
4317 HIThemeGetButtonContentBounds(&inRect, &bdi, &contentRect);
4320 HIThemeGetButtonShape(&inRect, &bdi, &shape);
4324 int(outRect.size.height));
4329 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
4330 switch (twf->shape) {
4333 rect =
QRect(
QPoint(0, 0), twf->leftCornerWidgetSize);
4337 rect =
QRect(
QPoint(0, twf->rect.height() - twf->leftCornerWidgetSize.height()),
4338 twf->leftCornerWidgetSize);
4343 rect =
visualRect(twf->direction, twf->rect, rect);
4348 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
4349 switch (twf->shape) {
4352 rect =
QRect(
QPoint(twf->rect.width() - twf->rightCornerWidgetSize.width(), 0),
4353 twf->rightCornerWidgetSize);
4357 rect =
QRect(
QPoint(twf->rect.width() - twf->rightCornerWidgetSize.width(),
4358 twf->rect.height() - twf->rightCornerWidgetSize.height()),
4359 twf->rightCornerWidgetSize);
4364 rect =
visualRect(twf->direction, twf->rect, rect);
4370 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
4371 if (twf->lineWidth != 0) {
4373 case kThemeTabNorth:
4374 rect.
adjust(+1, +14, -1, -1);
4376 case kThemeTabSouth:
4377 rect.
adjust(+1, +1, -1, -14);
4380 rect.
adjust(+14, +1, -1, -1);
4383 rect.
adjust(+1, +1, -14, -1);
4391 rect.
adjust(-1, -2, 0, 0);
4393 rect.
adjust(-1, -1, 0, +1);
4406 if (widget && qobject_cast<QToolBar *>(widget->
parentWidget())) {
4414 rect.
adjust(+3, +2, -3, -4);
4428 int bottom =
SIZE(3, 8, 8);
4430 rect.
adjust(0, +1, 0, -bottom);
4438 = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
4444 rect.
adjust(+6, +4, -6, -8);
4446 rect.
adjust(+5, +4, -5, -6);
4448 rect.
adjust(+1, 0, -1, -2);
4457 rect.
adjust(0, +6, 0 , -5);
4459 rect.
adjust(0, +6, 0 , -7);
4464 = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
4467 int above =
SIZE(3, 0, 2);
4468 int below =
SIZE(4, 3, 0);
4470 rect.
adjust(0, +above, 0, -below);
4472 rect.
adjust(+above, 0, -below, 0);
4475 int below =
SIZE(3, 2, 0);
4482 int above =
SIZE(3, 2, 0);
4493 if (
const QFrame *frame = qobject_cast<const QFrame *>(widget)) {
4497 rect.
adjust(0, +1, 0, -1);
4500 rect.
adjust(+1, 0, -1, 0);
4510 qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
4520 delta =
SIZE(8, 4, 4);
4522 delta =
SIZE(15, 12, 12);
4531 qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
4537 rect = tabWidgetOpt->rect;
4542 #ifndef QT_NO_DOCKWIDGET 4553 bool canClose = dwOpt == 0 ? true : dwOpt->
closable;
4554 bool canFloat = dwOpt == 0 ? false : dwOpt->
floatable;
4561 if (verticalTitleBar) {
4575 sz +=
QSize(buttonMargin, buttonMargin);
4576 if (verticalTitleBar)
4578 closeRect =
QRect(left,
4581 left = closeRect.
right() + 1;
4592 sz +=
QSize(buttonMargin, buttonMargin);
4593 if (verticalTitleBar)
4595 floatRect =
QRect(left,
4598 left = floatRect.
right() + 1;
4606 if (
const QDockWidget *dw = qobject_cast<const QDockWidget*>(widget)) {
4608 if (dw->isFloating())
4609 icon = dw->windowIcon();
4613 if (verticalTitleBar)
4617 right = iconRect.
left() - 1;
4633 if (verticalTitleBar) {
4653 HIThemePopupArrowDrawInfo padi;
4656 padi.orientation = kThemeArrowDown;
4657 padi.size = kThemeArrow7pt;
4659 HIThemeDrawPopupArrow(&hirect, &padi, cg, kHIThemeOrientationNormal);
4670 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
4671 HIThemeTrackDrawInfo tdi;
4676 tdi.trackInfo.slider.pressState = kThemeThumbPressed;
4678 tdi.trackInfo.slider.pressState = kThemeLeftTrackPressed;
4693 if ((reverseHorizontal
4695 || (!reverseHorizontal
4697 tdi.trackInfo.scrollbar.pressState = kThemeRightInsideArrowPressed
4698 | kThemeLeftOutsideArrowPressed;
4700 tdi.trackInfo.scrollbar.pressState = kThemeLeftInsideArrowPressed
4701 | kThemeRightOutsideArrowPressed;
4704 tdi.trackInfo.scrollbar.pressState = kThemeRightTrackPressed;
4706 tdi.trackInfo.scrollbar.pressState = kThemeLeftTrackPressed;
4708 tdi.trackInfo.scrollbar.pressState = kThemeThumbPressed;
4713 bool tracking = slider->sliderPosition == slider->sliderValue;
4717 HIThemeGetTrackThumbShape(&tdi, &shape);
4719 tdi.value = slider->sliderValue;
4727 const int scrollBarLength = (slider->orientation ==
Qt::Horizontal)
4728 ? slider->rect.width() : slider->rect.height();
4731 tdi.attributes &= ~kThemeTrackShowThumb;
4733 tdi.enableState = kThemeTrackNothingToScroll;
4736 tdi.attributes &= ~kThemeTrackShowThumb;
4737 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 4739 tdi.attributes |= kThemeTrackHideTrack;
4743 HIThemeDrawTrack(&tdi, tracking ? 0 : &macRect, cg,
4744 kHIThemeOrientationNormal);
4747 if (tdi.enableState == kThemeTrackInactive)
4748 tdi.enableState = kThemeTrackActive;
4750 int interval = slider->tickInterval;
4751 if (interval == 0) {
4752 interval = slider->pageStep;
4754 interval = slider->singleStep;
4758 int numMarks = 1 + ((slider->maximum - slider->minimum) / interval);
4760 if (tdi.trackInfo.slider.thumbDir == kThemeThumbPlain) {
4762 tdi.trackInfo.slider.thumbDir = kThemeThumbDownward;
4763 HIThemeDrawTrackTickMarks(&tdi, numMarks,
4765 kHIThemeOrientationNormal);
4766 tdi.trackInfo.slider.thumbDir = kThemeThumbUpward;
4767 HIThemeDrawTrackTickMarks(&tdi, numMarks,
4769 kHIThemeOrientationNormal);
4771 HIThemeDrawTrackTickMarks(&tdi, numMarks,
4773 kHIThemeOrientationNormal);
4784 int y = lv->rect.y();
4785 int h = lv->rect.height();
4786 int x = lv->rect.right() - 10;
4787 for (
int i = 1; i < lv->items.size() && y < h; ++i) {
4796 treeOpt.
palette = lv->palette;
4797 treeOpt.
state = lv->state;
4809 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
4813 GetThemeMetric(kThemeMetricEditTextFrameOutset, &frame_size);
4816 lineeditRect.
adjust(-frame_size, -frame_size, +frame_size, +frame_size);
4818 HIThemeFrameDrawInfo fdi;
4821 fdi.kind = kHIThemeFrameTextFieldSquare;
4822 fdi.isFocused =
false;
4824 HIThemeDrawFrame(&hirect, &fdi, cg, kHIThemeOrientationNormal);
4827 HIThemeButtonDrawInfo bdi;
4833 bdi.kind = kThemeIncDecButton;
4836 bdi.kind = kThemeIncDecButtonMini;
4839 bdi.kind = kThemeIncDecButtonSmall;
4844 tds = kThemeStateUnavailable;
4847 tds = kThemeStatePressedDown;
4850 tds = kThemeStatePressedUp;
4854 && tds == kThemeStateInactive)
4855 bdi.state = kThemeStateActive;
4856 bdi.value = kThemeButtonOff;
4857 bdi.adornment = kThemeAdornmentNone;
4865 HIThemeGetButtonBackgroundBounds(&newRect, &bdi, &outRect);
4866 off_rct.
setRect(
int(newRect.origin.x - outRect.origin.x),
4867 int(newRect.origin.y - outRect.origin.y),
4868 int(outRect.size.width - newRect.size.width),
4869 int(outRect.size.height - newRect.size.height));
4872 HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0);
4878 HIThemeButtonDrawInfo bdi;
4880 bool drawColorless = combo->palette.currentColorGroup() ==
QPalette::Active && tds == kThemeStateInactive;
4889 = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
4892 tds = kThemeStateActive;
4894 tds = kThemeStateInactive;
4896 tds = kThemeStateInactive;
4899 HIThemeWindowDrawInfo wdi;
4903 wdi.titleHeight = titlebar->rect.height();
4904 wdi.titleWidth = titlebar->rect.width();
4905 wdi.attributes = kThemeWindowHasTitleText;
4909 wdi.attributes |= kThemeWindowHasCloseBox | kThemeWindowHasDirty;
4911 HIRect titleBarRect;
4916 HIThemeGetWindowShape(&tmpRect, &wdi, kWindowTitleBarRgn, &titleRegion);
4918 newr.
translate(newr.
x() - int(tmpRect.origin.x), newr.
y() - int(tmpRect.origin.y));
4921 HIThemeDrawWindowFrame(&titleBarRect, &wdi, cg, kHIThemeOrientationNormal, 0);
4926 HIThemeWindowWidgetDrawInfo wwdi;
4928 wwdi.widgetState = tds;
4930 wwdi.widgetState = kThemeStateRollover;
4932 wwdi.attributes = wdi.attributes | kThemeWindowHasFullZoom | kThemeWindowHasCloseBox | kThemeWindowHasCollapseBox;
4933 wwdi.windowState = wdi.state;
4934 wwdi.titleHeight = wdi.titleHeight;
4935 wwdi.titleWidth = wdi.titleWidth;
4936 ThemeDrawState savedControlState = wwdi.widgetState;
4938 ThemeTitleBarWidget tbw = kThemeWidgetCollapseBox;
4942 titleBarRect.origin.x += border;
4943 titleBarRect.origin.y -= border;
4947 if (sc & titlebar->subControls) {
4949 wwdi.widgetState = savedControlState;
4950 wwdi.widgetType = tbw;
4953 if (active && (titlebar->activeSubControls & tmp)
4955 wwdi.widgetState = kThemeStatePressed;
4958 if (!(widget && widget->
isWindowModified() && tbw == kThemeWidgetCloseBox)) {
4959 HIThemeDrawTitleBarWidget(&titleBarRect, &wwdi, cg, kHIThemeOrientationNormal);
4970 if (!titlebar->icon.isNull()) {
4972 HIThemeGetWindowShape(&titleBarRect, &wdi, kWindowTitleProxyIconRgn,
4975 if (tmpRect.size.width != 1) {
4977 iw = titlebar->icon.actualSize(
QSize(iconExtent, iconExtent)).width();
4980 if (!titlebar->text.isEmpty()) {
4983 HIThemeGetWindowShape(&titleBarRect, &wdi, kWindowTitleTextRgn, &titleRegion3);
5005 = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
5012 if (groupBoxCopy.
subControls != groupBox->subControls) {
5015 CGContextSetShouldAntialias(cg,
true);
5016 CGContextSetShouldSmoothFonts(cg,
true);
5017 HIThemeTextInfo tti;
5020 QColor textColor = groupBox->palette.windowText().color();
5024 CGContextSetFillColor(cg, colorComp);
5025 tti.fontID = checkable ? kThemeSystemFont : kThemeSmallSystemFont;
5026 tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
5027 tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
5028 tti.options = kHIThemeTextBoxOptionNone;
5029 tti.truncationPosition = kHIThemeTextTruncationNone;
5030 tti.truncationMaxLines = 1 + groupBox->text.count(
QLatin1Char(
'\n'));
5034 HIThemeDrawTextBox(groupText, &bounds, &tti, cg, kHIThemeOrientationNormal);
5041 = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
5042 if (widget && qobject_cast<QToolBar *>(widget->
parentWidget())) {
5048 arrowOpt.
state = tb->state;
5049 arrowOpt.
palette = tb->palette;
5057 static QPixmap pm(
QLatin1String(
":/trolltech/mac/style/images/leopard-unified-toolbar-on.png"));
5063 p->
fillRect(tb->rect.adjusted(1, 1, -1, -1),
QColor(0, 0, 0, 0x12));
5064 p->
drawLine(tb->rect.left() + 1, tb->rect.top(),
5065 tb->rect.right() - 1, tb->rect.top());
5066 p->
drawLine(tb->rect.left() + 1, tb->rect.bottom(),
5067 tb->rect.right() - 1, tb->rect.bottom());
5068 p->
drawLine(tb->rect.topLeft(), tb->rect.bottomLeft());
5069 p->
drawLine(tb->rect.topRight(), tb->rect.bottomRight());
5075 ThemeButtonKind bkind = kThemeBevelButton;
5079 bkind = kThemeBevelButton;
5083 bkind = kThemeSmallBevelButton;
5087 QRect button, menuarea;
5090 State bflags = tb->state,
5099 HIThemeButtonDrawInfo bdi;
5102 bdi.adornment = kThemeAdornmentNone;
5104 bdi.value = kThemeButtonOff;
5106 bdi.adornment = kThemeAdornmentFocus;
5108 bdi.state = kThemeStatePressed;
5110 bdi.value = kThemeButtonOn;
5112 QRect off_rct(0, 0, 0, 0);
5113 HIRect myRect, macRect;
5114 myRect = CGRectMake(tb->rect.x(), tb->rect.y(),
5115 tb->rect.width(), tb->rect.height());
5116 HIThemeGetButtonBackgroundBounds(&myRect, &bdi, &macRect);
5117 off_rct.
setRect(
int(myRect.origin.x - macRect.origin.x),
5118 int(myRect.origin.y - macRect.origin.y),
5119 int(macRect.size.width - myRect.size.width),
5120 int(macRect.size.height - myRect.size.height));
5123 HIThemeDrawButton(&myRect, &bdi, cg, kHIThemeOrientationNormal, 0);
5128 HIThemeButtonDrawInfo bdi;
5131 bdi.value = kThemeButtonOff;
5132 bdi.adornment = kThemeAdornmentNone;
5135 bdi.adornment = kThemeAdornmentFocus;
5138 bdi.state = kThemeStatePressed;
5140 HIThemeDrawButton(&hirect, &bdi, cg, kHIThemeOrientationNormal, 0);
5141 QRect r(menuarea.
x() + ((menuarea.
width() / 2) - 3), menuarea.
height() - 8, 8, 8);
5142 HIThemePopupArrowDrawInfo padi;
5145 padi.orientation = kThemeArrowDown;
5146 padi.size = kThemeArrow7pt;
5148 HIThemeDrawPopupArrow(&hirect, &padi, cg, kHIThemeOrientationNormal);
5161 if (
const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(opt))
5184 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
5185 HIThemeTrackDrawInfo tdi;
5187 ControlPartCode part;
5188 HIPoint pos = CGPointMake(pt.
x(), pt.
y());
5189 if (HIThemeHitTestTrack(&tdi, &pos, &part)) {
5190 if (part == kControlPageUpPart || part == kControlPageDownPart)
5198 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
5199 HIScrollBarTrackInfo sbi;
5202 sbi.enableState = kThemeTrackInactive;
5204 sbi.enableState = kThemeTrackActive;
5206 sbi.enableState = kThemeTrackDisabled;
5211 ? sb->rect.width() : sb->rect.height();
5213 sbi.enableState = kThemeTrackNothingToScroll;
5215 sbi.viewsize = sb->pageStep;
5216 HIPoint pos = CGPointMake(pt.
x(), pt.
y());
5219 ControlPartCode part;
5222 && (!sb->upsideDown ||
5224 && sb->upsideDown)));
5225 if (HIThemeHitTestScrollBarArrows(&macSBRect, &sbi, sb->orientation ==
Qt::Horizontal,
5227 if (part == kControlUpButtonPart)
5229 else if (part == kControlDownButtonPart)
5232 HIThemeTrackDrawInfo tdi;
5234 if(tdi.enableState == kThemeTrackInactive)
5235 tdi.enableState = kThemeTrackActive;
5236 if (HIThemeHitTestTrack(&tdi, &pos, &part)) {
5237 if (part == kControlPageUpPart)
5240 else if (part == kControlPageDownPart)
5307 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
5308 HIThemeTrackDrawInfo tdi;
5315 HIThemeGetTrackThumbShape(&tdi, &shape);
5318 HIThemeGetTrackBounds(&tdi, &macRect);
5320 HIThemeGetTrackDragRect(&tdi, &macRect);
5322 ControlPartCode cpc;
5325 : kControlPageUpPart;
5328 : kControlDownButtonPart;
5331 if (cpc == kControlDownButtonPart)
5332 cpc = kControlUpButtonPart;
5333 else if (cpc == kControlUpButtonPart)
5334 cpc = kControlDownButtonPart;
5337 HIThemeGetTrackPartBounds(&tdi, cpc, &macRect);
5356 = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
5357 HIThemeWindowDrawInfo wdi;
5358 memset(&wdi, 0,
sizeof(wdi));
5360 wdi.state = kThemeStateActive;
5362 wdi.titleHeight = titlebar->rect.height();
5363 wdi.titleWidth = titlebar->rect.width();
5364 wdi.attributes = kThemeWindowHasTitleText;
5366 wdi.attributes |= kThemeWindowHasCloseBox;
5369 wdi.attributes |= kThemeWindowHasFullZoom;
5371 wdi.attributes |= kThemeWindowHasCollapseBox;
5372 WindowRegionCode wrc = kWindowGlobalPortRgn;
5375 wrc = kWindowCloseBoxRgn;
5377 wrc = kWindowCollapseBoxRgn;
5379 wrc = kWindowZoomBoxRgn;
5381 wrc = kWindowTitleTextRgn;
5385 if (wrc != kWindowGlobalPortRgn) {
5387 QRect tmpRect = titlebar->rect;
5389 HIThemeGetWindowShape(&titleRect, &wdi, kWindowTitleBarRgn, ®ion);
5392 tmpRect.
translate(tmpRect.
x() - int(titleRect.origin.x),
5393 tmpRect.
y() - int(titleRect.origin.y));
5395 HIThemeGetWindowShape(&titleRect, &wdi, wrc, ®ion);
5402 if (
const QStyleOptionComboBox *combo = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
5403 HIThemeButtonDrawInfo bdi;
5411 if (qobject_cast<const QDateTimeEdit *>(widget)) {
5422 if (combo->editable) {
5425 const int comboTop = combo->rect.top();
5428 qRound(inner.origin.x - combo->rect.left() + inner.size.width),
5429 editRect.
bottom() - comboTop + 2);
5432 ret =
QRect(combo->rect.x() + 4 - 11,
5433 combo->rect.y() + 1,
5434 editRect.
width() + 10 + 11,
5444 if (
const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
5447 bool hasNoText = !checkable && groupBox->text.isEmpty();
5457 int margin = flat || hasNoText ? 0 : 12;
5458 ret = groupBox->rect.
adjusted(margin, 0, -margin, 0);
5461 HIThemeTextInfo tti;
5463 tti.state = kThemeStateActive;
5464 tti.fontID = checkable ? kThemeSystemFont : kThemeSmallSystemFont;
5465 tti.horizontalFlushness = kHIThemeTextHorizontalFlushCenter;
5466 tti.verticalFlushness = kHIThemeTextVerticalFlushCenter;
5467 tti.options = kHIThemeTextBoxOptionNone;
5468 tti.truncationPosition = kHIThemeTextTruncationNone;
5469 tti.truncationMaxLines = 1 + groupBox->text.count(
QLatin1Char(
'\n'));
5473 HIThemeGetTextDimensions(groupText, 0, &tti, &width, &height, 0);
5483 QRect labelRect =
alignedRect(groupBox->direction, groupBox->textAlignment,
5489 int newSum = indicatorWidth + 1;
5490 int newLeft = labelRect.
left() + (rtl ? -newSum : newSum);
5493 int newLeft = labelRect.
left() - (rtl ? 3 : -3);
5497 int newLeft = labelRect.
left() - (rtl ? 3 : 2);
5505 int left = rtl ? labelRect.
right() - indicatorWidth : labelRect.
left();
5531 ret.
adjust(3, 3, -3, -4);
5541 if (
const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
5570 const int x = spin->rect.width() - spinner_w;
5571 ret.
setRect(x + spin->rect.x(), y + spin->rect.y(), spinner_w, spin->rect.height() - y * 2);
5572 HIThemeButtonDrawInfo bdi;
5574 bdi.kind = kThemeIncDecButton;
5580 bdi.kind = kThemeIncDecButton;
5584 bdi.kind = kThemeIncDecButtonSmall;
5585 hackTranslateX = -2;
5588 bdi.kind = kThemeIncDecButtonMini;
5589 hackTranslateX = -1;
5592 bdi.state = kThemeStateActive;
5593 bdi.value = kThemeButtonOff;
5594 bdi.adornment = kThemeAdornmentNone;
5598 HIThemeGetButtonBackgroundBounds(&hirect, &bdi, &outRect);
5612 ret =
visualRect(spin->direction, spin->rect, ret);
5618 spin->rect.width() - fw * 2,
5619 spin->rect.height() - fw * 2);
5622 spin->rect.width() - fw * 2 - spinBoxSep - spinner_w,
5623 spin->rect.height() - fw * 2);
5625 ret =
visualRect(spin->direction, spin->rect, ret);
5650 bool useAquaGuideline =
true;
5694 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) {
5697 const int gapBetweenTabbarAndStackWidget = 2 + 14 - overlap;
5700 extra =
QSize(2, gapBetweenTabbarAndStackWidget + 1);
5702 extra =
QSize(gapBetweenTabbarAndStackWidget + 1, 2);
5709 if (
const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) {
5714 bool vertTabs = ttd == kThemeTabWest || ttd == kThemeTabEast;
5717 int defaultTabHeight;
5723 if (tab->documentMode)
5724 defaultTabHeight = 23;
5726 defaultTabHeight = 21;
5729 defaultTabHeight = 18;
5732 defaultTabHeight = 16;
5735 bool setWidth =
false;
5736 if (differentFont || !tab->icon.isNull()) {
5741 sz.
rwidth() = textSize.
width() + defaultExtraSpace;
5748 int maxWidgetHeight =
qMax(tab->leftButtonSize.height(), tab->rightButtonSize.height());
5749 int maxWidgetWidth =
qMax(tab->leftButtonSize.width(), tab->rightButtonSize.width());
5751 int widgetWidth = 0;
5752 int widgetHeight = 0;
5754 if (tab->leftButtonSize.isValid()) {
5756 widgetWidth += tab->leftButtonSize.width();
5757 widgetHeight += tab->leftButtonSize.height();
5759 if (tab->rightButtonSize.isValid()) {
5761 widgetWidth += tab->rightButtonSize.width();
5762 widgetHeight += tab->rightButtonSize.height();
5784 int maxpmw = mi->maxIconWidth;
5791 GetThemeMenuSeparatorHeight(&ash);
5794 h = mi->fontMetrics.height() + 2;
5795 if (!mi->icon.isNull()) {
5799 maxpmw =
qMax(maxpmw, iconSize.
width());
5802 h =
qMax(h, mi->icon.actualSize(
QSize(iconExtent, iconExtent)).height() + 4);
5814 if (comboBox && comboBox->
isVisible()) {
5830 if (widget && qobject_cast<const QToolBar *>(widget->
parentWidget())) {
5832 if (mainWindow->unifiedTitleAndToolBarOnMac()) {
5860 useAquaGuideline =
false;
5864 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
5883 if (useAquaGuideline){
5886 if (macsz.
width() != -1)
5888 if (macsz.
height() != -1)
5898 switch (widgetSize) {
5901 bkind = combo->editable ? kThemeComboBox : kThemePopupButton;
5904 bkind = combo->editable ? int(kThemeComboBoxSmall) : int(kThemePopupButtonSmall);
5907 bkind = combo->editable ? kThemeComboBoxMini : kThemePopupButtonMini;
5910 HIRect tmpRect = {{0, 0}, {0, 0}};
5915 ThemeButtonKind bkind;
5920 if (
const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
5926 switch (widgetSize) {
5929 bkind = kThemePushButton;
5932 bkind = kThemePushButtonSmall;
5935 bkind = kThemePushButtonMini;
5940 switch (widgetSize) {
5943 bkind = kThemeLargeBevelButton;
5947 bkind = kThemeSmallBevelButton;
5952 HIThemeButtonDrawInfo bdi;
5954 bdi.state = kThemeStateActive;
5956 bdi.value = kThemeButtonOff;
5957 bdi.adornment = kThemeAdornmentNone;
5958 HIRect macRect, myRect;
5959 myRect = CGRectMake(0, 0, sz.
width(), sz.
height());
5960 HIThemeGetButtonBackgroundBounds(&myRect, &bdi, &macRect);
5962 if (bkind == kThemePushButtonMini)
5963 macRect.size.height += 8.;
5964 else if (bkind == kThemePushButtonSmall)
5965 macRect.size.height -= 10;
5966 sz.
setWidth(sz.
width() + int(macRect.size.width - myRect.size.width));
5967 sz.
setHeight(sz.
height() + int(macRect.size.height - myRect.size.height));
5985 #ifndef QT_NO_GRAPHICSVIEW 5986 if (
QGraphicsView *graphicsView = qobject_cast<QGraphicsView *>(focusWidget)) {
6000 #ifndef QT_NO_MAINWINDOW 6001 if (qobject_cast<QMainWindow *>(top)) {
6004 if (par == central) {
6008 if (par->isWindow())
6031 switch (standardIcon) {
6080 if ((control1 | control2) & ButtonMask) {
6092 switch (
CT2(control1, control2)) {
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
static int qt_mac_hitheme_tab_version()
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QPainter class performs low-level painting on widgets and other paint devices.
const int qt_mac_hitheme_version
QPaintDevice * device() const
Returns the paint device on which this painter is currently painting, or 0 if the painter is not acti...
The QColor class provides colors based on RGB, HSV or CMYK values.
static QRect alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rectangle)
Returns a new rectangle of the specified size that is aligned to the given rectangle according to the...
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget=0) const
QPixmap generateBackgroundPattern() 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
HIRect *(* PtrHIShapeGetBounds)(HIShapeRef, HIRect *)
void unpolish(QApplication *)
Reimplemented Function
bool addWidget(QWidget *)
QImage toImage() const
Converts the pixmap to a QImage.
QString qt_mac_removeMnemonics(const QString &original)
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
The QApplication class manages the GUI application's control flow and main settings.
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const
Reimplemented Function
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.
static CGColorSpaceRef macGenericColorSpace()
void unpolish(QWidget *w)
Reimplemented Function
int width(const QString &, int len=-1) const
Returns the width in pixels of the first len characters of text.
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
Reimplemented Function
void drawTabCloseButton(QPainter *p, bool hover, bool active, bool selected)
bool qt_mac_is_metal(const QWidget *w)
qreal alphaF() const
Returns the alpha color component of this color.
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling...
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 ...
TabPosition
This enum describes the position of the tab.
void setHeight(int h)
Sets the height of the rectangle to the given height.
const QBrush & base() const
Returns the base brush of the current color group.
SubControl
This enum describes the available sub controls.
StyleHint
This enum describes the available style hints.
void drawArc(const QRectF &rect, int a, int alen)
Draws the arc defined by the given rectangle, startAngle and spanAngle.
The QStyleHintReturn class provides style hints that return more than basic data types.
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect)
void startAnimate(Animates, QWidget *)
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static QPixmap darkenPixmap(const QPixmap &pixmap)
The QFontMetrics class provides font metrics information.
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
void drawTabShape(QPainter *p, const QStyleOptionTabV3 *tabOpt)
int width() const
Returns the width of the pixmap.
QPointer< QWidget > widget
QSize size() const
Returns the size of the pixmap.
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
void syncState()
Updates all dirty states in this engine.
const QChar at(int i) const
Returns the character at the given index position in the string.
const QBrush & dark() const
Returns the dark brush of the current color group.
void moveLeft(int pos)
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate...
virtual void drawItemText(QPainter *p, const QRect &r, 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.
static int closeButtonSize
qreal greenF() const
Returns the green color component of this color.
The QMatrix class specifies 2D transformations of a coordinate system.
QStyle::State state
the style flags that are used when drawing the control
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
QAquaWidgetSize aquaSizeConstrain(const QStyleOption *option, const QWidget *widg, QStyle::ContentsType ct=QStyle::CT_CustomBase, QSize szHint=QSize(-1, -1), QSize *insz=0) const
bool qt_scrollbar_jump_to_pos
static const QColor mainWindowGradientEnd(200, 200, 200)
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 setCapStyle(Qt::PenCapStyle pcs)
Sets the pen's cap style to the given style.
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.
int pixelMetric(PixelMetric pm, const QStyleOption *opt=0, const QWidget *widget=0) const
Reimplemented Function
qreal width() const
Returns the width.
ComplexControl
This enum describes the available complex controls.
The QStyleOptionQ3ListView class is used to describe the parameters for drawing a Q3ListView...
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const
Reimplemented Function
SelectedPosition
This enum describes the position of the selected tab.
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...
int length() const
Returns the number of characters in this string.
void setCapStyle(Qt::PenCapStyle style)
Sets the cap style of the generated outlines to style.
static bool verticalTabs(QTabBar::Shape shape)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
static void drawTableHeader(const HIRect &outerBounds, bool drawTopBorder, bool drawLeftBorder, const HIThemeButtonDrawInfo &bdi, QPainter *p)
The QStyleOptionTitleBar class is used to describe the parameters for drawing a title bar...
void restore()
Restores the current painter state (pops a saved state off the stack).
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
static const int PushButtonBottomOffset
State
This enum describes the state for which a pixmap is intended to be used.
PixelMetric
This enum describes the various available pixel metrics.
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.
static const int MiniButtonH
QColor color() const
Returns the color of this pen's brush.
static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg, QSize szHint, QAquaWidgetSize sz)
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=0) const
Reimplemented Function
static const QColor titlebarGradientInactiveEnd(207, 207, 207)
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.
QSize iconSize
the size of the icons shown in the combobox.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static const QColor titlebarSeparatorLineInactive(131, 131, 131)
int bytesPerLine() const
Returns the number of bytes per image scanline.
QSlider::TickPosition tickPosition
the position of the slider's tick marks, if any
QSizeF size(int flags, const QString &str, int tabstops=0, int *tabarray=0) const
Returns the size in pixels of the characters in the given text.
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
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
Reimplemented Function
static QPalette palette()
Returns the application palette.
QRect boundingRect() const
Returns the bounding rectangle of this region.
void setWidget(QWidget *widget)
QFocusFrame will track changes to widget and resize itself automatically.
The QTabBar class provides a tab bar, e.g.
QStyle::SubControls activeSubControls
This variable holds a bitwise OR of the sub-controls that are active for the complex control...
const struct __HIShape * HIShapeRef
bool editable
whether or not the combobox is editable or not
static const QColor titlebarGradientInactiveBegin(241, 241, 241)
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
void drawLine(const QLineF &line)
Draws a line defined by line.
The QProgressBar widget provides a horizontal or vertical progress bar.
void qt_mac_dispose_rgn(RgnHandle r)
int height() const
Returns the height of the rectangle.
void removeWidget(QWidget *)
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.
QFontMetrics fontMetrics
the font metrics that should be used when drawing text in the control
static const QRect qt_qrectForHIRect(const HIRect &hirect)
TickPosition tickPosition
the tickmark position for this slider
QPalette standardPalette() const
Returns the style's standard palette.
void setHeight(int h)
Sets the height to the given height.
T * qobject_cast(QObject *object)
struct QMacStylePrivate::ButtonState buttonState
static const QColor titlebarGradientActiveBegin(220, 220, 220)
The QObject class is the base class of all Qt objects.
const ThemeWindowType QtWinType
static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSize small, QSize mini)
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...
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.
QRgb pixel(int x, int y) const
Returns the color of the pixel at coordinates (x, y).
The QChar class provides a 16-bit Unicode character.
QTabBar::Shape shape
the tab shape used to draw the tab; by default QTabBar::RoundedNorth
#define SIZE(large, small, mini)
static const int PushButtonLeftOffset
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
const T value(const Key &key) const
Returns the value associated with the key.
static PtrHIShapeGetBounds ptrHIShapeGetBounds
#define return_SIZE(large, small, mini)
void save()
Saves the current painter state (pushes the state onto a stack).
static const int DisclosureOffset
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QString elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags=0) const
If the string text is wider than width, returns an elided version of the string (i.
StandardPixmap
This enum describes the available standard pixmaps.
static QPixmap * find(const QString &key)
void getHsv(int *h, int *s, int *v, int *a=0) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Q_GUI_EXPORT_INLINE int qRed(QRgb rgb)
void setHsv(int h, int s, int v, int a=255)
Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha componen...
OSWindowRef qt_mac_window_for(const QWidget *)
ColorGroup currentColorGroup() const
Returns the palette's current color group.
The QLineF class provides a two-dimensional vector using floating point precision.
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
void setWidth(int w)
Sets the width to the given width.
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt=0, const QWidget *widget=0) const
int ascent() const
Returns the ascent of the font.
void setDashPattern(Qt::PenStyle)
Sets the dash pattern for the generated outlines to style.
QRect boundingRect(QChar) const
Returns the rectangle that is covered by ink if character ch were to be drawn at the origin of the co...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
Q_CORE_EXPORT void qDebug(const char *,...)
CFAbsoluteTime defaultButtonStart
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.
bool upsideDown
the slider control orientation
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.
static QIcon windowIcon()
QRegion clipRegion() const
Returns the currently set clip region.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
void append(const T &t)
Inserts value at the end of the list.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
void setHsvF(qreal h, qreal s, qreal v, qreal a=1.0)
Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha componen...
const QPen & pen() const
Returns the painter's current pen.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
QFontMetrics fontMetrics() const
Returns the font metrics for the painter if the painter is active.
void setBrush(ColorRole cr, const QBrush &brush)
Sets the brush for the given color role to the specified brush for all groups in the palette...
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
void polish(QWidget *w)
Reimplemented Function
void drawDial(const QStyleOptionSlider *option, QPainter *painter)
int totalHeight
the total height of the item, including its children
The QRectF class defines a rectangle in the plane using floating point precision. ...
Shape
This enum type lists the built-in shapes supported by QTabBar.
virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
Returns the area within the given rectangle in which to draw the provided text according to the speci...
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.
QPainterPath createStroke(const QPainterPath &path) const
Generates a new path that is a fillable area representing the outline of the given path...
QGraphicsItem * focusItem() const
When the scene is active, this functions returns the scene's current focus item, or 0 if no item curr...
QPoint bottomRight() const
Returns the position of the rectangle's bottom-right corner.
QMatrix & rotate(qreal a)
Rotates the coordinate system the given degrees counterclockwise.
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
const QBrush & light() const
Returns the light brush of the current color group.
void drawLines(const QLineF *lines, int lineCount)
Draws the first lineCount lines in the array lines using the current pen.
void fillPath(const QPainterPath &path, const QBrush &brush)
Fills the given path using the given brush.
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
static const QColor titlebarGradientActiveEnd(151, 151, 151)
QSize size(int flags, const QString &str, int tabstops=0, int *tabarray=0) const
Returns the size in pixels of text.
virtual QPalette standardPalette() const
Returns the style's standard palette.
The QStyleOption class stores the parameters used by QStyle functions.
int size() const
Returns the number of characters in this string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static void setFocusRectPolicy(QWidget *w, FocusRectPolicy policy)
ContentsType
This enum describes the available contents types.
The QTreeView class provides a default model/view implementation of a tree view.
void initFrom(const QWidget *w)
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.
static ThemeTabDirection getTabDirection(QTabBar::Shape shape)
const QFont & font() const
Returns the currently set font used for drawing text.
static const QColor mainWindowGradientBegin(240, 240, 240)
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
QSize size() const
Returns the size of the rectangle.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
const T & at(int i) const
Returns the item at index position i in the list.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
The QComboBox widget is a combined button and popup list.
virtual int type() const
Returns the type of an item as an int.
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...
qreal height() const
Returns the height of the font.
Q3ListViewItemFeatures features
the features for this item
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
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.
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static int qt_mac_aqua_get_metric(ThemeMetric met)
bool macWindowIsTextured(void *window)
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
Qt::Orientation orientation() const
FontHash * qt_app_fonts_hash()
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
QRegion qt_mac_convert_mac_region(RgnHandle)
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
int sliderPosition
the position of the slider handle
The QSlider widget provides a vertical or horizontal slider.
The QRegion class specifies a clip region for a painter.
static const int BevelButtonW
The QPainterPathStroker class is used to generate fillable outlines for a given painter path...
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOptionButton *option)
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
The State element defines configurations of objects and properties.
static const int SmallButtonH
int layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=0, const QWidget *widget=0) const
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
static void drawCombobox(const HIRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p)
bool isNull() const
Returns true if this byte array is null; otherwise returns false.
The QStyleOptionRubberBand class is used to describe the parameters needed for drawing a rubber band...
Q_GUI_EXPORT_INLINE int qBlue(QRgb rgb)
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
struct OpaqueRgnHandle * RgnHandle
The QFontInfo class provides general information about fonts.
The QTableView class provides a default model/view implementation of a table view.
void setX(int x)
Sets the left edge of the rectangle to the given x coordinate.
FrameFeatures features
a bitwise OR of the features that describe this frame.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
void qSwap(T &value1, T &value2)
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
const T & at(int i) const
Returns the item at index position i in the vector.
QSize rightButtonSize
the size for the right widget on the tab.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
int styleHint(StyleHint hint, const QStyleOption *opt=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
bool documentMode
whether the tabbar is in document mode.
static HIRect qt_hirectForQRect(const QRect &convertRect, const QRect &rect=QRect())
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.
The QStyleOptionTabBarBaseV2 class is used to describe the base of a tab bar, i.e.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool contentFitsInPushButton(const QStyleOptionButton *btn, HIThemeButtonDrawInfo *bdi, ThemeButtonKind buttonKindToCheck) const
QPalette palette
the palette that should be used when painting the control
void setRenderHints(RenderHints hints, bool on=true)
Sets the given render hints on the painter if on is true; otherwise clears the render hints...
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.
void getSliderInfo(QStyle::ComplexControl cc, const QStyleOptionSlider *slider, HIThemeTrackDrawInfo *tdi, const QWidget *needToRemoveMe)
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
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...
bool animatable(Animates, const QWidget *) const
virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
Draws the given pixmap in the specified rectangle, according to the specified alignment, using the provided painter.
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
const QBrush & windowText() const
Returns the window text (general foreground) brush of the current color group.
QString text
the text of the tab
uchar * bits()
Returns a pointer to the first pixel data.
SelectedPosition selectedPosition
the position of the selected tab in relation to this tab
void setPixel(int x, int y, uint index_or_rgb)
Sets the pixel index or color at (x, y) to index_or_rgb.
The QStyleHintReturnMask class provides style hints that return a QRegion.
QPaintDevice * qt_mac_safe_pdev
int top() const
Returns the y-coordinate of the rectangle's top edge.
int width() const
Returns the width of the image.
int maximum
the maximum value for the slider
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction...
static const int PushButtonTopOffset
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
QSize pushButtonSizeFromContents(const QStyleOptionButton *btn) const
void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
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.
QPixmap * qt_mac_backgroundPattern
PrimitiveElement
This enum describes the various primitive elements.
void setAlphaF(qreal alpha)
Sets the alpha of this color to alpha.
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...
qint64 cacheKey() const
Returns a number that identifies the contents of this QIcon object.
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
static int getControlSize(const QStyleOption *option, const QWidget *widget)
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
T qstyleoption_cast(const QStyleOption *opt)
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=0) const
Reimplemented Function
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
int minimum
the minimum value for the slider
qreal redF() const
Returns the red color component of this color.
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
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...
static WidgetSizePolicy widgetSizePolicy(const QWidget *w)
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
The QPoint class defines a point in the plane using integer precision.
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
static QRect comboboxEditBounds(const QRect &outerBounds, const HIThemeButtonDrawInfo &bdi)
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
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...
virtual int styleHint(StyleHint sh, const QStyleOption *opt=0, const QWidget *w=0, QStyleHintReturn *shret=0) const
Reimplemented Function
void setMatrix(const QMatrix &matrix, bool combine=false)
Use setWorldTransform() instead.
static FocusRectPolicy focusRectPolicy(const QWidget *w)
The QMainWindow class provides a main application window.
int size() const
Returns the number of items in the list.
void setAlpha(int alpha)
Sets the alpha of this color to alpha.
void stopAnimate(Animates, QWidget *)
static const int BevelButtonH
void startAnimationTimer()
The QStyleOptionGroupBox class describes the parameters for drawing a group box.
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.
int & rheight()
Returns a reference to the height.
void setWidth(int w)
Sets the width of the rectangle to the given width.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
qreal pointSizeF() const
Returns the point size of the matched window system font.
QString objectName() const
The QStyleOptionTabV3 class is used to describe the parameters necessary for drawing a tabs in Qt 4...
int height() const
Returns the height.
Qt::LayoutDirection direction
the text layout direction that should be used when drawing text in the control
void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush)
if(void) toggleToolbarShown
qreal blueF() const
Returns the blue color component of this color.
The QRect class defines a rectangle in the plane using integer precision.
QColor qcolorForTheme(ThemeBrush brush)
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
QTabBar::Shape shape
the shape of the tab bar
static const char *const qt_mac_toolbar_ext[]
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=0) const
Reimplemented Function
static const int PushButtonContentPadding
static ThemeDrawState getDrawState(QStyle::State flags)
QMacStylePrivate(QMacStyle *style)
int height() const
Returns the height of the image.
The QStyleOptionFrameV2 class is used to describe the parameters necessary for drawing a frame in Qt ...
qint64 cacheKey() const
Returns a number that identifies this QPixmap.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
QPointer< QFocusFrame > focusWidget
int y() const
Returns the y coordinate of this point.
void setLoadHints(LoadHints hints)
const QStyle * proxy() const
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
Qt::Orientation orientation
the slider's orientation (horizontal or vertical)
QVariant property(const char *name) const
Returns the value of the object's name property.
The QPixmap class is an off-screen image representation that can be used as a paint device...
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect, int left, int top, int right, int bottom)
Q_GUI_EXPORT_INLINE int qGreen(QRgb rgb)
CGContextRef qt_mac_cg_context(const QPaintDevice *)
Returns the CoreGraphics CGContextRef of the paint device.
#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.
void setPointSizeF(qreal)
Sets the point size to pointSize.
The QFocusFrame widget provides a focus frame which can be outside of a widget's normal paintable are...
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
bool isNull() const
Returns true if both the width and height is 0; otherwise returns false.
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 QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags...
static const int PushButtonRightOffset
ControlElement
This enum represents a control element.
The QStyleOptionSlider class is used to describe the parameters needed for drawing a slider...
int pageStep
the size of the page step of the slider
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
The QFontMetricsF class provides font metrics information.
int pointSize() const
Returns the point size of the font.
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.
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
static void setWidgetSizePolicy(const QWidget *w, WidgetSizePolicy policy)
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...
struct CGContext * CGContextRef
static bool isTreeView(const QWidget *widget)
int animateSpeed(Animates) const
QRegion region
the region for style hints that return a QRegion
QPointer< QPushButton > defaultButton
void initHIThemePushButton(const QStyleOptionButton *btn, const QWidget *widget, const ThemeDrawState tds, HIThemeButtonDrawInfo *bdi) const
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
QList< QPointer< QWidget > > progressBars
The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress...
QSize leftButtonSize
the size for the left widget on the tab.
void initComboboxBdi(const QStyleOptionComboBox *combo, HIThemeButtonDrawInfo *bdi, const QWidget *widget, const ThemeDrawState &tds)
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.
HIRect pushButtonContentBounds(const QStyleOptionButton *btn, const HIThemeButtonDrawInfo *bdi) const
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; 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
static void drawToolbarButtonArrow(const QRect &toolButtonRect, ThemeDrawState tds, CGContextRef cg)
void drawColorlessButton(const HIRect &macRect, HIThemeButtonDrawInfo *bdi, QPainter *p, const QStyleOption *opt) const
static int scrollButtonsCutoffSize(ScrollBarCutoffType cutoffType, QMacStyle::WidgetSizePolicy widgetSize)
static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect *rect, Qt::LayoutDirection dir)
The QEvent class is the base class of all event classes.
The QRubberBand class provides a rectangle or line that can indicate a selection or a boundary...
Type type() const
Returns the event type.
The QFrame class is the base class of widgets that can have a frame.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
ControlType controlType() const
static bool isRightToLeft()
Returns true if the application's layout direction is Qt::RightToLeft; otherwise returns false...
static const QColor titlebarSeparatorLineActive(111, 111, 111)
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static bool isVerticalTabs(const QTabBar::Shape shape)
void drawTabBase(QPainter *p, const QStyleOptionTabBarBaseV2 *tbb, const QWidget *w)
int size() const
Returns the number of items in the vector.
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 HIRect comboboxInnerBounds(const HIRect &outerBounds, int buttonKind)
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.
static QPaintDevice * redirected(const QPaintDevice *device, QPoint *offset=0)
Using QWidget::render() obsoletes the use of this function.
Q_DECL_CONSTEXPR int qRound(qreal d)
bool event(QEvent *e)
This virtual function receives events to an object and should return true if the event e was recogniz...
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
static bool isNull(const QVariant::Private *d)
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
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=0) const
Reimplemented Function
const QBrush & text() const
Returns the text foreground brush of the current color group.
The QLibrary class loads shared libraries at runtime.
SubElement
This enum represents a sub-area of a widget.
The QList class is a template class that provides lists.
void setWidth(int width)
Sets the pen width to the given width in pixels with integer precision.
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 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.