KDecoration3::DecorationButton
#include <decorationbutton.h>
Properties | |
Qt::MouseButtons | acceptedButtons |
bool | checkable |
bool | checked |
bool | enabled |
QRectF | geometry |
bool | hovered |
bool | pressed |
bool | visible |
Properties inherited from QObject | |
objectName | |
Signals | |
void | acceptedButtonsChanged (Qt::MouseButtons) |
void | checkableChanged (bool) |
void | checkedChanged (bool) |
void | clicked (Qt::MouseButton) |
void | doubleClicked () |
void | enabledChanged (bool) |
void | geometryChanged (const QRectF &) |
void | hoveredChanged (bool) |
void | pointerEntered () |
void | pointerLeft () |
void | pressed () |
void | pressedChanged (bool) |
void | released () |
void | visibilityChanged (bool) |
Public Slots | |
void | setCheckable (bool checkable) |
void | setChecked (bool checked) |
void | setEnabled (bool enabled) |
void | setVisible (bool visible) |
void | update () |
void | update (const QRectF &rect) |
Public Member Functions | |
Qt::MouseButtons | acceptedButtons () const |
bool | contains (const QPointF &pos) const |
Decoration * | decoration () const |
bool | event (QEvent *event) override |
QRectF | geometry () const |
bool | isCheckable () const |
bool | isChecked () const |
bool | isEnabled () const |
bool | isHovered () const |
bool | isPressed () const |
bool | isVisible () const |
virtual void | paint (QPainter *painter, const QRect &repaintArea)=0 |
void | setAcceptedButtons (Qt::MouseButtons buttons) |
void | setGeometry (const QRectF &geometry) |
QSizeF | size () const |
DecorationButtonType | type () 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 | 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 |
Protected Member Functions | |
DecorationButton (DecorationButtonType type, Decoration *decoration, QObject *parent=nullptr) | |
virtual void | hoverEnterEvent (QHoverEvent *event) |
virtual void | hoverLeaveEvent (QHoverEvent *event) |
virtual void | hoverMoveEvent (QHoverEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
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) |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
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) |
Detailed Description
A button to be used in a Decoration.
The DecorationButton is a simple Button which can be used (but doesn't have to) in a Decoration. It takes care of the input handling and triggers the correct state change methods on the Decoration.
This simplifies the handling of DecorationButtons. A Decoration implementation just needs to subclass DecorationButton and implement the paint method. Everything else is handled by the DecorationButton.
For positioning the DecorationButtons it's recommended to use a DecorationButtonGroup.
- See also
- Decoration
- DecorationButtonGroup
Definition at line 40 of file decorationbutton.h.
Property Documentation
◆ acceptedButtons
|
readwrite |
The mouse buttons the DecorationButton accepts.
By default the Qt::LeftButton gets accepted, for some types more buttons are accepted.
Definition at line 80 of file decorationbutton.h.
◆ checkable
|
readwrite |
Whether the DecorationButton can be checked.
This is used for state aware DecorationButtons like Maximize, Shade, KeepAbove, KeepBelow and OnAllDesktops.
Definition at line 65 of file decorationbutton.h.
◆ checked
|
readwrite |
Whether the DecorationButton is checked.
A DecorationButton can only be checked if the DecorationButton is checkable. Note: the checked state is not changed by clicking the DecorationButton. It gets changed if the DecoratedWindow changes it's state, though.
Definition at line 71 of file decorationbutton.h.
◆ enabled
|
readwrite |
Whether the DecorationButton is enabled.
Only an enabled button accepts hover and mouse press events.
Definition at line 60 of file decorationbutton.h.
◆ geometry
|
read |
The geometry of the DecorationButton in Decoration-local coordinates.
Definition at line 75 of file decorationbutton.h.
◆ hovered
|
read |
Whether the DecorationButton is currently hovered.
Definition at line 55 of file decorationbutton.h.
◆ pressed
|
read |
Whether the DecorationButton is currently pressed.
Definition at line 51 of file decorationbutton.h.
◆ visible
|
readwrite |
Whether the DecorationButton is visible.
By default this is true
, OnAllDesktops and QuickHelp depend on the DecoratedWindow's state.
Definition at line 47 of file decorationbutton.h.
Constructor & Destructor Documentation
◆ DecorationButton()
|
explicitprotected |
Definition at line 342 of file decorationbutton.cpp.
Member Function Documentation
◆ acceptedButtons()
Qt::MouseButtons KDecoration3::DecorationButton::acceptedButtons | ( | ) | const |
Definition at line 441 of file decorationbutton.cpp.
◆ contains()
bool KDecoration3::DecorationButton::contains | ( | const QPointF & | pos | ) | const |
Returns true
if pos
is inside of the button, otherwise returns false
.
Definition at line 485 of file decorationbutton.cpp.
◆ decoration()
Decoration * KDecoration3::DecorationButton::decoration | ( | ) | const |
Definition at line 436 of file decorationbutton.cpp.
◆ event()
|
overridevirtual |
Reimplemented from QObject.
Definition at line 491 of file decorationbutton.cpp.
◆ geometry()
QRectF KDecoration3::DecorationButton::geometry | ( | ) | const |
Definition at line 431 of file decorationbutton.cpp.
◆ hoverEnterEvent()
|
protectedvirtual |
Definition at line 520 of file decorationbutton.cpp.
◆ hoverLeaveEvent()
|
protectedvirtual |
Definition at line 529 of file decorationbutton.cpp.
◆ hoverMoveEvent()
|
protectedvirtual |
Definition at line 538 of file decorationbutton.cpp.
◆ isCheckable()
bool KDecoration3::DecorationButton::isCheckable | ( | ) | const |
Definition at line 421 of file decorationbutton.cpp.
◆ isChecked()
bool KDecoration3::DecorationButton::isChecked | ( | ) | const |
Definition at line 416 of file decorationbutton.cpp.
◆ isEnabled()
bool KDecoration3::DecorationButton::isEnabled | ( | ) | const |
Definition at line 411 of file decorationbutton.cpp.
◆ isHovered()
bool KDecoration3::DecorationButton::isHovered | ( | ) | const |
Definition at line 406 of file decorationbutton.cpp.
◆ isPressed()
bool KDecoration3::DecorationButton::isPressed | ( | ) | const |
Definition at line 401 of file decorationbutton.cpp.
◆ isVisible()
bool KDecoration3::DecorationButton::isVisible | ( | ) | const |
Definition at line 426 of file decorationbutton.cpp.
◆ mouseMoveEvent()
|
protectedvirtual |
Definition at line 543 of file decorationbutton.cpp.
◆ mousePressEvent()
|
protectedvirtual |
Definition at line 554 of file decorationbutton.cpp.
◆ mouseReleaseEvent()
|
protectedvirtual |
Definition at line 574 of file decorationbutton.cpp.
◆ paint()
|
pure virtual |
Invoked for painting this DecorationButtons.
Implementing sub-classes need to implement this method. The coordinate system of the QPainter is set to Decoration coordinates.
This method will be invoked from the rendering thread.
- Parameters
-
painter The QPainter to paint this DecorationButton. repaintArea The area which is going to be repainted in Decoration coordinates
◆ setAcceptedButtons()
void KDecoration3::DecorationButton::setAcceptedButtons | ( | Qt::MouseButtons | buttons | ) |
Definition at line 451 of file decorationbutton.cpp.
◆ setCheckable
|
slot |
Definition at line 466 of file decorationbutton.cpp.
◆ setChecked
|
slot |
Definition at line 461 of file decorationbutton.cpp.
◆ setEnabled
|
slot |
Definition at line 456 of file decorationbutton.cpp.
◆ setGeometry()
void KDecoration3::DecorationButton::setGeometry | ( | const QRectF & | geometry | ) |
Definition at line 476 of file decorationbutton.cpp.
◆ setVisible
|
slot |
Definition at line 471 of file decorationbutton.cpp.
◆ size()
QSizeF KDecoration3::DecorationButton::size | ( | ) | const |
Definition at line 396 of file decorationbutton.cpp.
◆ type()
DecorationButtonType KDecoration3::DecorationButton::type | ( | ) | const |
Definition at line 446 of file decorationbutton.cpp.
◆ update [1/2]
|
slot |
Schedules a repaint of the DecorationButton.
Overloaded method for convenience.
Definition at line 391 of file decorationbutton.cpp.
◆ update [2/2]
|
slot |
Schedules a repaint of the DecorationButton.
Calling update will eventually result in paint being invoked.
- Parameters
-
rect The area to repaint in Decoration local coordinates, a null QRect updates the complete geometry
- See also
- paint
Definition at line 386 of file decorationbutton.cpp.
◆ wheelEvent()
|
protectedvirtual |
Definition at line 594 of file decorationbutton.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.