15#include <QtQuickTemplates2/private/qquickcontrol_p.h>
17#define QMAC_QAQUASTYLE_SIZE_CONSTRAIN
20#include <QtCore/qoperatingsystemversion.h>
21#include <QtCore/qvariant.h>
22#include <QtCore/qvarlengtharray.h>
24#include <QtGui/qpainterpath.h>
25#include <QtGui/qpa/qplatformnativeinterface.h>
26#include <QtGui/qpa/qplatformfontdatabase.h>
27#include <QtGui/qpa/qplatformtheme.h>
29#include <QtCore/private/qcore_mac_p.h>
30#include <QtGui/private/qcoregraphics_p.h>
31#include <QtGui/private/qguiapplication_p.h>
41#undef QT_MANGLE_NAMESPACE
42#undef QT_NAMESPACE_ALIAS_OBJC_CLASS
44#define QQC2_MANGLE1(a, b) a##_##b
45#define QQC2_MANGLE2(a, b) QQC2_MANGLE1(a, b)
47#if defined(QT_NAMESPACE)
48 #define QT_MANGLE_NAMESPACE(name) QQC2_MANGLE2(QQC2_MANGLE1(name, QQC2_NAMESPACE), QT_NAMESPACE)
49 #define QT_NAMESPACE_ALIAS_OBJC_CLASS(name) @compatibility_alias name QT_MANGLE_NAMESPACE(name)
51 #define QT_MANGLE_NAMESPACE(name) QQC2_MANGLE2(name, QQC2_NAMESPACE)
52 #define QT_NAMESPACE_ALIAS_OBJC_CLASS(name) @compatibility_alias name QT_MANGLE_NAMESPACE(name)
74 if ((self = [super
init])) {
76 self.indeterminate = YES;
77 self.usesThreadedAnimation = NO;
78 self.alphaValue = 0.0;
86 if (_animators == 0) {
88 [
super startAnimation:self];
96 if (_animators == 0) {
97 [
super stopAnimation:self];
99 [
self removeFromSuperviewWithoutNeedingDisplay];
103- (
void)drawWithFrame:(CGRect)rect inView:(NSView *)view
106 self.alphaValue = 1.0;
108 [view addSubview:self];
109 if (!CGRectEqualToRect(
self.frame,
rect))
111 [
self drawRect:rect];
112 self.alphaValue = 0.0;
139 if ((self = [super
init])) {
141 self.titlePosition = NSNoTitle;
142 self.boxType = NSBoxCustom;
143 self.cornerRadius = 3;
144 self.borderColor = [NSColor.controlColor colorWithAlphaComponent:0.1];
145 self.fillColor = [NSColor.darkGrayColor colorWithAlphaComponent:0.2];
151- (
void)drawRect:(NSRect)rect
153 [
super drawRect:rect];
189 return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient;
205 return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient;
229bool isDarkMode() {
return qt_mac_applicationIsInDarkMode(); }
269#ifndef QT_NO_ACCESSIBILITY
276 return isOnKeyWindow ?
QColor(73, 73, 73, 100) :
QColor(56, 56, 56, 100);
278 return isOnKeyWindow ?
QColor(0, 0, 0, 28) :
QColor(0, 0, 0, 21);
318#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
320 && !qt_mac_applicationIsInDarkMode()) {
321 auto requiredAppearanceName = NSApplication.sharedApplication.effectiveAppearance.name;
322 if (![NSAppearance.currentAppearance.name isEqualToString:requiredAppearanceName]) {
323 previous = NSAppearance.currentAppearance;
324 NSAppearance.currentAppearance = [NSAppearance appearanceNamed:requiredAppearanceName];
333 NSAppearance.currentAppearance = previous;
337 NSAppearance *previous = nil;
344 const qreal length = sb->maximum - sb->minimum + sb->pageStep;
353 scroller.frame = sb->rect.toCGRect();
355 scroller.knobProportion = proportion;
359static bool setupSlider(NSSlider *slider,
const QStyleOptionSlider *sl)
361 if (sl->minimum >= sl->maximum)
367 [slider initWithFrame:sl->rect.toCGRect()];
369 slider.minValue = sl->minimum;
370 slider.maxValue = sl->maximum;
371 slider.intValue = sl->sliderPosition;
373 if (sl->tickPosition != QStyleOptionSlider::NoTicks) {
375 int interval = sl->tickInterval;
377 interval = sl->pageStep;
379 interval = sl->singleStep;
383 slider.numberOfTickMarks = 1 + ((sl->maximum - sl->minimum) / interval);
385 const bool ticksAbove = sl->tickPosition == QStyleOptionSlider::TicksAbove;
387 slider.tickMarkPosition = ticksAbove ? NSTickMarkPositionAbove : NSTickMarkPositionBelow;
389 slider.tickMarkPosition = ticksAbove ? NSTickMarkPositionLeading : NSTickMarkPositionTrailing;
391 slider.numberOfTickMarks = 0;
396 [slider layoutSubtreeIfNeeded];
399 const CGRect knobRect = [slider.cell knobRectFlipped:slider.isFlipped];
401 pressPoint.x = CGRectGetMidX(knobRect);
402 pressPoint.y = CGRectGetMidY(knobRect);
403 [slider.cell startTrackingAt:pressPoint inView:slider];
411 const auto tabDirection = QMacStylePrivate::tabDirection(shape);
412 if (QMacStylePrivate::verticalTabs(tabDirection)) {
413 int newX, newY, newRot;
415 newX = tabRect.
width();
420 newY = tabRect.
y() + tabRect.
height();
435 if (QMacStylePrivate::verticalTabs(QMacStylePrivate::tabDirection(tabOpt->shape)))
436 rect =
rect.adjusted(-tabOverlap, 0, 0, 0);
438 rect =
rect.adjusted(0, -tabOverlap, 0, 0);
455 if (tabOpt->documentMode && isUnified) {
482 p->fillRect(leftLineRect, separatorLineColor);
483 p->fillRect(rightLineRect, separatorLineColor);
502 p->fillRect(bodyRect, bodyColor);
507 p->fillRect(topLineRect, topLineColor);
511 bool isDocument =
false;
515 p->fillRect(bottomLineRect, bottomLineColor);
532 int l = original.
length();
539 }
else if (original.
at(currPos) ==
QLatin1Char(
'(') && l >= 4 &&
545 while (finalDest >
n && returnText.
at(finalDest -
n - 1).
isSpace())
552 returnText[finalDest] = original.
at(currPos);
564 if (NSWindow *nswindow =
static_cast<NSWindow*
>(
568 return [nswindow isMainWindow];
574#define LargeSmallMini(option, large, small, mini) \
575 (option->state & QStyle::State_Small) ? small : ((option->state & QStyle::State_Mini) ? mini : large)
685 qDebug(
"Not sure how to return this...");
819 if (szHint ==
QSize(-1, -1)) {
859 const QStyleOptionSlider *sld = qstyleoption_cast<const QStyleOptionSlider *>(
opt);
865 if (sld->tickPosition != QStyleOptionSlider::NoTicks)
869 if (sld->tickPosition != QStyleOptionSlider::NoTicks)
875 if (sld->tickPosition != QStyleOptionSlider::NoTicks)
879 if (sld->tickPosition != QStyleOptionSlider::NoTicks)
885 if (sld->tickPosition != QStyleOptionSlider::NoTicks)
889 if (sld->tickPosition != QStyleOptionSlider::NoTicks)
946 ret =
QSize(-1, [[NSApp mainMenu] menuBarHeight]);
951 if (
ret.height() <= 0)
964 static const qreal CornerPointOffset = 5.5;
965 static const qreal CornerControlOffset = 2.1;
969 path.moveTo(
r.left(),
r.top() + CornerPointOffset);
970 path.cubicTo(
r.left(),
r.top() + CornerControlOffset,
971 r.left() + CornerControlOffset,
r.top(),
972 r.left() + CornerPointOffset,
r.top());
974 path.lineTo(
r.right() - CornerPointOffset,
r.top());
975 path.cubicTo(
r.right() - CornerControlOffset,
r.top(),
976 r.right(),
r.top() + CornerControlOffset,
977 r.right(),
r.top() + CornerPointOffset);
979 path.lineTo(
r.right(),
r.bottom() - CornerPointOffset);
980 path.cubicTo(
r.right(),
r.bottom() - CornerControlOffset,
981 r.right() - CornerControlOffset,
r.bottom(),
982 r.right() - CornerPointOffset,
r.bottom());
984 path.lineTo(
r.left() + CornerPointOffset,
r.bottom());
985 path.cubicTo(
r.left() + CornerControlOffset,
r.bottom(),
986 r.left(),
r.bottom() - CornerControlOffset,
987 r.left(),
r.bottom() - CornerPointOffset);
988 path.lineTo(
r.left(),
r.top() + CornerPointOffset);
995 struct WindowButtons {
1000 static const WindowButtons buttons[] = {
1006 for (
const auto &wb : buttons)
1020 ||
opt->shape == QStyleOptionTab::RoundedWest
1021 ||
opt->shape == QStyleOptionTab::TriangularEast
1022 ||
opt->shape == QStyleOptionTab::TriangularWest;
1024 tr.setRect(0, 0,
tr.height(),
tr.width());
1028 const int hpadding = 4;
1030 if (
opt->shape == QStyleOptionTab::RoundedSouth ||
opt->shape == QStyleOptionTab::TriangularSouth)
1031 verticalShift = -verticalShift;
1032 tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding);
1035 if (!
opt->leftButtonSize.isEmpty()) {
1036 const int buttonSize =
verticalTabs ?
opt->leftButtonSize.height() :
opt->leftButtonSize.width();
1037 tr.setLeft(
tr.left() + 4 + buttonSize);
1039 if (
opt->rightButtonSize.isEmpty())
1040 tr.setRight(
tr.right() - 4 - buttonSize);
1043 if (!
opt->rightButtonSize.isEmpty()) {
1044 const int buttonSize =
verticalTabs ?
opt->rightButtonSize.height() :
opt->rightButtonSize.width();
1045 tr.setRight(
tr.right() - 4 - buttonSize);
1047 if (
opt->leftButtonSize.isEmpty())
1048 tr.setLeft(
tr.left() + 4 + buttonSize);
1066 if (
opt->documentMode) {
1068 const int textWidth =
1070 *iconRect =
QRect(
tr.center().x() - textWidth / 2 - stylePadding - tabIconSize.
width(),
1071 tr.center().y() - tabIconSize.
height() / 2,
1074 *iconRect =
QRect(
tr.left() + stylePadding,
tr.center().y() - tabIconSize.
height() / 2,
1080 tr.setLeft(
tr.left() + stylePadding + tabIconSize.
width() + 4);
1081 tr.setRight(
tr.right() - stylePadding - tabIconSize.
width() - 4);
1093 case QStyleOptionTab::RoundedSouth:
1094 case QStyleOptionTab::TriangularSouth:
1096 case QStyleOptionTab::RoundedNorth:
1097 case QStyleOptionTab::TriangularNorth:
1099 case QStyleOptionTab::RoundedWest:
1100 case QStyleOptionTab::TriangularWest:
1102 case QStyleOptionTab::RoundedEast:
1103 case QStyleOptionTab::TriangularEast:
1141 return ((
cw.type << 2) |
cw.size) ^
seed;
1182 const auto frameSize = defaultFrameSize();
1184 frameRect =
rect.adjusted(3, 1, -3, -1)
1244 *buttonType = NSButtonTypeSwitch;
1245 *bezelStyle = NSBezelStyleRegularSquare;
1248 *buttonType = NSButtonTypeOnOff;
1249 *bezelStyle = NSBezelStyleDisclosure;
1252 *buttonType = NSButtonTypeRadio;
1253 *bezelStyle = NSBezelStyleRegularSquare;
1256 *buttonType = NSButtonTypePushOnPushOff;
1257 *bezelStyle = NSBezelStyleShadowlessSquare;
1260 *buttonType = NSButtonTypePushOnPushOff;
1261 *bezelStyle = NSBezelStyleRounded;
1272 if (
const auto *
btn = qstyleoption_cast<const QStyleOptionButton *>(
opt)) {
1286 if (
const auto *combo = qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
1287 if (combo->editable)
1302 CGRect innerBounds = outerBounds;
1307 switch (cocoaWidget.size) {
1309 innerBounds.origin.x += 3;
1310 innerBounds.origin.y += 3;
1311 innerBounds.size.width -= 6;
1312 innerBounds.size.height -= 7;
1315 innerBounds.origin.x += 2;
1316 innerBounds.origin.y += 2;
1317 innerBounds.size.width -= 5;
1318 innerBounds.size.height -= 6;
1322 innerBounds.origin.x += 2;
1323 innerBounds.origin.y += 2;
1324 innerBounds.size.width -= 5;
1325 innerBounds.size.height -= 6;
1327 }
else if (cocoaWidget.type ==
ComboBox) {
1328 switch (cocoaWidget.size) {
1330 innerBounds.origin.x += 3;
1331 innerBounds.origin.y += 3;
1332 innerBounds.size.width -= 7;
1333 innerBounds.size.height -= 8;
1336 innerBounds.origin.x += 3;
1337 innerBounds.origin.y += 3;
1338 innerBounds.size.width -= 4;
1339 innerBounds.size.height -= 8;
1343 innerBounds.origin.x += 3;
1344 innerBounds.origin.y += 2;
1345 innerBounds.size.width -= 6;
1346 innerBounds.size.height -= 8;
1363 ret =
ret.adjusted(0, 0, -25, 0).translated(2, 4.5);
1367 ret =
ret.adjusted(0, 0, -22, 0).translated(2, 3);
1371 ret =
ret.adjusted(0, 0, -19, 0).translated(2, 2.5);
1372 ret.setHeight(10.5);
1380 ret.adjust(10, 1, -23, -4);
1383 ret.adjust(10, 4, -20, -3);
1386 ret.adjust(9, 0, -19, 0);
1400 smallSystemFont = *ssf;
1402 miniSystemFont = *msf;
1421 if (__builtin_available(macOS 10.14, *)) {
1422 if (qt_mac_applicationIsInDarkMode()) {
1433 NSBox *
box = [[NSBox alloc] init];
1436 box.titlePosition = NSNoTitle;
1447 NSButton *bc = [[NSButton alloc] init];
1455 NSPopUpButton *bc = [[NSPopUpButton alloc] init];
1465 const NSWindowButton
button = [=] {
1468 return NSWindowCloseButton;
1470 return NSWindowMiniaturizeButton;
1472 return NSWindowZoomButton;
1478 const auto styleMask = NSWindowStyleMaskTitled
1479 | NSWindowStyleMaskClosable
1480 | NSWindowStyleMaskMiniaturizable
1481 | NSWindowStyleMaskResizable;
1482 bv = [NSWindow standardWindowButton:button forStyleMask:styleMask];
1487 bv = [[NSComboBox alloc] init];
1490 bv = [[NSProgressIndicator alloc] init];
1496 bv = [[NSScroller alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)];
1501 bv = [[NSScroller alloc] initWithFrame:NSMakeRect(0, 0, 20, 200)];
1504 bv = [[NSSlider alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)];
1509 bv = [[NSSlider alloc] initWithFrame:NSMakeRect(0, 0, 20, 200)];
1512 bv = [[NSSplitView alloc] init];
1518 bv = [[NSTextField alloc] init];
1524 if ([bv isKindOfClass:[NSControl class]]) {
1525 auto *ctrl =
static_cast<NSControl *
>(bv);
1528 ctrl.controlSize = NSControlSizeSmall;
1531 ctrl.controlSize = NSControlSizeMini;
1538 auto *
pi =
static_cast<NSProgressIndicator *
>(bv);
1542 pi.controlSize = NSControlSizeSmall;
1545 pi.controlSize = NSControlSizeMini;
1555 NSButtonType buttonType;
1556 NSBezelStyle bezelStyle;
1557 if (
cocoaControl.getCocoaButtonTypeAndBezelStyle(&buttonType, &bezelStyle)) {
1560 auto *
button =
static_cast<NSButton *
>(bv);
1561 button.buttonType = buttonType;
1562 button.bezelStyle = bezelStyle;
1564 button.allowsMixedState = YES;
1576 cell = [[NSStepperCell alloc] init];
1579 NSButtonCell *bc = [[NSButtonCell alloc] init];
1580 bc.buttonType = NSButtonTypeOnOff;
1581 bc.bezelStyle = NSBezelStyleDisclosure;
1591 cell.controlSize = NSControlSizeSmall;
1594 cell.controlSize = NSControlSizeMini;
1621 view.wantsLayer = YES;
1639 const CGRect dirtyRect =
rect.toCGRect();
1642 drawRectBlock(
ctx, dirtyRect);
1644 [view drawRect:dirtyRect];
1646 [view removeFromSuperviewWithoutNeedingDisplay];
1662 NSPreferredScrollerStyleDidChangeNotification, []() {
1671#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
1677 for (NSView *
b :
d->cocoaControls)
1679 d->cocoaControls.clear();
1713 if (sz ==
QSize(-1, -1))
1721 if (sz ==
QSize(-1, -1))
1772 if (qstyleoption_cast<const QStyleOptionComboBox *>(
opt) != 0)
1797 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
1798 int space = (sl->orientation ==
Qt::Horizontal) ? sl->rect.height() : sl->rect.width();
1799 int ticks = sl->tickPosition;
1801 if (ticks & QStyleOptionSlider::TicksAbove)
1803 if (ticks & QStyleOptionSlider::TicksBelow)
1811 if (ticks != QStyleOptionSlider::TicksBothSides && ticks != QStyleOptionSlider::NoTicks)
1816 thick += (space * 2) / (
n + 2);
1841 ret = int([NSWindow frameRectForContentRect:NSZeroRect
1842 styleMask:style].size.height);
1845 switch (
d->aquaSizeConstrain(
opt)) {
1856 const QStyleOptionTab *tb = qstyleoption_cast<const QStyleOptionTab *>(
opt);
1857 if (tb && tb->documentMode)
1878 switch (
d->aquaSizeConstrain(
opt)) {
1893 ret =
static_cast<int>([NSScroller
1894 scrollerWidthForControlSize:static_cast<NSControlSize>(size)
1895 scrollerStyle:[NSScroller preferredScrollerStyle]]);
1898 switch (
d->aquaSizeConstrain(
opt)) {
1912 switch (
d->aquaSizeConstrain(
opt)) {
1927 switch (
d->aquaSizeConstrain(
opt)) {
1941 switch (
d->aquaSizeConstrain(
opt)) {
2048 case PM_PushButtonFocusFrameRadius:
2051 case PM_CheckBoxFocusFrameRadius:
2054 case PM_ComboBoxFocusFrameRadius:
2057 case PM_RadioButtonFocusFrameRadius:
2060 case PM_SliderFocusFrameRadius:
2067 case PM_DialFocusFrameRadius:
2068 case PM_SpinBoxFocusFrameRadius:
2069 case PM_TextAreaFocusFrameRadius:
2070 case PM_TextFieldFocusFrameRadius:
2153 NSUserDefaults*
defaults = [NSUserDefaults standardUserDefaults];
2154 bool result = [defaults boolForKey:@"AppleScrollerPagingBehavior"];
2193 if (
const QStyleOptionTabBarBase *opt2 = qstyleoption_cast<const QStyleOptionTabBarBase *>(
opt)) {
2201 ret = !cmb->editable;
2248 const uchar fillR = 192, fillG = 191, fillB = 190;
2263 const int w = sbpl/4,
h =
img.height();
2269 for (
int y = 0;
y <
h; ++
y) {
2270 srow = sptr+((
y*sbpl)/4);
2271 drow = dptr+((
y*dbpl)/4);
2272 for (
int x = 0;
x <
w; ++
x) {
2273 const int redDiff =
qRed(*srow) - fillR;
2274 const int greenDiff =
qGreen(*srow) - fillG;
2275 const int blueDiff =
qBlue(*srow) - fillB;
2276 const int diff = (redDiff * redDiff) + (greenDiff * greenDiff) + (blueDiff * blueDiff);
2277 (*drow++) = (diff < 10) ? 0xffffffff : 0xff000000;
2333 case SH_SpellCheckUnderlineStyle:
2364 ret = QStyleOptionTabBarBase::LeftSide;
2401 int imgh =
img.height();
2402 int imgw =
img.width();
2404 for (
int y = 0;
y < imgh; ++
y) {
2405 for (
int x = 0;
x < imgw; ++
x) {
2406 pixel =
img.pixel(
x,
y);
2427 static bool recursionGuard =
false;
2432 recursionGuard =
true;
2434 recursionGuard =
false;
2436 switch (standardPixmap) {
2456 d->resolveCurrentNSView(
opt->window);
2465 const int xOffset = 1;
2467 const qreal penWidth =
qMax(halfSize / 3.0, 1.25);
2496 path.moveTo(-halfSize, -halfSize * 0.5);
2497 path.lineTo(0.0, halfSize * 0.5);
2498 path.lineTo(halfSize, -halfSize * 0.5);
2502 p->strokePath(
path, arrowPen);
2506 if (
const QStyleOptionTabBarBase *tbb
2507 = qstyleoption_cast<const QStyleOptionTabBarBase *>(
opt)) {
2508 if (tbb->documentMode) {
2515 region -= tbb->tabBarRect;
2517 p->setClipRegion(region);
2518 QStyleOptionTabWidgetFrame twf;
2519 twf.QStyleOption::operator=(*tbb);
2520 twf.shape = tbb->shape;
2521 switch (QMacStylePrivate::tabDirection(twf.shape)) {
2523 twf.rect = twf.rect.adjusted(0, 0, 0, 10);
2526 twf.rect = twf.rect.adjusted(0, -10, 0, 0);
2529 twf.rect = twf.rect.adjusted(0, 0, 10, 0);
2532 twf.rect = twf.rect.adjusted(0, -10, 0, 0);
2543 if (
const auto *
groupBox = qstyleoption_cast<const QStyleOptionFrame *>(
opt))
2552 auto *
box =
static_cast<NSBox *
>(
d->cocoaControl(
cw));
2566 auto adjustedRect =
opt->
rect;
2567 bool needTranslation =
false;
2569 && !qt_mac_applicationIsInDarkMode()) {
2581 adjustedRect.
adjust(0, 0, 6, 6);
2582 needTranslation =
true;
2590 CGContextTranslateCTM(
ctx, 0,
rect.origin.y +
rect.size.height);
2591 CGContextScaleCTM(
ctx, 1, -1);
2596 if (needTranslation)
2597 CGContextTranslateCTM(
ctx, -3.0, 5.0);
2620 p->fillPath(
path, dark);
2638 p->setPen(
QColor(160, 160, 160));
2641 p->setPen(
QColor(145, 145, 145));
2651 static const int RectHeight = 2;
2653 while (y < opt->
rect.height() - RectHeight - 5) {
2655 path.addEllipse(
x,
y, RectHeight, RectHeight);
2659 while (x < opt->
rect.width() - RectHeight - 5) {
2661 path.addEllipse(
x,
y, RectHeight, RectHeight);
2668 p->fillPath(
path, dark);
2677 proxy()->drawPrimitive(
2700 kCTFontUIFontMenuItemMark;
2707 CGContextSaveGState(cg);
2708 CGContextSetShouldSmoothFonts(cg, NO);
2716 CGContextScaleCTM(cg, 1, -1);
2718 CGContextTranslateCTM(cg,
opt->
rect.
x(), vOffset);
2722 static const CFStringRef
keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName };
2723 static const int numValues =
sizeof(
keys) /
sizeof(
keys[0]);
2724 const CFTypeRef
values[] = { (CFTypeRef)checkmarkFont, (CFTypeRef)checkmarkColor };
2727 numValues, NULL, NULL);
2732 CTLineDraw((CTLineRef)
line, cg);
2735 CGContextRestoreGState(cg);
2744 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
2746 auto *tb =
static_cast<NSButton *
>(
d->cocoaControl(
cw));
2747 tb.enabled = isEnabled;
2750 [tb highlight:isPressed];
2751 const auto vOffset = [=] {
2760 CGContextTranslateCTM(
ctx, 0, vOffset);
2761 [tb.cell drawInteriorWithFrame:rect inView:tb];
2771 NSButtonCell *triangleCell =
static_cast<NSButtonCell *
>(
d->cocoaCell(
cw));
2772 [triangleCell setState:(opt->state & State_Open) ? NSControlStateValueOn : NSControlStateValueOff];
2774 bool viewHasFocus =
false;
2775 [triangleCell setBackgroundStyle:((opt->state & State_Selected) && viewHasFocus) ? NSBackgroundStyleEmphasized : NSBackgroundStyleNormal];
2777 d->setupNSGraphicsContext(cg, NO);
2780 CGRect
rect = CGRectMake(qtRect.
x() + 1, qtRect.
y(), qtRect.
width(), qtRect.
height());
2781 CGContextTranslateCTM(cg,
rect.origin.x,
rect.origin.y +
rect.size.height);
2782 CGContextScaleCTM(cg, 1, -1);
2783 CGContextTranslateCTM(cg, -
rect.origin.x, -
rect.origin.y);
2785 [triangleCell drawBezelWithFrame:NSRectFromCGRect(rect) inView:[triangleCell controlView]];
2787 d->restoreNSGraphicsContext(cg);
2791 const QPen oldPen =
p->pen();
2792 QPen penCpy =
p->pen();
2808 auto *tf =
static_cast<NSTextField *
>(
d->cocoaControl(
cw));
2809 tf.enabled = isEnabled;
2810 tf.editable = !isReadOnly;
2812 static_cast<NSTextFieldCell *
>(tf.cell).bezelStyle = isRounded ? NSTextFieldRoundedBezel : NSTextFieldSquareBezel;
2813 tf.frame =
opt->
rect.toCGRect();
2815 QMacAutoReleasePool pool;
2816 if (!qt_mac_applicationIsInDarkMode()) {
2821 CGContextRef cgContext = NSGraphicsContext.currentContext.CGContext;
2825 if (cgContext ? bool(CGBitmapContextGetColorSpace(cgContext)) : false) {
2826 tf.drawsBackground = YES;
2827 const QColor bgColor = frame->palette.brush(QPalette::Base).color();
2828 tf.backgroundColor = [NSColor colorWithSRGBRed:bgColor.redF()
2829 green:bgColor.greenF()
2830 blue:bgColor.blueF()
2831 alpha:bgColor.alphaF()];
2832 if (bgColor.alpha() != 255) {
2839 [tf.cell drawWithFrame:
rect inView:tf];
2892 p->fillRect(
opt->
rect, linearGrad);
2923 int imgh =
img.height();
2924 int imgw =
img.width();
2927 for (
int y = 0;
y < imgh; ++
y) {
2928 for (
int x = 0;
x < imgw; ++
x) {
2929 pixel =
img.pixel(
x,
y);
2936 pixel = hsvColor.
rgb();
2946 CGContextTranslateCTM(cg,
rect.size.height, 0);
2947 CGContextRotateCTM(cg,
M_PI_2);
2949 if (vertical != reverse) {
2950 CGContextTranslateCTM(cg,
rect.size.width, 0);
2951 CGContextScaleCTM(cg, -1, 1);
2963 d->resolveCurrentNSView(
opt->window);
2971 p->fillRect(ir, pressed ?
header->palette.dark() :
header->palette.button());
2992 opt->window->devicePixelRatio(),
mode);
3008 myTb.
state &= ~State_AutoRaise;
3009#ifndef QT_NO_ACCESSIBILITY
3010 if (QStyleHelper::hasAncestor(
opt->
styleObject, QAccessible::ToolBar)) {
3011 QRect cr = tb->rect;
3014 bool needText =
false;
3027 if (tb->icon.isNull() && !tb->text.isEmpty())
3043 QPixmap pixmap = tb->icon.pixmap(tb->rect.size().boundedTo(tb->iconSize),
3044 opt->window->devicePixelRatio(), iconMode,
3080 QPen pen =
p->pen();
3127 d->autoDefaultButton =
nullptr;
3131 const bool isHighlighted =
isActive &&
3138 const auto cs =
d->effectiveAquaSizeConstrain(
btn);
3140 auto *pb =
static_cast<NSButton *
>(
d->cocoaControl(
cw));
3145 pb.frame = frameRect.toCGRect();
3147 pb.enabled = isEnabled;
3148 [pb highlight:isPressed];
3149 pb.state = isHighlighted && !isPressed ? NSControlStateValueOn : NSControlStateValueOff;
3150 d->drawNSViewInRect(pb, frameRect,
p, ^(
CGContextRef,
const CGRect &
r) {
3152 [pb.cell drawBezelWithFrame:r inView:pb.superview];
3160 const auto ir = frameRect.
toRect();
3161 int arrowYOffset = 0;
3195 if ((!hasIcon && !hasMenu) || (hasIcon && !hasText)) {
3218 int pixmapWidth =
pixmap.width() /
pixmap.devicePixelRatio();
3219 int pixmapHeight =
pixmap.height() /
pixmap.devicePixelRatio();
3221 int iconLeftOffset = freeContentRect.
x() + (freeContentRect.
width() - contentW) / 2;
3222 int iconTopOffset = freeContentRect.
y() + (freeContentRect.
height() - pixmapHeight) / 2;
3223 QRect iconDestRect(iconLeftOffset, iconTopOffset, pixmapWidth, pixmapHeight);
3226 int newOffset = iconDestRect.
x() + iconDestRect.
width()
3240 if (
const auto *
cb = qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
3241 auto comboCopy = *
cb;
3248 if (
const auto *tabOpt = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
3249 if (tabOpt->documentMode) {
3251 bool isUnified =
false;
3269 const auto tabDirection = QMacStylePrivate::tabDirection(tabOpt->shape);
3273 QStyleOptionTab::TabPosition tp = tabOpt->position;
3274 QStyleOptionTab::SelectedPosition
sp = tabOpt->selectedPosition;
3276 if (tp == QStyleOptionTab::Beginning)
3277 tp = QStyleOptionTab::End;
3278 else if (tp == QStyleOptionTab::End)
3279 tp = QStyleOptionTab::Beginning;
3281 if (
sp == QStyleOptionTab::NextIsSelected)
3282 sp = QStyleOptionTab::PreviousIsSelected;
3283 else if (
sp == QStyleOptionTab::PreviousIsSelected)
3284 sp = QStyleOptionTab::NextIsSelected;
3299 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
3301 const bool needsInactiveHack = (!
isActive && isSelected);
3302 const auto ct = !needsInactiveHack && (isSelected || tp == QStyleOptionTab::OnlyOneTab) ?
3307 auto *pb =
static_cast<NSButton *
>(
d->cocoaControl(
cw));
3309 auto vOffset = isPopupButton ? 1 : 2;
3312 const auto outerAdjust = isPopupButton ? 1 : 4;
3313 const auto innerAdjust = isPopupButton ? 20 : 10;
3314 QRectF frameRect = tabOpt->rect;
3318 frameRect = frameRect.
translated(0, vOffset);
3320 case QStyleOptionTab::Beginning:
3323 frameRect = frameRect.
adjusted(-innerAdjust, 0, outerAdjust, 0);
3325 frameRect = frameRect.
adjusted(-outerAdjust, 0, innerAdjust, 0);
3327 case QStyleOptionTab::Middle:
3328 frameRect = frameRect.
adjusted(-innerAdjust, 0, innerAdjust, 0);
3330 case QStyleOptionTab::End:
3333 frameRect = frameRect.
adjusted(-innerAdjust, 0, outerAdjust, 0);
3335 frameRect = frameRect.
adjusted(-outerAdjust, 0, innerAdjust, 0);
3337 case QStyleOptionTab::OnlyOneTab:
3338 frameRect = frameRect.
adjusted(-outerAdjust, 0, outerAdjust, 0);
3341 pb.frame = frameRect.toCGRect();
3343 pb.enabled = isEnabled;
3344 [pb highlight:isPressed];
3346 pb.state = (
isActive && isSelected && !isPressed) ? NSControlStateValueOn : NSControlStateValueOff;
3350 CGContextClipToRect(
ctx,
opt->
rect.toCGRect());
3351 if (!isSelected || needsInactiveHack) {
3355 CGContextScaleCTM(
ctx, -1, 1);
3356 CGContextTranslateCTM(
ctx, -frameRect.
left(), 0);
3359 CGContextScaleCTM(
ctx, 1, -1);
3360 CGContextTranslateCTM(
ctx, 0, -frameRect.
right());
3363 CGContextScaleCTM(
ctx, 1, -1);
3364 CGContextTranslateCTM(
ctx, 0, -frameRect.
left());
3371 CGContextTranslateCTM(
ctx, 0, frameRect.
right());
3373 CGContextTranslateCTM(
ctx, -frameRect.
left(), 0);
3381 NSPopUpArrowPosition
oldPosition = NSPopUpArrowAtCenter;
3382 NSPopUpButtonCell *pbCell = nil;
3383 if (isPopupButton) {
3384 pbCell =
static_cast<NSPopUpButtonCell *
>(pb.cell);
3386 pbCell.arrowPosition = NSPopUpNoArrow;
3389 [pb.cell drawBezelWithFrame:r inView:pb.superview];
3395 if (needsInactiveHack) {
3397 const qreal pixelRatio =
p->device()->devicePixelRatioF();
3402 d->drawNSViewInRect(pb, frameRect, &tabPainter, ^(
CGContextRef ctx,
const CGRect &
r) {
3405 drawBezelBlock(
ctx,
r);
3410 const qreal inactiveGray = 0.898;
3411 const int inactiveGray8 =
qRound(inactiveGray * 255.0);
3412 const QRgb inactiveGrayRGB =
qRgb(inactiveGray8, inactiveGray8, inactiveGray8);
3413 for (
int l = 0; l < tabPixmap.
height(); ++l) {
3415 for (
int i = 0;
i < tabPixmap.
width(); ++
i) {
3417 line[i] = inactiveGrayRGB;
3426 p->drawImage(
opt->
rect, tabPixmap);
3428 d->drawNSViewInRect(pb, frameRect,
p, drawBezelBlock);
3431 if (!isSelected &&
sp != QStyleOptionTab::NextIsSelected
3432 && tp != QStyleOptionTab::End
3433 && tp != QStyleOptionTab::OnlyOneTab) {
3436 p->setOpacity(isEnabled ? 0.105 : 0.06);
3437 p->setPen(separatorPen);
3453 if (
const auto *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
3454 QStyleOptionTab myTab = *tab;
3455 const auto tabDirection = QMacStylePrivate::tabDirection(tab->shape);
3464 const bool nonDefaultFont =
false;
3476 int heightOffset = 0;
3479 }
else if (nonDefaultFont) {
3480 if (
p->fontMetrics().height() == myTab.rect.height())
3483 myTab.rect.setHeight(myTab.rect.height() + heightOffset);
3489 if (
const auto *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(
opt)) {
3490 const bool isVertical = dwOpt->verticalTitleBar;
3494 p->
translate(effectiveRect.left(), effectiveRect.top() + effectiveRect.width());
3496 p->translate(-effectiveRect.left(), -effectiveRect.top());
3505 p->fillRect(effectiveRect, linearGrad);
3509 p->drawLine(effectiveRect.bottomLeft(), effectiveRect.bottomRight());
3511 if (!dwOpt->title.isEmpty()) {
3515 effectiveRect.top() + titleRect.left() -
opt->
rect.
left(),
3519 const auto text =
p->fontMetrics().elidedText(dwOpt->title,
Qt::ElideRight, titleRect.width());
3560 p->fillRect(mi->rect, mi->palette.highlight());
3566 p->drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2 - 1,
3567 mi->rect.x() + mi->rect.width() - 4,
3568 mi->rect.y() + mi->rect.height() / 2 - 1);
3570 p->drawLine(mi->rect.x() + 2, mi->rect.y() + mi->rect.height() / 2,
3571 mi->rect.x() + mi->rect.width() - 4,
3572 mi->rect.y() + mi->rect.height() / 2);
3575 const int scrollerVOffset = 5;
3576 const int left = mi->rect.x() + (mi->rect.width() - scrollerSize.
width()) / 2;
3581 bottom = mi->rect.y() + scrollerVOffset;
3584 bottom = mi->rect.bottom() - scrollerVOffset;
3600 CGColorRef separatorColor = [NSColor quaternaryLabelColor].CGColor;
3601 const QRect separatorRect =
QRect(mi->rect.left(), mi->rect.center().y(), mi->rect.width(), 2);
3606 const int maxpmw = mi->maxIconWidth;
3609 int xpos = mi->rect.x() + 18;
3610 int checkcol = maxpmw;
3612 p->setPen(mi->palette.text().color());
3614 p->setPen(mi->palette.highlightedText().color());
3616 p->setPen(mi->palette.buttonText().color());
3640 if (!mi->icon.isNull()) {
3653 int pixh =
pixmap.height() /
pixmap.devicePixelRatio();
3654 QRect cr(xpos, mi->rect.y(), checkcol, mi->rect.height());
3655 QRect pmr(0, 0, pixw, pixh);
3664 int yPos = mi->rect.y();
3669 const int tabwidth = isSubMenu ? 9 : mi->tabWidth;
3677 if (tabIndex >= 0) {
3679 rightMarginText =
s.
mid(tabIndex + 1);
3684 if (!rightMarginText.
isEmpty()) {
3689 p->drawText(xp, yPos, tabwidth, mi->rect.height(), text_flags |
Qt::AlignRight, rightMarginText);
3694 QFont myFont = mi->font;
3712 NSFont *
f = (NSFont *)(CTFontRef)fontEngine->handle();
3715 const auto pc =
p->pen().color();
3716 NSColor *
c = [NSColor colorWithSRGBRed:pc.redF()
3724 d->setupNSGraphicsContext(cgCtx, YES);
3730 [s.toNSString() drawAtPoint:CGPointMake(xpos, yPos)
3731 withAttributes:@{ NSFontAttributeName:f, NSForegroundColorAttributeName:c,
3732 NSObliquenessAttributeName: [NSNumber numberWithDouble: myFont.italic() ? 0.3 : 0.0]}];
3734 d->restoreNSGraphicsContext(cgCtx);
3737 p->drawText(xpos, yPos, mi->rect.width() - xm - tabwidth + 1,
3738 mi->rect.height(), text_flags,
s);
3748 const QBrush bg = selected ? mi->palette.highlight() : mi->palette.window();
3749 p->fillRect(mi->rect, bg);
3754 if (!mi->icon.isNull()) {
3759 mi->icon.pixmap(
QSize(iconExtent, iconExtent),
3760 opt->window->devicePixelRatio(),
3777 const bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
3778 const bool inverted = pb->invertedAppearance;
3784 const CGRect cgRect =
rect.toCGRect();
3786 const auto aquaSize =
d->aquaSizeConstrain(
opt);
3792 if (isIndeterminate) {
3811 d->setupNSGraphicsContext(cg, NO);
3812 d->setupVerticalInvertedXform(cg, reverse,
false, cgRect);
3813 [ipi drawWithFrame:cgRect inView:d->backingStoreNSView];
3814 d->restoreNSGraphicsContext(cg);
3822 auto *
pi =
static_cast<NSProgressIndicator *
>(
d->cocoaControl(
cw));
3825 d->setupVerticalInvertedXform(
ctx, reverse,
false,
rect);
3826 pi.minValue = pb->minimum;
3827 pi.maxValue = pb->maximum;
3828 pi.doubleValue = pb->progress;
3872 auto *sv =
static_cast<NSSplitView *
>(
d->cocoaControl(
cw));
3873 sv.frame =
opt->
rect.toCGRect();
3876 [sv drawDividerInRect:rect];
3879 QPen oldPen =
p->pen();
3889 if (
const QStyleOptionRubberBand *rubber = qstyleoption_cast<const QStyleOptionRubberBand *>(
opt)) {
3891 if (!rubber->opaque) {
3894 strokeColor.
setHsvF(0, 0, 0.86, 1.0);
3895 fillColor.
setHsvF(0, 0, 0.53, 0.25);
3897 p->fillRect(
opt->
rect, strokeColor);
3899 QPen oldPen =
p->pen();
3901 QPen pen(strokeColor);
3903 p->setBrush(fillColor);
3906 p->drawRect(adjusted);
3908 p->setBrush(oldBrush);
3916 const bool isDarkMode = qt_mac_applicationIsInDarkMode();
3959 linearGrad.
setColorAt(0, mainWindowGradientBegin);
3960 linearGrad.
setColorAt(1, mainWindowGradientEnd);
3961 p->fillRect(
opt->
rect, linearGrad);
4002 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
4006 if (vopt->features & QStyleOptionViewItem::HasDecoration)
4007 rect.adjust(-fw, 0, 0, 0);
4024 const auto cs =
d->effectiveAquaSizeConstrain(
btn);
4026 auto frameRect =
cw.adjustedControlFrame(
btn->
rect);
4027 frameRect -=
cw.titleMargins();
4080 if (
const QStyleOptionTabWidgetFrame *twf
4081 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
4082 switch (twf->shape) {
4083 case QStyleOptionTab::RoundedNorth:
4084 case QStyleOptionTab::TriangularNorth:
4087 case QStyleOptionTab::RoundedSouth:
4088 case QStyleOptionTab::TriangularSouth:
4089 rect =
QRect(
QPoint(0, twf->rect.height() - twf->leftCornerWidgetSize.height()),
4090 twf->leftCornerWidgetSize);
4099 if (
const QStyleOptionTabWidgetFrame *twf
4100 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
4101 switch (twf->shape) {
4102 case QStyleOptionTab::RoundedNorth:
4103 case QStyleOptionTab::TriangularNorth:
4104 rect =
QRect(
QPoint(twf->rect.width() - twf->rightCornerWidgetSize.width(), 0),
4105 twf->rightCornerWidgetSize);
4107 case QStyleOptionTab::RoundedSouth:
4108 case QStyleOptionTab::TriangularSouth:
4109 rect =
QRect(
QPoint(twf->rect.width() - twf->rightCornerWidgetSize.width(),
4110 twf->rect.height() - twf->rightCornerWidgetSize.height()),
4111 twf->rightCornerWidgetSize);
4121 if (
const auto *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
4122 if (twf->lineWidth != 0) {
4123 switch (QMacStylePrivate::tabDirection(twf->shape)) {
4125 rect.adjust(+1, +14, -1, -1);
4128 rect.adjust(+1, +1, -1, -14);
4131 rect.adjust(+14, +1, -1, -1);
4134 rect.adjust(+1, +1, -14, -1);
4140 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
4141 QRect dummyIconRect;
4142 d->tabLayout(tab, &
rect, &dummyIconRect);
4147 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
4153 bool verticalTabs = tab->shape == QStyleOptionTab::RoundedEast
4154 || tab->shape == QStyleOptionTab::RoundedWest
4155 || tab->shape == QStyleOptionTab::TriangularEast
4156 || tab->shape == QStyleOptionTab::TriangularWest;
4159 if (tab->shape == QStyleOptionTab::RoundedSouth || tab->shape == QStyleOptionTab::TriangularSouth)
4160 verticalShift = -verticalShift;
4162 qSwap(horizontalShift, verticalShift);
4163 horizontalShift *= -1;
4164 verticalShift *= -1;
4166 if (tab->shape == QStyleOptionTab::RoundedWest || tab->shape == QStyleOptionTab::TriangularWest)
4167 horizontalShift = -horizontalShift;
4169 tr.adjust(0, 0, horizontalShift, verticalShift);
4172 tr.setBottom(
tr.bottom() - verticalShift);
4173 tr.setRight(
tr.right() - horizontalShift);
4177 int w =
size.width();
4178 int h =
size.height();
4179 int midHeight =
static_cast<int>(
qCeil(
float(
tr.height() -
h) / 2));
4180 int midWidth = ((
tr.width() -
w) / 2);
4182 bool atTheTop =
true;
4183 switch (tab->shape) {
4184 case QStyleOptionTab::RoundedWest:
4185 case QStyleOptionTab::TriangularWest:
4188 case QStyleOptionTab::RoundedEast:
4189 case QStyleOptionTab::TriangularEast:
4194 rect =
QRect(tab->rect.x() + hpadding, midHeight,
w,
h);
4196 rect =
QRect(tab->rect.right() -
w - hpadding, midHeight,
w,
h);
4201 rect =
QRect(midWidth,
tr.y() + tab->rect.height() - hpadding -
h,
w,
h);
4209 int leftPadding = 4;
4210 int rightPadding = 4;
4212 int bottomPadding = 0;
4234 if (
const auto *combo = qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
4243 if (combo->editable)
4261 const bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
4264 if (isIndeterminate) {
4265 rect.adjust(1, 2, -1, -2);
4267 rect.adjust(1, 1, -1, -2);
4295 if (
const QStyleOptionSlider *sliderOpt
4296 = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4299 if (sliderOpt->tickPosition == QStyleOptionSlider::NoTicks)
4300 rect.adjust(3, 3, -3, -3);
4302 rect.adjust(3, 0, -3, 0);
4306 case SE_ScrollBarLayoutItem:
4307 if (
const QStyleOptionSlider *sliderOpt = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4329 qstyleoption_cast<const QStyleOptionGroupBox *>(
opt)) {
4339 delta =
SIZE(8, 4, 4);
4341 delta =
SIZE(15, 12, 12);
4349 if (
const QStyleOptionTabWidgetFrame *tabWidgetOpt =
4350 qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
4356 rect = tabWidgetOpt->rect;
4357 if (tabWidgetOpt->shape == QStyleOptionTab::RoundedNorth)
4370 = qstyleoption_cast<const QStyleOptionDockWidget*>(
opt);
4371 bool canClose = dwOpt == 0 ? true : dwOpt->
closable;
4378 if (verticalTitleBar)
4389 sz +=
QSize(buttonMargin, buttonMargin);
4390 if (verticalTitleBar)
4406 sz +=
QSize(buttonMargin, buttonMargin);
4407 if (verticalTitleBar)
4447 if (verticalTitleBar) {
4476 CGContextSaveGState(cg);
4477 [NSGraphicsContext saveGraphicsState];
4479 [NSGraphicsContext setCurrentContext:
4480 [NSGraphicsContext graphicsContextWithCGContext:cg flipped:flipped]];
4485 [NSGraphicsContext restoreGraphicsState];
4486 CGContextRestoreGState(cg);
4495 d->resolveCurrentNSView(
opt->window);
4499 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4503 if (!drawTrack && !drawKnob)
4511 static const CGFloat knobWidths[] = { 7.0, 5.0, 5.0 };
4512 const auto cocoaSize =
d->effectiveAquaSizeConstrain(
opt);
4517 bool wasActive =
false;
4521 bool shouldExpand =
false;
4528 const QStyle::State oldState =
static_cast<QStyle::State
>(
styleObject->
property(
"_q_stylestate").
value<QStyle::State::Int>());
4536 oldPos != sb->sliderPosition ||
4537 oldMin != sb->minimum ||
4538 oldMax != sb->maximum ||
4539 oldRect != sb->rect ||
4540 oldState != sb->state ||
4541 oldActiveControls != sb->activeSubControls) {
4580 shouldExpand =
isTransient && (
opt->activeSubControls || wasActive);
4598 d->setupNSGraphicsContext(cg, NO );
4602 NSScroller *
scroller =
static_cast<NSScroller *
>(
d->cocoaControl(
cw));
4605 const bool hasDarkBg = bgColor.
red() < 128 && bgColor.
green() < 128 && bgColor.
blue() < 128;
4609 scroller.knobStyle = hasDarkBg? NSScrollerKnobStyleLight : NSScrollerKnobStyleDark;
4611 scroller.knobStyle = NSScrollerKnobStyleDefault;
4620 CGContextBeginTransparencyLayerWithRect(cg,
scroller.frame,
nullptr);
4621 CGContextSetAlpha(cg, opacity);
4627 CGRect trackRect =
scroller.bounds;
4629 trackRect.origin.y += expandOffset;
4631 trackRect.origin.x += expandOffset;
4632 [scroller drawKnobSlotInRect:trackRect highlight:NO];
4642 const CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:scroller.controlSize scrollerStyle:scroller.scrollerStyle];
4643 const CGFloat knobWidth = knobWidths[cocoaSize] * expandScale;
4645 const CGRect scrollerKnobRect = CGRectInset([
scroller rectForPart:NSScrollerKnob], 1, 1);
4646 const CGFloat knobLength = isHorizontal ? scrollerKnobRect.size.width : scrollerKnobRect.size.height;
4647 const CGFloat knobPos = isHorizontal ? scrollerKnobRect.origin.x : scrollerKnobRect.origin.y;
4648 const CGFloat knobOffset =
qRound((scrollerWidth + expandOffset - knobWidth) / 2.0);
4649 const CGFloat knobRadius = knobWidth / 2.0;
4652 knobRect = CGRectMake(knobPos, knobOffset, knobLength, knobWidth);
4654 knobRect = CGRectMake(knobOffset, knobPos, knobWidth, knobLength);
4655 QCFType<CGPathRef> knobPath = CGPathCreateWithRoundedRect(knobRect, knobRadius, knobRadius,
nullptr);
4656 CGContextAddPath(cg, knobPath);
4657 CGContextSetAlpha(cg, 0.5);
4658 CGColorRef knobColor = hasDarkBg ? NSColor.whiteColor.CGColor : NSColor.blackColor.CGColor;
4659 CGContextSetFillColorWithColor(cg, knobColor);
4660 CGContextFillPath(cg);
4662 [scroller drawKnob];
4669 CGContextSetBlendMode(cg, kCGBlendModePlusDarker);
4670 [scroller drawKnob];
4676 CGContextEndTransparencyLayer(cg);
4678 d->restoreNSGraphicsContext(cg);
4682 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
4685 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
4687 auto *slider =
static_cast<NSSlider *
>(
d->cocoaControl(
cw));
4691 const bool hasTicks = sl->tickPosition != QStyleOptionSlider::NoTicks;
4692 const bool hasDoubleTicks = sl->tickPosition == QStyleOptionSlider::TicksBothSides;
4699 if (isPressed && drawKnob) {
4700 const CGRect knobRect = [slider.cell knobRectFlipped:slider.isFlipped];
4701 pressPoint.x = CGRectGetMidX(knobRect);
4702 pressPoint.y = CGRectGetMidY(knobRect);
4703 [slider.cell startTrackingAt:pressPoint inView:slider];
4709 NSSliderCell *cell = slider.cell;
4712 const CGRect barRect = [cell barRectFlipped:slider.isFlipped];
4718 [cell drawBarInside:barRect flipped:!isHorizontal];
4721 if (drawBar && hasTicks && drawTicks) {
4722 if (!hasDoubleTicks) {
4723 [cell drawTickMarks];
4726 slider.tickMarkPosition = NSTickMarkPositionAbove;
4727 [slider layoutSubtreeIfNeeded];
4728 [cell drawTickMarks];
4729 slider.tickMarkPosition = NSTickMarkPositionBelow;
4730 [slider layoutSubtreeIfNeeded];
4731 [cell drawTickMarks];
4733 slider.tickMarkPosition = NSTickMarkPositionLeading;
4734 [slider layoutSubtreeIfNeeded];
4735 [cell drawTickMarks];
4736 slider.tickMarkPosition = NSTickMarkPositionTrailing;
4737 [slider layoutSubtreeIfNeeded];
4738 [cell drawTickMarks];
4747 if (isPressed && drawKnob)
4748 [slider.cell stopTracking:pressPoint at:pressPoint inView:slider mouseIsUp:NO];
4752 if (
const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
4769 d->setupNSGraphicsContext(cg, NO);
4771 const auto aquaSize =
d->effectiveAquaSizeConstrain(
opt);
4773 NSStepperCell *cell =
static_cast<NSStepperCell *
>(
d->cocoaCell(
cw));
4776 const CGRect newRect = [cell drawingRectForBounds:updown.toCGRect()];
4780 const CGFloat x = CGRectGetMidX(newRect);
4781 const CGFloat y = upPressed ? -3 : 3;
4782 const CGPoint pressPoint = CGPointMake(
x,
y);
4785 if (upPressed || downPressed)
4786 [cell startTrackingAt:pressPoint inView:d->backingStoreNSView];
4788 [cell drawWithFrame:newRect inView:d->backingStoreNSView];
4790 if (upPressed || downPressed)
4791 [cell stopTracking:pressPoint at:pressPoint inView:d->backingStoreNSView mouseIsUp:NO];
4793 d->restoreNSGraphicsContext(cg);
4798 if (
const auto *combo = qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
4803 const auto cs =
d->effectiveAquaSizeConstrain(combo);
4805 auto *cc =
static_cast<NSControl *
>(
d->cocoaControl(
cw));
4806 cc.enabled = isEnabled;
4807 QRectF frameRect =
cw.adjustedControlFrame(combo->rect);;
4810 auto *pb =
static_cast<NSPopUpButton *
>(cc);
4818 pb.frame = frameRect.toCGRect();
4819 [pb highlight:isPressed];
4820 d->drawNSViewInRect(pb, frameRect,
p, ^(
CGContextRef,
const CGRect &
r) {
4822 [pb.cell drawBezelWithFrame:r inView:pb.superview];
4826 auto *
cb =
static_cast<NSComboBox *
>(cc);
4827 const auto frameRect =
cw.adjustedControlFrame(combo->rect);
4828 cb.frame = frameRect.toCGRect();
4831 if (NSButtonCell *cell =
static_cast<NSButtonCell *
>([cc.cell qt_valueForPrivateKey:
@"_buttonCell"])) {
4832 cell.highlighted = isPressed;
4840 [cb.cell drawWithFrame:r inView:cb];
4846 if (
const auto *titlebar = qstyleoption_cast<const QStyleOptionTitleBar *>(
opt)) {
4857 QPainterPath outerFramePath =
d->windowPanelPath(outerFrameRect);
4860 const auto frameAdjust = 1.0 /
p->device()->devicePixelRatioF();
4861 const auto innerFrameRect = outerFrameRect.adjusted(frameAdjust, frameAdjust, -frameAdjust, 0);
4862 QPainterPath innerFramePath =
d->windowPanelPath(innerFrameRect);
4869 p->fillPath(innerFramePath,
g);
4882 for (
const auto sc : buttons) {
4883 const auto ct =
d->windowButtonCocoaControl(sc);
4885 auto *wb =
static_cast<NSButton *
>(
d->cocoaControl(
cw));
4886 wb.enabled = (sc & titlebar->subControls) &&
isActive;
4887 [wb highlight:(titlebar->state & State_Sunken) && (sc & titlebar->activeSubControls)];
4893 auto *wbCell =
static_cast<NSButtonCell *
>(wb.cell);
4894 [wbCell drawWithFrame:rect inView:wb];
4901 if (!titlebar->icon.isNull()) {
4907 p->drawPixmap(iconPos,
tr.y(),
4909 opt->window->devicePixelRatio(),
4913 if (!titlebar->text.isEmpty())
4920 = qstyleoption_cast<const QStyleOptionGroupBox *>(
opt)) {
4949 = qstyleoption_cast<const QStyleOptionToolButton *>(
opt)) {
4950#ifndef QT_NO_ACCESSIBILITY
4951 if (QStyleHelper::hasAncestor(
opt->
styleObject, QAccessible::ToolBar)) {
4960 d->drawToolbarButtonArrow(tb,
p);
4963 NSView *
view =
reinterpret_cast<NSView *
>(
opt->window->winId());
4966 isKey = [view.window isKeyWindow];
4970 path.addRoundedRect(
QRectF(tb->rect.x(), tb->rect.y(), tb->rect.width(), tb->rect.height() + 4), 4, 4);
4978 auto bflags = tb->state;
4981 auto mflags = tb->state;
4991 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
4993 auto *pb =
static_cast<NSButton *
>(
d->cocoaControl(
cw));
4994 pb.bezelStyle = NSBezelStyleShadowlessSquare;
4995 pb.frame =
opt->
rect.toCGRect();
4996 pb.buttonType = NSButtonTypePushOnPushOff;
4997 pb.enabled = isEnabled;
4998 [pb highlight:isPressed];
4999 pb.state = isHighlighted && !isPressed ? NSControlStateValueOn : NSControlStateValueOff;
5003 [pb.cell drawBezelWithFrame:rect inView:pb];
5017 d->drawToolbarButtonArrow(tb,
p);
5028 if (
const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(
opt))
5029 QStyleHelper::drawDial(dial,
p);
5052 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
5053 if (!sl->rect.contains(pt))
5056 const bool hasTicks = sl->tickPosition != QStyleOptionSlider::NoTicks;
5059 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
5061 auto *slider =
static_cast<NSSlider *
>(
d->cocoaControl(
cw));
5065 NSSliderCell *cell = slider.cell;
5066 const auto barRect = QRectF::fromCGRect([cell barRectFlipped:slider.isFlipped]);
5067 const auto knobRect = QRectF::fromCGRect([cell knobRectFlipped:slider.isFlipped]);
5068 if (knobRect.contains(pt)) {
5070 }
else if (barRect.contains(pt)) {
5072 }
else if (hasTicks) {
5078 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
5079 if (!sb->rect.contains(pt)) {
5086 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
5088 auto *
scroller =
static_cast<NSScroller *
>(
d->cocoaControl(
cw));
5097 const auto knobRect = QRectF::fromCGRect([
scroller rectForPart:NSScrollerKnob]);
5100 if (pt.
x() < knobRect.left())
5102 else if (pt.
x() > knobRect.right())
5107 if (pt.
y() < knobRect.top())
5109 else if (pt.
y() > knobRect.bottom())
5131 if (
const QStyleOptionSlider *sb = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
5133 const bool isReverseHorizontal = isHorizontal && (sb->direction ==
Qt::RightToLeft);
5135 NSScrollerPart part = NSScrollerNoPart;
5137 part = NSScrollerKnob;
5139 part = NSScrollerKnobSlot;
5143 part = NSScrollerDecrementPage;
5145 part = NSScrollerIncrementPage;
5149 if (part != NSScrollerNoPart) {
5151 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
5153 auto *
scroller =
static_cast<NSScroller *
>(
d->cocoaControl(
cw));
5155 ret = QRectF::fromCGRect([
scroller rectForPart:part]).toRect();
5160 if (
const QStyleOptionSlider *sl = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
5161 const bool hasTicks = sl->tickPosition != QStyleOptionSlider::NoTicks;
5164 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
5166 auto *slider =
static_cast<NSSlider *
>(
d->cocoaControl(
cw));
5170 NSSliderCell *cell = slider.cell;
5172 ret = QRectF::fromCGRect([cell knobRectFlipped:slider.isFlipped]).toRect();
5174 ret = QRectF::fromCGRect([cell barRectFlipped:slider.isFlipped]).toRect();
5176 const auto tickMarkRect = QRectF::fromCGRect([cell rectOfTickMarkAtIndex:0]);
5178 ret =
QRect(sl->rect.left(), tickMarkRect.top(), sl->rect.width(), tickMarkRect.height());
5180 ret =
QRect(tickMarkRect.left(), sl->rect.top(), tickMarkRect.width(), sl->rect.height());
5191 if (
const auto *titlebar = qstyleoption_cast<const QStyleOptionTitleBar *>(
opt)) {
5198 qreal labelWidth = titlebar->fontMetrics.horizontalAdvance(titlebar->text) + 1;
5199 qreal labelHeight = titlebar->fontMetrics.height();
5203 if (!titlebar->icon.isNull()) {
5212 labelWidth, labelHeight);
5214 const auto currentButton =
d->windowButtonCocoaControl(sc);
5223 auto *wb =
static_cast<NSButton *
>(
d->cocoaControl(
cw));
5224 if (ct == currentButton)
5225 buttonSize = QSizeF::fromCGSize(wb.frame.size);
5238 const auto cs =
d->effectiveAquaSizeConstrain(combo);
5248 editRect = combo->rect.
adjusted(15, 7, -25, -9);
5251 if (combo->editable)
5252 editRect = combo->rect.
adjusted(15, 6, -22, -9);
5254 editRect = combo->rect.
adjusted(15, 8, -22, -6);
5257 if (combo->editable)
5258 editRect = combo->rect.
adjusted(15, 6, -20, -7);
5260 editRect = combo->rect.
adjusted(15, 5, -22, -6);
5271 ret.setWidth(combo->rect.right() -
ret.right());
5274 if (combo->editable) {
5276 const int comboTop = combo->rect.top();
5279 qRound(inner.origin.x - combo->rect.left() + inner.size.width),
5280 editRect.
bottom() - comboTop + 2);
5282 ret =
QRect(combo->rect.x() + 4 - 11,
5283 combo->rect.y() + 1,
5284 editRect.
width() + 10 + 11,
5297 bool hasNoText = !checkable &&
groupBox->text.isEmpty();
5303 const bool fontIsSet =
false;
5306 const int margin = flat || hasNoText ? 0 : 9;
5311 const int tw =
qCeil(
s.width());
5317 if (flat && checkable)
5323 int newSum = indicatorWidth + 1;
5324 int newLeft = labelRect.
left() + (rtl ? -newSum : newSum);
5331 int newLeft = labelRect.
left() - (rtl ? 3 : -3);
5335 int newLeft = labelRect.
left() - (rtl ? 3 : 2);
5343 int left = rtl ? labelRect.
right() - indicatorWidth : labelRect.
left() - 1;
5344 int top = flat ?
ret.top() + 1 :
ret.top() + 5;
5362 ret.adjust(3, -5, -3, -4);
5364 ret.adjust(3, 3, -3, -4);
5375 if (
const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
5408 if (spin->buttonSymbols == QStyleOptionSpinBox::NoButtons)
5412 const int x = spin->rect.width() - spinner_w;
5413 ret.setRect(
x + spin->rect.x(),
y + spin->rect.y(), spinner_w, spinner_h);
5416 NSStepperCell *cell =
static_cast<NSStepperCell *
>(
d->cocoaCell(
cw));
5417 const CGRect outRect = [cell drawingRectForBounds:ret.toCGRect()];
5418 ret = QRectF::fromCGRect(outRect).toRect();
5422 ret.setHeight(
ret.height() / 2);
5433 ret.translate(0, adjust_y);
5438 ret = spin->rect.adjusted(fw, fw, -fw, -fw);
5440 ret.setWidth(spin->rect.width() - spinBoxSep - spinner_w);
5453#ifndef QT_NO_ACCESSIBILITY
5454 if (QStyleHelper::hasAncestor(
opt->
styleObject, QAccessible::ToolBar))
5457 ret.adjust(-1, 0, 0, 0);
5472 bool useAquaGuideline =
true;
5476 if (
const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(
opt)) {
5478 const QSize minimumSize(20, 24);
5485 const int upAndDownTogetherHeight = buttonSize.
height() * 2;
5486 sz +=
QSize(buttonSize.
width(), upAndDownTogetherHeight);
5525 if (
const QStyleOptionTabWidgetFrame *twf
5526 = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(
opt)) {
5529 const int gapBetweenTabbarAndStackWidget = 2 + 14 - overlap;
5531 const auto tabDirection = QMacStylePrivate::tabDirection(twf->shape);
5534 extra =
QSize(2, gapBetweenTabbarAndStackWidget + 1);
5536 extra =
QSize(gapBetweenTabbarAndStackWidget + 1, 2);
5542 if (
const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(
opt)) {
5545 const bool differentFont =
false;
5546 const auto tabDirection = QMacStylePrivate::tabDirection(tab->shape);
5552 int defaultTabHeight;
5553 const auto cs =
d->effectiveAquaSizeConstrain(
opt);
5556 if (tab->documentMode)
5557 defaultTabHeight = 24;
5559 defaultTabHeight = 21;
5562 defaultTabHeight = 18;
5565 defaultTabHeight = 16;
5571 const bool widthSet = !differentFont && tab->icon.isNull();
5574 sz.
rwidth() = textSize.width();
5575 sz.
rheight() =
qMax(defaultTabHeight, textSize.height());
5584 int maxWidgetHeight =
qMax(tab->leftButtonSize.height(), tab->rightButtonSize.height());
5585 int maxWidgetWidth =
qMax(tab->leftButtonSize.width(), tab->rightButtonSize.width());
5587 int widgetWidth = 0;
5588 int widgetHeight = 0;
5590 if (tab->leftButtonSize.isValid()) {
5592 widgetWidth += tab->leftButtonSize.width();
5593 widgetHeight += tab->leftButtonSize.height();
5595 if (tab->rightButtonSize.isValid()) {
5597 widgetWidth += tab->rightButtonSize.width();
5598 widgetHeight += tab->rightButtonSize.height();
5614 if (sz.
width() < 10)
5620 int leftPadding = 4;
5621 int rightPadding = 4;
5623 int bottomPadding = 0;
5631 sz.
rwidth() += leftPadding + rightPadding;
5632 sz.
rheight() += topPadding + bottomPadding;
5645 const auto controlSize =
d->effectiveAquaSizeConstrain(
opt,
CT_PushButton, sz, &macsz);
5647 if (macsz.
width() != -1)
5664 int maxpmw = mi->maxIconWidth;
5676 h = mi->fontMetrics.height() + 2;
5677 if (!mi->icon.isNull()) {
5719 if (
const auto *tb = qstyleoption_cast<const QStyleOptionToolButton *>(
opt))
5724 if (
const auto *
cb = qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
5728 if (sz.
width() < 10)
5731 if (!
cb->editable) {
5757 if (
proxy() ==
this) {
5771 useAquaGuideline =
false;
5775 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
5776 const int minimumWidth = 24;
5777 const int absoluteHeight = 14;
5788 if (
const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(
opt)) {
5801 if (macsz.
width() != -1)
5803 if (macsz.
height() != -1)
5811 if (combo->editable) {
5812 const auto widgetSize =
d->aquaSizeConstrain(
opt);
5815 cw.size = widgetSize;
5847 margins = QCommonStyle::ninePatchMargins(cc,
opt,
imageSize);
5875 p.translate(pix2.
width(), 0);
nonatomic NSInteger animators
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.
const QColor & color() const
Returns the brush color.
constexpr bool isSpace() const noexcept
Returns true if the character is a separator character (Separator_* categories or certain code points...
The QColor class provides colors based on RGB, HSV or CMYK values.
void setAlphaF(float alpha)
Sets the alpha of this color to alpha.
QColor darker(int f=200) const noexcept
QRgb rgb() const noexcept
Returns the RGB value of the color.
float greenF() const noexcept
Returns the green color component of this color.
QRgb rgba() const noexcept
Returns the RGB value of the color, including its alpha.
int red() const noexcept
Returns the red color component of this color.
int blue() const noexcept
Returns the blue color component of this color.
int green() const noexcept
Returns the green color component of this color.
float redF() const noexcept
Returns the red color component of this color.
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...
QColor lighter(int f=150) const noexcept
float alphaF() const noexcept
Returns the alpha color component of this color.
float blueF() const noexcept
Returns the blue color component of this color.
void setHsvF(float h, float s, float v, float 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...
void getHsv(int *h, int *s, int *v, int *a=nullptr) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
int pixelMetric(PixelMetric m, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override
\reimp
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget=nullptr) const override
\reimp
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=nullptr) const override
\reimp
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override
\reimp
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const override
\reimp
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=nullptr) const override
\reimp
int styleHint(StyleHint sh, const QStyleOption *opt=nullptr, const QWidget *w=nullptr, QStyleHintReturn *shret=nullptr) const override
\reimp
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
\reimp
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=nullptr) const override
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=nullptr) const override
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const override
\reimp
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
qreal pointSizeF() const
Returns the point size of the matched window system font.
\reentrant \inmodule QtGui
qreal height() const
Returns the height of the font.
QSizeF size(int flags, const QString &str, int tabstops=0, int *tabarray=nullptr) const
Returns the size in pixels of the characters in the given text.
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
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...
QSize size(int flags, const QString &str, int tabstops=0, int *tabarray=nullptr) const
Returns the size in pixels of text.
int descent() const
Returns the descent of the font.
static QFontPrivate * get(const QFont &font)
QFontEngine * engineForScript(int script) const
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
void setPointSizeF(qreal)
Sets the point size to pointSize.
int midLineWidth
the width of the mid-line
int lineWidth
the line width
Shape frameShape
the frame shape value from the frame style
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
static QPlatformTheme * platformTheme()
static QPlatformNativeInterface * platformNativeInterface()
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
State
This enum describes the state for which a pixmap is intended to be used.
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.
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.
qsizetype bytesPerLine() const
Returns the number of bytes per image scanline.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
int width() const
Returns the width of the image.
uchar * bits()
Returns a pointer to the first pixel data.
int height() const
Returns the height of the image.
@ Format_ARGB32_Premultiplied
void fill(uint pixel)
Fills the entire image with the given pixelValue.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
void setFinalStop(const QPointF &stop)
void setStart(const QPointF &start)
qsizetype removeAll(const AT &t)
void append(parameter_type t)
void drawNSViewInRect(NSView *view, const QRectF &rect, QPainter *p, __attribute__((noescape)) DrawRectBlock drawRectBlock=nil) const
static const int PushButtonRightOffset
QHash< CocoaControl, NSCell * > cocoaCells
CocoaControlType windowButtonCocoaControl(QStyle::SubControl sc) const
@ Button_WindowMiniaturize
@ ProgressIndicator_Determinate
@ ProgressIndicator_Indeterminate
void resolveCurrentNSView(QWindow *window) const
NSView * cocoaControl(CocoaControl widget) const
QHash< CocoaControl, NSView * > cocoaControls
void drawToolbarButtonArrow(const QStyleOption *opt, QPainter *p) const
NSCell * cocoaCell(CocoaControl widget) const
static CGRect comboboxInnerBounds(const CGRect &outterBounds, const CocoaControl &cocoaWidget)
static QList< QPointer< QObject > > scrollBars
NSView * backingStoreNSView
void setupNSGraphicsContext(CGContextRef cg, bool flipped) const
QPainterPath windowPanelPath(const QRectF &r) const
static const int PushButtonLeftOffset
static const int PushButtonContentPadding
static QRectF comboboxEditBounds(const QRectF &outterBounds, const CocoaControl &cw)
QStyleHelper::WidgetSizePolicy effectiveAquaSizeConstrain(const QStyleOption *option, const QWidget *widg, QStyle::ContentsType ct=QStyle::CT_CustomBase, QSize szHint=QSize(-1, -1), QSize *insz=0) const
void restoreNSGraphicsContext(CGContextRef cg) const
QStyleHelper::WidgetSizePolicy aquaSizeConstrain(const QStyleOption *option, const QWidget *widg, QStyle::ContentsType ct=QStyle::CT_CustomBase, QSize szHint=QSize(-1, -1), QSize *insz=0) const
void setupVerticalInvertedXform(CGContextRef cg, bool reverse, bool vertical, const CGRect &rect) const
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.
int pixelMetric(PixelMetric pm, const QStyleOption *opt=0, const QWidget *widget=nullptr) const
\reimp
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const
\reimp
virtual int styleHint(StyleHint sh, const QStyleOption *opt=0, const QWidget *w=nullptr, QStyleHintReturn *shret=nullptr) const
\reimp
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget=nullptr) const
\reimp
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *w=nullptr) const
\reimp
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *w=nullptr) const
\reimp
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
\reimp
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const
\reimp
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt, const QWidget *widget=nullptr) const
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w=nullptr) const
\reimp
QVariant property(const char *name) const
Returns the value of the object's name property.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
static constexpr QOperatingSystemVersionBase MacOSMojave
\variable QOperatingSystemVersion::MacOSMojave
static QOperatingSystemVersion current()
[0]
The QPainterPathStroker class is used to generate fillable outlines for a given painter path.
void setDashPattern(Qt::PenStyle)
Sets the dash pattern for the generated outlines to style.
void setCapStyle(Qt::PenCapStyle style)
Sets the cap style of the generated outlines to style.
QPainterPath createStroke(const QPainterPath &path) const
Generates a new path that is a fillable area representing the outline of the given path.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPalette class contains color groups for each widget state.
const QBrush & button() const
Returns the button brush of the current color group.
const QBrush & text() const
Returns the text foreground brush of the current color group.
const QBrush & dark() const
Returns the dark brush of the current color group.
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
void setCurrentColorGroup(ColorGroup cg)
Set the palette's current color group to cg.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
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...
const QBrush & window() const
Returns the window (general background) brush of the current color group.
const QBrush & buttonText() const
Returns the button text foreground brush of the current color group.
const QBrush & highlightedText() const
Returns the highlighted text brush of the current color group.
void setWidth(int width)
Sets the pen width to the given width in pixels with integer precision.
void setColor(const QColor &color)
Sets the color of this pen's brush to the given color.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QImage toImage() const
Converts the pixmap to a QImage.
int width() const
Returns the width of the pixmap.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the pixmap.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
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.
\inmodule QtCore\reentrant
constexpr qreal & rx() noexcept
Returns a reference to the x coordinate of this point.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
NSView * backingStoreNSView
int styleHint(StyleHint sh, const QStyleOption *opt=0, QStyleHintReturn *shret=0) const override
int pixelMetric(PixelMetric pm, const QStyleOption *opt=0) const override
\inmodule QtCore\reentrant
constexpr qreal bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
QRect toAlignedRect() const noexcept
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
\inmodule QtCore\reentrant
constexpr QPoint bottomLeft() const noexcept
Returns the position of the rectangle's bottom-left corner.
constexpr void adjust(int x1, int y1, int x2, int y2) noexcept
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
constexpr void moveCenter(const QPoint &p) noexcept
Moves the rectangle, leaving the center point at the given position.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr void setSize(const QSize &s) noexcept
Sets the size of the rectangle to the given size.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QPoint topRight() const noexcept
Returns the position of the rectangle's top-right corner.
constexpr void moveLeft(int pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setRect(int x, int y, int w, int h) noexcept
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setWidth(int w) noexcept
Sets the width of the rectangle to the given width.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr QRect transposed() const noexcept
constexpr void translate(int dx, int dy) noexcept
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position.
constexpr QPoint bottomRight() const noexcept
Returns the position of the rectangle's bottom-right corner.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
constexpr void moveTo(int x, int t) noexcept
Moves the rectangle, leaving the top-left corner at the given position (x, y).
constexpr void moveTop(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
constexpr void setY(int y) noexcept
Sets the top edge of the rectangle to the given y coordinate.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
constexpr qreal height() const noexcept
Returns the height.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr int & rheight() noexcept
Returns a reference to the height.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
constexpr QSize transposed() const noexcept
constexpr int & rwidth() noexcept
Returns a reference to the width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString right(qsizetype n) const
Returns a substring that contains the n rightmost characters of the string.
void truncate(qsizetype pos)
Truncates the string at the given position index.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
qsizetype length() const
Returns the number of characters in this string.
The QStyleHintReturnMask class provides style hints that return a QRegion.
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionToolButton::features
\variable QStyleOptionMenuItem::menuItemType
\variable QStyleOptionFocusRect::backgroundColor
\variable QStyleOptionFrame::features
\variable QStyleOptionButton::features
The QStyleOption class stores the parameters used by QStyle functions.
Qt::LayoutDirection direction
ContentsType
This enum describes the available contents types.
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const =0
Returns the rectangle containing the specified subControl of the given complex control (with the styl...
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
StyleHint
This enum describes the available style hints.
@ SH_TitleBar_ShowToolTipsOnButtons
@ SH_ComboBox_ListMouseTracking
@ SH_TabBar_CloseButtonPosition
@ SH_Slider_PageSetButtons
@ SH_ScrollView_FrameOnlyAroundContents
@ SH_MainWindow_SpaceBelowMenuBar
@ SH_ItemView_PaintAlternatingRowColorsForEmptyArea
@ SH_ItemView_ChangeHighlightOnFocus
@ SH_ItemView_MovementWithoutUpdatingSelection
@ SH_MenuBar_AltKeyNavigation
@ SH_Menu_SubMenuUniDirection
@ SH_ScrollBar_RollBetweenButtons
@ SH_Menu_FlashTriggeredItem
@ SH_Menu_SubMenuPopupDelay
@ SH_ItemView_ArrowKeysNavigateIntoChildren
@ SH_Slider_AbsoluteSetButtons
@ SH_Menu_SubMenuResetWhenReenteringParent
@ SH_Header_ArrowAlignment
@ SH_ToolBox_SelectedPageTitleBold
@ SH_TabBar_PreferNoArrows
@ SH_Menu_SubMenuSloppySelectOtherActions
@ SH_Widget_ShareActivation
@ SH_ComboBox_LayoutDirection
@ SH_ComboBox_AllowWheelScrolling
@ SH_Menu_AllowActiveAndDisabled
@ SH_TabBar_SelectMouseType
@ SH_Menu_FillScreenWithScroll
@ SH_FontDialog_SelectAssociatedText
@ SH_ToolTipLabel_Opacity
@ SH_ScrollBar_LeftClickAbsolutePosition
@ SH_DialogButtonBox_ButtonsHaveIcons
@ SH_MenuBar_MouseTracking
@ SH_ScrollBar_ContextMenu
@ SH_FormLayoutFormAlignment
@ SH_Menu_SubMenuDontStartSloppyOnLeave
@ SH_MessageBox_CenterButtons
@ SH_TitleBar_ModifyNotification
@ SH_Slider_StopMouseOverSlider
@ SH_SpinBox_ButtonsInsideFrame
@ SH_GroupBox_TextLabelVerticalAlignment
@ SH_PrintDialog_RightAlignButtons
@ SH_BlinkCursorWhenTextSelected
@ SH_ListViewExpand_SelectMouseType
@ SH_ItemView_EllipsisLocation
@ SH_MessageBox_TextInteractionFlags
@ SH_RichText_FullWidthSelection
@ SH_FormLayoutLabelAlignment
@ SH_ItemView_ShowDecorationSelected
@ SH_DockWidget_ButtonsHaveFrame
@ SH_Menu_SpaceActivatesItem
@ SH_FocusFrame_AboveWidget
@ SH_Workspace_FillSpaceOnMaximize
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
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,...
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...
StandardPixmap
This enum describes the available standard pixmaps.
@ SP_TitleBarNormalButton
@ SP_MessageBoxInformation
@ SP_ToolBarVerticalExtensionButton
@ SP_ToolBarHorizontalExtensionButton
ControlElement
This enum represents a control element.
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...
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const =0
Returns the sub-area for the given element as described in the provided style option.
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.
PixelMetric
This enum describes the various available pixel metrics.
@ PM_DockWidgetFrameWidth
@ PM_DockWidgetTitleMargin
@ PM_ExclusiveIndicatorHeight
@ PM_ButtonShiftHorizontal
@ PM_MdiSubWindowFrameWidth
@ PM_DockWidgetTitleBarButtonMargin
@ PM_ScrollView_ScrollBarOverlap
@ PM_DockWidgetSeparatorExtent
@ PM_TabCloseIndicatorWidth
@ PM_CheckBoxLabelSpacing
@ PM_LayoutVerticalSpacing
@ PM_TabBarTabShiftVertical
@ PM_LayoutHorizontalSpacing
@ PM_ButtonDefaultIndicator
@ PM_SliderControlThickness
@ PM_MenuDesktopFrameWidth
@ PM_DialogButtonsSeparator
@ PM_ToolBarExtensionExtent
@ PM_TabCloseIndicatorHeight
@ PM_DialogButtonsButtonHeight
@ PM_DialogButtonsButtonWidth
@ PM_RadioButtonLabelSpacing
@ PM_TabBarTabShiftHorizontal
@ PM_ExclusiveIndicatorWidth
@ PM_ToolTipLabelFrameWidth
ComplexControl
This enum describes the available complex controls.
PrimitiveElement
This enum describes the various primitive elements.
@ PE_IndicatorToolBarHandle
@ PE_IndicatorHeaderArrow
@ PE_PanelScrollAreaCorner
@ PE_IndicatorDockWidgetResizeHandle
@ PE_IndicatorRadioButton
@ PE_IndicatorToolBarSeparator
@ PE_IndicatorMenuCheckMark
@ PE_IndicatorItemViewItemCheck
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given element with the provided painter with the style options specified by option.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
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.
SubElement
This enum represents a sub-area of a widget.
@ SE_RadioButtonLayoutItem
@ SE_TreeViewDisclosureItem
@ SE_TabBarTabRightButton
@ SE_TabWidgetRightCorner
@ SE_ProgressBarLayoutItem
@ SE_DockWidgetTitleBarText
@ SE_DockWidgetFloatButton
@ SE_PushButtonLayoutItem
@ SE_DockWidgetCloseButton
@ SE_TabWidgetTabContents
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given primitive element with the provided painter using the style options specified by opti...
const QStyle * proxy() const
SubControl
This enum describes the available sub controls.
@ SC_TitleBarNormalButton
@ SC_ComboBoxListBoxPopup
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
uint toUInt(bool *ok=nullptr) const
Returns the variant as an unsigned int if the variant has userType() \l QMetaType::UInt,...
QRect toRect() const
Returns the variant as a QRect if the variant has userType() \l QMetaType::QRect; otherwise returns a...
const QStyleOptionButton * btn
[3]
static const QColor darkTabBarTabBackgroundActiveHovered(32, 32, 32)
static const QColor tabBarTabLineActiveHovered()
static const QColor darkTabBarTabLineActive(90, 90, 90)
static const QColor darkTabBarTabBackground(38, 38, 38)
static const QColor tabBarTabBackgroundActiveHovered()
static const QColor lightTabBarTabBackgroundSelected(246, 246, 246)
static const QColor lightTabBarTabLineActiveHovered(150, 150, 150)
static const QColor lightTabBarTabBackground(227, 227, 227)
static const QColor lightTabBarTabLineSelected(189, 189, 189)
static const QColor tabBarTabBackgroundSelected()
static const QColor lightTabBarTabLineActive(160, 160, 160)
static const QColor darkTabBarTabLineActiveHovered(90, 90, 90)
QBrush brushForToolButton(bool isOnKeyWindow)
static const QColor darkTabBarTabLineSelected(90, 90, 90)
static const QColor darkTabBarTabBackgroundActive(38, 38, 38)
static const QColor lightTabBarTabBackgroundActiveSelected(211, 211, 211)
static const QColor lightTabBarTabBackgroundActive(190, 190, 190)
static const QColor lightTabBarTabLine(210, 210, 210)
static const QColor tabBarTabLineActive()
static const QColor tabBarTabBackgroundActiveSelected()
QRect rotateTabPainter(QPainter *p, QStyleOptionTab::Shape shape, QRect tabRect)
static const QColor tabBarTabBackgroundActive()
static const int closeButtonSize
static const QColor darkTabBarTabLine(90, 90, 90)
static const QColor tabBarTabLine()
static const QColor darkTabBarTabBackgroundSelected(52, 52, 52)
static const QColor tabBarTabBackground()
static const QColor tabBarTabLineSelected()
void drawTabShape(QPainter *p, const QStyleOptionTab *tabOpt, bool isUnified, int tabOverlap)
void drawTabBase(QPainter *p, const QStyleOptionTabBarBase *tbb)
static const QColor darkTabBarTabBackgroundActiveSelected(52, 52, 52)
static const QColor lightTabBarTabBackgroundActiveHovered(178, 178, 178)
Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi)
WidgetSizePolicy widgetSizePolicy(const QWidget *widget, const QStyleOption *opt)
QColor backgroundColor(const QPalette &pal, const QWidget *widget)
Combined button and popup list for selecting options.
@ TextSelectableByKeyboard
@ ToolButtonTextUnderIcon
@ ToolButtonTextBesideIcon
#define Q_STATIC_ASSERT(Condition)
#define QByteArrayLiteral(str)
#define QT_NAMESPACE_ALIAS_OBJC_CLASS(__KLASS__)
QColor qt_mac_toQColor(CGColorRef color)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static QString header(const QString &name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
bool qFuzzyIsNull(qfloat16 f) noexcept
int qRound(qfloat16 d) noexcept
static const QColor darkModeSeparatorLine(88, 88, 88)
static QStyleHelper::WidgetSizePolicy getControlSize(const QStyleOption *option, const QWidget *widget)
static const qreal focusRingWidth
static const int toolButtonArrowSize
static const QColor darkMainWindowGradientBegin(47, 47, 47)
static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QStyleOption *opt, const QWidget *widg, QSize szHint, QStyleHelper::WidgetSizePolicy sz)
static const QColor lightMainWindowGradientEnd(200, 200, 200)
static const QColor lightMainWindowGradientBegin(240, 240, 240)
static QLinearGradient titlebarGradientActive()
static const QColor titlebarSeparatorLineInactive(131, 131, 131)
static const int headerSectionArrowHeight
static bool setupSlider(NSSlider *slider, const QStyleOptionSlider *sl)
static bool setupScroller(NSScroller *scroller, const QStyleOptionSlider *sb)
static const qreal titleBarIconTitleSpacing
static QLinearGradient titlebarGradientInactive()
static QPixmap darkenPixmap(const QPixmap &pixmap)
static const int qt_mac_aqua_metrics[]
static const QColor titlebarSeparatorLineActive(111, 111, 111)
static const qreal titleBarButtonSpacing
static const int toolButtonArrowMargin
@ ProgressBarShadowOutset
@ SmallProgressBarShadowOutset
@ LargeProgressBarThickness
@ NormalProgressBarThickness
QMacStylePrivate::CocoaControlType cocoaControlType(const QStyleOption *opt, const QWidget *w)
static const qreal popupButtonDefaultHeight[3]
static const QColor darkMainWindowGradientEnd(47, 47, 47)
static QString qt_mac_removeMnemonics(const QString &original)
static const qreal pushButtonDefaultHeight[3]
static void setLayoutItemMargins(int left, int top, int right, int bottom, QRect *rect, Qt::LayoutDirection dir)
static const qreal comboBoxDefaultHeight[3]
static const int headerSectionSeparatorInset
static int qt_mac_aqua_get_metric(QAquaMetric m)
static const int DisclosureOffset
static const qreal titleBarTitleRightMargin
static bool qt_macWindowMainWindow(const QWidget *window)
#define return_SIZE(large, small, mini)
#define SIZE(large, small, mini)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLenum GLsizei GLsizei GLint * values
[15]
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * label
[43]
GLenum GLsizeiptr fontSize
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei const GLint * box
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLfloat GLfloat GLfloat GLfloat h
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
struct CGContext * CGContextRef
static constexpr QSize frameSize(const T &frame)
#define QT_NAMESPACE_ALIAS_OBJC_CLASS(name)
#define LargeSmallMini(option, large, small, mini)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr QRgb qRgb(int r, int g, int b)
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr QRgb qRgba(int r, int g, int b, int a)
constexpr int qBlue(QRgb rgb)
constexpr int qAlpha(QRgb rgb)
static const struct TessellationWindingOrderTab cw[]
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
constexpr bool verticalTabs(QTabBar::Shape shape) noexcept
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QObject * styleObject(const QStyleOption *option)
static bool isTransient(const QWindow *w)
if(qFloatDistance(a, b)<(1<< 7))
[0]
QFile defaults(defaultsPath)
\inmodule QtCore \reentrant
bool contains(const AT &t) const noexcept
QSizeF defaultFrameSize() const
QRectF adjustedControlFrame(const QRectF &rect) const
bool operator==(const CocoaControl &other) const
bool getCocoaButtonTypeAndBezelStyle(NSButtonType *buttonType, NSBezelStyle *bezelStyle) const
QStyleHelper::WidgetSizePolicy size
QMarginsF titleMargins() const