diff --git a/tests/manual/widgets/CMakeLists.txt b/tests/manual/widgets/CMakeLists.txt index d552dc3a66b..f39dd7874fb 100644 --- a/tests/manual/widgets/CMakeLists.txt +++ b/tests/manual/widgets/CMakeLists.txt @@ -3,5 +3,6 @@ add_subdirectory(crumblepath) add_subdirectory(infolabel) add_subdirectory(layoutbuilder) add_subdirectory(manhattanstyle) +add_subdirectory(styledbar) add_subdirectory(tracing) add_subdirectory(uifonts) diff --git a/tests/manual/widgets/styledbar/CMakeLists.txt b/tests/manual/widgets/styledbar/CMakeLists.txt new file mode 100644 index 00000000000..0494d7b5b2c --- /dev/null +++ b/tests/manual/widgets/styledbar/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qtc_test(tst_manual_widgets_styledbar + MANUALTEST + DEPENDS Qt::Gui Utils Core + SOURCES + tst_manual_widgets_styledbar.cpp + ../common/themeselector.cpp ../common/themeselector.h + ../common/themes.qrc +) diff --git a/tests/manual/widgets/styledbar/styledbar.qbs b/tests/manual/widgets/styledbar/styledbar.qbs new file mode 100644 index 00000000000..6160a811d8e --- /dev/null +++ b/tests/manual/widgets/styledbar/styledbar.qbs @@ -0,0 +1,12 @@ +import "../common/common.qbs" as Common + +CppApplication { + name: "Manual Test Utils StyledBar" + + Depends { name: "Core" } + Depends { name: "Utils" } + + files: "tst_manual_widgets_styledbar.cpp" + + Common {} +} diff --git a/tests/manual/widgets/styledbar/tst_manual_widgets_styledbar.cpp b/tests/manual/widgets/styledbar/tst_manual_widgets_styledbar.cpp new file mode 100644 index 00000000000..413dc06b14e --- /dev/null +++ b/tests/manual/widgets/styledbar/tst_manual_widgets_styledbar.cpp @@ -0,0 +1,80 @@ +// 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 +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace Utils; + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + auto themeSelector = new ManualTest::ThemeSelector; + + StyleHelper::setToolbarStyle(StyleHelper::ToolbarStyleRelaxed); + + const Icon icon({ + {":/utils/images/zoom.png", Theme::IconsBaseColor}, + {":/utils/images/iconoverlay_add_small.png", Theme::IconsRunColor}, + }); + const QIcon qIcon = icon.icon(); + + auto styledBar = new StyledBar; + + auto toolButton = new QToolButton; + toolButton->setCheckable(true); + toolButton->setIcon(qIcon); + + auto toolButtonChecked = new QToolButton; + toolButtonChecked->setCheckable(true); + toolButtonChecked->setChecked(true); + toolButtonChecked->setIcon(qIcon); + + auto toolButtonDisabled = new QToolButton; + toolButtonDisabled->setEnabled(false); + toolButtonDisabled->setIcon(qIcon); + + auto comboBox = new QComboBox; + const QStringList content = QColor::colorNames(); + comboBox->addItems(content.first(8)); + + auto spinBox = new QSpinBox; + spinBox->setFrame(false); + spinBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); + + auto checkBox = new QCheckBox("check"); + + using namespace Layouting; + Row { + toolButton, + toolButtonChecked, + toolButtonDisabled, + new Utils::StyledSeparator, + comboBox, + "Text label", + spinBox, + checkBox, + noMargin, spacing(0), + }.attachTo(styledBar); + + Column { + themeSelector, + styledBar, + st, + }.show(); + + return app.exec(); +} diff --git a/tests/manual/widgets/widgets.qbs b/tests/manual/widgets/widgets.qbs index 41e1bcf96db..269680b1ac8 100644 --- a/tests/manual/widgets/widgets.qbs +++ b/tests/manual/widgets/widgets.qbs @@ -7,6 +7,7 @@ Project { "infolabel/infolabel.qbs", "layoutbuilder/layoutbuilder.qbs", "manhattanstyle/manhattanstyle.qbs", + "styledbar/styledbar.qbs", "tracing/tracing.qbs", "uifonts/uifonts.qbs", ]