diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2022-12-27 13:26:37 +0800 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2023-01-03 12:09:41 +0800 |
commit | 29106dc0c0ab37f099e6b4bfdb81ccff6f65aa4f (patch) | |
tree | 72f7e1f0567980bf827e28012c85e831b6ff880b /tests/manual | |
parent | f641848af970190584a84ba6a0b9f2b59b2141b5 (diff) |
testbench: save search text between session
This makes using the testbench more convenient, as you don't need to
search for the controls you're interested in each time you run it.
Also added an extra font icon (clear), which required regenerating
the set from fontello. The same license is still applicable since
they're from Font Awesome.
Pick-to: 6.5
Change-Id: I9b44f7f8bce0bb4032071c19186eb5affbfe42a5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/quickcontrols/testbench/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/manual/quickcontrols/testbench/fonts/fontawesome.ttf | bin | 5464 -> 0 bytes | |||
-rw-r--r-- | tests/manual/quickcontrols/testbench/fonts/fontello.ttf | bin | 0 -> 6352 bytes | |||
-rw-r--r-- | tests/manual/quickcontrols/testbench/main.cpp | 2 | ||||
-rw-r--r-- | tests/manual/quickcontrols/testbench/testbench.qml | 22 |
5 files changed, 22 insertions, 4 deletions
diff --git a/tests/manual/quickcontrols/testbench/CMakeLists.txt b/tests/manual/quickcontrols/testbench/CMakeLists.txt index f4feb1a454..9cbf26f324 100644 --- a/tests/manual/quickcontrols/testbench/CMakeLists.txt +++ b/tests/manual/quickcontrols/testbench/CMakeLists.txt @@ -91,7 +91,7 @@ qt_internal_add_resource(testbench "qml" ${qml_resource_files} ) set(fonts_resource_files - "fonts/fontawesome.ttf" + "fonts/fontello.ttf" ) qt_internal_add_resource(testbench "fonts" diff --git a/tests/manual/quickcontrols/testbench/fonts/fontawesome.ttf b/tests/manual/quickcontrols/testbench/fonts/fontawesome.ttf Binary files differdeleted file mode 100644 index 49b6c5da65..0000000000 --- a/tests/manual/quickcontrols/testbench/fonts/fontawesome.ttf +++ /dev/null diff --git a/tests/manual/quickcontrols/testbench/fonts/fontello.ttf b/tests/manual/quickcontrols/testbench/fonts/fontello.ttf Binary files differnew file mode 100644 index 0000000000..e213021db9 --- /dev/null +++ b/tests/manual/quickcontrols/testbench/fonts/fontello.ttf diff --git a/tests/manual/quickcontrols/testbench/main.cpp b/tests/manual/quickcontrols/testbench/main.cpp index 7fad3c9390..4a629523e6 100644 --- a/tests/manual/quickcontrols/testbench/main.cpp +++ b/tests/manual/quickcontrols/testbench/main.cpp @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) else QQuickStyle::setStyle(settings.value("style").isValid() ? settings.value("style").toString() : "Imagine"); - if (QFontDatabase::addApplicationFont(":/fonts/fontawesome.ttf") == -1) { + if (QFontDatabase::addApplicationFont(":/fonts/fontello.ttf") == -1) { qWarning() << "Failed to load fontawesome font"; } diff --git a/tests/manual/quickcontrols/testbench/testbench.qml b/tests/manual/quickcontrols/testbench/testbench.qml index c88e16425a..9df1ed873f 100644 --- a/tests/manual/quickcontrols/testbench/testbench.qml +++ b/tests/manual/quickcontrols/testbench/testbench.qml @@ -85,6 +85,8 @@ Ui.ApplicationWindow { property bool autoFixImagineAssets property alias imagineDirLastModified: assetFixer.assetDirectoryLastModified + property string lastSearchText + Component.onCompleted: settingsLoaded = true } @@ -119,7 +121,7 @@ Ui.ApplicationWindow { ToolButton { text: "\uf0c9" - font.family: "fontawesome" + font.family: "fontello" font.pixelSize: Qt.application.font.pixelSize * 1.6 onClicked: drawer.open() } @@ -129,6 +131,22 @@ Ui.ApplicationWindow { TextField { id: searchTextField placeholderText: "Search" + text: settings.lastSearchText + onTextEdited: settings.lastSearchText = text + } + + ToolButton { + text: "\ue801" + font.family: "fontello" + visible: searchTextField.length > 0 + onClicked: searchTextField.clear() + + Layout.leftMargin: -5 + } + + Label { + text: controlFolderListModel.count + " result(s)" + visible: searchTextField.length > 0 } Item { @@ -138,7 +156,7 @@ Ui.ApplicationWindow { ToolButton { id: optionsMenuButton text: "\ue800" - font.family: "FontAwesome" + font.family: "fontello" font.pixelSize: Qt.application.font.pixelSize * 1.6 checked: optionsMenu.visible checkable: true |