1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms
** and conditions contained in a signed written agreement between you
** and Nokia.
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\class QMacStyle
\brief The QMacStyle class provides a Mac OS X style using the Apple Appearance Manager.
\ingroup appearance
This class is implemented as a wrapper to the HITheme
APIs, allowing applications to be styled according to the current
theme in use on Mac OS X. This is done by having primitives
in QStyle implemented in terms of what Mac OS X would normally theme.
\warning This style is only available on Mac OS X because it relies on the
HITheme APIs.
There are additional issues that should be taken
into consideration to make an application compatible with the
\link http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/index.html
Apple Human Interface Guidelines \endlink. Some of these issues are outlined
below.
\list
\i Layout - The restrictions on window layout are such that some
aspects of layout that are style-dependent cannot be achieved
using QLayout. Changes are being considered (and feedback would be
appreciated) to make layouts QStyle-able. Some of the restrictions
involve horizontal and vertical widget alignment and widget size
(covered below).
\i Widget size - Mac OS X allows widgets to have specific fixed sizes. Qt
does not fully implement this behavior so as to maintain cross-platform
compatibility. As a result some widgets sizes may be inappropriate (and
subsequently not rendered correctly by the HITheme APIs).The
QWidget::sizeHint() will return the appropriate size for many
managed widgets (widgets enumerated in \l QStyle::ContentsType).
\i Effects - QMacStyle uses HITheme for performing most of the drawing, but
also uses emulation in a few cases where HITheme does not provide the
required functionality (for example, tab bars on Panther, the toolbar
separator, etc). We tried to make the emulation as close to the original as
possible. Please report any issues you see in effects or non-standard
widgets.
\endlist
There are other issues that need to be considered in the feel of
your application (including the general color scheme to match the
Aqua colors). The Guidelines mentioned above will remain current
with new advances and design suggestions for Mac OS X.
Note that the functions provided by QMacStyle are
reimplementations of QStyle functions; see QStyle for their
documentation.
\img qmacstyle.png
\sa QWindowsXPStyle, QWindowsStyle, QPlastiqueStyle, QCDEStyle, QMotifStyle
*/
/*!
\enum QMacStyle::WidgetSizePolicy
\value SizeSmall
\value SizeLarge
\value SizeMini
\value SizeDefault
\omitvalue SizeNone
*/
/*! \fn QMacStyle::QMacStyle()
Constructs a QMacStyle object.
*/
/*! \fn QMacStyle::~QMacStyle()
Destructs a QMacStyle object.
*/
/*! \fn void QMacStyle::polish(QPalette &pal)
\reimp
*/
/*! \fn void QMacStyle::polish(QApplication *)
\reimp
*/
/*! \fn void QMacStyle::unpolish(QApplication *)
\reimp
*/
/*! \fn void QMacStyle::polish(QWidget* w)
\reimp
*/
/*! \fn void QMacStyle::unpolish(QWidget* w)
\reimp
*/
/*! \fn int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QWidget *widget) const
\reimp
*/
/*! \fn QPalette QMacStyle::standardPalette() const
\reimp
*/
/*! \fn int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *hret) const
\reimp
*/
/*! \fn QPixmap QMacStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
\reimp
*/
/*! \fn QPixmap QMacStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const
\reimp
*/
/*!
\enum QMacStyle::FocusRectPolicy
This type is used to signify a widget's focus rectangle policy.
\value FocusEnabled show a focus rectangle when the widget has focus.
\value FocusDisabled never show a focus rectangle for the widget.
\value FocusDefault show a focus rectangle when the widget has
focus and the widget is a QSpinWidget, QDateTimeEdit, QLineEdit,
QListBox, QListView, editable QTextEdit, or one of their
subclasses.
*/
/*! \fn void QMacStyle::setFocusRectPolicy(QWidget *w, FocusRectPolicy policy)
\obsolete
Sets the focus rectangle policy of \a w. The \a policy can be one of
\l{QMacStyle::FocusRectPolicy}.
This is now simply an interface to the Qt::WA_MacShowFocusRect attribute and the
FocusDefault value does nothing anymore. If you want to set a widget back
to its default value, you must save the old value of the attribute before
you change it.
\sa focusRectPolicy() QWidget::setAttribute()
*/
/*! \fn QMacStyle::FocusRectPolicy QMacStyle::focusRectPolicy(const QWidget *w)
\obsolete
Returns the focus rectangle policy for the widget \a w.
The focus rectangle policy can be one of \l{QMacStyle::FocusRectPolicy}.
In 4.3 and up this function will simply test for the
Qt::WA_MacShowFocusRect attribute and will never return
QMacStyle::FocusDefault.
\sa setFocusRectPolicy(), QWidget::testAttribute()
*/
/*! \fn void QMacStyle::setWidgetSizePolicy(const QWidget *widget, WidgetSizePolicy policy)
\obsolete
Call QWidget::setAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
or Qt::WA_MacNormalSize instead.
*/
/*! \fn QMacStyle::WidgetSizePolicy QMacStyle::widgetSizePolicy(const QWidget *widget)
\obsolete
Call QWidget::testAttribute() with Qt::WA_MacMiniSize, Qt::WA_MacSmallSize,
or Qt::WA_MacNormalSize instead.
*/
/*! \fn void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const
\reimp
*/
/*! \fn void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w) const
\reimp
*/
/*! \fn QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, const QWidget *widget) const
\reimp
*/
/*! \fn void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const
\reimp
*/
/*! \fn QStyle::SubControl QMacStyle::hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const
\reimp
*/
/*! \fn QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const
\reimp
*/
/*! \fn QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &csz, const QWidget *widget) const
\reimp
*/
/*! \fn void QMacStyle::drawItemText(QPainter *p, const QRect &r, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const
\reimp
*/
/*! \fn bool QMacStyle::event(QEvent *e)
\reimp
*/
/*! \fn QIcon QMacStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *opt, const QWidget *widget) const
\internal
*/
/*! \fn int QMacStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const
\internal
*/
|