forked from qt-creator/qt-creator
Utils: Add a StringAspect::valueChanged signal
Similar to what BoolAspect already has. Will help with the NimSettings page. Change-Id: Id373cd21769c129fb8329d9102ccfd97675e8d24 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -820,6 +820,7 @@ void StringAspect::setValue(const QString &val)
|
|||||||
if (BaseAspect::setValueQuietly(QVariant(processedValue))) {
|
if (BaseAspect::setValueQuietly(QVariant(processedValue))) {
|
||||||
update();
|
update();
|
||||||
emit changed();
|
emit changed();
|
||||||
|
emit valueChanged(processedValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1179,6 +1180,11 @@ void StringAspect::setVolatileValue(const QVariant &val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StringAspect::emitChangedValue()
|
||||||
|
{
|
||||||
|
emit valueChanged(value());
|
||||||
|
}
|
||||||
|
|
||||||
void StringAspect::update()
|
void StringAspect::update()
|
||||||
{
|
{
|
||||||
const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value();
|
const QString displayedString = d->m_displayFilter ? d->m_displayFilter(value()) : value();
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ public:
|
|||||||
|
|
||||||
QVariant volatileValue() const override;
|
QVariant volatileValue() const override;
|
||||||
void setVolatileValue(const QVariant &val) override;
|
void setVolatileValue(const QVariant &val) override;
|
||||||
|
void emitChangedValue() override;
|
||||||
|
|
||||||
// Hook between UI and StringAspect:
|
// Hook between UI and StringAspect:
|
||||||
using ValueAcceptor = std::function<Utils::optional<QString>(const QString &, const QString &)>;
|
using ValueAcceptor = std::function<Utils::optional<QString>(const QString &, const QString &)>;
|
||||||
@@ -354,6 +355,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void checkedChanged();
|
void checkedChanged();
|
||||||
|
void valueChanged(const QString &newValue);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void update();
|
void update();
|
||||||
|
|||||||
Reference in New Issue
Block a user