summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <[email protected]>2017-09-17 12:35:35 -0400
committerAllen Winter <[email protected]>2017-09-17 12:35:35 -0400
commit375399018c377395983ed4c25eb4de9a7ed9e7ac (patch)
tree9a5307f3f51a9301c2224927dd1cf7e316bcce2e
parent75518d90e1098e7896dedbcc29375fbea903106c (diff)
prefs/kprefsdialog.cpp - KPrefsWidCombo behave like other KPrefsWid's
allow the parent to give it a layout. add tooltip and whatsthis
-rw-r--r--src/libkdepim/prefs/kprefsdialog.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libkdepim/prefs/kprefsdialog.cpp b/src/libkdepim/prefs/kprefsdialog.cpp
index 9e80b1b..c000905 100644
--- a/src/libkdepim/prefs/kprefsdialog.cpp
+++ b/src/libkdepim/prefs/kprefsdialog.cpp
@@ -482,13 +482,20 @@ QList<QWidget *> KPrefsWidRadios::widgets() const
KPrefsWidCombo::KPrefsWidCombo(KConfigSkeleton::ItemEnum *item, QWidget *parent)
: mItem(item)
{
- QWidget *hbox = new QWidget(parent);
- QHBoxLayout *hboxHBoxLayout = new QHBoxLayout(hbox);
- hboxHBoxLayout->setMargin(0);
- mLabel = new QLabel(mItem->label(), hbox);
- mCombo = new KComboBox(hbox);
- hboxHBoxLayout->addWidget(mCombo);
+ mLabel = new QLabel(mItem->label(), parent);
+ mCombo = new KComboBox(parent);
connect(mCombo, QOverload<int>::of(&KComboBox::activated), this, &KPrefsWidCombo::changed);
+ mLabel->setBuddy(mCombo);
+ QString toolTip = mItem->toolTip();
+ if (!toolTip.isEmpty()) {
+ mLabel->setToolTip(toolTip);
+ mCombo->setToolTip(toolTip);
+ }
+ QString whatsThis = mItem->whatsThis();
+ if (!whatsThis.isEmpty()) {
+ mLabel->setWhatsThis(whatsThis);
+ mCombo->setWhatsThis(whatsThis);
+ }
}
KPrefsWidCombo::~KPrefsWidCombo()