forked from qt-creator/qt-creator
Utils: Introduce a SelectionAspect::volatileChanged
Analog to BoolAspect::volatileChanged for cases when the availability of some other aspect, line edit, ... is governed by a specific state of a combobox. Change-Id: I5c7903dde21ab997e799568b20a01308a25c4397 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1390,6 +1390,8 @@ void SelectionAspect::addToLayout(LayoutBuilder &builder)
|
||||
connect(d->m_comboBox.data(), QOverload<int>::of(&QComboBox::activated),
|
||||
this, &SelectionAspect::setValue);
|
||||
}
|
||||
connect(d->m_comboBox.data(), QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &SelectionAspect::volatileValueChanged);
|
||||
d->m_comboBox->setCurrentIndex(value());
|
||||
addLabeledItem(builder, d->m_comboBox);
|
||||
break;
|
||||
|
||||
@@ -225,6 +225,9 @@ public:
|
||||
int indexForDisplay(const QString &displayName) const;
|
||||
QString displayForIndex(int index) const;
|
||||
|
||||
signals:
|
||||
void volatileValueChanged(int newValue);
|
||||
|
||||
private:
|
||||
std::unique_ptr<Internal::SelectionAspectPrivate> d;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user