summaryrefslogtreecommitdiffstats
path: root/old/doc/html/qtuitest.html
blob: 39acc1e4adf2215474d9d6c073e5fd28fed59006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- ../../lib/qtuitestnamespace.cpp -->
<head>
  <title>QtUiTest Namespace Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QtUiTest Namespace Reference<br /><span class="small-subtitle">[QtUiTestModule]</span>
</h1>
<p>The QtUiTest namespace provides the plugin interfaces used for customizing the behaviour of QtUiTest. <a href="#details">More...</a></p>
<pre> #include &lt;QtUiTest&gt;</pre><p><b>This namespace is under development and is subject to change.</b></p>
<ul>
</ul>
<hr />
<a name="classes"></a>
<h2>Classes</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-activatewidget.html">ActivateWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-checkitemwidget.html">CheckItemWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-checkwidget.html">CheckWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-indexedwidget.html">IndexedWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-inputwidget.html">InputWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-labelwidget.html">LabelWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-listwidget.html">ListWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-selectwidget.html">SelectWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-testwidget.html">TestWidget</a></b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-textwidget.html">TextWidget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-widget.html">Widget</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-widgetfactory.html">WidgetFactory</a></b>&nbsp;&nbsp;<tt> (preliminary)</tt></td></tr>
</table>
<hr />
<a name="types"></a>
<h2>Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest.html#InputOption-enum">InputOption</a></b> { NoOptions, DemoMode, KeyRepeat }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest.html#Key-enum">Key</a></b> { Key_Activate, Key_ActivateButton, Key_Select }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest.html#LabelOrientation-enum">LabelOrientation</a></b> { LabelLeft, LabelRight, LabelAbove, LabelBelow }</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest.html#WidgetType-enum">WidgetType</a></b> { Focus, InputMethod, SoftMenu, OptionsMenu, ..., Launcher }</td></tr>
</table>
<hr />
<a name="functions"></a>
<h2>Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">T </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest.html#qtuitest_cast">qtuitest_cast</a></b> ( const QObject * <i>object</i> )</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QtUiTest namespace provides the plugin interfaces used for customizing the behaviour of QtUiTest.</p>
<p>When running a <a href="qsystemtest.html">Qt Extended system test</a>, functions such as <a href="qsystemtest.html#select">select()</a> and <a href="qsystemtest.html#getText">getText()</a> 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.</p>
<p>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.</p>
<p>For example, when the following system test code executes:</p>
<pre> select(&quot;Dog&quot;, &quot;Favorite Animal&quot;);</pre>
<p>QtUiTest will first look up the QWidget which is labelled by the text &quot;Favorite Animal&quot;. It will then use qtuitest_cast to cast this widget to a <a href="qtuitest-selectwidget.html">QtUiTest::SelectWidget</a>. If this is successful, it will then call <a href="qtuitest-selectwidget.html#select">select</a>(&quot;Dog&quot;) on the list widget.</p>
<p>It is possible to customize the behavior of QtUiTest for particular widgets by creating custom test widget classes and a <a href="qtuitest-widgetfactory.html">QtUiTest::WidgetFactory</a> factory class to wrap QObject instances in test widgets.</p>
<hr />
<h2>Classes</h2>
<h3> class <a href="qtuitest-activatewidget.html">ActivateWidget</a></h3><p>The ActivateWidget class provides an abstract base class for all test widgets which can conceptually be &quot;activated&quot; by a user. <a href="qtuitest-activatewidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-checkitemwidget.html">CheckItemWidget</a></h3><p>The CheckItemWidget class provides an abstract base class for all test widgets which include items that support 'checked' and 'unchecked' states. <a href="qtuitest-checkitemwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-checkwidget.html">CheckWidget</a></h3><p>The CheckWidget class provides an abstract base class for all test widgets which support 'checked' and 'unchecked' states. <a href="qtuitest-checkwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-indexedwidget.html">IndexedWidget</a></h3><p>The IndexedWidget class provides an abstract base class for all test widgets which allow the user to select items based on index. <a href="qtuitest-indexedwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-inputwidget.html">InputWidget</a></h3><p>The InputWidget class provides an abstract base class for all test widgets which allow the user to input text. <a href="qtuitest-inputwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-labelwidget.html">LabelWidget</a></h3><p>The LabelWidget class provides an abstract base class for all test widgets which are conceptually labels. <a href="qtuitest-labelwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-listwidget.html">ListWidget</a></h3><p>The ListWidget class provides an abstract base class for all test widgets which display a list of items to the user. <a href="qtuitest-listwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-selectwidget.html">SelectWidget</a></h3><p>The SelectWidget class provides an abstract base class for all test widgets which allow the user to select from a range of items. <a href="qtuitest-selectwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-testwidget.html">TestWidget</a></h3><h3> class <a href="qtuitest-textwidget.html">TextWidget</a></h3><p>The TextWidget class provides an abstract base class for all test widgets which display text to the user. <a href="qtuitest-textwidget.html#details">More...</a></p>
<h3> class <a href="qtuitest-widget.html">Widget</a></h3><p>The Widget class provides an abstract base class for all test widgets. <a href="qtuitest-widget.html#details">More...</a></p>
<h3> class <a href="qtuitest-widgetfactory.html">WidgetFactory</a></h3><p>The WidgetFactory class provides a factory interface for <a href="qtuitest.html">QtUiTest</a> widget wrapper classes. <a href="qtuitest-widgetfactory.html#details">More...</a></p>
<hr />
<h2>Type Documentation</h2>
<h3 class="fn"><a name="InputOption-enum"></a>enum QtUiTest::InputOption</h3>
<p>This enum type specifies the options to be used when simulating key and mouse events.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QtUiTest::NoOptions</tt></td><td align="center" valign="top"><tt>0x0</tt></td><td valign="top">no options.</td></tr>
<tr><td valign="top"><tt>QtUiTest::DemoMode</tt></td><td align="center" valign="top"><tt>0x1</tt></td><td valign="top">when simulating, force artificial delays between key and mouse events, and animate some events.</td></tr>
<tr><td valign="top"><tt>QtUiTest::KeyRepeat</tt></td><td align="center" valign="top"><tt>0x2</tt></td><td valign="top">when simulating key press events, simulate auto-repeat key press events. The default is to simulate regular key press events.</td></tr>
</table></p>
<h3 class="fn"><a name="Key-enum"></a>enum QtUiTest::Key</h3>
<p>This enum provides mappings for high-level conceptual keys to platform-specific values of Qt::Key.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QtUiTest::Key_Activate</tt></td><td align="center" valign="top"><tt>Qt::Key_Enter</tt></td><td valign="top">Key used to activate generic UI elements.</td></tr>
<tr><td valign="top"><tt>QtUiTest::Key_ActivateButton</tt></td><td align="center" valign="top"><tt>Qt::Key_Space</tt></td><td valign="top">Key used to activate buttons.</td></tr>
<tr><td valign="top"><tt>QtUiTest::Key_Select</tt></td><td align="center" valign="top"><tt>Qt::Key_Space</tt></td><td valign="top">Key used to select an item from lists.</td></tr>
</table></p>
<h3 class="fn"><a name="LabelOrientation-enum"></a>enum QtUiTest::LabelOrientation</h3>
<h3 class="fn"><a name="WidgetType-enum"></a>enum QtUiTest::WidgetType</h3>
<p>This enum type specifies different types of widgets which can be retrieved via QtUiTest::findWidget().</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QtUiTest::Focus</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">The widget which currently has keyboard focus. Note that this need not be located in the current application.</td></tr>
<tr><td valign="top"><tt>QtUiTest::InputMethod</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">A currently active input method widget.</td></tr>
<tr><td valign="top"><tt>QtUiTest::SoftMenu</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">A currently displayed soft menu bar.</td></tr>
<tr><td valign="top"><tt>QtUiTest::OptionsMenu</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">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).</td></tr>
<tr><td valign="top"><tt>QtUiTest::TabBar</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">The tab bar for the currently active tab widget, if one exists. <a href="qtuitest.html">QtUiTest</a> is not designed to handle multiple nested tab widgets.</td></tr>
<tr><td valign="top"><tt>QtUiTest::HomeScreen</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">The home screen widget.</td></tr>
<tr><td valign="top"><tt>QtUiTest::Launcher</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">The widget (typically a grid-like menu) in the server process used for launching applications.</td></tr>
</table></p>
<hr />
<h2>Function Documentation</h2>
<h3 class="fn"><a name="qtuitest_cast"></a>T qtuitest_cast ( const QObject * <i>object</i> )</h3>
<p>Casts <i>object</i> to the specified Qt Extended test widget interface <tt>T</tt>.</p>
<p>If <i>object</i> already implements <tt>T</tt>, it is simply casted and returned. Otherwise, <a href="qtuitest.html">QtUiTest</a> will attempt to find or create a test widget to wrap <i>object</i>, using all loaded <a href="qtuitest-widgetfactory.html">QtUiTest::WidgetFactory</a> plugins. If a test widget cannot be created to wrap <i>object</i>, 0 is returned.</p>
<p>In either case, the returned value must not be deleted by the caller.</p>
<p>Example:</p>
<pre><span class="comment"> // Attempt to select the item &quot;Foo&quot; from the given widget</span>
 bool selectFoo(QWidget *widget) {
     QtUiTest::SelectWidget* sw
         = qtuitest_cast&lt;QtUiTest::SelectWidget*&gt;(widget);
     if (!sw || !sw-&gt;canSelect(&quot;Foo&quot;)) {
         return false;
     }
     return sw-&gt;select(&quot;Foo&quot;);
 }</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">QtUiTest</div></td>
</tr></table></div></address></body>
</html>