Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
SondeTest::GuiTest Class Reference

Fixture with a fully equipped server, a widget form and a QML window. More...

#include <guifixture.h>

Inheritance diagram for SondeTest::GuiTest:
FlickTest QuickOverflowTest anonymous_namespace{test_actions.cpp}::ActionTest anonymous_namespace{test_bindings.cpp}::BindingTest anonymous_namespace{test_instruments.cpp}::InstrumentTest anonymous_namespace{test_models.cpp}::ModelTest anonymous_namespace{test_qmltemplates.cpp}::QmlTemplateTest anonymous_namespace{test_qmlwindows.cpp}::QmlWindowTest anonymous_namespace{test_widgets.cpp}::WidgetsTest

Protected Member Functions

void SetUp () override
 Installs integrations and tools, builds and shows both windows.
void TearDown () override
 Destroys the windows (before the server).
virtual bool withQuick () const
 Whether this test needs the QML window (override to skip it).
QJsonObject call (const QString &tool, const QJsonObject &args={ })
 Calls a tool and returns its result.
QString text (const QString &tool, const QJsonObject &args={ })
 Calls a tool and returns its text.
bool fails (const QString &tool, const QJsonObject &args={ })
 Calls a tool and reports whether it returned an error result.

Protected Attributes

Sonde::Server server
 Server under test.
QString name
 Local socket name of the server.
std::unique_ptr< LocalClient > client
 Initialized client.
std::unique_ptr< QWidget > form
 The widgets window ("Form Window").
QLineEdit * edit = nullptr
 Line edit "edit" (has focus initially).
QPushButton * button = nullptr
 Push button "button" ("&Press").
QCheckBox * check = nullptr
 Check box "check".
QSlider * slider = nullptr
 Horizontal slider "slider", 0-100.
QListWidget * list = nullptr
 List "list" with 200 items (scrollable).
QLabel * hiddenLabel = nullptr
 Hidden label "hiddenLabel".
int buttonClicks = 0
 Times button was clicked.
int shortcutHits = 0
 Times the Ctrl+K shortcut fired.
QQmlEngine engine
 Engine of the QML window.
std::unique_ptr< QQuickWindow > quick
 The Qt Quick window ("Quick Window").

Private Member Functions

void buildForm ()
 Builds the Qt Widgets form.
void buildQuick ()
 Builds the Qt Quick window from inline QML.

Detailed Description

Fixture with a fully equipped server, a widget form and a QML window.

Member Function Documentation

◆ withQuick()

virtual bool SondeTest::GuiTest::withQuick ( ) const
inlineprotectedvirtual

Whether this test needs the QML window (override to skip it).

Reimplemented in anonymous_namespace{test_widgets.cpp}::WidgetsTest.


The documentation for this class was generated from the following file: