<?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" /> <!-- qglobal.cpp --> <title>Qt 4.8: QFlags Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <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="qtcore.html">QtCore</a></li> <li>QFlags</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></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="#public-functions">Public Functions</a></li> <li class="level1"><a href="#macros">Macros</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> <li class="level2"><a href="#flags-and-the-meta-object-system">Flags and the Meta-Object System</a></li> <li class="level2"><a href="#naming-convention">Naming Convention</a></li> </ul> </div> <h1 class="title">QFlags Class Reference</h1> <!-- $$$QFlags-brief --> <p>The QFlags class provides a type-safe way of storing OR-combinations of enum values. <a href="#details">More...</a></p> <!-- @@@QFlags --> <pre class="cpp"> <span class="preprocessor">#include <QFlags></span></pre><ul> <li><a href="qflags-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="qflags.html#enum_type-typedef">enum_type</a></b></td></tr> </table> <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="qflags.html#QFlags">QFlags</a></b> ( const QFlags & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#QFlags-2">QFlags</a></b> ( Enum <i>flag</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#QFlags-3">QFlags</a></b> ( Zero <i>zero</i> = 0 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#QFlags-4">QFlags</a></b> ( QFlag <i>value</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#testFlag">testFlag</a></b> ( Enum <i>flag</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-int">operator int</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-not">operator!</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-and">operator&</a></b> ( int <i>mask</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-and-2">operator&</a></b> ( uint <i>mask</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-and-3">operator&</a></b> ( Enum <i>mask</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-and-eq">operator&=</a></b> ( int <i>mask</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-and-eq-2">operator&=</a></b> ( uint <i>mask</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-eq">operator=</a></b> ( const QFlags & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-5e">operator^</a></b> ( QFlags <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-5e-2">operator^</a></b> ( Enum <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-5e-eq">operator^=</a></b> ( QFlags <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-5e-eq-2">operator^=</a></b> ( Enum <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-7c">operator|</a></b> ( QFlags <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-7c-2">operator|</a></b> ( Enum <i>other</i> ) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-7c-eq">operator|=</a></b> ( QFlags <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags & </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-7c-eq-2">operator|=</a></b> ( Enum <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QFlags </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#operator-7e">operator~</a></b> () const</td></tr> </table> <a name="macros"></a> <h2>Macros</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#Q_DECLARE_FLAGS">Q_DECLARE_FLAGS</a></b> ( <i>Flags</i>, <i>Enum</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qflags.html#Q_DECLARE_OPERATORS_FOR_FLAGS">Q_DECLARE_OPERATORS_FOR_FLAGS</a></b> ( <i>Flags</i> )</td></tr> </table> <a name="details"></a> <!-- $$$QFlags-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QFlags class provides a type-safe way of storing OR-combinations of enum values.</p> <p>The QFlags<Enum> class is a template class, where Enum is an enum type. QFlags is used throughout Qt for storing combinations of enum values.</p> <p>The traditional C++ approach for storing OR-combinations of enum values is to use an <tt>int</tt> or <tt>uint</tt> variable. The inconvenience with this approach is that there's no type checking at all; any enum value can be OR'd with any other enum value and passed on to a function that takes an <tt>int</tt> or <tt>uint</tt>.</p> <p>Qt uses QFlags to provide type safety. For example, the <a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a> type is simply a typedef for QFlags<<a href="qt.html#AlignmentFlag-enum">Qt::AlignmentFlag</a>>. <a href="qlabel.html#alignment-prop">QLabel::setAlignment</a>() takes a <a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a> parameter, which means that any combination of <a href="qt.html#AlignmentFlag-enum">Qt::AlignmentFlag</a> values,or 0, is legal:</p> <pre class="cpp"> label<span class="operator">-</span><span class="operator">></span>setAlignment(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AlignLeft <span class="operator">|</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>AlignTop);</pre> <p>If you try to pass a value from another enum or just a plain integer other than 0, the compiler will report an error. If you need to cast integer values to flags in a untyped fashion, you can use the explicit QFlags constructor as cast operator.</p> <p>If you want to use QFlags for your own enum types, use the <a href="qflags.html#Q_DECLARE_FLAGS">Q_DECLARE_FLAGS</a>() and <a href="qflags.html#Q_DECLARE_OPERATORS_FOR_FLAGS">Q_DECLARE_OPERATORS_FOR_FLAGS</a>().</p> <p>Example:</p> <pre class="cpp"> <span class="keyword">class</span> MyClass { <span class="keyword">public</span>: <span class="keyword">enum</span> Option { NoOptions <span class="operator">=</span> <span class="number">0x0</span><span class="operator">,</span> ShowTabs <span class="operator">=</span> <span class="number">0x1</span><span class="operator">,</span> ShowAll <span class="operator">=</span> <span class="number">0x2</span><span class="operator">,</span> SqueezeBlank <span class="operator">=</span> <span class="number">0x4</span> }; Q_DECLARE_FLAGS(Options<span class="operator">,</span> Option) <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> }; <a href="qflags.html#Q_DECLARE_OPERATORS_FOR_FLAGS">Q_DECLARE_OPERATORS_FOR_FLAGS</a>(MyClass<span class="operator">::</span>Options)</pre> <p>You can then use the <tt>MyClass::Options</tt> type to store combinations of <tt>MyClass::Option</tt> values.</p> <a name="flags-and-the-meta-object-system"></a> <h3>Flags and the Meta-Object System</h3> <p>The <a href="qflags.html#Q_DECLARE_FLAGS">Q_DECLARE_FLAGS</a>() macro does not expose the flags to the meta-object system, so they cannot be used by Qt Script or edited in Qt Designer. To make the flags available for these purposes, the <a href="qobject.html#Q_FLAGS">Q_FLAGS</a>() macro must be used:</p> <pre class="cpp"> <a href="qobject.html#Q_FLAGS">Q_FLAGS</a>(Options)</pre> <a name="naming-convention"></a> <h3>Naming Convention</h3> <p>A sensible naming convention for enum types and associated QFlags types is to give a singular name to the enum type (e.g., <tt>Option</tt>) and a plural name to the QFlags type (e.g., <tt>Options</tt>). When a singular name is desired for the QFlags type (e.g., <tt>Alignment</tt>), you can use <tt>Flag</tt> as the suffix for the enum type (e.g., <tt>AlignmentFlag</tt>).</p> </div> <p><b>See also </b><a href="qflag.html">QFlag</a>.</p> <!-- @@@QFlags --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$enum_type --> <h3 class="fn"><a name="enum_type-typedef"></a>typedef QFlags::<span class="name">enum_type</span></h3> <p>Typedef for the Enum template type.</p> <!-- @@@enum_type --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QFlags[overload1]$$$QFlagsconstQFlags& --> <h3 class="fn"><a name="QFlags"></a>QFlags::<span class="name">QFlags</span> ( const <span class="type">QFlags</span> & <i>other</i> )</h3> <p>Constructs a copy of <i>other</i>.</p> <!-- @@@QFlags --> <!-- $$$QFlags$$$QFlagsEnum --> <h3 class="fn"><a name="QFlags-2"></a>QFlags::<span class="name">QFlags</span> ( <span class="type">Enum</span> <i>flag</i> )</h3> <p>Constructs a <a href="qflags.html">QFlags</a> object storing the given <i>flag</i>.</p> <!-- @@@QFlags --> <!-- $$$QFlags$$$QFlagsZero --> <h3 class="fn"><a name="QFlags-3"></a>QFlags::<span class="name">QFlags</span> ( <span class="type">Zero</span> <i>zero</i> = 0 )</h3> <p>Constructs a <a href="qflags.html">QFlags</a> object with no flags set. <i>zero</i> must be a literal 0 value.</p> <!-- @@@QFlags --> <!-- $$$QFlags$$$QFlagsQFlag --> <h3 class="fn"><a name="QFlags-4"></a>QFlags::<span class="name">QFlags</span> ( <span class="type"><a href="qflag.html">QFlag</a></span> <i>value</i> )</h3> <p>Constructs a <a href="qflags.html">QFlags</a> object initialized with the given integer <i>value</i>.</p> <p>The <a href="qflag.html">QFlag</a> type is a helper type. By using it here instead of <tt>int</tt>, we effectively ensure that arbitrary enum values cannot be cast to a <a href="qflags.html">QFlags</a>, whereas untyped enum values (i.e., <tt>int</tt> values) can.</p> <!-- @@@QFlags --> <!-- $$$testFlag[overload1]$$$testFlagEnum --> <h3 class="fn"><a name="testFlag"></a><span class="type">bool</span> QFlags::<span class="name">testFlag</span> ( <span class="type">Enum</span> <i>flag</i> ) const</h3> <p>Returns true if the <i>flag</i> is set, otherwise false.</p> <p>This function was introduced in Qt 4.2.</p> <!-- @@@testFlag --> <!-- $$$operator int[overload1]$$$operator int --> <h3 class="fn"><a name="operator-int"></a>QFlags::<span class="name">operator int</span> () const</h3> <p>Returns the value stored in the <a href="qflags.html">QFlags</a> object as an integer.</p> <!-- @@@operator int --> <!-- $$$operator![overload1]$$$operator! --> <h3 class="fn"><a name="operator-not"></a><span class="type">bool</span> QFlags::<span class="name">operator!</span> () const</h3> <p>Returns true if no flag is set (i.e., if the value stored by the <a href="qflags.html">QFlags</a> object is 0); otherwise returns false.</p> <!-- @@@operator! --> <!-- $$$operator&[overload1]$$$operator&int --> <h3 class="fn"><a name="operator-and"></a><span class="type">QFlags</span> QFlags::<span class="name">operator&</span> ( <span class="type">int</span> <i>mask</i> ) const</h3> <p>Returns a <a href="qflags.html">QFlags</a> object containing the result of the bitwise AND operation on this object and <i>mask</i>.</p> <p><b>See also </b><a href="qflags.html#operator-and-eq">operator&=</a>(), <a href="qflags.html#operator-7c">operator|</a>(), <a href="qflags.html#operator-5e">operator^</a>(), and <a href="qflags.html#operator-7e">operator~</a>().</p> <!-- @@@operator& --> <!-- $$$operator&$$$operator&uint --> <h3 class="fn"><a name="operator-and-2"></a><span class="type">QFlags</span> QFlags::<span class="name">operator&</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>mask</i> ) const</h3> <p>This is an overloaded function.</p> <!-- @@@operator& --> <!-- $$$operator&$$$operator&Enum --> <h3 class="fn"><a name="operator-and-3"></a><span class="type">QFlags</span> QFlags::<span class="name">operator&</span> ( <span class="type">Enum</span> <i>mask</i> ) const</h3> <p>This is an overloaded function.</p> <!-- @@@operator& --> <!-- $$$operator&=[overload1]$$$operator&=int --> <h3 class="fn"><a name="operator-and-eq"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator&=</span> ( <span class="type">int</span> <i>mask</i> )</h3> <p>Performs a bitwise AND operation with <i>mask</i> and stores the result in this <a href="qflags.html">QFlags</a> object. Returns a reference to this object.</p> <p><b>See also </b><a href="qflags.html#operator-and">operator&</a>(), <a href="qflags.html#operator-7c-eq">operator|=</a>(), and <a href="qflags.html#operator-5e-eq">operator^=</a>().</p> <!-- @@@operator&= --> <!-- $$$operator&=$$$operator&=uint --> <h3 class="fn"><a name="operator-and-eq-2"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator&=</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>mask</i> )</h3> <p>This is an overloaded function.</p> <!-- @@@operator&= --> <!-- $$$operator=[overload1]$$$operator=constQFlags& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator=</span> ( const <span class="type">QFlags</span> & <i>other</i> )</h3> <p>Assigns <i>other</i> to this object and returns a reference to this object.</p> <!-- @@@operator= --> <!-- $$$operator^[overload1]$$$operator^QFlags --> <h3 class="fn"><a name="operator-5e"></a><span class="type">QFlags</span> QFlags::<span class="name">operator^</span> ( <span class="type">QFlags</span> <i>other</i> ) const</h3> <p>Returns a <a href="qflags.html">QFlags</a> object containing the result of the bitwise XOR operation on this object and <i>other</i>.</p> <p><b>See also </b><a href="qflags.html#operator-5e-eq">operator^=</a>(), <a href="qflags.html#operator-and">operator&</a>(), <a href="qflags.html#operator-7c">operator|</a>(), and <a href="qflags.html#operator-7e">operator~</a>().</p> <!-- @@@operator^ --> <!-- $$$operator^$$$operator^Enum --> <h3 class="fn"><a name="operator-5e-2"></a><span class="type">QFlags</span> QFlags::<span class="name">operator^</span> ( <span class="type">Enum</span> <i>other</i> ) const</h3> <p>This is an overloaded function.</p> <!-- @@@operator^ --> <!-- $$$operator^=[overload1]$$$operator^=QFlags --> <h3 class="fn"><a name="operator-5e-eq"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator^=</span> ( <span class="type">QFlags</span> <i>other</i> )</h3> <p>Performs a bitwise XOR operation with <i>other</i> and stores the result in this <a href="qflags.html">QFlags</a> object. Returns a reference to this object.</p> <p><b>See also </b><a href="qflags.html#operator-5e">operator^</a>(), <a href="qflags.html#operator-and-eq">operator&=</a>(), and <a href="qflags.html#operator-7c-eq">operator|=</a>().</p> <!-- @@@operator^= --> <!-- $$$operator^=$$$operator^=Enum --> <h3 class="fn"><a name="operator-5e-eq-2"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator^=</span> ( <span class="type">Enum</span> <i>other</i> )</h3> <p>This is an overloaded function.</p> <!-- @@@operator^= --> <!-- $$$operator|[overload1]$$$operator|QFlags --> <h3 class="fn"><a name="operator-7c"></a><span class="type">QFlags</span> QFlags::<span class="name">operator|</span> ( <span class="type">QFlags</span> <i>other</i> ) const</h3> <p>Returns a <a href="qflags.html">QFlags</a> object containing the result of the bitwise OR operation on this object and <i>other</i>.</p> <p><b>See also </b><a href="qflags.html#operator-7c-eq">operator|=</a>(), <a href="qflags.html#operator-5e">operator^</a>(), <a href="qflags.html#operator-and">operator&</a>(), and <a href="qflags.html#operator-7e">operator~</a>().</p> <!-- @@@operator| --> <!-- $$$operator|$$$operator|Enum --> <h3 class="fn"><a name="operator-7c-2"></a><span class="type">QFlags</span> QFlags::<span class="name">operator|</span> ( <span class="type">Enum</span> <i>other</i> ) const</h3> <p>This is an overloaded function.</p> <!-- @@@operator| --> <!-- $$$operator|=[overload1]$$$operator|=QFlags --> <h3 class="fn"><a name="operator-7c-eq"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator|=</span> ( <span class="type">QFlags</span> <i>other</i> )</h3> <p>Performs a bitwise OR operation with <i>other</i> and stores the result in this <a href="qflags.html">QFlags</a> object. Returns a reference to this object.</p> <p><b>See also </b><a href="qflags.html#operator-7c">operator|</a>(), <a href="qflags.html#operator-and-eq">operator&=</a>(), and <a href="qflags.html#operator-5e-eq">operator^=</a>().</p> <!-- @@@operator|= --> <!-- $$$operator|=$$$operator|=Enum --> <h3 class="fn"><a name="operator-7c-eq-2"></a><span class="type">QFlags</span> & QFlags::<span class="name">operator|=</span> ( <span class="type">Enum</span> <i>other</i> )</h3> <p>This is an overloaded function.</p> <!-- @@@operator|= --> <!-- $$$operator~[overload1]$$$operator~ --> <h3 class="fn"><a name="operator-7e"></a><span class="type">QFlags</span> QFlags::<span class="name">operator~</span> () const</h3> <p>Returns a <a href="qflags.html">QFlags</a> object that contains the bitwise negation of this object.</p> <p><b>See also </b><a href="qflags.html#operator-and">operator&</a>(), <a href="qflags.html#operator-7c">operator|</a>(), and <a href="qflags.html#operator-5e">operator^</a>().</p> <!-- @@@operator~ --> </div> <div class="macros"> <h2>Macro Documentation</h2> <!-- $$$Q_DECLARE_FLAGS[overload1]$$$Q_DECLARE_FLAGS --> <h3 class="fn"><a name="Q_DECLARE_FLAGS"></a><span class="name">Q_DECLARE_FLAGS</span> ( <i>Flags</i>, <i>Enum</i> )</h3> <p>The Q_DECLARE_FLAGS() macro expands to</p> <pre class="cpp"> <span class="keyword">typedef</span> <span class="type"><a href="qflags.html">QFlags</a></span><span class="operator"><</span>Enum<span class="operator">></span> Flags;</pre> <p><i>Enum</i> is the name of an existing enum type, whereas <i>Flags</i> is the name of the <a href="qflags.html">QFlags</a><<i>Enum</i>> typedef.</p> <p>See the <a href="qflags.html">QFlags</a> documentation for details.</p> <p><b>See also </b><a href="qflags.html#Q_DECLARE_OPERATORS_FOR_FLAGS">Q_DECLARE_OPERATORS_FOR_FLAGS</a>().</p> <!-- @@@Q_DECLARE_FLAGS --> <!-- $$$Q_DECLARE_OPERATORS_FOR_FLAGS[overload1]$$$Q_DECLARE_OPERATORS_FOR_FLAGS --> <h3 class="fn"><a name="Q_DECLARE_OPERATORS_FOR_FLAGS"></a><span class="name">Q_DECLARE_OPERATORS_FOR_FLAGS</span> ( <i>Flags</i> )</h3> <p>The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global <tt>operator|()</tt> functions for <i>Flags</i>, which is of type <a href="qflags.html">QFlags</a><T>.</p> <p>See the <a href="qflags.html">QFlags</a> documentation for details.</p> <p><b>See also </b><a href="qflags.html#Q_DECLARE_FLAGS">Q_DECLARE_FLAGS</a>().</p> <!-- @@@Q_DECLARE_OPERATORS_FOR_FLAGS --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc 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> Digia, Qt and their respective logos are trademarks of Digia Plc 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> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>