KStyle
#include <kstyle.h>
Public Member Functions | |
int | pixelMetric (PixelMetric m, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const override |
virtual void | polish (QApplication *app) override |
virtual void | polish (QPalette &pal) override |
void | polish (QWidget *) override |
QIcon | standardIcon (StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const override |
QPalette | standardPalette () const override |
int | styleHint (StyleHint hint, const QStyleOption *opt, const QWidget *w, QStyleHintReturn *returnData) const override |
Public Member Functions inherited from QCommonStyle | |
virtual void | drawComplexControl (ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget) const const override |
virtual void | drawControl (ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *widget) const const override |
virtual void | drawPrimitive (PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *widget) const const override |
virtual QPixmap | generatedIconPixmap (QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const const override |
virtual SubControl | hitTestComplexControl (ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget) const const override |
virtual int | layoutSpacing (QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const const override |
virtual QSize | sizeFromContents (ContentsType contentsType, const QStyleOption *opt, const QSize &contentsSize, const QWidget *widget) const const override |
virtual QPixmap | standardPixmap (StandardPixmap sp, const QStyleOption *option, const QWidget *widget) const const override |
virtual QRect | subControlRect (ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const const override |
virtual QRect | subElementRect (SubElement sr, const QStyleOption *opt, const QWidget *widget) const const override |
virtual void | unpolish (QApplication *application) override |
virtual void | unpolish (QWidget *widget) override |
Public Member Functions inherited from QStyle | |
int | combinedLayoutSpacing (QSizePolicy::ControlTypes controls1, QSizePolicy::ControlTypes controls2, Qt::Orientation orientation, QStyleOption *option, QWidget *widget) const const |
virtual void | drawItemPixmap (QPainter *painter, const QRect &rectangle, int alignment, const QPixmap &pixmap) const const |
virtual void | drawItemText (QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const const |
virtual QRect | itemPixmapRect (const QRect &rectangle, int alignment, const QPixmap &pixmap) const const |
virtual QRect | itemTextRect (const QFontMetrics &metrics, const QRect &rectangle, int alignment, bool enabled, const QString &text) const const |
QString | name () const const |
const QStyle * | proxy () const const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Static Public Member Functions | |
static ControlElement | customControlElement (const QString &element, const QWidget *widget) |
static StyleHint | customStyleHint (const QString &element, const QWidget *widget) |
static SubElement | customSubElement (const QString &element, const QWidget *widget) |
Static Public Member Functions inherited from QStyle | |
QRect | alignedRect (Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rectangle) |
int | sliderPositionFromValue (int min, int max, int logicalValue, int span, bool upsideDown) |
int | sliderValueFromPosition (int min, int max, int position, int span, bool upsideDown) |
Qt::Alignment | visualAlignment (Qt::LayoutDirection direction, Qt::Alignment alignment) |
QPoint | visualPos (Qt::LayoutDirection direction, const QRect &boundingRectangle, const QPoint &logicalPosition) |
QRect | visualRect (Qt::LayoutDirection direction, const QRect &boundingRectangle, const QRect &logicalRectangle) |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
ControlElement | newControlElement (const QString &element) |
StyleHint | newStyleHint (const QString &element) |
SubElement | newSubElement (const QString &element) |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
Provides integration with KDE Plasma Workspace settings for Qt styles.
Derive your Qt style from KStyle to automatically inherit various settings from the KDE Plasma Workspace, providing a consistent user experience. For example, this will ensure a consistent single-click or double-click activation setting, and the use of standard themed icons.
Constructor & Destructor Documentation
◆ KStyle()
KStyle::KStyle | ( | ) |
Definition at line 99 of file kstyle.cpp.
◆ ~KStyle()
|
override |
Definition at line 104 of file kstyle.cpp.
Member Function Documentation
◆ customControlElement()
|
static |
Definition at line 89 of file kstyle.cpp.
◆ customStyleHint()
|
static |
Runtime element extension This is just convenience and does /not/ require the using widgets style to inherit KStyle (i.e.
calling this while using cleanlooks won't segfault or so but just return 0) Returns a unique id for an element string (e.g. "CE_CapacityBar")
For simplicity, only StyleHints, ControlElements and their SubElements are supported If you don't need extended SubElement functionality, just drop it
- Parameters
-
element The style element, represented as string. Naming convention: "appname.(2-char-element-type)_element" where the 2-char-element-type is of {SH, CE, SE} (widgets in kdelibs don't have to pass the appname) examples: "CE_CapacityBar", "amarok.CE_Analyzer" widget Your widget ("this") passing this is mandatory, passing NULL will just return 0
- Returns
- a unique id for the
element
string or 0, if the element is not supported by the widgets current style
Important notes: 1) If your string lacks the matching "SH_", "CE_" or "SE_" token the element request will be ignored (return is 0) 2) Try to avoid custom elements and use default ones (if possible) to get better style support and keep UI coherency 3) If you cache this value (good idea, this requires a map lookup) don't (!) forget to catch style changes in QWidget::changeEvent()
Definition at line 84 of file kstyle.cpp.
◆ customSubElement()
|
static |
Definition at line 94 of file kstyle.cpp.
◆ newControlElement()
|
protected |
Definition at line 171 of file kstyle.cpp.
◆ newStyleHint()
|
protected |
Runtime element extension, allows inheriting styles to add support custom elements merges supporting inherit chains Supposed to be called e.g.
in your constructor.
NOTICE: in order to have this work, your style must provide an "X-KDE-CustomElements" classinfo, i.e. class MyStyle : public KStyle { Q_OBJECT Q_CLASSINFO ("X-KDE-CustomElements", "true")
public: ..... }
- Parameters
-
element The style element, represented as string. Suggested naming convention: appname.(2-char-element-type)_element where the 2-char-element-type is of {SH, CE, SE} widgets in kdelibs don't have to pass the appname examples: "CE_CapacityBar", "amarok.CE_Analyzer"
Important notes: 1) If your string lacks the matching "SH_", "CE_" or "SE_" token the element request will be ignored (return is 0) 2) To keep UI coherency, don't support any nonsense in your style, but convince app developers to use standard elements - if available
Definition at line 166 of file kstyle.cpp.
◆ newSubElement()
|
protected |
Definition at line 176 of file kstyle.cpp.
◆ pixelMetric()
|
overridevirtual |
Reimplemented from QCommonStyle.
Definition at line 436 of file kstyle.cpp.
◆ polish() [1/3]
|
virtual |
Reimplemented from QCommonStyle.
◆ polish() [2/3]
|
virtual |
Reimplemented from QCommonStyle.
◆ polish() [3/3]
|
overridevirtual |
Reimplemented from QCommonStyle.
Definition at line 181 of file kstyle.cpp.
◆ standardIcon()
|
overridevirtual |
Implements QStyle.
Definition at line 225 of file kstyle.cpp.
◆ standardPalette()
|
overridevirtual |
needed to avoid warnings at compilation time
Reimplemented from QStyle.
Definition at line 220 of file kstyle.cpp.
◆ styleHint()
|
overridevirtual |
Reimplemented from QCommonStyle.
Definition at line 369 of file kstyle.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.