From 553fb640622542592d353ba2af06d5baef6a5915 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 28 Feb 2009 21:25:16 +0100 Subject: [PATCH] Allow QGroupBox for auto widget handling in settingspages --- src/uisupport/settingspage.cpp | 4 ++-- src/uisupport/settingspage.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/uisupport/settingspage.cpp b/src/uisupport/settingspage.cpp index de82f69e..577f1683 100644 --- a/src/uisupport/settingspage.cpp +++ b/src/uisupport/settingspage.cpp @@ -88,7 +88,7 @@ void SettingsPage::initAutoWidgets() { findAutoWidgets(this, &_autoWidgets); foreach(QObject *widget, _autoWidgets) { - if(widget->inherits("QAbstractButton")) + if(widget->inherits("QAbstractButton") || widget->inherits("QGroupBox")) connect(widget, SIGNAL(toggled(bool)), SLOT(autoWidgetHasChanged())); else if(widget->inherits("QLineEdit") || widget->inherits("QTextEdit")) connect(widget, SIGNAL(textChanged(const QString &)), SLOT(autoWidgetHasChanged())); @@ -111,7 +111,7 @@ void SettingsPage::findAutoWidgets(QObject *parent, QObjectList *autoList) const QByteArray SettingsPage::autoWidgetPropertyName(QObject *widget) const { QByteArray prop; - if(widget->inherits("QAbstractButton")) + if(widget->inherits("QAbstractButton") || widget->inherits("QGroupBox")) prop = "checked"; else if(widget->inherits("QLineEdit") || widget->inherits("QTextEdit")) prop = "text"; diff --git a/src/uisupport/settingspage.h b/src/uisupport/settingspage.h index 98abc385..4a106aa1 100644 --- a/src/uisupport/settingspage.h +++ b/src/uisupport/settingspage.h @@ -45,6 +45,7 @@ class QSpinBox; * of load(), save() and defaults() (preferably at the end of the derived function, since they call setChangedState(false)). * * The following widgets can be handled for now: + * - QGroupBox (isChecked()) * - QAbstractButton (isChecked(), e.g. for QCheckBox and QRadioButton) * - QLineEdit, QTextEdit (text()) * - QComboBox (currentIndex()) -- 2.20.1