![]() |
The QtUiTest namespace provides the plugin interfaces used for customizing the behaviour of QtUiTest. More...
#include <QtUiTest>
This namespace is under development and is subject to change.
| class | ActivateWidget (preliminary) |
| class | CheckItemWidget (preliminary) |
| class | CheckWidget (preliminary) |
| class | IndexedWidget (preliminary) |
| class | InputWidget (preliminary) |
| class | LabelWidget (preliminary) |
| class | ListWidget (preliminary) |
| class | SelectWidget (preliminary) |
| class | TestWidget |
| class | TextWidget (preliminary) |
| class | Widget (preliminary) |
| class | WidgetFactory (preliminary) |
| enum | InputOption { NoOptions, DemoMode, KeyRepeat } |
| enum | Key { Key_Activate, Key_ActivateButton, Key_Select } |
| enum | LabelOrientation { LabelLeft, LabelRight, LabelAbove, LabelBelow } |
| enum | WidgetType { Focus, InputMethod, SoftMenu, OptionsMenu, ..., Launcher } |
| T | qtuitest_cast ( const QObject * object ) |
The QtUiTest namespace provides the plugin interfaces used for customizing the behaviour of QtUiTest.
When running a Qt Extended system test, functions such as select() and getText() are used to perform actions and retrieve information from widgets. This is implemented by wrapping each conceptual widget (which is not necessarily a QWidget) with a test widget class.
These test widgets each implement one or more of the widget interfaces in the QtUiTest namespace. The interfaces are used to determine what actions can be taken on a particular widget, and how to perform them.
For example, when the following system test code executes:
select("Dog", "Favorite Animal");
QtUiTest will first look up the QWidget which is labelled by the text "Favorite Animal". It will then use qtuitest_cast to cast this widget to a QtUiTest::SelectWidget. If this is successful, it will then call select("Dog") on the list widget.
It is possible to customize the behavior of QtUiTest for particular widgets by creating custom test widget classes and a QtUiTest::WidgetFactory factory class to wrap QObject instances in test widgets.
The ActivateWidget class provides an abstract base class for all test widgets which can conceptually be "activated" by a user. More...
The CheckItemWidget class provides an abstract base class for all test widgets which include items that support 'checked' and 'unchecked' states. More...
The CheckWidget class provides an abstract base class for all test widgets which support 'checked' and 'unchecked' states. More...
The IndexedWidget class provides an abstract base class for all test widgets which allow the user to select items based on index. More...
The InputWidget class provides an abstract base class for all test widgets which allow the user to input text. More...
The LabelWidget class provides an abstract base class for all test widgets which are conceptually labels. More...
The ListWidget class provides an abstract base class for all test widgets which display a list of items to the user. More...
The SelectWidget class provides an abstract base class for all test widgets which allow the user to select from a range of items. More...
The TextWidget class provides an abstract base class for all test widgets which display text to the user. More...
The Widget class provides an abstract base class for all test widgets. More...
The WidgetFactory class provides a factory interface for QtUiTest widget wrapper classes. More...
This enum type specifies the options to be used when simulating key and mouse events.
| Constant | Value | Description |
|---|---|---|
| QtUiTest::NoOptions | 0x0 | no options. |
| QtUiTest::DemoMode | 0x1 | when simulating, force artificial delays between key and mouse events, and animate some events. |
| QtUiTest::KeyRepeat | 0x2 | when simulating key press events, simulate auto-repeat key press events. The default is to simulate regular key press events. |
This enum provides mappings for high-level conceptual keys to platform-specific values of Qt::Key.
| Constant | Value | Description |
|---|---|---|
| QtUiTest::Key_Activate | Qt::Key_Enter | Key used to activate generic UI elements. |
| QtUiTest::Key_ActivateButton | Qt::Key_Space | Key used to activate buttons. |
| QtUiTest::Key_Select | Qt::Key_Space | Key used to select an item from lists. |
This enum type specifies different types of widgets which can be retrieved via QtUiTest::findWidget().
| Constant | Value | Description |
|---|---|---|
| QtUiTest::Focus | 6 | The widget which currently has keyboard focus. Note that this need not be located in the current application. |
| QtUiTest::InputMethod | 0 | A currently active input method widget. |
| QtUiTest::SoftMenu | 1 | A currently displayed soft menu bar. |
| QtUiTest::OptionsMenu | 2 | The context/options menu which is currently shown, or would be shown if the user attempted to raise a context menu (typically by pressing Qt::Key_Context1). |
| QtUiTest::TabBar | 3 | The tab bar for the currently active tab widget, if one exists. QtUiTest is not designed to handle multiple nested tab widgets. |
| QtUiTest::HomeScreen | 5 | The home screen widget. |
| QtUiTest::Launcher | 4 | The widget (typically a grid-like menu) in the server process used for launching applications. |
Casts object to the specified Qt Extended test widget interface T.
If object already implements T, it is simply casted and returned. Otherwise, QtUiTest will attempt to find or create a test widget to wrap object, using all loaded QtUiTest::WidgetFactory plugins. If a test widget cannot be created to wrap object, 0 is returned.
In either case, the returned value must not be deleted by the caller.
Example:
// Attempt to select the item "Foo" from the given widget
bool selectFoo(QWidget *widget) {
QtUiTest::SelectWidget* sw
= qtuitest_cast<QtUiTest::SelectWidget*>(widget);
if (!sw || !sw->canSelect("Foo")) {
return false;
}
return sw->select("Foo");
}
| Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | QtUiTest |