diff --git a/tests/manual/widgets/CMakeLists.txt b/tests/manual/widgets/CMakeLists.txt index 8408e78ae9d..d552dc3a66b 100644 --- a/tests/manual/widgets/CMakeLists.txt +++ b/tests/manual/widgets/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(components) add_subdirectory(crumblepath) add_subdirectory(infolabel) add_subdirectory(layoutbuilder) diff --git a/tests/manual/widgets/components/CMakeLists.txt b/tests/manual/widgets/components/CMakeLists.txt new file mode 100644 index 00000000000..3d5d87dcef8 --- /dev/null +++ b/tests/manual/widgets/components/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qtc_test(tst_manual_widgets_components + MANUALTEST + DEPENDS Qt::Gui Utils Core + SOURCES + tst_manual_widgets_components.cpp + ../common/themeselector.cpp ../common/themeselector.h + ../common/themes.qrc +) diff --git a/tests/manual/widgets/components/components.qbs b/tests/manual/widgets/components/components.qbs new file mode 100644 index 00000000000..3880a5fce1e --- /dev/null +++ b/tests/manual/widgets/components/components.qbs @@ -0,0 +1,12 @@ +import "../common/common.qbs" as Common + +CppApplication { + name: "Manual Test Core Components" + + Depends { name: "Core" } + Depends { name: "Utils" } + + files: "tst_manual_widgets_components.cpp" + + Common {} +} diff --git a/tests/manual/widgets/components/tst_manual_widgets_components.cpp b/tests/manual/widgets/components/tst_manual_widgets_components.cpp new file mode 100644 index 00000000000..8698c850da9 --- /dev/null +++ b/tests/manual/widgets/components/tst_manual_widgets_components.cpp @@ -0,0 +1,79 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +#include "../common/themeselector.h" + +#include + +#include + +#include + +QWidget *widgets() +{ + auto widget = new QWidget; + + auto comboBox = new Core::ComboBox; + const QStringList content = QColor::colorNames(); + comboBox->addItems(content.first(8)); + + using namespace Layouting; + Column { + Group { + title("Core::Button"), + Column { + new Core::Button("MediumPrimary", Core::Button::MediumPrimary), + new Core::Button("MediumSecondary", Core::Button::MediumSecondary), + new Core::Button("SmallPrimary", Core::Button::SmallPrimary), + new Core::Button("SmallSecondary", Core::Button::SmallSecondary), + new Core::Button("SmallList", Core::Button::SmallList), + new Core::Button("SmallLink", Core::Button::SmallLink), + new Core::Button("Tag", Core::Button::Tag), + }, + }, + Group { + title("Core::Label"), + Column { + new Core::Label("Primary", Core::Label::Primary), + new Core::Label("Secondary", Core::Label::Secondary), + }, + }, + Group { + title("Core::SearchBox"), + Column { + new Core::SearchBox, + }, + }, + Group { + title("Core::ComboBox"), + Column { + comboBox, + }, + }, + }.attachTo(widget); + + return widget; +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + auto themeSelector = new ManualTest::ThemeSelector; + + QWidget *enabledWidgets = widgets(); + QWidget *disbledWidgets = widgets(); + disbledWidgets->setEnabled(false); + + QWidget widget; + using namespace Layouting; + Column { + themeSelector, + Row {enabledWidgets, disbledWidgets}, + st, + }.attachTo(&widget); + + widget.show(); + + return app.exec(); +} diff --git a/tests/manual/widgets/widgets.qbs b/tests/manual/widgets/widgets.qbs index 10bb2752dcf..41e1bcf96db 100644 --- a/tests/manual/widgets/widgets.qbs +++ b/tests/manual/widgets/widgets.qbs @@ -2,6 +2,7 @@ Project { name: "Widgets manualtests" references: [ + "components/components.qbs", "crumblepath/crumblepath.qbs", "infolabel/infolabel.qbs", "layoutbuilder/layoutbuilder.qbs",