forked from qt-creator/qt-creator
Utils: Make validation async
Changes FancyLineEdit to accept two types of validation functions: AsyncValidationFunction, which returns a QFuture and takes the new text, or SynchronousValidationFunction. Especially PathChooser is changed to use async validation function to improve snappyness of settings pages that do heavy validation, for instance the Debugger page. Change-Id: I1677e7d8acc29e36c69a867850304b7913e6ae7e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -888,6 +888,18 @@ LayoutItem columnStretch(int column, int stretch)
|
||||
};
|
||||
}
|
||||
|
||||
LayoutItem fieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy)
|
||||
{
|
||||
return [policy](QObject *target) {
|
||||
if (auto form = qobject_cast<QFormLayout *>(target)) {
|
||||
form->setFieldGrowthPolicy(policy);
|
||||
} else {
|
||||
QTC_CHECK(false);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Id based setters
|
||||
|
||||
LayoutItem id(ID &out)
|
||||
|
||||
Reference in New Issue
Block a user