forked from qt-creator/qt-creator
Tests: Add a manual test for "Component" widgets
For quick testing and for creating overview screenshots. As a side effect, this exposes a couple of issues for the disabled state. Change-Id: I9d0211bf4177f276fea6e69eb988e2d34a1260cc Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
add_subdirectory(components)
|
||||
add_subdirectory(crumblepath)
|
||||
add_subdirectory(infolabel)
|
||||
add_subdirectory(layoutbuilder)
|
||||
|
8
tests/manual/widgets/components/CMakeLists.txt
Normal file
8
tests/manual/widgets/components/CMakeLists.txt
Normal file
@@ -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
|
||||
)
|
12
tests/manual/widgets/components/components.qbs
Normal file
12
tests/manual/widgets/components/components.qbs
Normal file
@@ -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 {}
|
||||
}
|
@@ -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 <QApplication>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
|
||||
#include <coreplugin/welcomepagehelper.h>
|
||||
|
||||
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();
|
||||
}
|
@@ -2,6 +2,7 @@ Project {
|
||||
name: "Widgets manualtests"
|
||||
|
||||
references: [
|
||||
"components/components.qbs",
|
||||
"crumblepath/crumblepath.qbs",
|
||||
"infolabel/infolabel.qbs",
|
||||
"layoutbuilder/layoutbuilder.qbs",
|
||||
|
Reference in New Issue
Block a user