ProjectExplorer: Add BaseIntegerAspect::setToolTip()

Change-Id: I7a9fe0695b30c926d6b3e11302a4a8eaadfa2b16
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-07-28 22:36:16 +02:00
parent 5e2abd7181
commit 120540f1db
2 changed files with 12 additions and 0 deletions

View File

@@ -135,6 +135,7 @@ public:
QString m_labelText;
QString m_prefix;
QString m_suffix;
QString m_tooltip;
QPointer<QLabel> m_label;
QPointer<QSpinBox> m_spinBox; // Owned by configuration widget
bool m_enabled = true;
@@ -677,6 +678,7 @@ void BaseIntegerAspect::addToLayout(LayoutBuilder &builder)
d->m_spinBox->setPrefix(d->m_prefix);
d->m_spinBox->setSuffix(d->m_suffix);
d->m_spinBox->setEnabled(d->m_enabled);
d->m_spinBox->setToolTip(d->m_tooltip);
if (d->m_maximumValue.isValid() && d->m_maximumValue.isValid())
d->m_spinBox->setRange(int(d->m_minimumValue.toLongLong() / d->m_displayScaleFactor),
int(d->m_maximumValue.toLongLong() / d->m_displayScaleFactor));
@@ -761,6 +763,15 @@ void BaseIntegerAspect::setDefaultValue(qint64 defaultValue)
d->m_defaultValue = defaultValue;
}
void BaseIntegerAspect::setToolTip(const QString &tooltip)
{
d->m_tooltip = tooltip;
}
/*!
\class ProjectExplorer::BaseTristateAspect
*/
BaseTriStateAspect::BaseTriStateAspect()
{
setDisplayStyle(DisplayStyle::ComboBox);

View File

@@ -192,6 +192,7 @@ public:
void setDisplayScaleFactor(qint64 factor);
void setEnabled(bool enabled);
void setDefaultValue(qint64 defaultValue);
void setToolTip(const QString &tooltip);
void fromMap(const QVariantMap &map) override;
void toMap(QVariantMap &map) const override;