forked from qt-creator/qt-creator
ProjectExplorer: Use a real label for the extra BoolAspect checkbox label
And show a tool tip also there. Noticeable e.g. in the "Incredibuild for Windows" buildstep checkboxes. Change-Id: Iebabda6fb025596aa9dbc7c917c4bdbeb25a1a8d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -61,9 +61,10 @@ public:
|
||||
bool m_value = false;
|
||||
bool m_defaultValue = false;
|
||||
bool m_enabled = true;
|
||||
QString m_label;
|
||||
QString m_labelText;
|
||||
QString m_tooltip;
|
||||
QPointer<QCheckBox> m_checkBox; // Owned by configuration widget
|
||||
QPointer<QLabel> m_label; // Owned by configuration widget
|
||||
};
|
||||
|
||||
class BaseSelectionAspectPrivate
|
||||
@@ -501,10 +502,12 @@ void BaseBoolAspect::addToLayout(LayoutBuilder &builder)
|
||||
QTC_CHECK(!d->m_checkBox);
|
||||
d->m_checkBox = new QCheckBox();
|
||||
if (d->m_labelPlacement == LabelPlacement::AtCheckBox) {
|
||||
d->m_checkBox->setText(d->m_label);
|
||||
d->m_checkBox->setText(d->m_labelText);
|
||||
builder.addItem(new QLabel);
|
||||
} else {
|
||||
builder.addItem(d->m_label);
|
||||
d->m_label = new QLabel(d->m_labelText);
|
||||
d->m_label->setToolTip(d->m_tooltip);
|
||||
builder.addItem(d->m_label.data());
|
||||
}
|
||||
d->m_checkBox->setChecked(d->m_value);
|
||||
d->m_checkBox->setToolTip(d->m_tooltip);
|
||||
@@ -549,9 +552,9 @@ void BaseBoolAspect::setValue(bool value)
|
||||
d->m_checkBox->setChecked(d->m_value);
|
||||
}
|
||||
|
||||
void BaseBoolAspect::setLabel(const QString &label, LabelPlacement labelPlacement)
|
||||
void BaseBoolAspect::setLabel(const QString &labelText, LabelPlacement labelPlacement)
|
||||
{
|
||||
d->m_label = label;
|
||||
d->m_labelText = labelText;
|
||||
d->m_labelPlacement = labelPlacement;
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
void setDefaultValue(bool defaultValue);
|
||||
|
||||
enum class LabelPlacement { AtCheckBox, InExtraLabel };
|
||||
void setLabel(const QString &label,
|
||||
void setLabel(const QString &labelText,
|
||||
LabelPlacement labelPlacement = LabelPlacement::InExtraLabel);
|
||||
void setToolTip(const QString &tooltip);
|
||||
void setEnabled(bool enabled);
|
||||
|
Reference in New Issue
Block a user