forked from qt-creator/qt-creator
ProjectExplorer: Allow tool tips for bool aspects
Useful e.g. for Boot2Qt::PushToDeviceStep Change-Id: I41f4a52ee7d3b0f18df8b2249232cfd0e4445ced Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -55,6 +55,7 @@ public:
|
|||||||
bool m_value = false;
|
bool m_value = false;
|
||||||
bool m_defaultValue = false;
|
bool m_defaultValue = false;
|
||||||
QString m_label;
|
QString m_label;
|
||||||
|
QString m_tooltip;
|
||||||
QPointer<QCheckBox> m_checkBox; // Owned by configuration widget
|
QPointer<QCheckBox> m_checkBox; // Owned by configuration widget
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -309,6 +310,7 @@ void BaseBoolAspect::addToConfigurationLayout(QFormLayout *layout)
|
|||||||
QTC_CHECK(!d->m_checkBox);
|
QTC_CHECK(!d->m_checkBox);
|
||||||
d->m_checkBox = new QCheckBox(d->m_label, layout->parentWidget());
|
d->m_checkBox = new QCheckBox(d->m_label, layout->parentWidget());
|
||||||
d->m_checkBox->setChecked(d->m_value);
|
d->m_checkBox->setChecked(d->m_value);
|
||||||
|
d->m_checkBox->setToolTip(d->m_tooltip);
|
||||||
layout->addRow(QString(), d->m_checkBox);
|
layout->addRow(QString(), d->m_checkBox);
|
||||||
connect(d->m_checkBox.data(), &QAbstractButton::clicked, this, [this] {
|
connect(d->m_checkBox.data(), &QAbstractButton::clicked, this, [this] {
|
||||||
d->m_value = d->m_checkBox->isChecked();
|
d->m_value = d->m_checkBox->isChecked();
|
||||||
@@ -353,6 +355,11 @@ void BaseBoolAspect::setLabel(const QString &label)
|
|||||||
d->m_label = label;
|
d->m_label = label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseBoolAspect::setToolTip(const QString &tooltip)
|
||||||
|
{
|
||||||
|
d->m_tooltip = tooltip;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class ProjectExplorer::BaseIntegerAspect
|
\class ProjectExplorer::BaseIntegerAspect
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
void setDefaultValue(bool defaultValue);
|
void setDefaultValue(bool defaultValue);
|
||||||
|
|
||||||
void setLabel(const QString &label);
|
void setLabel(const QString &label);
|
||||||
|
void setToolTip(const QString &tooltip);
|
||||||
|
|
||||||
void fromMap(const QVariantMap &map) override;
|
void fromMap(const QVariantMap &map) override;
|
||||||
void toMap(QVariantMap &map) const override;
|
void toMap(QVariantMap &map) const override;
|
||||||
|
|||||||
Reference in New Issue
Block a user