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 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qaxbase.cpp -->
<title>Qt 4.8: QAxBase Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qaxcontainer.html">QAxContainer</a></li>
<li>QAxBase</li>
</ul>
</div>
</div>
<div class="content mainContent">
<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="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QAxBase Class Reference</h1>
<!-- $$$QAxBase-brief -->
<p>The QAxBase class is an abstract class that provides an API to initialize and access a COM object. <a href="#details">More...</a></p>
<!-- @@@QAxBase -->
<pre class="cpp"> <span class="preprocessor">#include <QAxBase></span></pre><p><b>Inherited by: </b><a href="qaxobject.html">QAxObject</a> and <a href="qaxwidget.html">QAxWidget</a>.</p>
<ul>
<li><a href="qaxbase-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#PropertyBag-typedef">PropertyBag</a></b></td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qaxbase.html#control-prop">control</a></b> : QString</li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#QAxBase">QAxBase</a></b> ( IUnknown * <i>iface</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#dtor.QAxBase">~QAxBase</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#asVariant">asVariant</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#control-prop">control</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#disableClassInfo">disableClassInfo</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#disableEventSink">disableEventSink</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#disableMetaObject">disableMetaObject</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#dynamicCall">dynamicCall</a></b> ( const char * <i>function</i>, const QVariant & <i>var1</i> = QVariant(), const QVariant & <i>var2</i> = QVariant(), const QVariant & <i>var3</i> = QVariant(), const QVariant & <i>var4</i> = QVariant(), const QVariant & <i>var5</i> = QVariant(), const QVariant & <i>var6</i> = QVariant(), const QVariant & <i>var7</i> = QVariant(), const QVariant & <i>var8</i> = QVariant() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#dynamicCall-2">dynamicCall</a></b> ( const char * <i>function</i>, QList<QVariant> & <i>vars</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#generateDocumentation">generateDocumentation</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> PropertyBag </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#propertyBag">propertyBag</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#propertyWritable">propertyWritable</a></b> ( const char * <i>prop</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> long </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#queryInterface">queryInterface</a></b> ( const QUuid & <i>uuid</i>, void ** <i>iface</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAxObject * </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#querySubObject">querySubObject</a></b> ( const char * <i>name</i>, const QVariant & <i>var1</i> = QVariant(), const QVariant & <i>var2</i> = QVariant(), const QVariant & <i>var3</i> = QVariant(), const QVariant & <i>var4</i> = QVariant(), const QVariant & <i>var5</i> = QVariant(), const QVariant & <i>var6</i> = QVariant(), const QVariant & <i>var7</i> = QVariant(), const QVariant & <i>var8</i> = QVariant() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAxObject * </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#querySubObject-2">querySubObject</a></b> ( const char * <i>name</i>, QList<QVariant> & <i>vars</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#control-prop">setControl</a></b> ( const QString & )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#setPropertyBag">setPropertyBag</a></b> ( const PropertyBag & <i>bag</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#setPropertyWritable">setPropertyWritable</a></b> ( const char * <i>prop</i>, bool <i>ok</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#verbs">verbs</a></b> () const</td></tr>
</table>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#exception">exception</a></b> ( int <i>code</i>, const QString & <i>source</i>, const QString & <i>desc</i>, const QString & <i>help</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#propertyChanged">propertyChanged</a></b> ( const QString & <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#signal">signal</a></b> ( const QString & <i>name</i>, int <i>argc</i>, void * <i>argv</i> )</td></tr>
</table>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#initialize">initialize</a></b> ( IUnknown ** <i>ptr</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#initializeActive">initializeActive</a></b> ( IUnknown ** <i>ptr</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#initializeFromFile">initializeFromFile</a></b> ( IUnknown ** <i>ptr</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#initializeLicensed">initializeLicensed</a></b> ( IUnknown ** <i>ptr</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qaxbase.html#initializeRemote">initializeRemote</a></b> ( IUnknown ** <i>ptr</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QAxBase-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QAxBase class is an abstract class that provides an API to initialize and access a COM object.</p>
<p>QAxBase is an abstract class that cannot be used directly, and is instantiated through the subclasses <a href="qaxobject.html">QAxObject</a> and <a href="qaxwidget.html">QAxWidget</a>. This class provides the API to access the COM object directly through its IUnknown implementation. If the COM object implements the IDispatch interface, the properties and methods of that object become available as Qt properties and slots.</p>
<pre class="cpp"> connect(buttonBack<span class="operator">,</span> SIGNAL(clicked())<span class="operator">,</span> webBrowser<span class="operator">,</span> SLOT(GoBack()));</pre>
<p>Properties exposed by the object's IDispatch implementation can be read and written through the property system provided by the Qt Object Model (both subclasses are <a href="qtwebkit-bridge.html#qobjects">QObjects</a>, so you can use <a href="qobject.html#setProperty">QObject::setProperty</a>() and <a href="qobject.html#property">QObject::property</a>()). Properties with multiple parameters are not supported.</p>
<pre class="cpp"> activeX<span class="operator">-</span><span class="operator">></span>setProperty(<span class="string">"text"</span><span class="operator">,</span> <span class="string">"some text"</span>);
<span class="type">int</span> value <span class="operator">=</span> activeX<span class="operator">-</span><span class="operator">></span>property(<span class="string">"value"</span>);</pre>
<p>Write-functions for properties and other methods exposed by the object's IDispatch implementation can be called directly using <a href="qaxbase.html#dynamicCall">dynamicCall</a>(), or indirectly as slots connected to a signal.</p>
<pre class="cpp"> webBrowser<span class="operator">-</span><span class="operator">></span><a href="qaxbase.html#dynamicCall">dynamicCall</a>(<span class="string">"GoHome()"</span>);</pre>
<p>Outgoing events supported by the COM object are emitted as standard Qt signals.</p>
<pre class="cpp"> connect(webBrowser<span class="operator">,</span> SIGNAL(TitleChanged(<span class="type"><a href="qstring.html">QString</a></span>))<span class="operator">,</span>
<span class="keyword">this</span><span class="operator">,</span> SLOT(setCaption(<span class="type"><a href="qstring.html">QString</a></span>)));</pre>
<p>QAxBase transparently converts between COM data types and the equivalent Qt data types. Some COM types have no equivalent Qt data structure.</p>
<p>Supported COM datatypes are listed in the first column of following table. The second column is the Qt type that can be used with the <a href="qobject.html">QObject</a> property functions. The third column is the Qt type that is used in the prototype of generated signals and slots for in-parameters, and the last column is the Qt type that is used in the prototype of signals and slots for out-parameters.</p>
<table class="generic">
<thead><tr class="qt-style"><th >COM type</th><th >Qt property</th><th >in-parameter</th><th >out-parameter</th></tr></thead>
<tr valign="top" class="odd"><td >VARIANT_BOOL</td><td >bool</td><td >bool</td><td >bool&</td></tr>
<tr valign="top" class="even"><td >BSTR</td><td ><a href="qstring.html">QString</a></td><td >const <a href="qstring.html">QString</a>&</td><td ><a href="qstring.html">QString</a>&</td></tr>
<tr valign="top" class="odd"><td >char, short, int, long</td><td >int</td><td >int</td><td >int&</td></tr>
<tr valign="top" class="even"><td >uchar, ushort, uint, ulong</td><td >uint</td><td >uint</td><td >uint&</td></tr>
<tr valign="top" class="odd"><td >float, double</td><td >double</td><td >double</td><td >double&</td></tr>
<tr valign="top" class="even"><td >DATE</td><td ><a href="qdatetime.html">QDateTime</a></td><td >const <a href="qdatetime.html">QDateTime</a>&</td><td ><a href="qdatetime.html">QDateTime</a>&</td></tr>
<tr valign="top" class="odd"><td >CY</td><td >qlonglong</td><td >qlonglong</td><td >qlonglong&</td></tr>
<tr valign="top" class="even"><td >OLE_COLOR</td><td ><a href="qcolor.html">QColor</a></td><td >const <a href="qcolor.html">QColor</a>&</td><td ><a href="qcolor.html">QColor</a>&</td></tr>
<tr valign="top" class="odd"><td >SAFEARRAY(VARIANT)</td><td ><a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>></td><td >const <a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>>&</td><td ><a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>>&</td></tr>
<tr valign="top" class="even"><td >SAFEARRAY(int), SAFEARRAY(double), SAFEARRAY(Date)</td><td ><a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>></td><td >const <a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>>&</td><td ><a href="qlist.html">QList</a><<a href="qvariant.html">QVariant</a>>&</td></tr>
<tr valign="top" class="odd"><td >SAFEARRAY(BYTE)</td><td ><a href="qbytearray.html">QByteArray</a></td><td >const <a href="qbytearray.html">QByteArray</a>&</td><td ><a href="qbytearray.html">QByteArray</a>&</td></tr>
<tr valign="top" class="even"><td >SAFEARRAY(BSTR)</td><td ><a href="qstringlist.html">QStringList</a></td><td >const <a href="qstringlist.html">QStringList</a>&</td><td ><a href="qstringlist.html">QStringList</a>&</td></tr>
<tr valign="top" class="odd"><td >VARIANT</td><td >type-dependent</td><td >const <a href="qvariant.html">QVariant</a>&</td><td ><a href="qvariant.html">QVariant</a>&</td></tr>
<tr valign="top" class="even"><td >IFontDisp*</td><td ><a href="qfont.html">QFont</a></td><td >const <a href="qfont.html">QFont</a>&</td><td ><a href="qfont.html">QFont</a>&</td></tr>
<tr valign="top" class="odd"><td >IPictureDisp*</td><td ><a href="qpixmap.html">QPixmap</a></td><td >const <a href="qpixmap.html">QPixmap</a>&</td><td ><a href="qpixmap.html">QPixmap</a>&</td></tr>
<tr valign="top" class="even"><td >IDispatch*</td><td ><a href="qaxobject.html">QAxObject</a>*</td><td ><tt>QAxBase::asVariant()</tt></td><td ><a href="qaxobject.html">QAxObject</a>* (return value)</td></tr>
<tr valign="top" class="odd"><td >IUnknown*</td><td ><a href="qaxobject.html">QAxObject</a>*</td><td ><tt>QAxBase::asVariant()</tt></td><td ><a href="qaxobject.html">QAxObject</a>* (return value)</td></tr>
<tr valign="top" class="even"><td >SCODE, DECIMAL</td><td ><i>unsupported</i></td><td ><i>unsupported</i></td><td ><i>unsupported</i></td></tr>
<tr valign="top" class="odd"><td >VARIANT* (Since Qt 4.5)</td><td ><i>unsupported</i></td><td ><i>QVariant&</i></td><td ><i>QVariant&</i></td></tr>
</table>
<p>Supported are also enumerations, and typedefs to supported types.</p>
<p>To call the methods of a COM interface described by the following IDL</p>
<pre class="cpp"> dispinterface IControl
{
properties:
<span class="operator">[</span>id(<span class="number">1</span>)<span class="operator">]</span> BSTR text;
<span class="operator">[</span>id(<span class="number">2</span>)<span class="operator">]</span> IFontDisp <span class="operator">*</span>font;
methods:
<span class="operator">[</span>id(<span class="number">6</span>)<span class="operator">]</span> <span class="type">void</span> showColumn(<span class="operator">[</span>in<span class="operator">]</span> <span class="type">int</span> i);
<span class="operator">[</span>id(<span class="number">3</span>)<span class="operator">]</span> <span class="type">bool</span> addColumn(<span class="operator">[</span>in<span class="operator">]</span> BSTR t);
<span class="operator">[</span>id(<span class="number">4</span>)<span class="operator">]</span> <span class="type">int</span> fillList(<span class="operator">[</span>in<span class="operator">,</span> out<span class="operator">]</span> SAFEARRAY(VARIANT) <span class="operator">*</span>list);
<span class="operator">[</span>id(<span class="number">5</span>)<span class="operator">]</span> IDispatch <span class="operator">*</span>item(<span class="operator">[</span>in<span class="operator">]</span> <span class="type">int</span> i);
};</pre>
<p>use the QAxBase API like this:</p>
<pre class="cpp"> <span class="type"><a href="qaxobject.html">QAxObject</a></span> object(<span class="string">"<CLSID>"</span>);
<span class="type"><a href="qstring.html">QString</a></span> text <span class="operator">=</span> object<span class="operator">.</span>property(<span class="string">"text"</span>)<span class="operator">.</span>toString();
object<span class="operator">.</span>setProperty(<span class="string">"font"</span><span class="operator">,</span> <span class="type"><a href="qfont.html">QFont</a></span>(<span class="string">"Times New Roman"</span><span class="operator">,</span> <span class="number">12</span>));
connect(<span class="keyword">this</span><span class="operator">,</span> SIGNAL(clicked(<span class="type">int</span>))<span class="operator">,</span> <span class="operator">&</span>object<span class="operator">,</span> SLOT(showColumn(<span class="type">int</span>)));
<span class="type">bool</span> ok <span class="operator">=</span> object<span class="operator">.</span><a href="qaxbase.html#dynamicCall">dynamicCall</a>(<span class="string">"addColumn(const QString&)"</span><span class="operator">,</span> <span class="string">"Column 1"</span>)<span class="operator">.</span>toBool();
<span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qvariant.html">QVariant</a></span><span class="operator">></span> varlist;
<span class="type"><a href="qlist.html">QList</a></span><span class="operator"><</span><span class="type"><a href="qvariant.html">QVariant</a></span><span class="operator">></span> parameters;
parameters <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qvariant.html">QVariant</a></span>(varlist);
<span class="type">int</span> n <span class="operator">=</span> object<span class="operator">.</span><a href="qaxbase.html#dynamicCall">dynamicCall</a>(<span class="string">"fillList(QList<QVariant>&)"</span><span class="operator">,</span> parameters)<span class="operator">.</span>toInt();
<span class="type"><a href="qaxobject.html">QAxObject</a></span> <span class="operator">*</span>item <span class="operator">=</span> object<span class="operator">.</span>querySubItem(<span class="string">"item(int)"</span><span class="operator">,</span> <span class="number">5</span>);</pre>
<p>Note that the <a href="qlist.html">QList</a> the object should fill has to be provided as an element in the parameter list of <a href="qvariant.html">QVariant</a>s.</p>
<p>If you need to access properties or pass parameters of unsupported datatypes you must access the COM object directly through its <tt>IDispatch</tt> implementation or other interfaces. Those interfaces can be retrieved through <a href="qaxbase.html#queryInterface">queryInterface</a>().</p>
<pre class="cpp"> IUnknown <span class="operator">*</span>iface <span class="operator">=</span> <span class="number">0</span>;
activeX<span class="operator">-</span><span class="operator">></span><a href="qaxbase.html#queryInterface">queryInterface</a>(IID_IUnknown<span class="operator">,</span> (<span class="type">void</span><span class="operator">*</span><span class="operator">*</span>)<span class="operator">&</span>iface);
<span class="keyword">if</span> (iface) {
<span class="comment">// use the interface</span>
iface<span class="operator">-</span><span class="operator">></span>Release();
}</pre>
<p>To get the definition of the COM interfaces you will have to use the header files provided with the component you want to use. Some compilers can also import type libraries using the #import compiler directive. See the component documentation to find out which type libraries you have to import, and how to use them.</p>
<p>If you need to react to events that pass parameters of unsupported datatypes you can use the generic signal that delivers the event data as provided by the COM event.</p>
</div>
<p><b>See also </b><a href="qaxobject.html">QAxObject</a>, <a href="qaxwidget.html">QAxWidget</a>, <a href="qaxscript.html">QAxScript</a>, and <a href="activeqt.html#activeqt-framework">ActiveQt Framework</a>.</p>
<!-- @@@QAxBase -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$PropertyBag -->
<h3 class="fn"><a name="PropertyBag-typedef"></a>typedef QAxBase::<span class="name">PropertyBag</span></h3>
<p>A <a href="qmap.html">QMap</a><<a href="qstring.html">QString</a>,<a href="qvariant.html">QVariant</a>> that can store properties as name:value pairs.</p>
<!-- @@@PropertyBag -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$control-prop$$$control$$$setControlconstQString& -->
<h3 class="fn"><a name="control-prop"></a><span class="name">control</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the name of the COM object wrapped by this QAxBase object.</p>
<p>Setting this property initializes the COM object. Any COM object previously set is shut down.</p>
<p>The most efficient way to set this property is by using the registered component's UUID, e.g.</p>
<pre class="cpp"> ctrl<span class="operator">-</span><span class="operator">></span>setControl(<span class="string">"{8E27C92B-1264-101C-8A2F-040224009C02}"</span>);</pre>
<p>The second fastest way is to use the registered control's class name (with or without version number), e.g.</p>
<pre class="cpp"> ctrl<span class="operator">-</span><span class="operator">></span>setControl(<span class="string">"MSCal.Calendar"</span>);</pre>
<p>The slowest, but easiest way to use is to use the control's full name, e.g.</p>
<pre class="cpp"> ctrl<span class="operator">-</span><span class="operator">></span>setControl(<span class="string">"Calendar Control 9.0"</span>);</pre>
<p>It is also possible to initialize the object from a file, e.g.</p>
<pre class="cpp"> ctrl<span class="operator">-</span><span class="operator">></span>setControl(<span class="string">"c:/files/file.doc"</span>);</pre>
<p>If the component's UUID is used the following patterns can be used to initialize the control on a remote machine, to initialize a licensed control or to connect to a running object:</p>
<ul>
<li>To initialize the control on a different machine use the following pattern:<pre class="cpp"> <span class="operator"><</span>domain<span class="operator">/</span>username<span class="operator">></span>:<span class="operator"><</span>password<span class="operator">></span>@server<span class="operator">/</span>{<span class="number">8E27C92B</span><span class="operator">-</span><span class="number">1264</span><span class="operator">-</span><span class="number">101C</span><span class="operator">-</span><span class="number">8A2F</span><span class="operator">-</span><span class="number">040224009C02</span>}</pre>
</li>
<li>To initialize a licensed control use the following pattern:<pre class="cpp"> {<span class="number">8E27C92B</span><span class="operator">-</span><span class="number">1264</span><span class="operator">-</span><span class="number">101C</span><span class="operator">-</span><span class="number">8A2F</span><span class="operator">-</span><span class="number">040224009C02</span>}:<span class="operator"><</span>LicenseKey<span class="operator">></span></pre>
</li>
<li>To connect to an already running object use the following pattern:<pre class="cpp"> {<span class="number">8E27C92B</span><span class="operator">-</span><span class="number">1264</span><span class="operator">-</span><span class="number">101C</span><span class="operator">-</span><span class="number">8A2F</span><span class="operator">-</span><span class="number">040224009C02</span>}<span class="operator">&</span></pre>
</li>
</ul>
<p>The first two patterns can be combined, e.g. to initialize a licensed control on a remote machine:</p>
<pre class="cpp"> ctrl<span class="operator">-</span><span class="operator">></span>setControl(<span class="string">"DOMAIN/user:password@server/{8E27C92B-1264-101C-8A2F-040224009C02}:LicenseKey"</span>);</pre>
<p>The control's read function always returns the control's UUID, if provided including the license key, and the name of the server, but not including the username, the domain or the password.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>control</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>setControl</b></span> ( const QString & )</td></tr>
</table>
<!-- @@@control -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAxBase[overload1]$$$QAxBaseIUnknown* -->
<h3 class="fn"><a name="QAxBase"></a>QAxBase::<span class="name">QAxBase</span> ( <span class="type">IUnknown</span> * <i>iface</i> = 0 )</h3>
<p>Creates a <a href="qaxbase.html">QAxBase</a> object that wraps the COM object <i>iface</i>. If <i>iface</i> is 0 (the default), use <a href="qaxbase.html#control-prop">setControl</a>() to instantiate a COM object.</p>
<!-- @@@QAxBase -->
<!-- $$$~QAxBase[overload1]$$$~QAxBase -->
<h3 class="fn"><a name="dtor.QAxBase"></a>QAxBase::<span class="name">~QAxBase</span> ()<tt> [virtual]</tt></h3>
<p>Shuts down the COM object and destroys the <a href="qaxbase.html">QAxBase</a> object.</p>
<p><b>See also </b><a href="qaxbase.html#clear">clear</a>().</p>
<!-- @@@~QAxBase -->
<!-- $$$asVariant[overload1]$$$asVariant -->
<h3 class="fn"><a name="asVariant"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QAxBase::<span class="name">asVariant</span> () const</h3>
<p>Returns a <a href="qvariant.html">QVariant</a> that wraps the COM object. The variant can then be used as a parameter in e.g. <a href="qaxbase.html#dynamicCall">dynamicCall</a>().</p>
<!-- @@@asVariant -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QAxBase::<span class="name">clear</span> ()<tt> [virtual]</tt></h3>
<p>Disconnects and destroys the COM object.</p>
<p>If you reimplement this function you must also reimplement the destructor to call clear(), and call this implementation at the end of your clear() function.</p>
<!-- @@@clear -->
<!-- $$$disableClassInfo[overload1]$$$disableClassInfo -->
<h3 class="fn"><a name="disableClassInfo"></a><span class="type">void</span> QAxBase::<span class="name">disableClassInfo</span> ()</h3>
<p>Disables the class info generation for this ActiveX container. If you don't require any class information about the ActiveX control use this function to speed up the meta object generation.</p>
<p>Note that this function must be called immediately after construction of the object</p>
<!-- @@@disableClassInfo -->
<!-- $$$disableEventSink[overload1]$$$disableEventSink -->
<h3 class="fn"><a name="disableEventSink"></a><span class="type">void</span> QAxBase::<span class="name">disableEventSink</span> ()</h3>
<p>Disables the event sink implementation for this ActiveX container. If you don't intend to listen to the ActiveX control's events use this function to speed up the meta object generation.</p>
<p>Some ActiveX controls might be unstable when connected to an event sink. To get OLE events you must use standard COM methods to register your own event sink. Use <a href="qaxbase.html#queryInterface">queryInterface</a>() to get access to the raw COM object.</p>
<p>Note that this function should be called immediately after construction of the object.</p>
<!-- @@@disableEventSink -->
<!-- $$$disableMetaObject[overload1]$$$disableMetaObject -->
<h3 class="fn"><a name="disableMetaObject"></a><span class="type">void</span> QAxBase::<span class="name">disableMetaObject</span> ()</h3>
<p>Disables the meta object generation for this ActiveX container. This also disables the event sink and class info generation. If you don't intend to use the Qt meta object implementation call this function to speed up instantiation of the control. You will still be able to call the object through <a href="qaxbase.html#dynamicCall">dynamicCall</a>(), but signals, slots and properties will not be available with <a href="qobject.html">QObject</a> APIs.</p>
<p>Some ActiveX controls might be unstable when used with OLE automation. Use standard COM methods to use those controls through the COM interfaces provided by <a href="qaxbase.html#queryInterface">queryInterface</a>().</p>
<p>Note that this function must be called immediately after construction of the object.</p>
<!-- @@@disableMetaObject -->
<!-- $$$dynamicCall[overload1]$$$dynamicCallconstchar*constQVariant&constQVariant&constQVariant&constQVariant&constQVariant&constQVariant&constQVariant&constQVariant& -->
<h3 class="fn"><a name="dynamicCall"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QAxBase::<span class="name">dynamicCall</span> ( const <span class="type">char</span> * <i>function</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var1</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var2</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var3</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var4</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var5</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var6</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var7</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var8</i> = QVariant() )</h3>
<p>Calls the COM object's method <i>function</i>, passing the parameters <i>var1</i>, <i>var1</i>, <i>var2</i>, <i>var3</i>, <i>var4</i>, <i>var5</i>, <i>var6</i>, <i>var7</i> and <i>var8</i>, and returns the value returned by the method, or an invalid <a href="qvariant.html">QVariant</a> if the method does not return a value or when the function call failed.</p>
<p>If <i>function</i> is a method of the object the string must be provided as the full prototype, for example as it would be written in a <a href="qobject.html#connect">QObject::connect</a>() call.</p>
<pre class="cpp"> activeX<span class="operator">-</span><span class="operator">></span>dynamicCall(<span class="string">"Navigate(const QString&)"</span><span class="operator">,</span> <span class="string">"qt.nokia.com"</span>);</pre>
<p>Alternatively a function can be called passing the parameters embedded in the string, e.g. above function can also be invoked using</p>
<pre class="cpp"> activeX<span class="operator">-</span><span class="operator">></span>dynamicCall(<span class="string">"Navigate(\"qt.nokia.com\")"</span>);</pre>
<p>All parameters are passed as strings; it depends on the control whether they are interpreted correctly, and is slower than using the prototype with correctly typed parameters.</p>
<p>If <i>function</i> is a property the string has to be the name of the property. The property setter is called when <i>var1</i> is a valid <a href="qvariant.html">QVariant</a>, otherwise the getter is called.</p>
<pre class="cpp"> activeX<span class="operator">-</span><span class="operator">></span>dynamicCall(<span class="string">"Value"</span><span class="operator">,</span> <span class="number">5</span>);
<span class="type"><a href="qstring.html">QString</a></span> text <span class="operator">=</span> activeX<span class="operator">-</span><span class="operator">></span>dynamicCall(<span class="string">"Text"</span>)<span class="operator">.</span>toString();</pre>
<p>Note that it is faster to get and set properties using <a href="qobject.html#property">QObject::property</a>() and <a href="qobject.html#setProperty">QObject::setProperty</a>().</p>
<p>dynamicCall() can also be used to call objects with a <a href="qaxbase.html#disableMetaObject">disabled metaobject</a> wrapper, which can improve performance significantely, esp. when calling many different objects of different types during an automation process. <a href="activeqt.html#activeqt">ActiveQt</a> will then however not validate parameters.</p>
<p>It is only possible to call functions through dynamicCall() that have parameters or return values of datatypes supported by <a href="qvariant.html">QVariant</a>. See the <a href="qaxbase.html">QAxBase</a> class documentation for a list of supported and unsupported datatypes. If you want to call functions that have unsupported datatypes in the parameter list, use <a href="qaxbase.html#queryInterface">queryInterface</a>() to retrieve the appropriate COM interface, and use the function directly.</p>
<pre class="cpp"> IWebBrowser2 <span class="operator">*</span>webBrowser <span class="operator">=</span> <span class="number">0</span>;
activeX<span class="operator">-</span><span class="operator">></span><a href="qaxbase.html#queryInterface">queryInterface</a>(IID_IWebBrowser2<span class="operator">,</span> (<span class="type">void</span> <span class="operator">*</span><span class="operator">*</span>)<span class="operator">&</span>webBrowser);
<span class="keyword">if</span> (webBrowser) {
webBrowser<span class="operator">-</span><span class="operator">></span>Navigate2(pvarURL);
webBrowser<span class="operator">-</span><span class="operator">></span>Release();
}</pre>
<p>This is also more efficient.</p>
<!-- @@@dynamicCall -->
<!-- $$$dynamicCall$$$dynamicCallconstchar*QList<QVariant>& -->
<h3 class="fn"><a name="dynamicCall-2"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QAxBase::<span class="name">dynamicCall</span> ( const <span class="type">char</span> * <i>function</i>, <span class="type"><a href="qlist.html">QList</a></span><<span class="type"><a href="qvariant.html">QVariant</a></span>> & <i>vars</i> )</h3>
<p>This is an overloaded function.</p>
<p>Calls the COM object's method <i>function</i>, passing the parameters in <i>vars</i>, and returns the value returned by the method. If the method does not return a value or when the function call failed this function returns an invalid <a href="qvariant.html">QVariant</a> object.</p>
<p>The <a href="qvariant.html">QVariant</a> objects in <i>vars</i> are updated when the method has out-parameters.</p>
<!-- @@@dynamicCall -->
<!-- $$$exception[overload1]$$$exceptionintconstQString&constQString&constQString& -->
<h3 class="fn"><a name="exception"></a><span class="type">void</span> QAxBase::<span class="name">exception</span> ( <span class="type">int</span> <i>code</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>source</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>desc</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>help</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the COM object throws an exception while called using the OLE automation interface IDispatch. <i>code</i>, <i>source</i>, <i>desc</i> and <i>help</i> provide information about the exception as provided by the COM server and can be used to provide useful feedback to the end user. <i>help</i> includes the help file, and the help context ID in brackets, e.g. "filename [id]".</p>
<!-- @@@exception -->
<!-- $$$generateDocumentation[overload1]$$$generateDocumentation -->
<h3 class="fn"><a name="generateDocumentation"></a><span class="type"><a href="qstring.html">QString</a></span> QAxBase::<span class="name">generateDocumentation</span> ()</h3>
<p>Returns a rich text string with documentation for the wrapped COM object. Dump the string to an HTML-file, or use it in e.g. a <a href="qtextbrowser.html">QTextBrowser</a> widget.</p>
<!-- @@@generateDocumentation -->
<!-- $$$initialize[overload1]$$$initializeIUnknown** -->
<h3 class="fn"><a name="initialize"></a><span class="type">bool</span> QAxBase::<span class="name">initialize</span> ( <span class="type">IUnknown</span> ** <i>ptr</i> )<tt> [virtual protected]</tt></h3>
<p>This virtual function is called by <a href="qaxbase.html#control-prop">setControl</a>() and creates the requested COM object. <i>ptr</i> is set to the object's IUnknown implementation. The function returns true if the object initialization succeeded; otherwise the function returns false.</p>
<p>The default implementation interprets the string returned by <a href="qaxbase.html#control-prop">control</a>(), and calls <a href="qaxbase.html#initializeRemote">initializeRemote</a>(), <a href="qaxbase.html#initializeLicensed">initializeLicensed</a>() or <a href="qaxbase.html#initializeActive">initializeActive</a>() if the string matches the respective patterns. If <a href="qaxbase.html#control-prop">control</a>() is the name of an existing file, <a href="qaxbase.html#initializeFromFile">initializeFromFile</a>() is called. If no pattern is matched, or if remote or licensed initialization fails, CoCreateInstance is used directly to create the object.</p>
<p>See the <a href="qaxbase.html#control-prop">control</a> property documentation for details about supported patterns.</p>
<p>The interface returned in <i>ptr</i> must be referenced exactly once when this function returns. The interface provided by e.g. CoCreateInstance is already referenced, and there is no need to reference it again.</p>
<!-- @@@initialize -->
<!-- $$$initializeActive[overload1]$$$initializeActiveIUnknown** -->
<h3 class="fn"><a name="initializeActive"></a><span class="type">bool</span> QAxBase::<span class="name">initializeActive</span> ( <span class="type">IUnknown</span> ** <i>ptr</i> )<tt> [protected]</tt></h3>
<p>Connects to an active instance running on the current machine, and returns the IUnknown interface to the running object in <i>ptr</i>. This function returns true if successful, otherwise returns false.</p>
<p>This function is called by <a href="qaxbase.html#initialize">initialize</a>() if the control string contains the substring "}&".</p>
<p><b>See also </b><a href="qaxbase.html#initialize">initialize</a>().</p>
<!-- @@@initializeActive -->
<!-- $$$initializeFromFile[overload1]$$$initializeFromFileIUnknown** -->
<h3 class="fn"><a name="initializeFromFile"></a><span class="type">bool</span> QAxBase::<span class="name">initializeFromFile</span> ( <span class="type">IUnknown</span> ** <i>ptr</i> )<tt> [protected]</tt></h3>
<p>Creates the COM object handling the filename in the control property, and returns the IUnknown interface to the object in <i>ptr</i>. This function returns true if successful, otherwise returns false.</p>
<p>This function is called by <a href="qaxbase.html#initialize">initialize</a>() if the control string is the name of an existing file.</p>
<p><b>See also </b><a href="qaxbase.html#initialize">initialize</a>().</p>
<!-- @@@initializeFromFile -->
<!-- $$$initializeLicensed[overload1]$$$initializeLicensedIUnknown** -->
<h3 class="fn"><a name="initializeLicensed"></a><span class="type">bool</span> QAxBase::<span class="name">initializeLicensed</span> ( <span class="type">IUnknown</span> ** <i>ptr</i> )<tt> [protected]</tt></h3>
<p>Creates an instance of a licensed control, and returns the IUnknown interface to the object in <i>ptr</i>. This functions returns true if successful, otherwise returns false.</p>
<p>This function is called by <a href="qaxbase.html#initialize">initialize</a>() if the control string contains the substring "}:". The license key needs to follow this substring.</p>
<p><b>See also </b><a href="qaxbase.html#initialize">initialize</a>().</p>
<!-- @@@initializeLicensed -->
<!-- $$$initializeRemote[overload1]$$$initializeRemoteIUnknown** -->
<h3 class="fn"><a name="initializeRemote"></a><span class="type">bool</span> QAxBase::<span class="name">initializeRemote</span> ( <span class="type">IUnknown</span> ** <i>ptr</i> )<tt> [protected]</tt></h3>
<p>Creates the instance on a remote server, and returns the IUnknown interface to the object in <i>ptr</i>. This function returns true if successful, otherwise returns false.</p>
<p>This function is called by <a href="qaxbase.html#initialize">initialize</a>() if the control string contains the substring "/{". The information about the remote machine needs to be provided in front of the substring.</p>
<p><b>See also </b><a href="qaxbase.html#initialize">initialize</a>().</p>
<!-- @@@initializeRemote -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QAxBase::<span class="name">isNull</span> () const</h3>
<p>Returns true if there is no COM object loaded by this wrapper; otherwise return false.</p>
<p><b>See also </b><a href="qaxbase.html#control-prop">control</a>.</p>
<!-- @@@isNull -->
<!-- $$$propertyBag[overload1]$$$propertyBag -->
<h3 class="fn"><a name="propertyBag"></a><span class="type"><a href="qaxbase.html#PropertyBag-typedef">PropertyBag</a></span> QAxBase::<span class="name">propertyBag</span> () const</h3>
<p>Returns a name:value map of all the properties exposed by the COM object.</p>
<p>This is more efficient than getting multiple properties individually if the COM object supports property bags.</p>
<p><b>Warning:</b> It is not guaranteed that the property bag implementation of the COM object returns all properties, or that the properties returned are the same as those available through the IDispatch interface.</p>
<p><b>See also </b><a href="qaxbase.html#setPropertyBag">setPropertyBag</a>().</p>
<!-- @@@propertyBag -->
<!-- $$$propertyChanged[overload1]$$$propertyChangedconstQString& -->
<h3 class="fn"><a name="propertyChanged"></a><span class="type">void</span> QAxBase::<span class="name">propertyChanged</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )<tt> [signal]</tt></h3>
<p>If the COM object supports property notification, this signal gets emitted when the property called <i>name</i> is changed.</p>
<!-- @@@propertyChanged -->
<!-- $$$propertyWritable[overload1]$$$propertyWritableconstchar* -->
<h3 class="fn"><a name="propertyWritable"></a><span class="type">bool</span> QAxBase::<span class="name">propertyWritable</span> ( const <span class="type">char</span> * <i>prop</i> ) const<tt> [virtual]</tt></h3>
<p>Returns true if the property <i>prop</i> is writable; otherwise returns false. By default, all properties are writable.</p>
<p><b>Warning:</b> Depending on the control implementation this setting might be ignored for some properties.</p>
<p><b>See also </b><a href="qaxbase.html#setPropertyWritable">setPropertyWritable</a>() and <a href="qaxbase.html#propertyChanged">propertyChanged</a>().</p>
<!-- @@@propertyWritable -->
<!-- $$$queryInterface[overload1]$$$queryInterfaceconstQUuid&void** -->
<h3 class="fn"><a name="queryInterface"></a><span class="type">long</span> QAxBase::<span class="name">queryInterface</span> ( const <span class="type"><a href="quuid.html">QUuid</a></span> & <i>uuid</i>, <span class="type">void</span> ** <i>iface</i> ) const</h3>
<p>Requests the interface <i>uuid</i> from the COM object and sets the value of <i>iface</i> to the provided interface, or to 0 if the requested interface could not be provided.</p>
<p>Returns the result of the QueryInterface implementation of the COM object.</p>
<p><b>See also </b><a href="qaxbase.html#control-prop">control</a>.</p>
<!-- @@@queryInterface -->
<!-- $$$querySubObject[overload1]$$$querySubObjectconstchar*constQVariant&constQVariant&constQVariant&constQVariant&constQVariant&constQVariant&constQVariant&constQVariant& -->
<h3 class="fn"><a name="querySubObject"></a><span class="type"><a href="qaxobject.html">QAxObject</a></span> * QAxBase::<span class="name">querySubObject</span> ( const <span class="type">char</span> * <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var1</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var2</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var3</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var4</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var5</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var6</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var7</i> = QVariant(), const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>var8</i> = QVariant() )</h3>
<p>Returns a pointer to a <a href="qaxobject.html">QAxObject</a> wrapping the COM object provided by the method or property <i>name</i>, passing passing the parameters <i>var1</i>, <i>var1</i>, <i>var2</i>, <i>var3</i>, <i>var4</i>, <i>var5</i>, <i>var6</i>, <i>var7</i> and <i>var8</i>.</p>
<p>If <i>name</i> is provided by a method the string must include the full function prototype.</p>
<p>If <i>name</i> is a property the string must be the name of the property, and <i>var1</i>, ... <i>var8</i> are ignored.</p>
<p>The returned <a href="qaxobject.html">QAxObject</a> is a child of this object (which is either of type <a href="qaxobject.html">QAxObject</a> or <a href="qaxwidget.html">QAxWidget</a>), and is deleted when this object is deleted. It is however safe to delete the returned object yourself, and you should do so when you iterate over lists of subobjects.</p>
<p>COM enabled applications usually have an object model publishing certain elements of the application as dispatch interfaces. Use this method to navigate the hierarchy of the object model, e.g.</p>
<pre class="cpp"> <span class="type"><a href="qaxwidget.html">QAxWidget</a></span> outlook(<span class="string">"Outlook.Application"</span>);
<span class="type"><a href="qaxobject.html">QAxObject</a></span> <span class="operator">*</span>session <span class="operator">=</span> outlook<span class="operator">.</span>querySubObject(<span class="string">"Session"</span>);
<span class="keyword">if</span> (session) {
<span class="type"><a href="qaxobject.html">QAxObject</a></span> <span class="operator">*</span>defFolder <span class="operator">=</span> session<span class="operator">-</span><span class="operator">></span>querySubObject(
<span class="string">"GetDefaultFolder(OlDefaultFolders)"</span><span class="operator">,</span>
<span class="string">"olFolderContacts"</span>);
<span class="comment">//...</span>
}</pre>
<!-- @@@querySubObject -->
<!-- $$$querySubObject$$$querySubObjectconstchar*QList<QVariant>& -->
<h3 class="fn"><a name="querySubObject-2"></a><span class="type"><a href="qaxobject.html">QAxObject</a></span> * QAxBase::<span class="name">querySubObject</span> ( const <span class="type">char</span> * <i>name</i>, <span class="type"><a href="qlist.html">QList</a></span><<span class="type"><a href="qvariant.html">QVariant</a></span>> & <i>vars</i> )</h3>
<p>This is an overloaded function.</p>
<p>The <a href="qvariant.html">QVariant</a> objects in <i>vars</i> are updated when the method has out-parameters.</p>
<!-- @@@querySubObject -->
<!-- $$$setPropertyBag[overload1]$$$setPropertyBagconstPropertyBag& -->
<h3 class="fn"><a name="setPropertyBag"></a><span class="type">void</span> QAxBase::<span class="name">setPropertyBag</span> ( const <span class="type"><a href="qaxbase.html#PropertyBag-typedef">PropertyBag</a></span> & <i>bag</i> )</h3>
<p>Sets the properties of the COM object to the corresponding values in <i>bag</i>.</p>
<p><b>Warning:</b> You should only set property bags that have been returned by the propertyBag function, as it cannot be guaranteed that the property bag implementation of the COM object supports the same properties that are available through the IDispatch interface.</p>
<p><b>See also </b><a href="qaxbase.html#propertyBag">propertyBag</a>().</p>
<!-- @@@setPropertyBag -->
<!-- $$$setPropertyWritable[overload1]$$$setPropertyWritableconstchar*bool -->
<h3 class="fn"><a name="setPropertyWritable"></a><span class="type">void</span> QAxBase::<span class="name">setPropertyWritable</span> ( const <span class="type">char</span> * <i>prop</i>, <span class="type">bool</span> <i>ok</i> )<tt> [virtual]</tt></h3>
<p>Sets the property <i>prop</i> to writable if <i>ok</i> is true, otherwise sets <i>prop</i> to be read-only. By default, all properties are writable.</p>
<p><b>Warning:</b> Depending on the control implementation this setting might be ignored for some properties.</p>
<p><b>See also </b><a href="qaxbase.html#propertyWritable">propertyWritable</a>() and <a href="qaxbase.html#propertyChanged">propertyChanged</a>().</p>
<!-- @@@setPropertyWritable -->
<!-- $$$signal[overload1]$$$signalconstQString&intvoid* -->
<h3 class="fn"><a name="signal"></a><span class="type">void</span> QAxBase::<span class="name">signal</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, <span class="type">int</span> <i>argc</i>, <span class="type">void</span> * <i>argv</i> )<tt> [signal]</tt></h3>
<p>This generic signal gets emitted when the COM object issues the event <i>name</i>. <i>argc</i> is the number of parameters provided by the event (DISPPARAMS.cArgs), and <i>argv</i> is the pointer to the parameter values (DISPPARAMS.rgvarg). Note that the order of parameter values is turned around, ie. the last element of the array is the first parameter in the function.</p>
<pre class="cpp"> <span class="type">void</span> Receiver<span class="operator">::</span>slot(<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&</span>name<span class="operator">,</span> <span class="type">int</span> argc<span class="operator">,</span> <span class="type">void</span> <span class="operator">*</span>argv)
{
VARIANTARG <span class="operator">*</span>params <span class="operator">=</span> (VARIANTARG<span class="operator">*</span>)argv;
<span class="keyword">if</span> (name<span class="operator">.</span>startsWith(<span class="string">"BeforeNavigate2("</span>)) {
IDispatch <span class="operator">*</span>pDisp <span class="operator">=</span> params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">1</span><span class="operator">]</span><span class="operator">.</span>pdispVal;
VARIANTARG URL <span class="operator">=</span> <span class="operator">*</span>params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">2</span><span class="operator">]</span><span class="operator">.</span>pvarVal;
VARIANTARG Flags <span class="operator">=</span> <span class="operator">*</span>params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">3</span><span class="operator">]</span><span class="operator">.</span>pvarVal;
VARIANTARG TargetFrameName <span class="operator">=</span> <span class="operator">*</span>params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">4</span><span class="operator">]</span><span class="operator">.</span>pvarVal;
VARIANTARG PostData <span class="operator">=</span> <span class="operator">*</span>params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">5</span><span class="operator">]</span><span class="operator">.</span>pvarVal;
VARIANTARG Headers <span class="operator">=</span> <span class="operator">*</span>params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">6</span><span class="operator">]</span><span class="operator">.</span>pvarVal;
<span class="type">bool</span> <span class="operator">*</span>Cancel <span class="operator">=</span> params<span class="operator">[</span>argc<span class="operator">-</span><span class="number">7</span><span class="operator">]</span><span class="operator">.</span>pboolVal;
}
}</pre>
<p>Use this signal if the event has parameters of unsupported data types. Otherwise, connect directly to the signal <i>name</i>.</p>
<!-- @@@signal -->
<!-- $$$verbs[overload1]$$$verbs -->
<h3 class="fn"><a name="verbs"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QAxBase::<span class="name">verbs</span> () const</h3>
<p>Returns the list of verbs that the COM object can execute. If the object does not implement IOleObject, or does not support any verbs, then this function returns an empty stringlist.</p>
<p>Note that the OLE default verbs (OLEIVERB_SHOW etc) are not included in the list.</p>
<p>This function was introduced in Qt 4.1.</p>
<!-- @@@verbs -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
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.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|