Allow QGroupBox for auto widget handling in settingspages
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Feb 2009 20:25:16 +0000 (21:25 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Feb 2009 20:25:16 +0000 (21:25 +0100)
src/uisupport/settingspage.cpp
src/uisupport/settingspage.h

index de82f69..577f168 100644 (file)
@@ -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";
index 98abc38..4a106aa 100644 (file)
@@ -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())