43 #include <private/qproxystyle_p.h> 44 #include <private/qapplication_p.h> 47 #include <private/qstyle_p.h> 49 #if !defined(QT_NO_STYLE_PROXY) || defined(QT_PLUGIN) 94 q->metaObject()->className()) == 0) {
126 d->baseStyle = style;
147 d->ensureBaseStyle();
163 if (
d->baseStyle &&
d->baseStyle->parent() ==
this)
164 d->baseStyle->deleteLater();
166 d->baseStyle = style;
169 d->baseStyle->setProxy(
this);
170 d->baseStyle->setParent(
this);
179 d->ensureBaseStyle();
180 d->baseStyle->drawPrimitive(element, option, painter, widget);
189 d->ensureBaseStyle();
190 d->baseStyle->drawControl(element, option, painter, widget);
198 d->ensureBaseStyle();
199 d->baseStyle->drawComplexControl(control, option, painter, widget);
208 d->ensureBaseStyle();
209 d->baseStyle->drawItemText(painter, rect, flags, pal, enabled, text, textRole);
217 d->ensureBaseStyle();
218 d->baseStyle->drawItemPixmap(painter, rect, alignment, pixmap);
226 d->ensureBaseStyle();
227 return d->baseStyle->sizeFromContents(type, option, size, widget);
235 d->ensureBaseStyle();
236 return d->baseStyle->subElementRect(element, option, widget);
244 d->ensureBaseStyle();
245 return d->baseStyle->subControlRect(cc, option, sc, widget);
253 d->ensureBaseStyle();
254 return d->baseStyle->itemTextRect(fm, r, flags, enabled, text);
262 d->ensureBaseStyle();
263 return d->baseStyle->itemPixmapRect(r, flags, pixmap);
271 d->ensureBaseStyle();
272 return d->baseStyle->hitTestComplexControl(control, option, pos, widget);
280 d->ensureBaseStyle();
281 return d->baseStyle->styleHint(hint, option, widget, returnData);
289 d->ensureBaseStyle();
290 return d->baseStyle->pixelMetric(metric, option, widget);
298 d->ensureBaseStyle();
299 return d->baseStyle->standardPixmap(standardPixmap, opt, widget);
307 d->ensureBaseStyle();
308 return d->baseStyle->generatedIconPixmap(iconMode, pixmap, opt);
316 d->ensureBaseStyle();
317 return d->baseStyle->standardPalette();
325 d->ensureBaseStyle();
326 d->baseStyle->polish(widget);
334 d->ensureBaseStyle();
335 d->baseStyle->polish(pal);
343 d->ensureBaseStyle();
344 d->baseStyle->polish(app);
352 d->ensureBaseStyle();
353 d->baseStyle->unpolish(widget);
361 d->ensureBaseStyle();
362 d->baseStyle->unpolish(app);
370 d->ensureBaseStyle();
371 return d->baseStyle->event(e);
394 d->ensureBaseStyle();
395 return d->baseStyle->standardIcon(standardIcon, option, widget);
417 d->ensureBaseStyle();
418 return d->baseStyle->layoutSpacing(control1, control2, orientation, option, widget);
423 #endif // QT_NO_STYLE_PROXY The QPainter class performs low-level painting on widgets and other paint devices.
The QApplication class manages the GUI application's control flow and main settings.
SubControl
This enum describes the available sub controls.
StyleHint
This enum describes the available style hints.
The QStyleHintReturn class provides style hints that return more than basic data types.
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const
Reimplemented Function
QPointer< QWidget > widget
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const
Reimplemented Function
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
bool event(QEvent *e)
Reimplemented Function
int layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=0, const QWidget *widget=0) const
This slot is called by layoutSpacing() to determine the spacing that should be used between control1 ...
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget=0) const
Reimplemented Function
ComplexControl
This enum describes the available complex controls.
The QProxyStyle class is a convenience class that simplifies dynamically overriding QStyle elements...
static QStyle * create(const QString &)
PixelMetric
This enum describes the various available pixel metrics.
QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
Reimplemented Function
int styleHint(StyleHint hint, const QStyleOption *option=0, const QWidget *widget=0, QStyleHintReturn *returnData=0) const
Reimplemented Function
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=0) const
Reimplemented Function
QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
Returns an icon for the given standardIcon.
The QString class provides a Unicode character string.
void polish(QWidget *widget)
Reimplemented Function
StandardPixmap
This enum describes the available standard pixmaps.
void setParent(QObject *)
Makes the object a child of parent.
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=0) const
Reimplemented Function
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=0, const QWidget *widget=0) const
Returns an icon for the given standardIcon.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
Reimplemented Function
static bool isEmpty(const char *str)
void ensureBaseStyle() const
void setBaseStyle(QStyle *style)
Sets the base style that should be proxied.
The QStyleOption class stores the parameters used by QStyle functions.
ContentsType
This enum describes the available contents types.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
QPalette standardPalette() const
Reimplemented Function
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const
Reimplemented Function
QStyle * baseStyle() const
Returns the proxy base style object.
QProxyStyle(QStyle *baseStyle=0)
Constructs a QProxyStyle object for overriding behavior in style or in the current application style ...
QPointer< QStyle > baseStyle
QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
Reimplemented Function
PrimitiveElement
This enum describes the various primitive elements.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=0) const
Reimplemented Function
~QProxyStyle()
Destroys the QProxyStyle object.
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
The QPoint class defines a point in the plane using integer precision.
static QString desktopStyleKey()
virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
Reimplemented Function
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
The QRect class defines a rectangle in the plane using integer precision.
The QPixmap class is an off-screen image representation that can be used as a paint device...
static QString styleOverride
ControlElement
This enum represents a control element.
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const
Reimplemented Function
The QSize class defines the size of a two-dimensional object using integer point precision.
int qstrcmp(const QByteArray &str1, const char *str2)
The QStyleOptionComplex class is used to hold parameters that are common to all complex controls...
void unpolish(QWidget *widget)
Reimplemented Function
void setProxy(QStyle *style)
QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
Reimplemented Function
The QEvent class is the base class of all event classes.
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget=0) const
Reimplemented Function
SubElement
This enum represents a sub-area of a widget.
The QPalette class contains color groups for each widget state.
The QIcon class provides scalable icons in different modes and states.