Commit 37539901 authored by Allen Winter's avatar Allen Winter

prefs/kprefsdialog.cpp - KPrefsWidCombo behave like other KPrefsWid's

allow the parent to give it a layout. add tooltip and whatsthis
parent 75518d90
...@@ -482,13 +482,20 @@ QList<QWidget *> KPrefsWidRadios::widgets() const ...@@ -482,13 +482,20 @@ QList<QWidget *> KPrefsWidRadios::widgets() const
KPrefsWidCombo::KPrefsWidCombo(KConfigSkeleton::ItemEnum *item, QWidget *parent) KPrefsWidCombo::KPrefsWidCombo(KConfigSkeleton::ItemEnum *item, QWidget *parent)
: mItem(item) : mItem(item)
{ {
QWidget *hbox = new QWidget(parent); mLabel = new QLabel(mItem->label(), parent);
QHBoxLayout *hboxHBoxLayout = new QHBoxLayout(hbox); mCombo = new KComboBox(parent);
hboxHBoxLayout->setMargin(0);
mLabel = new QLabel(mItem->label(), hbox);
mCombo = new KComboBox(hbox);
hboxHBoxLayout->addWidget(mCombo);
connect(mCombo, QOverload<int>::of(&KComboBox::activated), this, &KPrefsWidCombo::changed); 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() KPrefsWidCombo::~KPrefsWidCombo()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment