Qt 4.8
|
#include <qmacstyle_mac_p.h>
Classes | |
struct | ButtonState |
Public Types | |
enum | Animates { AquaPushButton, AquaProgressBar, AquaListViewItemOpen } |
Public Functions | |
bool | addWidget (QWidget *) |
bool | animatable (Animates, const QWidget *) const |
int | animateSpeed (Animates) const |
QAquaWidgetSize | aquaSizeConstrain (const QStyleOption *option, const QWidget *widg, QStyle::ContentsType ct=QStyle::CT_CustomBase, QSize szHint=QSize(-1, -1), QSize *insz=0) const |
bool | contentFitsInPushButton (const QStyleOptionButton *btn, HIThemeButtonDrawInfo *bdi, ThemeButtonKind buttonKindToCheck) const |
bool | doAnimate (Animates) |
void | drawColorlessButton (const HIRect &macRect, HIThemeButtonDrawInfo *bdi, QPainter *p, const QStyleOption *opt) const |
QPixmap | generateBackgroundPattern () const |
void | getSliderInfo (QStyle::ComplexControl cc, const QStyleOptionSlider *slider, HIThemeTrackDrawInfo *tdi, const QWidget *needToRemoveMe) |
void | initComboboxBdi (const QStyleOptionComboBox *combo, HIThemeButtonDrawInfo *bdi, const QWidget *widget, const ThemeDrawState &tds) |
void | initHIThemePushButton (const QStyleOptionButton *btn, const QWidget *widget, const ThemeDrawState tds, HIThemeButtonDrawInfo *bdi) const |
HIRect | pushButtonContentBounds (const QStyleOptionButton *btn, const HIThemeButtonDrawInfo *bdi) const |
QSize | pushButtonSizeFromContents (const QStyleOptionButton *btn) const |
QMacStylePrivate (QMacStyle *style) | |
void | removeWidget (QWidget *) |
void | startAnimate (Animates, QWidget *) |
void | stopAnimate (Animates, QWidget *) |
Public Functions inherited from QObject | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Static Public Functions | |
static QRect | comboboxEditBounds (const QRect &outerBounds, const HIThemeButtonDrawInfo &bdi) |
static HIRect | comboboxInnerBounds (const HIRect &outerBounds, int buttonKind) |
static void | drawCombobox (const HIRect &outerBounds, const HIThemeButtonDrawInfo &bdi, QPainter *p) |
static void | drawTableHeader (const HIRect &outerBounds, bool drawTopBorder, bool drawLeftBorder, const HIThemeButtonDrawInfo &bdi, QPainter *p) |
static ThemeDrawState | getDrawState (QStyle::State flags) |
Static Public Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Public Variables | |
struct QMacStylePrivate::ButtonState | buttonState |
QPointer< QPushButton > | defaultButton |
CFAbsoluteTime | defaultButtonStart |
QPointer< QFocusFrame > | focusWidget |
bool | mouseDown |
QList< QPointer< QWidget > > | progressBars |
UInt8 | progressFrame |
QMacStyle * | q |
int | timerID |
Static Public Variables | |
static const int | BevelButtonH = 22 |
static const int | BevelButtonW = 50 |
static const int | MiniButtonH = 26 |
static const int | PushButtonBottomOffset = 12 |
static const int | PushButtonContentPadding = 6 |
static const int | PushButtonLeftOffset = 6 |
static const int | PushButtonRightOffset = 12 |
static const int | PushButtonTopOffset = 4 |
static const int | SmallButtonH = 30 |
Static Public Variables inherited from QObject | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Functions | |
bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
void | timerEvent (QTimerEvent *) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Protected Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *) |
This event handler can be reimplemented in a subclass to receive child events. More... | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
Private Slots | |
void | startAnimationTimer () |
Additional Inherited Members | |
Public Slots inherited from QObject | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Protected Variables inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Static Protected Variables inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
Related Functions inherited from QObject | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
Definition at line 155 of file qmacstyle_mac_p.h.
Enumerator | |
---|---|
AquaPushButton | |
AquaProgressBar | |
AquaListViewItemOpen |
Definition at line 178 of file qmacstyle_mac_p.h.
QMacStylePrivate::QMacStylePrivate | ( | QMacStyle * | style | ) |
Definition at line 1427 of file qmacstyle_mac.mm.
bool QMacStylePrivate::addWidget | ( | QWidget * | w | ) |
Definition at line 1489 of file qmacstyle_mac.mm.
Referenced by QMacStyle::polish().
bool QMacStylePrivate::animatable | ( | QMacStylePrivate::Animates | as, |
const QWidget * | w | ||
) | const |
Definition at line 1441 of file qmacstyle_mac.mm.
Referenced by QMacStyle::drawControl().
|
inline |
Definition at line 189 of file qmacstyle_mac_p.h.
Referenced by startAnimationTimer().
QAquaWidgetSize QMacStylePrivate::aquaSizeConstrain | ( | const QStyleOption * | option, |
const QWidget * | widg, | ||
QStyle::ContentsType | ct = QStyle::CT_CustomBase , |
||
QSize | szHint = QSize(-1, -1) , |
||
QSize * | insz = 0 |
||
) | const |
Definition at line 866 of file qmacstyle_mac.mm.
Referenced by QMacStyle::drawComplexControl(), QMacStyle::drawControl(), QMacStyle::drawPrimitive(), getSliderInfo(), initComboboxBdi(), initHIThemePushButton(), QMacStyle::pixelMetric(), QMacStyle::sizeFromContents(), and QMacStyle::subControlRect().
|
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 1193 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), and QMacStyle::subControlRect().
|
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 1140 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), drawCombobox(), QMacStyle::sizeFromContents(), and QMacStyle::subControlRect().
bool QMacStylePrivate::contentFitsInPushButton | ( | const QStyleOptionButton * | btn, |
HIThemeButtonDrawInfo * | bdi, | ||
ThemeButtonKind | buttonKindToCheck | ||
) | const |
Checks if the actual contents of btn fits inside the free content bounds of 'buttonKindToCheck'. Meant as a helper function for 'initHIThemePushButton' for determining which button kind to use for drawing.
Definition at line 983 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), and initHIThemePushButton().
bool QMacStylePrivate::doAnimate | ( | QMacStylePrivate::Animates | as | ) |
void QMacStylePrivate::drawColorlessButton | ( | const HIRect & | macRect, |
HIThemeButtonDrawInfo * | bdi, | ||
QPainter * | p, | ||
const QStyleOption * | opt | ||
) | const |
Definition at line 1676 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), QMacStyle::drawComplexControl(), and QMacStyle::drawPrimitive().
|
static |
Carbon comboboxes don't scale (sight). If the size of the combo suggest a scaled version, create it manually by drawing a small Carbon combo onto a pixmap (use pixmap cache), chop it up, and copy it back onto the widget. Othervise, draw the combobox supplied by Carbon directly.
Definition at line 1227 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), drawColorlessButton(), and QMacStyle::drawComplexControl().
|
static |
Carbon tableheaders don't scale (sight). So create it manually by drawing a small Carbon header onto a pixmap (use pixmap cache), chop it up, and copy it back onto the widget.
Definition at line 1278 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), and QMacStyle::drawControl().
Filters events if this object has been installed as an event filter for the watched object.
In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Example:
Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.
Reimplemented from QObject.
Definition at line 1603 of file qmacstyle_mac.mm.
Referenced by animateSpeed().
QPixmap QMacStylePrivate::generateBackgroundPattern | ( | ) | const |
Definition at line 1797 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), and QMacStyle::polish().
|
static |
Definition at line 1534 of file qmacstyle_mac.mm.
Referenced by QMacStyle::drawComplexControl(), QMacStyle::drawControl(), QMacStyle::drawPrimitive(), QMacStyle::subControlRect(), and QMacStyle::subElementRect().
void QMacStylePrivate::getSliderInfo | ( | QStyle::ComplexControl | cc, |
const QStyleOptionSlider * | slider, | ||
HIThemeTrackDrawInfo * | tdi, | ||
const QWidget * | needToRemoveMe | ||
) |
Definition at line 1356 of file qmacstyle_mac.mm.
Referenced by QMacStyle::drawComplexControl(), QMacStyle::hitTestComplexControl(), and QMacStyle::subControlRect().
void QMacStylePrivate::initComboboxBdi | ( | const QStyleOptionComboBox * | combo, |
HIThemeButtonDrawInfo * | bdi, | ||
const QWidget * | widget, | ||
const ThemeDrawState & | tds | ||
) |
Creates a HIThemeButtonDrawInfo structure that specifies the correct button kind and other details to use for drawing the given combobox. Which button kind depends on the size of the combo, wether or not it is editable, explicit user style settings, etc.
Definition at line 1078 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), QMacStyle::drawComplexControl(), and QMacStyle::subControlRect().
void QMacStylePrivate::initHIThemePushButton | ( | const QStyleOptionButton * | btn, |
const QWidget * | widget, | ||
const ThemeDrawState | tds, | ||
HIThemeButtonDrawInfo * | bdi | ||
) | const |
Creates a HIThemeButtonDrawInfo structure that specifies the correct button kind and other details to use for drawing the given push button. Which button kind depends on the size of the button, the size of the contents, explicit user style settings, etc.
Definition at line 1002 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), QMacStyle::drawControl(), qt_mac_buttonIsRenderedFlat(), and QMacStyle::subElementRect().
HIRect QMacStylePrivate::pushButtonContentBounds | ( | const QStyleOptionButton * | btn, |
const HIThemeButtonDrawInfo * | bdi | ||
) | const |
Returns the free space awailable for contents inside the button (and not the size of the contents itself)
Definition at line 942 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), contentFitsInPushButton(), and QMacStyle::subElementRect().
QSize QMacStylePrivate::pushButtonSizeFromContents | ( | const QStyleOptionButton * | btn | ) | const |
Calculates the size of the button contents. This includes both the text and the icon.
Definition at line 964 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), and contentFitsInPushButton().
void QMacStylePrivate::removeWidget | ( | QWidget * | w | ) |
Definition at line 1520 of file qmacstyle_mac.mm.
Referenced by QMacStyle::unpolish().
void QMacStylePrivate::startAnimate | ( | QMacStylePrivate::Animates | as, |
QWidget * | w | ||
) |
Definition at line 1474 of file qmacstyle_mac.mm.
Referenced by addWidget(), animatable(), and eventFilter().
|
privateslot |
Definition at line 1483 of file qmacstyle_mac.mm.
Referenced by animateSpeed(), and startAnimate().
void QMacStylePrivate::stopAnimate | ( | QMacStylePrivate::Animates | as, |
QWidget * | w | ||
) |
Definition at line 1463 of file qmacstyle_mac.mm.
Referenced by animatable(), eventFilter(), and removeWidget().
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive timer events for the object.
QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.
Reimplemented from QObject.
Definition at line 1551 of file qmacstyle_mac.mm.
Referenced by animateSpeed().
|
static |
Definition at line 170 of file qmacstyle_mac_p.h.
Referenced by initHIThemePushButton().
|
static |
Definition at line 169 of file qmacstyle_mac_p.h.
Referenced by initHIThemePushButton().
struct QMacStylePrivate::ButtonState QMacStylePrivate::buttonState |
Referenced by QMacStylePrivate().
QPointer<QPushButton> QMacStylePrivate::defaultButton |
Definition at line 224 of file qmacstyle_mac_p.h.
Referenced by addWidget(), animatable(), eventFilter(), removeWidget(), startAnimate(), startAnimationTimer(), stopAnimate(), and timerEvent().
CFAbsoluteTime QMacStylePrivate::defaultButtonStart |
Definition at line 234 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), and QMacStylePrivate().
QPointer<QFocusFrame> QMacStylePrivate::focusWidget |
Definition at line 233 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::event().
|
static |
Definition at line 167 of file qmacstyle_mac_p.h.
Referenced by initHIThemePushButton().
bool QMacStylePrivate::mouseDown |
Definition at line 236 of file qmacstyle_mac_p.h.
Referenced by animatable(), and eventFilter().
Definition at line 226 of file qmacstyle_mac_p.h.
Referenced by addWidget(), animatable(), eventFilter(), startAnimate(), startAnimationTimer(), stopAnimate(), and timerEvent().
UInt8 QMacStylePrivate::progressFrame |
Definition at line 232 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), and timerEvent().
|
static |
Definition at line 166 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), QPushButtonPrivate::hitButton(), pushButtonContentBounds(), and QMacStyle::sizeFromContents().
|
static |
Definition at line 171 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), QPushButtonPrivate::hitButton(), and pushButtonSizeFromContents().
|
static |
Definition at line 163 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), QPushButtonPrivate::hitButton(), and QMacStyle::sizeFromContents().
|
static |
Definition at line 165 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), QPushButtonPrivate::hitButton(), and QMacStyle::sizeFromContents().
|
static |
Definition at line 164 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), pushButtonContentBounds(), and QMacStyle::sizeFromContents().
QMacStyle* QMacStylePrivate::q |
Definition at line 235 of file qmacstyle_mac_p.h.
Referenced by aquaSizeConstrain(), and pushButtonSizeFromContents().
|
static |
Definition at line 168 of file qmacstyle_mac_p.h.
Referenced by initHIThemePushButton().
int QMacStylePrivate::timerID |
Definition at line 225 of file qmacstyle_mac_p.h.
Referenced by QMacStyle::drawControl(), startAnimationTimer(), and timerEvent().