Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QMacStylePrivate Class Reference

#include <qmacstyle_mac_p_p.h>

+ Inheritance diagram for QMacStylePrivate:
+ Collaboration diagram for QMacStylePrivate:

Classes

struct  CocoaControl
 

Public Types

enum  Direction { North , South , East , West }
 
enum  CocoaControlType {
  NoControl , Box , Box_Dark , Button_CheckBox ,
  Button_Disclosure , Button_PopupButton , Button_PullDown , Button_PushButton ,
  Button_RadioButton , Button_SquareButton , Button_WindowClose , Button_WindowMiniaturize ,
  Button_WindowZoom , ComboBox , ProgressIndicator_Determinate , ProgressIndicator_Indeterminate ,
  Scroller_Horizontal , Scroller_Vertical , SegmentedControl_First , SegmentedControl_Middle ,
  SegmentedControl_Last , SegmentedControl_Single , Slider_Horizontal , Slider_Vertical ,
  SplitView_Horizontal , SplitView_Vertical , Stepper , TextField
}
 
enum  Animates { AquaPushButton , AquaProgressBar , AquaListViewItemOpen , AquaScrollBar }
 
typedef void(^ DrawRectBlock) (CGContextRef, const CGRect &)
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData >
 

Public Member Functions

 QMacStylePrivate ()
 
 ~QMacStylePrivate ()
 
QStyleHelper::WidgetSizePolicy aquaSizeConstrain (const QStyleOption *option, const QWidget *widg, QStyle::ContentsType ct=QStyle::CT_CustomBase, QSize szHint=QSize(-1, -1), QSize *insz=0) const
 
QStyleHelper::WidgetSizePolicy effectiveAquaSizeConstrain (const QStyleOption *option, const QWidget *widg, QStyle::ContentsType ct=QStyle::CT_CustomBase, QSize szHint=QSize(-1, -1), QSize *insz=0) const
 
int animateSpeed (Animates) const
 
void setAutoDefaultButton (QObject *button) const
 
NSView * cocoaControl (CocoaControl widget) const
 
NSCell * cocoaCell (CocoaControl widget) const
 
void setupNSGraphicsContext (CGContextRef cg, bool flipped) const
 
void restoreNSGraphicsContext (CGContextRef cg) const
 
void setupVerticalInvertedXform (CGContextRef cg, bool reverse, bool vertical, const CGRect &rect) const
 
void drawNSViewInRect (NSView *view, const QRectF &rect, QPainter *p, __attribute__((noescape)) DrawRectBlock drawRectBlock=nil) const
 
void resolveCurrentNSView (QWindow *window) const
 
void drawFocusRing (QPainter *p, const QRectF &targetRect, int hMargin, int vMargin, const CocoaControl &cw) const
 
void drawToolbarButtonArrow (const QStyleOption *opt, QPainter *p) const
 
QPainterPath windowPanelPath (const QRectF &r) const
 
CocoaControlType windowButtonCocoaControl (QStyle::SubControl sc) const
 
- Public Member Functions inherited from QCommonStylePrivate
 QCommonStylePrivate ()
 
 ~QCommonStylePrivate ()
 
QString calculateElidedText (const QString &text, const QTextOption &textOption, const QFont &font, const QRect &textRect, const Qt::Alignment valign, Qt::TextElideMode textElideMode, int flags, bool lastVisibleLineShouldBeElided, QPointF *paintStartPosition) const
 
- Public Member Functions inherited from QStylePrivate
 QStylePrivate ()
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
void _q_reregisterTimers (void *pointer)
 
bool isSender (const QObject *receiver, const char *signal) const
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static CGRect comboboxInnerBounds (const CGRect &outterBounds, const CocoaControl &cocoaWidget)
 
static QRectF comboboxEditBounds (const QRectF &outterBounds, const CocoaControl &cw)
 
- Static Public Member Functions inherited from QStylePrivate
static bool useFullScreenForPopup ()
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QPointer< QObjectautoDefaultButton
 
QPointer< QFocusFramefocusWidget
 
NSView * backingStoreNSView
 
QHash< CocoaControl, NSView * > cocoaControls
 
QHash< CocoaControl, NSCell * > cocoaCells
 
std::optional< QFontsmallSystemFont
 
QMacKeyValueObserver appearanceObserver
 
- Public Attributes inherited from QCommonStylePrivate
QIcon tabBarcloseButtonIcon
 
int animationFps
 
- Public Attributes inherited from QStylePrivate
int layoutSpacingIndex
 
QStyleproxyStyle
 
QString name
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint unused: 21
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Static Public Attributes

static const int PushButtonLeftOffset = 6
 
static const int PushButtonRightOffset = 12
 
static const int PushButtonContentPadding = 6
 
static QList< QPointer< QObject > > scrollBars
 

Detailed Description

Definition at line 149 of file qmacstyle_mac_p_p.h.

Member Typedef Documentation

◆ DrawRectBlock

typedef void(^ QMacStylePrivate::DrawRectBlock) (CGContextRef, const CGRect &)

Definition at line 205 of file qmacstyle_mac_p_p.h.

Member Enumeration Documentation

◆ Animates

Enumerator
AquaPushButton 
AquaProgressBar 
AquaListViewItemOpen 
AquaScrollBar 

Definition at line 215 of file qmacstyle_mac_p_p.h.

◆ CocoaControlType

Enumerator
NoControl 
Box 
Box_Dark 
Button_CheckBox 
Button_Disclosure 
Button_PopupButton 
Button_PullDown 
Button_PushButton 
Button_RadioButton 
Button_SquareButton 
Button_WindowClose 
Button_WindowMiniaturize 
Button_WindowZoom 
ComboBox 
ProgressIndicator_Determinate 
ProgressIndicator_Indeterminate 
Scroller_Horizontal 
Scroller_Vertical 
SegmentedControl_First 
SegmentedControl_Middle 
SegmentedControl_Last 
SegmentedControl_Single 
Slider_Horizontal 
Slider_Vertical 
SplitView_Horizontal 
SplitView_Vertical 
Stepper 
TextField 

Definition at line 157 of file qmacstyle_mac_p_p.h.

◆ Direction

Enumerator
North 
South 
East 
West 

Definition at line 153 of file qmacstyle_mac_p_p.h.

Constructor & Destructor Documentation

◆ QMacStylePrivate()

QMacStylePrivate::QMacStylePrivate ( )

Definition at line 1781 of file qmacstyle_mac.mm.

◆ ~QMacStylePrivate()

QMacStylePrivate::~QMacStylePrivate ( )

Definition at line 1786 of file qmacstyle_mac.mm.

References cocoaCells, cocoaControls, pool, and release().

+ Here is the call graph for this function:

Member Function Documentation

◆ animateSpeed()

int QMacStylePrivate::animateSpeed ( Animates  ) const
inline

Definition at line 222 of file qmacstyle_mac_p_p.h.

◆ aquaSizeConstrain()

QStyleHelper::WidgetSizePolicy QMacStylePrivate::aquaSizeConstrain ( const QStyleOption option,
const QWidget widg,
QStyle::ContentsType  ct = QStyle::CT_CustomBase,
QSize  szHint = QSize(-1, -1),
QSize insz = 0 
) const

◆ cocoaCell()

NSCell * QMacStylePrivate::cocoaCell ( CocoaControl  widget) const

◆ cocoaControl()

◆ comboboxEditBounds()

QRectF QMacStylePrivate::comboboxEditBounds ( const QRectF outerBounds,
const CocoaControl cw 
)
static

Inside a combobox Qt places a line edit widget. The size of this widget should depend on the kind of combobox we choose to draw. This function calculates and returns this size.

Definition at line 1742 of file qmacstyle_mac.mm.

References Button_PopupButton, ComboBox, cw, ret, QStyleHelper::SizeLarge, QStyleHelper::SizeMini, and QStyleHelper::SizeSmall.

Referenced by QMacStyle::subControlRect().

+ Here is the caller graph for this function:

◆ comboboxInnerBounds()

CGRect QMacStylePrivate::comboboxInnerBounds ( const CGRect &  outerBounds,
const CocoaControl cocoaWidget 
)
static

Carbon draws comboboxes (and other views) outside the rect given as argument. Use this function to obtain the corresponding inner rect for drawing the same combobox so that it stays inside the given outerBounds.

Definition at line 1685 of file qmacstyle_mac.mm.

References Button_PopupButton, ComboBox, QMacStylePrivate::CocoaControl::size, QStyleHelper::SizeDefault, QStyleHelper::SizeLarge, QStyleHelper::SizeMini, QStyleHelper::SizeSmall, and QMacStylePrivate::CocoaControl::type.

Referenced by QQC2_NAMESPACE::QMacStyle::sizeFromContents(), QMacStyle::sizeFromContents(), QQC2_NAMESPACE::QMacStyle::subControlRect(), and QMacStyle::subControlRect().

+ Here is the caller graph for this function:

◆ drawFocusRing()

◆ drawNSViewInRect()

void QMacStylePrivate::drawNSViewInRect ( NSView *  view,
const QRectF rect,
QPainter p,
__attribute__((noescape)) DrawRectBlock  drawRectBlock = nil 
) const

Definition at line 1983 of file qmacstyle_mac.mm.

References backingStoreNSView, rect, restoreNSGraphicsContext(), setupNSGraphicsContext(), and view.

+ Here is the call graph for this function:

◆ drawToolbarButtonArrow()

void QMacStylePrivate::drawToolbarButtonArrow ( const QStyleOption opt,
QPainter p 
) const

Definition at line 5133 of file qmacstyle_mac.mm.

References QRect::bottom(), opt, QStyle::PE_IndicatorArrowDown, QStyleOption::rect, QRect::right(), toolButtonArrowMargin, and toolButtonArrowSize.

+ Here is the call graph for this function:

◆ effectiveAquaSizeConstrain()

QStyleHelper::WidgetSizePolicy QMacStylePrivate::effectiveAquaSizeConstrain ( const QStyleOption option,
const QWidget widg,
QStyle::ContentsType  ct = QStyle::CT_CustomBase,
QSize  szHint = QSize(-1, -1),
QSize insz = 0 
) const

Definition at line 1432 of file qmacstyle_mac.mm.

References QStyleHelper::SizeDefault, and QStyleHelper::SizeLarge.

◆ resolveCurrentNSView()

void QMacStylePrivate::resolveCurrentNSView ( QWindow window) const

Definition at line 2028 of file qmacstyle_mac.mm.

References backingStoreNSView, and window().

+ Here is the call graph for this function:

◆ restoreNSGraphicsContext()

void QMacStylePrivate::restoreNSGraphicsContext ( CGContextRef  cg) const

Definition at line 5153 of file qmacstyle_mac.mm.

Referenced by drawNSViewInRect(), and QQC2::QMacStylePrivate::drawNSViewInRect().

+ Here is the caller graph for this function:

◆ setAutoDefaultButton()

void QMacStylePrivate::setAutoDefaultButton ( QObject button) const

◆ setupNSGraphicsContext()

void QMacStylePrivate::setupNSGraphicsContext ( CGContextRef  cg,
bool  flipped 
) const

Definition at line 5144 of file qmacstyle_mac.mm.

Referenced by drawNSViewInRect(), and QQC2::QMacStylePrivate::drawNSViewInRect().

+ Here is the caller graph for this function:

◆ setupVerticalInvertedXform()

void QMacStylePrivate::setupVerticalInvertedXform ( CGContextRef  cg,
bool  reverse,
bool  vertical,
const CGRect &  rect 
) const

Definition at line 3475 of file qmacstyle_mac.mm.

References M_PI_2, and rect.

◆ windowButtonCocoaControl()

◆ windowPanelPath()

QPainterPath QMacStylePrivate::windowPanelPath ( const QRectF r) const

Definition at line 1277 of file qmacstyle_mac.mm.

Member Data Documentation

◆ appearanceObserver

QMacKeyValueObserver QMacStylePrivate::appearanceObserver

Definition at line 267 of file qmacstyle_mac_p_p.h.

◆ autoDefaultButton

QPointer<QObject> QMacStylePrivate::autoDefaultButton
mutable

Definition at line 257 of file qmacstyle_mac_p_p.h.

◆ backingStoreNSView

NSView* QMacStylePrivate::backingStoreNSView
mutable

Definition at line 261 of file qmacstyle_mac_p_p.h.

Referenced by drawNSViewInRect(), and resolveCurrentNSView().

◆ cocoaCells

QHash<CocoaControl, NSCell *> QMacStylePrivate::cocoaCells
mutable

Definition at line 263 of file qmacstyle_mac_p_p.h.

Referenced by ~QMacStylePrivate(), and cocoaCell().

◆ cocoaControls

QHash<CocoaControl, NSView *> QMacStylePrivate::cocoaControls
mutable

Definition at line 262 of file qmacstyle_mac_p_p.h.

Referenced by ~QMacStylePrivate(), and cocoaControl().

◆ focusWidget

QPointer<QFocusFrame> QMacStylePrivate::focusWidget
mutable

Definition at line 260 of file qmacstyle_mac_p_p.h.

◆ PushButtonContentPadding

const int QMacStylePrivate::PushButtonContentPadding = 6
static

◆ PushButtonLeftOffset

const int QMacStylePrivate::PushButtonLeftOffset = 6
static

◆ PushButtonRightOffset

const int QMacStylePrivate::PushButtonRightOffset = 12
static

◆ scrollBars

◆ smallSystemFont

std::optional<QFont> QMacStylePrivate::smallSystemFont

Definition at line 265 of file qmacstyle_mac_p_p.h.


The documentation for this class was generated from the following files: