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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qstyleoption.cpp -->
<title>QStyleHintReturn Class | Qt Widgets 5.11</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
// loading style sheet breaks anchors that were jumped to before
// so force jumping to anchor again
setTimeout(function() {
var anchor = location.hash;
// need to jump to different anchor first (e.g. none)
location.hash = "#";
setTimeout(function() {
location.hash = anchor;
}, 0);
}, 0);
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QStyleHintReturn</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.11.2 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-variables">Public Variables</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QStyleHintReturn Class</h1>
<!-- $$$QStyleHintReturn-brief -->
<p>The <a href="qstylehintreturn.html">QStyleHintReturn</a> class provides style hints that return more than basic data types. <a href="#details">More...</a></p>
<!-- @@@QStyleHintReturn -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QStyleHintReturn></span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qstylehintreturnmask.html">QStyleHintReturnMask</a> and <a href="qstylehintreturnvariant.html">QStyleHintReturnVariant</a></p>
</td></tr></table></div><ul>
<li><a href="qstylehintreturn-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#HintReturnType-enum">HintReturnType</a></b> { SH_Default, SH_Mask, SH_Variant }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#QStyleHintReturn">QStyleHintReturn</a></b>(int <i>version</i> = QStyleOption::Version, int <i>type</i> = SH_Default)</td></tr>
</table></div>
<a name="public-variables"></a>
<h2 id="public-variables">Public Variables</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#type-var">type</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#version-var">version</a></b></td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#qstyleoption_cast">qstyleoption_cast</a></b>(const QStyleHintReturn *<i>hint</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qstylehintreturn.html#qstyleoption_cast-1">qstyleoption_cast</a></b>(QStyleHintReturn *<i>hint</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QStyleHintReturn-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qstylehintreturn.html">QStyleHintReturn</a> class provides style hints that return more than basic data types.</p>
<p><a href="qstylehintreturn.html">QStyleHintReturn</a> and its subclasses are used to pass information from a style back to the querying widget. This is most useful when the return value from <a href="qstyle.html#styleHint">QStyle::styleHint</a>() does not provide enough detail; for example, when a mask is to be returned.</p>
</div>
<!-- @@@QStyleHintReturn -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$HintReturnType$$$SH_Default$$$SH_Mask$$$SH_Variant -->
<h3 class="fn" id="HintReturnType-enum"><a name="HintReturnType-enum"></a>enum QStyleHintReturn::<span class="name">HintReturnType</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleHintReturn::SH_Default</code></td><td class="topAlign tblval"><code>0xf000</code></td><td class="topAlign"><a href="qstylehintreturn.html">QStyleHintReturn</a></td></tr>
<tr><td class="topAlign"><code>QStyleHintReturn::SH_Mask</code></td><td class="topAlign tblval"><code>0xf001</code></td><td class="topAlign"><a href="qstyle.html#StyleHint-enum">QStyle::SH_RubberBand_Mask</a> <a href="qstyle.html#StyleHint-enum">QStyle::SH_FocusFrame_Mask</a></td></tr>
<tr><td class="topAlign"><code>QStyleHintReturn::SH_Variant</code></td><td class="topAlign tblval"><code>0xf002</code></td><td class="topAlign"><a href="qstyle.html#StyleHint-enum">QStyle::SH_TextControl_FocusIndicatorTextCharFormat</a></td></tr>
</table></div>
<!-- @@@HintReturnType -->
<!-- $$$StyleOptionType$$$Type -->
<h3 class="fn" id="StyleOptionType-enum"><a name="StyleOptionType-enum"></a>enum QStyleHintReturn::<span class="name">StyleOptionType</span></h3>
<p>This enum is used to hold information about the type of the style option, and is defined for each <a href="qstylehintreturn.html">QStyleHintReturn</a> subclass.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleHintReturn::Type</code></td><td class="topAlign tblval"><code>SH_Default</code></td><td class="topAlign">The type of style option provided (<a href="qstylehintreturn.html#HintReturnType-enum">SH_Default</a> for this class).</td></tr>
</table></div>
<p>The type is used internally by <a href="qstylehintreturn.html">QStyleHintReturn</a>, its subclasses, and <a href="qstylehintreturn.html#qstyleoption_cast">qstyleoption_cast</a>() to determine the type of style option. In general you do not need to worry about this unless you want to create your own <a href="qstylehintreturn.html">QStyleHintReturn</a> subclass and your own styles.</p>
<p><b>See also </b><a href="qstylehintreturn.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>
<!-- @@@StyleOptionType -->
<!-- $$$StyleOptionVersion$$$Version -->
<h3 class="fn" id="StyleOptionVersion-enum"><a name="StyleOptionVersion-enum"></a>enum QStyleHintReturn::<span class="name">StyleOptionVersion</span></h3>
<p>This enum is used to hold information about the version of the style option, and is defined for each <a href="qstylehintreturn.html">QStyleHintReturn</a> subclass.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleHintReturn::Version</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">1</td></tr>
</table></div>
<p>The version is used by <a href="qstylehintreturn.html">QStyleHintReturn</a> subclasses to implement extensions without breaking compatibility. If you use <a href="qstylehintreturn.html#qstyleoption_cast">qstyleoption_cast</a>(), you normally do not need to check it.</p>
<p><b>See also </b><a href="qstylehintreturn.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<!-- @@@StyleOptionVersion -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QStyleHintReturn[overload1]$$$QStyleHintReturnintint -->
<h3 class="fn" id="QStyleHintReturn"><a name="QStyleHintReturn"></a>QStyleHintReturn::<span class="name">QStyleHintReturn</span>(<span class="type">int</span> <i>version</i> = QStyleOption::Version, <span class="type">int</span> <i>type</i> = SH_Default)</h3>
<p>Constructs a <a href="qstylehintreturn.html">QStyleHintReturn</a> with version <i>version</i> and type <i>type</i>.</p>
<p>The version has no special meaning for <a href="qstylehintreturn.html">QStyleHintReturn</a>; it can be used by subclasses to distinguish between different version of the same hint type.</p>
<p><b>See also </b><a href="qstyleoption.html#version-var">QStyleOption::version</a> and <a href="qstyleoption.html#type-var">QStyleOption::type</a>.</p>
<!-- @@@QStyleHintReturn -->
</div>
<div class="vars">
<h2>Member Variable Documentation</h2>
<!-- $$$type -->
<h3 class="fn" id="type-var"><a name="type-var"></a><span class="type">int</span> QStyleHintReturn::<span class="name">type</span></h3>
<p>This variable holds the type of the style hint container</p>
<p><b>See also </b><a href="qstylehintreturn.html#HintReturnType-enum">HintReturnType</a>.</p>
<!-- @@@type -->
<!-- $$$version -->
<h3 class="fn" id="version-var"><a name="version-var"></a><span class="type">int</span> QStyleHintReturn::<span class="name">version</span></h3>
<p>This variable holds the version of the style hint return container</p>
<p>This value can be used by subclasses to implement extensions without breaking compatibility. If you use <a href="qstylehintreturn.html#qstyleoption_cast">qstyleoption_cast</a><T>(), you normally do not need to check it.</p>
<!-- @@@version -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qstyleoption_cast[overload1]$$$qstyleoption_castconstQStyleHintReturn* -->
<h3 class="fn" id="qstyleoption_cast"><a name="qstyleoption_cast"></a><span class="type">T</span> <span class="name">qstyleoption_cast</span>(const <span class="type"><a href="qstylehintreturn.html#QStyleHintReturn">QStyleHintReturn</a></span> *<i>hint</i>)</h3>
<p>Returns a T or 0 depending on the <a href="qstylehintreturn.html#type-var">type</a> and <a href="qstylehintreturn.html#version-var">version</a> of <i>hint</i>.</p>
<p>Example:</p>
<pre class="cpp">
<span class="type">int</span> MyStyle<span class="operator">::</span>styleHint(StyleHint stylehint<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qstyleoption.html">QStyleOption</a></span> <span class="operator">*</span>opt<span class="operator">,</span>
<span class="keyword">const</span> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget<span class="operator">,</span> <span class="type"><a href="qstylehintreturn.html">QStyleHintReturn</a></span><span class="operator">*</span> returnData) <span class="keyword">const</span>;
{
<span class="keyword">if</span> (stylehint <span class="operator">=</span><span class="operator">=</span> SH_RubberBand_Mask) {
<span class="keyword">const</span> <span class="type"><a href="qstylehintreturnmask.html">QStyleHintReturnMask</a></span> <span class="operator">*</span>maskReturn <span class="operator">=</span>
qstyleoption_cast<span class="operator"><</span><span class="keyword">const</span> <span class="type"><a href="qstylehintreturnmask.html">QStyleHintReturnMask</a></span> <span class="operator">*</span><span class="operator">></span>(hint);
<span class="keyword">if</span> (maskReturn) {
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
}
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
</pre>
<p><b>See also </b><a href="qstylehintreturn.html#type-var">QStyleHintReturn::type</a> and <a href="qstylehintreturn.html#version-var">QStyleHintReturn::version</a>.</p>
<!-- @@@qstyleoption_cast -->
<!-- $$$qstyleoption_cast$$$qstyleoption_castQStyleHintReturn* -->
<h3 class="fn" id="qstyleoption_cast-1"><a name="qstyleoption_cast-1"></a><span class="type">T</span> <span class="name">qstyleoption_cast</span>(<span class="type"><a href="qstylehintreturn.html#QStyleHintReturn">QStyleHintReturn</a></span> *<i>hint</i>)</h3>
<p>This is an overloaded function.</p>
<p>Returns a T or 0 depending on the type of <i>hint</i>.</p>
<!-- @@@qstyleoption_cast -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2018 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>