Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3543

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qstyleoption.cpp -->
  <title>QStyleOptionMenuItem Class | Qt Widgets 5.9</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.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QStyleOptionMenuItem</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-variables">Public Variables</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QStyleOptionMenuItem Class</h1>
<!-- $$$QStyleOptionMenuItem-brief -->
<p>The <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a> class is used to describe the parameter necessary for drawing a menu item. <a href="#details">More...</a></p>
<!-- @@@QStyleOptionMenuItem -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QStyleOptionMenuItem&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qstyleoption.html">QStyleOption</a></td></tr></table></div><ul>
<li><a href="qstyleoptionmenuitem-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a></b> { NotCheckable, Exclusive, NonExclusive }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a></b> { Normal, DefaultItem, Separator, SubMenu, ..., EmptyArea }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem">QStyleOptionMenuItem</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem-1">QStyleOptionMenuItem</a></b>(const QStyleOptionMenuItem &amp;<i>other</i>)</td></tr>
</table></div>
<ul>
<li class="fn">2 public functions inherited from <a href="qstyleoption.html#public-functions">QStyleOption</a></li>
</ul>
<a name="public-variables"></a>
<h2 id="public-variables">Public Variables</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> CheckType </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#checkType-var">checkType</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#checked-var">checked</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#font-var">font</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QIcon </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#icon-var">icon</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#maxIconWidth-var">maxIconWidth</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#menuHasCheckableItems-var">menuHasCheckableItems</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> MenuItemType </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#menuItemType-var">menuItemType</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#menuRect-var">menuRect</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#tabWidth-var">tabWidth</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qstyleoptionmenuitem.html#text-var">text</a></b></td></tr>
</table></div>
<ul>
<li class="fn">8 public variables inherited from <a href="qstyleoption.html#public-variables">QStyleOption</a></li>
</ul>
<a name="details"></a>
<!-- $$$QStyleOptionMenuItem-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a> class is used to describe the parameter necessary for drawing a menu item.</p>
<p><a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a> contains all the information that <a href="qstyle.html">QStyle</a> functions need to draw the menu items from <a href="qmenu.html">QMenu</a>. It is also used for drawing other menu-related widgets.</p>
<p>For performance reasons, the access to the member variables is direct (i.e&#x2e;, using the <code>.</code> or <code>-&gt;</code> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.</p>
<p>For an example demonstrating how style options can be used, see the <a href="qtwidgets-widgets-styles-example.html">Styles</a> example.</p>
</div>
<p><b>See also </b><a href="qstyleoption.html">QStyleOption</a>.</p>
<!-- @@@QStyleOptionMenuItem -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$CheckType$$$NotCheckable$$$Exclusive$$$NonExclusive -->
<h3 class="fn" id="CheckType-enum"><a name="CheckType-enum"></a>enum QStyleOptionMenuItem::<span class="name">CheckType</span></h3>
<p>This enum is used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::NotCheckable</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The item is not checkable.</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Exclusive</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The item is an exclusive check item (like a radio button).</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::NonExclusive</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The item is a non-exclusive check item (like a check box).</td></tr>
</table></div>
<p><b>See also </b><a href="qstyleoptionmenuitem.html#checkType-var">checkType</a>, <a href="qaction.html#checkable-prop">QAction::checkable</a>, <a href="qaction.html#checked-prop">QAction::checked</a>, and <a href="qactiongroup.html#exclusive-prop">QActionGroup::exclusive</a>.</p>
<!-- @@@CheckType -->
<!-- $$$MenuItemType$$$Normal$$$DefaultItem$$$Separator$$$SubMenu$$$Scroller$$$TearOff$$$Margin$$$EmptyArea -->
<h3 class="fn" id="MenuItemType-enum"><a name="MenuItemType-enum"></a>enum QStyleOptionMenuItem::<span class="name">MenuItemType</span></h3>
<p>This enum indicates the type of menu item that the structure describes.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Normal</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">A normal menu item.</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::DefaultItem</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">A menu item that is the default action as specified with <a href="qmenu.html#defaultAction">QMenu::defaultAction</a>().</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Separator</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">A menu separator.</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::SubMenu</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Indicates the menu item points to a sub-menu.</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Scroller</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">A popup menu scroller (currently only used on macOS).</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::TearOff</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">A tear-off handle for the menu.</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Margin</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The margin of the menu.</td></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::EmptyArea</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">The empty area of the menu.</td></tr>
</table></div>
<p><b>See also </b><a href="qstyleoptionmenuitem.html#menuItemType-var">menuItemType</a>.</p>
<!-- @@@MenuItemType -->
<!-- $$$StyleOptionType$$$Type -->
<h3 class="fn" id="StyleOptionType-enum"><a name="StyleOptionType-enum"></a>enum QStyleOptionMenuItem::<span class="name">StyleOptionType</span></h3>
<p>This enum is used to hold information about the type of the style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Type</code></td><td class="topAlign tblval"><code>SO_MenuItem</code></td><td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_MenuItem</a> for this class).</td></tr>
</table></div>
<p>The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to determine the type of style option. In general you do not need to worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own styles.</p>
<p><b>See also </b><a href="qstyleoptionmenuitem.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>
<!-- @@@StyleOptionType -->
<!-- $$$StyleOptionVersion$$$Version -->
<h3 class="fn" id="StyleOptionVersion-enum"><a name="StyleOptionVersion-enum"></a>enum QStyleOptionMenuItem::<span class="name">StyleOptionVersion</span></h3>
<p>This enum is used to hold information about the version of the style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QStyleOptionMenuItem::Version</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">1</td></tr>
</table></div>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you normally do not need to check it.</p>
<p><b>See also </b><a href="qstyleoptionmenuitem.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<!-- @@@StyleOptionVersion -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QStyleOptionMenuItem[overload1]$$$QStyleOptionMenuItem -->
<h3 class="fn" id="QStyleOptionMenuItem"><a name="QStyleOptionMenuItem"></a>QStyleOptionMenuItem::<span class="name">QStyleOptionMenuItem</span>()</h3>
<p>Constructs a <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a>, initializing the members variables to their default values.</p>
<!-- @@@QStyleOptionMenuItem -->
<!-- $$$QStyleOptionMenuItem$$$QStyleOptionMenuItemconstQStyleOptionMenuItem& -->
<h3 class="fn" id="QStyleOptionMenuItem-1"><a name="QStyleOptionMenuItem-1"></a>QStyleOptionMenuItem::<span class="name">QStyleOptionMenuItem</span>(const <span class="type"><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem">QStyleOptionMenuItem</a></span> &amp;<i>other</i>)</h3>
<p>Constructs a copy of the <i>other</i> style option.</p>
<!-- @@@QStyleOptionMenuItem -->
</div>
<div class="vars">
<h2>Member Variable Documentation</h2>
<!-- $$$checkType -->
<h3 class="fn" id="checkType-var"><a name="checkType-var"></a><span class="type"><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a></span> QStyleOptionMenuItem::<span class="name">checkType</span></h3>
<p>This variable holds the type of checkmark of the menu item</p>
<p>The default value is <a href="qstyleoptionmenuitem.html#CheckType-enum">NotCheckable</a>.</p>
<p><b>See also </b><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a>.</p>
<!-- @@@checkType -->
<!-- $$$checked -->
<h3 class="fn" id="checked-var"><a name="checked-var"></a><span class="type">bool</span> QStyleOptionMenuItem::<span class="name">checked</span></h3>
<p>This variable holds whether the menu item is checked or not</p>
<p>The default value is false.</p>
<!-- @@@checked -->
<!-- $$$font -->
<h3 class="fn" id="font-var"><a name="font-var"></a><span class="type"><a href="../qtgui/qfont.html">QFont</a></span> QStyleOptionMenuItem::<span class="name">font</span></h3>
<p>This variable holds the font used for the menu item text</p>
<p>This is the font that should be used for drawing the menu text minus the shortcut. The shortcut is usually drawn using the painter's font. By default, the application's default font is used.</p>
<!-- @@@font -->
<!-- $$$icon -->
<h3 class="fn" id="icon-var"><a name="icon-var"></a><span class="type"><a href="../qtgui/qicon.html">QIcon</a></span> QStyleOptionMenuItem::<span class="name">icon</span></h3>
<p>This variable holds the icon for the menu item</p>
<p>The default value is an empty icon, i.e&#x2e; an icon with neither a pixmap nor a filename.</p>
<!-- @@@icon -->
<!-- $$$maxIconWidth -->
<h3 class="fn" id="maxIconWidth-var"><a name="maxIconWidth-var"></a><span class="type">int</span> QStyleOptionMenuItem::<span class="name">maxIconWidth</span></h3>
<p>This variable holds the maximum icon width for the icon in the menu item</p>
<p>This can be used for drawing the icon into the correct place or properly aligning items. The variable must be set regardless of whether or not the menu item has an icon. The default value is 0.</p>
<!-- @@@maxIconWidth -->
<!-- $$$menuHasCheckableItems -->
<h3 class="fn" id="menuHasCheckableItems-var"><a name="menuHasCheckableItems-var"></a><span class="type">bool</span> QStyleOptionMenuItem::<span class="name">menuHasCheckableItems</span></h3>
<p>This variable holds whether the menu as a whole has checkable items or not</p>
<p>The default value is true.</p>
<p>If this option is set to false, then the menu has no checkable items. This makes it possible for GUI styles to save some horizontal space that would normally be used for the check column.</p>
<!-- @@@menuHasCheckableItems -->
<!-- $$$menuItemType -->
<h3 class="fn" id="menuItemType-var"><a name="menuItemType-var"></a><span class="type"><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a></span> QStyleOptionMenuItem::<span class="name">menuItemType</span></h3>
<p>This variable holds the type of menu item</p>
<p>The default value is <a href="qstyleoptionmenuitem.html#MenuItemType-enum">Normal</a>.</p>
<p><b>See also </b><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a>.</p>
<!-- @@@menuItemType -->
<!-- $$$menuRect -->
<h3 class="fn" id="menuRect-var"><a name="menuRect-var"></a><span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QStyleOptionMenuItem::<span class="name">menuRect</span></h3>
<p>This variable holds the rectangle for the entire menu</p>
<p>The default value is a null rectangle, i.e&#x2e; a rectangle with both the width and the height set to 0.</p>
<!-- @@@menuRect -->
<!-- $$$tabWidth -->
<h3 class="fn" id="tabWidth-var"><a name="tabWidth-var"></a><span class="type">int</span> QStyleOptionMenuItem::<span class="name">tabWidth</span></h3>
<p>This variable holds the tab width for the menu item</p>
<p>The tab width is the distance between the text of the menu item and the shortcut. The default value is 0.</p>
<!-- @@@tabWidth -->
<!-- $$$text -->
<h3 class="fn" id="text-var"><a name="text-var"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QStyleOptionMenuItem::<span class="name">text</span></h3>
<p>This variable holds the text for the menu item</p>
<p>Note that the text format is something like this &quot;Menu text<b>\t</b>Shortcut&quot;.</p>
<p>If the menu item doesn't have a shortcut, it will just contain the menu item's text. The default value is an empty string.</p>
<!-- @@@text -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 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>