5#include <private/qproxystyle_p.h>
6#include <private/qapplication_p.h>
9#include <private/qstyle_p.h>
11#if !defined(QT_NO_STYLE_PROXY) || defined(QT_PLUGIN)
63 if (
qstrcmp(baseStyle->metaObject()->className(),
64 q->metaObject()->className()) == 0) {
94 style->setProxy(
this);
129 d->ensureBaseStyle();
145 if (
d->baseStyle &&
d->baseStyle->parent() ==
this)
146 d->baseStyle->deleteLater();
148 d->baseStyle = style;
151 d->baseStyle->setProxy(
this);
152 d->baseStyle->setParent(
this);
161 d->ensureBaseStyle();
171 d->ensureBaseStyle();
180 d->ensureBaseStyle();
190 d->ensureBaseStyle();
199 d->ensureBaseStyle();
208 d->ensureBaseStyle();
217 d->ensureBaseStyle();
218 return d->baseStyle->subElementRect(element,
option,
widget);
226 d->ensureBaseStyle();
235 d->ensureBaseStyle();
244 d->ensureBaseStyle();
253 d->ensureBaseStyle();
262 d->ensureBaseStyle();
271 d->ensureBaseStyle();
280 d->ensureBaseStyle();
289 d->ensureBaseStyle();
290 return d->baseStyle->generatedIconPixmap(iconMode,
pixmap,
opt);
298 d->ensureBaseStyle();
299 return d->baseStyle->standardPalette();
307 d->ensureBaseStyle();
316 d->ensureBaseStyle();
317 d->baseStyle->polish(pal);
325 d->ensureBaseStyle();
326 d->baseStyle->polish(
app);
334 d->ensureBaseStyle();
335 d->baseStyle->unpolish(
widget);
343 d->ensureBaseStyle();
344 d->baseStyle->unpolish(
app);
357 d->ensureBaseStyle();
379 d->ensureBaseStyle();
402 d->ensureBaseStyle();
403 return d->baseStyle->layoutSpacing(control1, control2, orientation,
option,
widget);
408#include "moc_qproxystyle.cpp"
static QString desktopStyleKey()
The QApplication class manages the GUI application's control flow and main settings.
The QCommonStyle class encapsulates the common Look and Feel of a GUI.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
\reentrant \inmodule QtGui
static QString styleOverride
The QIcon class provides scalable icons in different modes and states.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
void setParent(QObject *parent)
Makes the object a child of parent.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPalette class contains color groups for each widget state.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
void ensureBaseStyle() const
The QProxyStyle class is a convenience class that simplifies dynamically overriding QStyle elements.
bool event(QEvent *e) override
\reimp
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const override
\reimp
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=nullptr) const override
\reimp
QPalette standardPalette() const override
\reimp
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget=nullptr) const override
\reimp
int styleHint(StyleHint hint, const QStyleOption *option=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const override
\reimp
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const override
\reimp
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const override
\reimp
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
This slot is called by layoutSpacing() to determine the spacing that should be used between control1 ...
void unpolish(QWidget *widget) override
\reimp
QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override
\reimp
int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
\reimp
void polish(QWidget *widget) override
\reimp
QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override
\reimp
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget=nullptr) const override
\reimp
QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const override
\reimp
void setBaseStyle(QStyle *style)
Sets the base style that should be proxied.
SubControl hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget=nullptr) const override
\reimp
void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=nullptr) const override
\reimp
virtual void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const override
\reimp
QStyle * baseStyle() const
Returns the proxy base style object.
QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const override
\reimp
~QProxyStyle()
Destroys the QProxyStyle object.
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override
Returns an icon for the given standardIcon.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QStyleFactory class creates QStyle objects.
static QStyle * create(const QString &)
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionMenuItem::menuItemType
The QStyleOption class stores the parameters used by QStyle functions.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
ContentsType
This enum describes the available contents types.
StyleHint
This enum describes the available style hints.
StandardPixmap
This enum describes the available standard pixmaps.
ControlElement
This enum represents a control element.
PixelMetric
This enum describes the various available pixel metrics.
ComplexControl
This enum describes the available complex controls.
PrimitiveElement
This enum describes the various primitive elements.
SubElement
This enum represents a sub-area of a widget.
SubControl
This enum describes the available sub controls.
Combined button and popup list for selecting options.
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLdouble GLdouble GLdouble GLdouble q
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QApplication app(argc, argv)
[0]