summaryrefslogtreecommitdiffstats
path: root/old/doc/html/qtuitest-textwidget.html
blob: 745cf90d11c61b0cfc1a0bd8ee981f383afbec61 (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
<?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/qtuitestwidgetinterface.cpp -->
<head>
  <title>TextWidget Class 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">TextWidget Class Reference<br /><span class="small-subtitle">(QtUiTest::TextWidget)<br />[QtUiTestModule]</span>
</h1>
<p>The TextWidget class provides an abstract base class for all test widgets which display text to the user. <a href="#details">More...</a></p>
<pre> #include &lt;<a href="qtuitest.html">QtUiTest</a>&gt;</pre><p><b>This class is under development and is subject to change.</b></p>
<ul>
<li><a href="qtuitest-textwidget-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QString </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-textwidget.html#selectedText">selectedText</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-textwidget.html#selectedValue">selectedValue</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QString </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-textwidget.html#text">text</a></b> () const = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qtuitest-textwidget.html#value">value</a></b> () const</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The TextWidget class provides an abstract base class for all test widgets which display text to the user.</p>
<p>The QtUiTest::TextWidget interface should be implemented on any widget which shows any text at all. This is the primary interface <a href="qtuitest.html">QtUiTest</a> uses to determine text-&gt;widget mappings, and it is used to implement <a href="qsystemtest.html#getText">getText()</a>, a heavily used verification mechanism.</p>
<p>This interface is closely related to <a href="qtuitest-inputwidget.html">QtUiTest::InputWidget</a>, which provides an interface for entering text into a widget. Any widgets which contain user-editable text will typically implement both <a href="qtuitest-inputwidget.html">QtUiTest::InputWidget</a> and QtUiTest::TextWidget.</p>
<p>Examples of widgets suitable for this interface include QLabel, QAbstractButton, QLineEdit, QTextEdit and many more.</p>
<p>See also <a href="qtuitest-inputwidget.html">QtUiTest::InputWidget</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="selectedText"></a>QString TextWidget::selectedText () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the text in this widget which is currently selected / highlighted. If the widget does not support the concept of selected text, this function should return the same as <a href="qtuitest-textwidget.html#text">text</a>().</p>
<p>The base implementation calls <a href="qtuitest-textwidget.html#text">text</a>().</p>
<p>See also QLineEdit::selectedText().</p>
<h3 class="fn"><a name="selectedValue"></a>QVariant TextWidget::selectedValue () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the value in this widget which is currently selected / highlighted. If the widget does not support the concept of a selected value, this function should return the same as <a href="qtuitest-textwidget.html#value">value</a>().</p>
<p>The base implementation calls <a href="qtuitest-textwidget.html#selectedText">selectedText</a>().</p>
<h3 class="fn"><a name="text"></a>QString TextWidget::text () const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns all of the text this widget is currently presenting to the user.</p>
<h3 class="fn"><a name="value"></a>QVariant TextWidget::value () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Returns the value this widget is currently presenting to the user.</p>
<p>The returned value will be of whatever type is most appropriate for this widget. For example, a QLineEdit would return a literal copy of its text (giving the same result as the <a href="qtuitest-textwidget.html#text">text</a>() function), while a QTimeEdit may return a QTime.</p>
<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>