Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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
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()
......
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