![]() |
HAL
|
The base class for all specific SettingsWidgets. More...
#include <settings_widget.h>
Public Slots | |
virtual void | handleRevertModification () |
virtual void | handleSetDefaultValue (bool setAll=false) |
void | handleItemDestroyed () |
Signals | |
void | valueChanged () |
void | triggerDescriptionUpdate (SettingsItem *item) |
void | triggerRemoveWidget (SettingsWidget *widget) |
Public Member Functions | |
SettingsWidget (SettingsItem *item, QWidget *parent=nullptr) | |
void | reset_labels () |
bool | matchLabel (const QString &needle) |
void | prepare () |
const SettingsItem * | settingsItem () const |
virtual void | acceptValue () |
virtual void | loadCurrentValue () |
virtual void | load (const QVariant &value)=0 |
virtual QVariant | value ()=0 |
virtual void | clearEditor () |
QString | getLabel () |
Q_PROPERTY READ Function | |
bool | dirty () const |
![]() | |
QFrame (QWidget *parent, Qt::WindowFlags f) | |
virtual | ~QFrame () |
int | frameStyle () const const |
void | setFrameStyle (int style) |
int | frameWidth () const const |
virtual QSize | sizeHint () const const override |
QFrame::Shape | frameShape () const const |
void | setFrameShape (QFrame::Shape) |
QFrame::Shadow | frameShadow () const const |
void | setFrameShadow (QFrame::Shadow) |
int | lineWidth () const const |
void | setLineWidth (int) |
int | midLineWidth () const const |
void | setMidLineWidth (int) |
QRect | frameRect () const const |
void | setFrameRect (const QRect &) |
![]() | |
QWidget (QWidget *parent, Qt::WindowFlags f) | |
virtual | ~QWidget () |
WId | winId () const const |
WId | effectiveWinId () const const |
QStyle * | style () const const |
void | setStyle (QStyle *style) |
bool | isTopLevel () const const |
bool | isWindow () const const |
bool | isModal () const const |
Qt::WindowModality | windowModality () const const |
void | setWindowModality (Qt::WindowModality windowModality) |
bool | isEnabled () const const |
bool | isEnabledTo (const QWidget *ancestor) const const |
bool | isEnabledToTLW () const const |
void | setEnabled (bool) |
void | setDisabled (bool disable) |
void | setWindowModified (bool) |
QRect | frameGeometry () const const |
const QRect & | geometry () const const |
QRect | normalGeometry () const const |
int | x () const const |
int | y () const const |
QPoint | pos () const const |
QSize | frameSize () const const |
QSize | size () const const |
int | width () const const |
int | height () const const |
QRect | rect () const const |
QRect | childrenRect () const const |
QRegion | childrenRegion () const const |
QSize | minimumSize () const const |
QSize | maximumSize () const const |
int | minimumWidth () const const |
int | minimumHeight () const const |
int | maximumWidth () const const |
int | maximumHeight () const const |
void | setMinimumSize (const QSize &) |
void | setMinimumSize (int minw, int minh) |
void | setMaximumSize (const QSize &) |
void | setMaximumSize (int maxw, int maxh) |
void | setMinimumWidth (int minw) |
void | setMinimumHeight (int minh) |
void | setMaximumWidth (int maxw) |
void | setMaximumHeight (int maxh) |
void | setupUi (QWidget *widget) |
QSize | sizeIncrement () const const |
void | setSizeIncrement (const QSize &) |
void | setSizeIncrement (int w, int h) |
QSize | baseSize () const const |
void | setBaseSize (const QSize &) |
void | setBaseSize (int basew, int baseh) |
void | setFixedSize (const QSize &s) |
void | setFixedSize (int w, int h) |
void | setFixedWidth (int w) |
void | setFixedHeight (int h) |
QPoint | mapToGlobal (const QPoint &pos) const const |
QPoint | mapFromGlobal (const QPoint &pos) const const |
QPoint | mapToParent (const QPoint &pos) const const |
QPoint | mapFromParent (const QPoint &pos) const const |
QPoint | mapTo (const QWidget *parent, const QPoint &pos) const const |
QPoint | mapFrom (const QWidget *parent, const QPoint &pos) const const |
QWidget * | window () const const |
QWidget * | nativeParentWidget () const const |
QWidget * | topLevelWidget () const const |
const QPalette & | palette () const const |
void | setPalette (const QPalette &) |
void | setBackgroundRole (QPalette::ColorRole role) |
QPalette::ColorRole | backgroundRole () const const |
void | setForegroundRole (QPalette::ColorRole role) |
QPalette::ColorRole | foregroundRole () const const |
const QFont & | font () const const |
void | setFont (const QFont &) |
QFontMetrics | fontMetrics () const const |
QFontInfo | fontInfo () const const |
QCursor | cursor () const const |
void | setCursor (const QCursor &) |
void | unsetCursor () |
void | setMouseTracking (bool enable) |
bool | hasMouseTracking () const const |
bool | underMouse () const const |
void | setTabletTracking (bool enable) |
bool | hasTabletTracking () const const |
void | setMask (const QBitmap &bitmap) |
void | setMask (const QRegion ®ion) |
QRegion | mask () const const |
void | clearMask () |
void | render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags) |
void | render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags) |
QPixmap | grab (const QRect &rectangle) |
QGraphicsEffect * | graphicsEffect () const const |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags) |
void | ungrabGesture (Qt::GestureType gesture) |
void | setWindowTitle (const QString &) |
void | setStyleSheet (const QString &styleSheet) |
QString | styleSheet () const const |
QString | windowTitle () const const |
void | setWindowIcon (const QIcon &icon) |
QIcon | windowIcon () const const |
void | setWindowIconText (const QString &) |
QString | windowIconText () const const |
void | setWindowRole (const QString &role) |
QString | windowRole () const const |
void | setWindowFilePath (const QString &filePath) |
QString | windowFilePath () const const |
void | setWindowOpacity (qreal level) |
qreal | windowOpacity () const const |
bool | isWindowModified () const const |
void | setToolTip (const QString &) |
QString | toolTip () const const |
void | setToolTipDuration (int msec) |
int | toolTipDuration () const const |
void | setStatusTip (const QString &) |
QString | statusTip () const const |
void | setWhatsThis (const QString &) |
QString | whatsThis () const const |
QString | accessibleName () const const |
void | setAccessibleName (const QString &name) |
QString | accessibleDescription () const const |
void | setAccessibleDescription (const QString &description) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
Qt::LayoutDirection | layoutDirection () const const |
void | unsetLayoutDirection () |
void | setLocale (const QLocale &locale) |
QLocale | locale () const const |
void | unsetLocale () |
void | setFocus () |
bool | isActiveWindow () const const |
void | activateWindow () |
void | clearFocus () |
void | setFocus (Qt::FocusReason reason) |
Qt::FocusPolicy | focusPolicy () const const |
void | setFocusPolicy (Qt::FocusPolicy policy) |
bool | hasFocus () const const |
void | setFocusProxy (QWidget *w) |
QWidget * | focusProxy () const const |
Qt::ContextMenuPolicy | contextMenuPolicy () const const |
void | setContextMenuPolicy (Qt::ContextMenuPolicy policy) |
void | grabMouse () |
void | grabMouse (const QCursor &cursor) |
void | releaseMouse () |
void | grabKeyboard () |
void | releaseKeyboard () |
int | grabShortcut (const QKeySequence &key, Qt::ShortcutContext context) |
void | releaseShortcut (int id) |
void | setShortcutEnabled (int id, bool enable) |
void | setShortcutAutoRepeat (int id, bool enable) |
bool | updatesEnabled () const const |
void | setUpdatesEnabled (bool enable) |
QGraphicsProxyWidget * | graphicsProxyWidget () const const |
void | update () |
void | repaint () |
void | update (int x, int y, int w, int h) |
void | update (const QRect &rect) |
void | update (const QRegion &rgn) |
void | repaint (int x, int y, int w, int h) |
void | repaint (const QRect &rect) |
void | repaint (const QRegion &rgn) |
virtual void | setVisible (bool visible) |
void | setHidden (bool hidden) |
void | show () |
void | hide () |
void | showMinimized () |
void | showMaximized () |
void | showFullScreen () |
void | showNormal () |
bool | close () |
void | raise () |
void | lower () |
void | stackUnder (QWidget *w) |
void | move (int x, int y) |
void | move (const QPoint &) |
void | resize (int w, int h) |
void | resize (const QSize &) |
void | setGeometry (int x, int y, int w, int h) |
void | setGeometry (const QRect &) |
QByteArray | saveGeometry () const const |
bool | restoreGeometry (const QByteArray &geometry) |
void | adjustSize () |
bool | isVisible () const const |
bool | isVisibleTo (const QWidget *ancestor) const const |
bool | isHidden () const const |
bool | isMinimized () const const |
bool | isMaximized () const const |
bool | isFullScreen () const const |
Qt::WindowStates | windowState () const const |
void | setWindowState (Qt::WindowStates windowState) |
virtual QSize | minimumSizeHint () const const |
QSizePolicy | sizePolicy () const const |
void | setSizePolicy (QSizePolicy) |
void | setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) |
virtual int | heightForWidth (int w) const const |
virtual bool | hasHeightForWidth () const const |
QRegion | visibleRegion () const const |
void | setContentsMargins (int left, int top, int right, int bottom) |
void | setContentsMargins (const QMargins &margins) |
void | getContentsMargins (int *left, int *top, int *right, int *bottom) const const |
QMargins | contentsMargins () const const |
QRect | contentsRect () const const |
QLayout * | layout () const const |
void | setLayout (QLayout *layout) |
void | updateGeometry () |
void | setParent (QWidget *parent) |
void | setParent (QWidget *parent, Qt::WindowFlags f) |
void | scroll (int dx, int dy) |
void | scroll (int dx, int dy, const QRect &r) |
QWidget * | focusWidget () const const |
QWidget * | nextInFocusChain () const const |
QWidget * | previousInFocusChain () const const |
bool | acceptDrops () const const |
void | setAcceptDrops (bool on) |
void | addAction (QAction *action) |
void | addActions (QList< QAction * > actions) |
void | insertActions (QAction *before, QList< QAction * > actions) |
void | insertAction (QAction *before, QAction *action) |
void | removeAction (QAction *action) |
QList< QAction * > | actions () const const |
QWidget * | parentWidget () const const |
void | setWindowFlags (Qt::WindowFlags type) |
Qt::WindowFlags | windowFlags () const const |
void | setWindowFlag (Qt::WindowType flag, bool on) |
void | overrideWindowFlags (Qt::WindowFlags flags) |
Qt::WindowType | windowType () const const |
QWidget * | childAt (int x, int y) const const |
QWidget * | childAt (const QPoint &p) const const |
void | setAttribute (Qt::WidgetAttribute attribute, bool on) |
bool | testAttribute (Qt::WidgetAttribute attribute) const const |
virtual QPaintEngine * | paintEngine () const const override |
void | ensurePolished () const const |
bool | isAncestorOf (const QWidget *child) const const |
bool | hasEditFocus () const const |
void | setEditFocus (bool enable) |
bool | autoFillBackground () const const |
void | setAutoFillBackground (bool enabled) |
QBackingStore * | backingStore () const const |
QWindow * | windowHandle () const const |
QScreen * | screen () const const |
void | windowTitleChanged (const QString &title) |
void | windowIconChanged (const QIcon &icon) |
void | windowIconTextChanged (const QString &iconText) |
void | customContextMenuRequested (const QPoint &pos) |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const const |
Qt::InputMethodHints | inputMethodHints () const const |
void | setInputMethodHints (Qt::InputMethodHints hints) |
QWIDGETSIZE_MAX QWIDGETSIZE_MAX | |
![]() | |
virtual const QMetaObject * | metaObject () const const |
QObject (QObject *parent) | |
virtual | ~QObject () |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
T | qobject_cast (QObject *object) |
T | qobject_cast (const QObject *object) |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
Q_CLASSINFO (Name, Value) | |
Q_INTERFACES (...) | |
Q_PROPERTY (...) | |
Q_ENUMS (...) | |
Q_FLAGS (...) | |
Q_ENUM (...) | |
Q_FLAG (...) | |
Q_ENUM_NS (...) | |
Q_FLAG_NS (...) | |
Q_OBJECT Q_OBJECT | |
Q_GADGET Q_GADGET | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_SIGNALS Q_SIGNALS | |
Q_SIGNAL Q_SIGNAL | |
Q_SLOTS Q_SLOTS | |
Q_SLOT Q_SLOT | |
Q_EMIT Q_EMIT | |
Q_INVOKABLE Q_INVOKABLE | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
![]() | |
virtual | ~QPaintDevice () |
bool | paintingActive () const const |
int | width () const const |
int | height () const const |
int | widthMM () const const |
int | heightMM () const const |
int | logicalDpiX () const const |
int | logicalDpiY () const const |
int | physicalDpiX () const const |
int | physicalDpiY () const const |
int | devicePixelRatio () const const |
qreal | devicePixelRatioF () const const |
int | colorCount () const const |
int | depth () const const |
Protected Member Functions | |
void | trigger_setting_updated () |
void | enterEvent (QEvent *event) |
void | leaveEvent (QEvent *event) |
Q_PROPERTY WRITE Function | |
void | setDirty (bool dirty) |
Sets the dirty state. More... | |
![]() | |
virtual bool | event (QEvent *e) override |
virtual void | paintEvent (QPaintEvent *) override |
virtual void | changeEvent (QEvent *ev) override |
void | initStyleOption (QStyleOptionFrame *option) const const |
![]() | |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | focusInEvent (QFocusEvent *event) |
virtual void | focusOutEvent (QFocusEvent *event) |
virtual void | moveEvent (QMoveEvent *event) |
virtual void | resizeEvent (QResizeEvent *event) |
virtual void | closeEvent (QCloseEvent *event) |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
virtual void | tabletEvent (QTabletEvent *event) |
virtual void | actionEvent (QActionEvent *event) |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dragMoveEvent (QDragMoveEvent *event) |
virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
virtual void | showEvent (QShowEvent *event) |
virtual void | hideEvent (QHideEvent *event) |
virtual bool | nativeEvent (const QByteArray &eventType, void *message, long *result) |
virtual int | metric (QPaintDevice::PaintDeviceMetric m) const const override |
virtual void | initPainter (QPainter *painter) const const override |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
void | updateMicroFocus () |
void | create (WId window, bool initializeWindow, bool destroyOldWindow) |
void | destroy (bool destroyWindow, bool destroySubWindows) |
virtual bool | focusNextPrevChild (bool next) |
bool | focusNextChild () |
bool | focusPreviousChild () |
![]() | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
![]() | |
QPaintDevice () | |
Protected Attributes | |
QVBoxLayout * | m_layout |
QBoxLayout * | mContainer |
QHBoxLayout * | m_top_bar |
QLabel * | mNameLabel |
QToolButton * | mRevertButton |
QToolButton * | mDefaultButton |
QList< QPair< QLabel *, QString > > | m_labels |
SettingsItem * | mSettingsItem |
Additional Inherited Members | |
![]() | |
enum | Shape |
enum | Shadow |
enum | StyleMask |
![]() | |
enum | RenderFlag |
![]() | |
enum | PaintDeviceMetric |
![]() | |
void | setTabOrder (QWidget *first, QWidget *second) |
QWidget * | mouseGrabber () |
QWidget * | keyboardGrabber () |
QWidget * | find (WId id) |
QWidget * | createWindowContainer (QWindow *window, QWidget *parent, Qt::WindowFlags flags) |
![]() | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
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 QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
![]() | |
NoFrame | |
Box | |
Panel | |
WinPanel | |
HLine | |
VLine | |
StyledPanel | |
Plain | |
Raised | |
Sunken | |
Shadow_Mask | |
Shape_Mask | |
![]() | |
typedef | RenderFlags |
DrawWindowBackground | |
DrawChildren | |
IgnoreMask | |
![]() | |
typedef | QObjectList |
![]() | |
PdmWidth | |
PdmHeight | |
PdmWidthMM | |
PdmHeightMM | |
PdmNumColors | |
PdmDepth | |
PdmDpiX | |
PdmDpiY | |
PdmPhysicalDpiX | |
PdmPhysicalDpiY | |
PdmDevicePixelRatio | |
PdmDevicePixelRatioScaled | |
The base class for all specific SettingsWidgets.
The SettingsWidget class represents the visual part of a single setting. It provides an interface and collection of commenly shared functions such as load(), value() or matchLabel(). It displays and works on a SettingsItem that represents the logical part.
Definition at line 52 of file settings_widget.h.
|
explicit |
The constructor.
item | - The underlying SettingsItem for the widget. |
parent | - The widget's parent. |
Definition at line 14 of file settings_widget.cpp.
References QBoxLayout::addLayout(), QBoxLayout::addStretch(), QBoxLayout::addWidget(), Qt::AlignLeft, Qt::AlignTop, QAbstractButton::clicked(), QObject::connect(), QObject::destroyed(), QSizePolicy::Expanding, QSizePolicy::Fixed, handleItemDestroyed(), handleRevertModification(), handleSetDefaultValue(), QWidget::hide(), hal::SettingsItem::isDefaultValue(), hal::SettingsItem::label(), m_layout, m_top_bar, mContainer, mDefaultButton, mNameLabel, mRevertButton, mSettingsItem, QFrame::NoFrame, QLayout::setAlignment(), QLayout::setContentsMargins(), QWidget::setEnabled(), QFrame::setFrameStyle(), QWidget::setLayout(), QObject::setObjectName(), QSizePolicy::setRetainSizeWhenHidden(), QWidget::setSizePolicy(), QBoxLayout::setSpacing(), QLabel::setText(), QAbstractButton::setText(), QWidget::setToolTip(), QWidget::setVisible(), and QWidget::sizePolicy.
|
virtual |
Sets the value of the SettingsItem to the in the visual part configured value.
Definition at line 155 of file settings_widget.cpp.
References mSettingsItem, setDirty(), hal::SettingsItem::setValue(), and value().
|
inlinevirtual |
Clears the editor that is used to change the setting.
Reimplemented in hal::SettingsWidgetKeybind.
Definition at line 131 of file settings_widget.h.
Referenced by hal::MainSettingsList::clearAll().
bool hal::SettingsWidget::dirty | ( | ) | const |
|
protectedvirtual |
Overwritten Qt function. Please refer to Qt's documentation for additional information.
event | - The triggered event. |
Reimplemented from QWidget.
Definition at line 139 of file settings_widget.cpp.
References QFrame::event(), mDefaultButton, mRevertButton, mSettingsItem, QObject::Q_EMIT(), QWidget::setVisible(), and triggerDescriptionUpdate().
QString hal::SettingsWidget::getLabel | ( | ) |
Definition at line 80 of file settings_widget.cpp.
References hal::SettingsItem::label(), and mSettingsItem.
|
slot |
Removes its SettingsItem pointer, emits the triggerRemoveWidget signal and closes itself. Should be called when the underlying SettingsItem is destroyed or simply connected to the item's destroyed signal.
Definition at line 109 of file settings_widget.cpp.
References QWidget::close(), mSettingsItem, QObject::Q_EMIT(), and triggerRemoveWidget().
Referenced by SettingsWidget().
|
virtualslot |
Loads the value of the SettingsItem and updates the visuals. Does the same as loadCurrentValue().
Reimplemented in hal::SettingsWidgetKeybind.
Definition at line 102 of file settings_widget.cpp.
References load(), mSettingsItem, trigger_setting_updated(), and hal::SettingsItem::value().
Referenced by hal::SettingsWidgetKeybind::handleRevertModification(), and SettingsWidget().
|
virtualslot |
Loads the default value from the SettingsItem and updates the visuals.
setAll | - Not used. |
Reimplemented in hal::SettingsWidgetKeybind.
Definition at line 94 of file settings_widget.cpp.
References hal::SettingsItem::defaultValue(), load(), mSettingsItem, and trigger_setting_updated().
Referenced by hal::SettingsWidgetKeybind::handleSetDefaultValue(), and SettingsWidget().
|
protectedvirtual |
Overwritten Qt function. Please refer to Qt's documentation for additional information.
event | - The triggered event. |
Reimplemented from QWidget.
Definition at line 147 of file settings_widget.cpp.
References QFrame::event(), mDefaultButton, mRevertButton, QObject::Q_EMIT(), QWidget::setVisible(), and triggerDescriptionUpdate().
|
pure virtual |
Updates the visual setting by the given value.
value | - The value to be loaded into the visual setting. |
Implemented in hal::SettingsWidgetText, hal::SettingsWidgetSpinbox, hal::SettingsWidgetSlider, hal::SettingsWidgetKeybind, hal::SettingsWidgetDropdown, and hal::SettingsWidgetCheckbox.
Referenced by handleRevertModification(), handleSetDefaultValue(), loadCurrentValue(), and prepare().
|
virtual |
Loads the value of the SettingsItem and updates the visuals.
Definition at line 162 of file settings_widget.cpp.
References load(), mSettingsItem, trigger_setting_updated(), and hal::SettingsItem::value().
bool hal::SettingsWidget::matchLabel | ( | const QString & | needle | ) |
Searches the given string in the label of this widget's underlying SettingsItem.
needle | - The string to search for. |
Definition at line 74 of file settings_widget.cpp.
References QRegularExpressionMatch::hasMatch(), hal::SettingsItem::label(), QRegularExpression::match(), and mSettingsItem.
void hal::SettingsWidget::prepare | ( | ) |
Loads the value of its SettingsItem and adjusts the visuals accordingly and sets its dirty state to false.
Definition at line 131 of file settings_widget.cpp.
References hal::SettingsItem::isDefaultValue(), load(), mDefaultButton, mSettingsItem, setDirty(), QWidget::setEnabled(), and hal::SettingsItem::value().
void hal::SettingsWidget::reset_labels | ( | ) |
Hides empty labels and shows non-empty labels.
Definition at line 58 of file settings_widget.cpp.
References m_labels.
|
protected |
Sets the dirty state.
dirty | - The value to set the state to. |
Definition at line 116 of file settings_widget.cpp.
References dirty, mRevertButton, QStyle::polish(), QWidget::setEnabled(), QWidget::style(), and QStyle::unpolish().
Referenced by acceptValue(), prepare(), and trigger_setting_updated().
|
inline |
Get the SettingsItem that this widget represents.
Definition at line 102 of file settings_widget.h.
References mSettingsItem.
Referenced by hal::MainSettingsList::getItems().
|
protected |
Compares its visual value to the SettingsItem's current value and default value and sets the additional visual informations accordingly.
Definition at line 85 of file settings_widget.cpp.
References hal::SettingsItem::defaultValue(), mDefaultButton, mSettingsItem, setDirty(), QWidget::setEnabled(), hal::SettingsItem::value(), and value().
Referenced by handleRevertModification(), handleSetDefaultValue(), and loadCurrentValue().
|
signal |
Q_SIGNAL that is emitted whenever the mouse enters or leaves the widget.
item | - The widget's SettingItem when entering or nullptr when leaving the widget. |
Referenced by enterEvent(), and leaveEvent().
|
signal |
Q_SIGNAL that is emitted when all cleanup is done and the widget is ready to be removed.
widget |
Referenced by handleItemDestroyed().
|
pure virtual |
Get the visual value of the setting.
Implemented in hal::SettingsWidgetText, hal::SettingsWidgetSpinbox, hal::SettingsWidgetSlider, hal::SettingsWidgetKeybind, hal::SettingsWidgetDropdown, and hal::SettingsWidgetCheckbox.
Referenced by acceptValue(), and trigger_setting_updated().
|
signal |
Q_SIGNAL that is currently unused.
Definition at line 218 of file settings_widget.h.
Referenced by reset_labels().
|
protected |
Definition at line 211 of file settings_widget.h.
Referenced by SettingsWidget().
|
protected |
Definition at line 213 of file settings_widget.h.
Referenced by SettingsWidget().
|
protected |
Definition at line 212 of file settings_widget.h.
Referenced by SettingsWidget(), hal::SettingsWidgetCheckbox::SettingsWidgetCheckbox(), hal::SettingsWidgetDropdown::SettingsWidgetDropdown(), hal::SettingsWidgetKeybind::SettingsWidgetKeybind(), hal::SettingsWidgetSlider::SettingsWidgetSlider(), hal::SettingsWidgetSpinbox::SettingsWidgetSpinbox(), and hal::SettingsWidgetText::SettingsWidgetText().
|
protected |
Definition at line 216 of file settings_widget.h.
Referenced by enterEvent(), leaveEvent(), prepare(), SettingsWidget(), and trigger_setting_updated().
|
protected |
Definition at line 214 of file settings_widget.h.
Referenced by SettingsWidget().
|
protected |
Definition at line 215 of file settings_widget.h.
Referenced by enterEvent(), leaveEvent(), setDirty(), and SettingsWidget().
|
protected |
Definition at line 219 of file settings_widget.h.
Referenced by acceptValue(), enterEvent(), getLabel(), handleItemDestroyed(), handleRevertModification(), hal::SettingsWidgetKeybind::handleRevertModification(), handleSetDefaultValue(), hal::SettingsWidgetKeybind::handleSetDefaultValue(), hal::SettingsWidgetKeybind::load(), loadCurrentValue(), matchLabel(), prepare(), settingsItem(), SettingsWidget(), and trigger_setting_updated().
|
readwrite |
Definition at line 1 of file settings_widget.h.
Referenced by setDirty().