diff --git a/krusader/Konfigurator/kgadvanced.cpp b/krusader/Konfigurator/kgadvanced.cpp --- a/krusader/Konfigurator/kgadvanced.cpp +++ b/krusader/Konfigurator/kgadvanced.cpp @@ -97,12 +97,9 @@ const QString cacheTip = i18n("The icon cache size influences how fast the contents of a panel can be displayed. However, too large a cache might consume your memory."); QLabel *label = new QLabel(i18n("Icon cache size (KB):"), fineTuneGrp); - label->setWhatsThis(cacheTip); fineTuneGrid->addWidget(label, 0, 0); KonfiguratorSpinBox *spinBox = createSpinBox("Advanced", "Icon Cache Size", _IconCacheSize, - 1, 8192, fineTuneGrp, false); - spinBox->setWhatsThis(cacheTip); - spinBox->setToolTip(cacheTip); + 1, 8192, label, fineTuneGrp, false, cacheTip); spinBox->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); fineTuneGrid->addWidget(spinBox, 0, 1); diff --git a/krusader/Konfigurator/kgcolors.cpp b/krusader/Konfigurator/kgcolors.cpp --- a/krusader/Konfigurator/kgcolors.cpp +++ b/krusader/Konfigurator/kgcolors.cpp @@ -177,8 +177,9 @@ addColorSelector("Dim Target Color", i18n("Dim target color:"), Qt::black); int index = itemList.count() - offset; - labelList.append(addLabel(colorsGrid, index, 0, i18n("Dim factor:"), colorsGrp)); - dimFactor = createSpinBox("Colors", "Dim Factor", 80, 0, 100, colorsGrp); + QLabel *spinBoxLabel = addLabel(colorsGrid, index, 0, i18n("Dim factor:"), colorsGrp); + labelList.append(spinBoxLabel); + dimFactor = createSpinBox("Colors", "Dim Factor", 80, 0, 100, spinBoxLabel, colorsGrp); dimFactor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); colorsGrid->addWidget(dimFactor, index++, 1); diff --git a/krusader/Konfigurator/kggeneral.cpp b/krusader/Konfigurator/kggeneral.cpp --- a/krusader/Konfigurator/kggeneral.cpp +++ b/krusader/Konfigurator/kggeneral.cpp @@ -120,10 +120,9 @@ const QString listerLimitTip = i18n("If a text file is bigger than this size then lister will be used."); QLabel *label5 = new QLabel(i18n("Use lister if the text file is bigger than:"), hboxWidget4); - label5->setWhatsThis(listerLimitTip); hbox4->addWidget(label5); KonfiguratorSpinBox *spinBox = createSpinBox("General", "Lister Limit", _ListerLimit, - 0, 0x7FFFFFFF, hboxWidget4, false, listerLimitTip, PAGE_VIEWER); + 0, 0x7FFFFFFF, label5, hboxWidget4, false, listerLimitTip, PAGE_VIEWER); hbox4->addWidget(spinBox); QLabel *label6 = new QLabel(i18n("MB"), hboxWidget4); hbox4->addWidget(label6); diff --git a/krusader/Konfigurator/kgpanel.cpp b/krusader/Konfigurator/kgpanel.cpp --- a/krusader/Konfigurator/kgpanel.cpp +++ b/krusader/Konfigurator/kgpanel.cpp @@ -389,10 +389,10 @@ const QString delayTip = i18n("The duration after a tooltip is shown for a file item, in " "milliseconds. Set a negative value to disable tooltips."); QLabel *tooltipLabel = new QLabel(i18n("Tooltip delay (msec):")); - tooltipLabel->setWhatsThis(delayTip); tooltipLayout->addWidget(tooltipLabel); KonfiguratorSpinBox *tooltipSpinBox = createSpinBox("Look&Feel", "Panel Tooltip Delay", 1000, - -100, 5000, panelGrp, false, delayTip, PAGE_VIEW); + -100, 5000, tooltipLabel, panelGrp, false, + delayTip, PAGE_VIEW); tooltipSpinBox->setSingleStep(100); tooltipLayout->addWidget(tooltipSpinBox); tooltipLayout->addStretch(1); diff --git a/krusader/Konfigurator/konfiguratorpage.h b/krusader/Konfigurator/konfiguratorpage.h --- a/krusader/Konfigurator/konfiguratorpage.h +++ b/krusader/Konfigurator/konfiguratorpage.h @@ -139,15 +139,16 @@ * @param defaultValue The default value of the spinbox * @param min The minimum value of the spinbox * @param max The maximum value of the spinbox + * @param label The label that is associated to the spinbox * @param parent Reference to the parent widget * @param restart The change of this parameter requires Krusader restart * @param toolTip Tooltip used for this spinbox * @param page The subpage of a Konfigurator page (because of setDefaults) * * @return reference to the newly created spinbox */ KonfiguratorSpinBox *createSpinBox(QString configGroup, QString configName, int defaultValue, - int min, int max, QWidget *parent = nullptr, bool restart = false, + int min, int max, QLabel *label, QWidget *parent = nullptr, bool restart = false, const QString &toolTip = QString(), int page = FIRST_PAGE); /** diff --git a/krusader/Konfigurator/konfiguratorpage.cpp b/krusader/Konfigurator/konfiguratorpage.cpp --- a/krusader/Konfigurator/konfiguratorpage.cpp +++ b/krusader/Konfigurator/konfiguratorpage.cpp @@ -90,11 +90,13 @@ } KonfiguratorSpinBox* KonfiguratorPage::createSpinBox(QString configGroup, QString configName, - int defaultValue, int min, int max, QWidget *parent, bool restart, const QString &toolTip, int page) + int defaultValue, int min, int max, QLabel *label, QWidget *parent, bool restart, const QString &toolTip, int page) { KonfiguratorSpinBox *spinBox = new KonfiguratorSpinBox(std::move(configGroup), std::move(configName), defaultValue, min, max, parent, restart, page); if (!toolTip.isEmpty()) { + label->setWhatsThis(toolTip); + label->setToolTip(toolTip); spinBox->setWhatsThis(toolTip); spinBox->setToolTip(toolTip); }