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:
Marcus Tillmanns
2023-06-29 08:23:45 +02:00
parent 569e73c5ed
commit 83111bb3f6
15 changed files with 350 additions and 213 deletions

View File

@@ -6,6 +6,7 @@
#include <QList>
#include <QString>
#include <QtGlobal>
#include <QFormLayout>
#include <optional>
@@ -215,6 +216,8 @@ QTCREATOR_UTILS_EXPORT LayoutItem resize(int, int);
QTCREATOR_UTILS_EXPORT LayoutItem columnStretch(int column, int stretch);
QTCREATOR_UTILS_EXPORT LayoutItem spacing(int);
QTCREATOR_UTILS_EXPORT LayoutItem windowTitle(const QString &windowTitle);
QTCREATOR_UTILS_EXPORT LayoutItem fieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy);
// "Getters"