<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qobject.cpp --> <title>Obsolete Members for QObject | Qt Core 5.12.6</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 >Qt 5.12</td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QObject</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtcore-index.html">Qt 5.12.6 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Obsolete Members for QObject</h1> <p><b>The following members of class <a href="qobject.html">QObject</a> are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p> <h2>Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#dumpObjectInfo-1">dumpObjectInfo</a></b>()</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#dumpObjectTree-1">dumpObjectTree</a></b>()</td></tr> </table></div> <h2>Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QString </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#trUtf8">trUtf8</a></b>(const char *<i>sourceText</i>, const char *<i>disambiguation</i> = Q_OBJECT, int <i>n</i> = Q_OBJECT)</td></tr> </table></div> <h2>Related Non-Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>T </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#qFindChild">qFindChild</a></b>(const QObject *<i>obj</i>, const QString &<i>name</i> = QString())</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>QList<T> </td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#qFindChildren">qFindChildren</a></b>(const QObject *<i>obj</i>, const QString &<i>name</i> = QString())</td></tr> </table></div> <h2>Macros</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code></td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#Q_ENUMS">Q_ENUMS</a></b>(<i> ...</i>)</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code></td><td class="memItemRight bottomAlign"><b><a href="qobject-obsolete.html#Q_FLAGS">Q_FLAGS</a></b>(<i> ...</i>)</td></tr> </table></div> <h2>Member Function Documentation</h2> <!-- $$$dumpObjectInfo$$$dumpObjectInfo --> <h3 class="fn" id="dumpObjectInfo-1"><a name="dumpObjectInfo-1"></a><span class="type">void</span> QObject::<span class="name">dumpObjectInfo</span>()</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This is an overloaded function.</p> <p>Dumps information about signal connections, etc. for this object to the debug output.</p> <p><b>See also </b><a href="qobject.html#dumpObjectTree">dumpObjectTree</a>().</p> <!-- @@@dumpObjectInfo --> <!-- $$$dumpObjectTree$$$dumpObjectTree --> <h3 class="fn" id="dumpObjectTree-1"><a name="dumpObjectTree-1"></a><span class="type">void</span> QObject::<span class="name">dumpObjectTree</span>()</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This is an overloaded function.</p> <p>Dumps a tree of children to the debug output.</p> <p><b>See also </b><a href="qobject.html#dumpObjectInfo">dumpObjectInfo</a>().</p> <!-- @@@dumpObjectTree --> <!-- $$$trUtf8[overload1]$$$trUtf8constchar*constchar*int --> <h3 class="fn" id="trUtf8"><a name="trUtf8"></a><code>[static] </code><span class="type"><a href="qstring.html">QString</a></span> QObject::<span class="name">trUtf8</span>(const <span class="type">char</span> *<i>sourceText</i>, const <span class="type">char</span> *<i>disambiguation</i> = Q_OBJECT, <span class="type">int</span> <i>n</i> = Q_OBJECT)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>Returns a translated version of <i>sourceText</i>, or <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(<i>sourceText</i>) if there is no appropriate version. It is otherwise identical to tr(<i>sourceText</i>, <i>disambiguation</i>, <i>n</i>).</p> <p><b>Warning:</b> This method is reentrant only if all translators are installed <i>before</i> calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior.</p> <p><b>Warning:</b> For portability reasons, we recommend that you use escape sequences for specifying non-ASCII characters in string literals to trUtf8(). For example:</p> <pre class="cpp"> label<span class="operator">-</span><span class="operator">></span>setText(tr(<span class="string">"F\374r \310lise"</span>)); </pre> <p><b>See also </b><a href="qobject.html#tr">tr</a>(), <a href="qcoreapplication.html#translate">QCoreApplication::translate</a>(), and Internationalization with Qt.</p> <!-- @@@trUtf8 --> <h2>Related Non-Members</h2> <!-- $$$qFindChild[overload1]$$$qFindChildconstQObject*constQString& --> <h3 class="fn" id="qFindChild"><a name="qFindChild"></a><span class="type">T</span> <span class="name">qFindChild</span>(const <span class="type"><a href="qobject.html#QObject">QObject</a></span> *<i>obj</i>, const <span class="type"><a href="qstring.html">QString</a></span> &<i>name</i> = QString())</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This function overloads <a href="qobject.html#qFindChildren">qFindChildren</a>().</p> <p>This function is equivalent to <i>obj</i>-><a href="qobject.html#findChild">findChild</a><T>(<i>name</i>).</p> <p><b>Note: </b>This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.</p><p><b>See also </b><a href="qobject.html#findChild">QObject::findChild</a>().</p> <!-- @@@qFindChild --> <!-- $$$qFindChildren[overload1]$$$qFindChildrenconstQObject*constQString& --> <h3 class="fn" id="qFindChildren"><a name="qFindChildren"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type">T</span>> <span class="name">qFindChildren</span>(const <span class="type"><a href="qobject.html#QObject">QObject</a></span> *<i>obj</i>, const <span class="type"><a href="qstring.html">QString</a></span> &<i>name</i> = QString())</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This function overloads <a href="qobject.html#qFindChildren">qFindChildren</a>().</p> <p>This function is equivalent to <i>obj</i>-><a href="qobject.html#findChildren">findChildren</a><T>(<i>name</i>).</p> <p><b>Note: </b>This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.</p><p><b>See also </b><a href="qobject.html#findChildren">QObject::findChildren</a>().</p> <!-- @@@qFindChildren --> <h2>Macro Documentation</h2> <!-- $$$Q_ENUMS[overload1]$$$Q_ENUMS... --> <h3 class="fn" id="Q_ENUMS"><a name="Q_ENUMS"></a><span class="name">Q_ENUMS</span>(<i> ...</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This macro registers one or several enum types to the meta-object system.</p> <p>For example:</p> <pre class="cpp"> <span class="keyword">class</span> MyClass : <span class="keyword">public</span> <span class="type"><a href="qobject.html">QObject</a></span> { Q_OBJECT <span class="keyword">public</span>: MyClass(<span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>parent <span class="operator">=</span> <span class="number">0</span>); <span class="operator">~</span>MyClass(); <span class="keyword">enum</span> Priority { High<span class="operator">,</span> Low<span class="operator">,</span> VeryHigh<span class="operator">,</span> VeryLow }; Q_ENUM(Priority) <span class="type">void</span> setPriority(Priority priority); Priority priority() <span class="keyword">const</span>; }; </pre> <p>If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class defining it. In addition, the class <i>defining</i> the enum has to inherit <a href="qobject.html">QObject</a> as well as declare the enum using Q_ENUMS().</p> <p>In new code, you should prefer the use of the <a href="qobject.html#Q_ENUM">Q_ENUM</a>() macro, which makes the type available also to the meta type system. For instance, <a href="qmetaenum.html#fromType">QMetaEnum::fromType</a>() will not work with types declared with Q_ENUMS().</p> <p><b>See also </b><a href="properties.html">Qt's Property System</a>.</p> <!-- @@@Q_ENUMS --> <!-- $$$Q_FLAGS[overload1]$$$Q_FLAGS... --> <h3 class="fn" id="Q_FLAGS"><a name="Q_FLAGS"></a><span class="name">Q_FLAGS</span>(<i> ...</i>)</h3> <p>This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.</p> <p>This macro registers one or several <a href="qflags.html">flags types</a> with the meta-object system. It is typically used in a class definition to declare that values of a given enum can be used as flags and combined using the bitwise OR operator.</p> <p><b>Note: </b>This macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use <a href="qobject-obsolete.html#Q_ENUMS">Q_ENUMS</a>() in addition to this macro.</p><p>In new code, you should prefer the use of the <a href="qobject.html#Q_FLAG">Q_FLAG</a>() macro, which makes the type available also to the meta type system.</p> <p><b>See also </b><a href="properties.html">Qt's Property System</a>.</p> <!-- @@@Q_FLAGS --> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 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>