![]() |
CopperSpice API
1.7.4
|
Convenience class that simplifies dynamically overriding QStyle elements. More...
Public Methods | |
QProxyStyle (const QString &key) | |
QProxyStyle (QStyle *style=nullptr) | |
~QProxyStyle () | |
QStyle * | baseStyle () const |
void | drawComplexControl (ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget=nullptr) const override |
void | drawControl (ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=nullptr) const override |
void | drawItemPixmap (QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const override |
void | drawItemText (QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const override |
void | drawPrimitive (PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget=nullptr) const override |
QPixmap | generatedIconPixmap (QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const override |
SubControl | hitTestComplexControl (ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget=nullptr) const override |
QRect | itemPixmapRect (const QRect &r, int flags, const QPixmap &pixmap) const override |
QRect | itemTextRect (const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const override |
int | layoutSpacing (QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override |
int | pixelMetric (PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override |
void | polish (QApplication *app) override |
void | polish (QPalette &pal) override |
void | polish (QWidget *widget) override |
void | setBaseStyle (QStyle *style) |
QSize | sizeFromContents (ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override |
QIcon | standardIcon (StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override |
QPalette | standardPalette () const override |
QPixmap | standardPixmap (StandardPixmap standardPixmap, const QStyleOption *option, const QWidget *widget=nullptr) const override |
int | styleHint (StyleHint hint, const QStyleOption *option=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *styleHintReturn=nullptr) const override |
QRect | subControlRect (ComplexControl control, const QStyleOptionComplex *option, SubControl sc, const QWidget *widget) const override |
QRect | subElementRect (SubElement element, const QStyleOption *option, const QWidget *widget) const override |
void | unpolish (QApplication *app) override |
void | unpolish (QWidget *widget) override |
![]() | |
QCommonStyle () | |
~QCommonStyle () | |
![]() | |
QStyle () | |
virtual | ~QStyle () |
int | combinedLayoutSpacing (QSizePolicy::ControlTypes controls1, QSizePolicy::ControlTypes controls2, Qt::Orientation orientation, QStyleOption *option=nullptr, QWidget *widget=nullptr) const |
const QStyle * | proxy () const |
![]() | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
Protected Methods | |
bool | event (QEvent *event) override |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signalMethod) const |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signalMethod) const |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
![]() | |
using | State = QFlags< StateFlag > |
using | SubControls = QFlags< SubControl > |
![]() | |
enum | ComplexControl |
enum | ContentsType |
enum | ControlElement |
enum | PixelMetric |
enum | PrimitiveElement |
enum | RequestSoftwareInputPanel |
enum | StandardPixmap |
enum | StateFlag |
enum | StyleHint |
enum | SubControl |
enum | SubElement |
![]() | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
![]() | |
void | deleteLater () |
![]() | |
static QRect | alignedRect (Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rect) |
static int | sliderPositionFromValue (int min, int max, int logicalValue, int span, bool upsideDown=false) |
static int | sliderValueFromPosition (int min, int max, int position, int span, bool upsideDown=false) |
static Qt::Alignment | visualAlignment (Qt::LayoutDirection direction, Qt::Alignment alignment) |
static QPoint | visualPos (Qt::LayoutDirection direction, const QRect &boundingRect, const QPoint &logicalPosition) |
static QRect | visualRect (Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect) |
![]() | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
![]() | |
objectName | |
![]() | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QProxyStyle class is a convenience class that simplifies dynamically overriding QStyle elements. A QProxyStyle wraps a QStyle (usually the default system style) for the purpose of dynamically overriding painting or other specific style behavior.
The following example shows how to override the shortcut underline behavior on any platform:
Warning: The common styles provided by CopperSpice will respect this hint, because they call QStyle::proxy(), but there is no guarantee that QStyle::proxy() will be called for user defined or system controlled styles. It would not work on a Mac, for example, where menus are handled by the operating system.
QProxyStyle::QProxyStyle | ( | QStyle * | style = nullptr | ) |
Constructs a QProxyStyle object for overriding behavior in style or in the current application style if style is 0 (default). Normally style is 0, because you want to override behavior in the system style.
Ownership of style is transferred to QProxyStyle.
QProxyStyle::QProxyStyle | ( | const QString & | key | ) |
Constructs a QProxyStyle object for overriding behavior in the base style specified by style key, or in the current application style if the specified style key is unrecognized.
QProxyStyle::~QProxyStyle | ( | ) |
Destroys the QProxyStyle object.
QStyle * QProxyStyle::baseStyle | ( | ) | const |
Returns the proxy base style object. If no base style is set on the proxy style, QProxyStyle will create an instance of the application style instead.
|
overridevirtual |
Reimplemented from QStyle::drawComplexControl().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::drawControl().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::drawItemPixmap().
Reimplemented from QStyle.
|
overridevirtual |
Reimplemented from QStyle::drawItemText().
Reimplemented from QStyle.
|
overridevirtual |
Reimplemented from QStyle::drawPrimitive().
Reimplemented from QCommonStyle.
|
overrideprotectedvirtual |
Reimplemented from QObject::event().
Reimplemented from QObject.
|
overridevirtual |
Reimplemented from QStyle::generatedIconPixmap().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::hitTestComplexControl().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::itemPixmapRect().
Reimplemented from QStyle.
|
overridevirtual |
Reimplemented from QStyle::itemTextRect().
Reimplemented from QStyle.
|
overridevirtual |
This slot is called by layoutSpacing() to determine the spacing that should be used between control1 and control2 in a layout. The orientation specifies whether the controls are laid out side by side or stacked vertically. The option parameter can be used to pass extra information about the parent widget. The widget parameter is optional and can also be used if option is 0.
The default implementation returns -1.
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::pixelMetric().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::polish().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::polish().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::polish().
Reimplemented from QCommonStyle.
void QProxyStyle::setBaseStyle | ( | QStyle * | style | ) |
Sets the base style which should be proxied. Ownership of style is transferred to QProxyStyle.
If style is zero, a desktop-dependent style will be assigned automatically.
|
overridevirtual |
Reimplemented from QStyle::sizeFromContents().
Reimplemented from QCommonStyle.
|
overridevirtual |
Returns an icon for the given standardIcon.
Reimplement this method to provide your own icons in a QStyle subclass. The option argument can be used to pass extra information required to find the appropriate icon. The widget argument is optional and can also be used to help find the icon.
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::standardPalette().
Reimplemented from QStyle.
|
overridevirtual |
Reimplemented from QStyle::standardPixmap().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::styleHint().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::subControlRect().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::subElementRect().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::unpolish().
Reimplemented from QCommonStyle.
|
overridevirtual |
Reimplemented from QStyle::unpolish().
Reimplemented from QCommonStyle.