<?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" /> <!-- qframe.cpp --> <title>Qt 4.8: QFrame 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="qtgui.html">QtGui</a></li> <li>QFrame</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="#properties">Properties</a></li> <li class="level1"><a href="#public-functions">Public Functions</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">QFrame Class Reference</h1> <!-- $$$QFrame-brief --> <p>The QFrame class is the base class of widgets that can have a frame. <a href="#details">More...</a></p> <!-- @@@QFrame --> <pre class="cpp"> <span class="preprocessor">#include <QFrame></span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p> <p><b>Inherited by: </b><a href="q3frame.html" class="compat">Q3Frame</a>, <a href="q3progressbar.html" class="compat">Q3ProgressBar</a>, <a href="qabstractscrollarea.html">QAbstractScrollArea</a>, <a href="qlabel.html">QLabel</a>, <a href="qlcdnumber.html">QLCDNumber</a>, <a href="qsplitter.html">QSplitter</a>, <a href="qstackedwidget.html">QStackedWidget</a>, and <a href="qtoolbox.html">QToolBox</a>.</p> <ul> <li><a href="qframe-members.html">List of all members, including inherited members</a></li> <li><a href="qframe-qt3.html">Qt 3 support members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#Shadow-enum">Shadow</a></b> { Plain, Raised, Sunken }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#Shape-enum">Shape</a></b> { NoFrame, Box, Panel, StyledPanel, ..., WinPanel }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#StyleMask-enum">StyleMask</a></b> { Shadow_Mask, Shape_Mask }</td></tr> </table> <a name="properties"></a> <h2>Properties</h2> <table class="propsummary"> <tr><td class="topAlign"><ul> <li class="fn"><b><a href="qframe.html#frameRect-prop">frameRect</a></b> : QRect</li> <li class="fn"><b><a href="qframe.html#frameShadow-prop">frameShadow</a></b> : Shadow</li> <li class="fn"><b><a href="qframe.html#frameShape-prop">frameShape</a></b> : Shape</li> </ul></td><td class="topAlign"><ul> <li class="fn"><b><a href="qframe.html#frameWidth-prop">frameWidth</a></b> : const int</li> <li class="fn"><b><a href="qframe.html#lineWidth-prop">lineWidth</a></b> : int</li> <li class="fn"><b><a href="qframe.html#midLineWidth-prop">midLineWidth</a></b> : int</li> </ul> </td></tr> </table> <ul> <li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li> <li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></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="qframe.html#QFrame">QFrame</a></b> ( QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>f</i> = 0 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#dtor.QFrame">~QFrame</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameRect-prop">frameRect</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Shadow </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameShadow-prop">frameShadow</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> Shape </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameShape-prop">frameShape</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameStyle">frameStyle</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameWidth-prop">frameWidth</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#lineWidth-prop">lineWidth</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#midLineWidth-prop">midLineWidth</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameRect-prop">setFrameRect</a></b> ( const QRect & )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameShadow-prop">setFrameShadow</a></b> ( Shadow )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#frameShape-prop">setFrameShape</a></b> ( Shape )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#setFrameStyle">setFrameStyle</a></b> ( int <i>style</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#lineWidth-prop">setLineWidth</a></b> ( int )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#midLineWidth-prop">setMidLineWidth</a></b> ( int )</td></tr> </table> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#sizeHint">sizeHint</a></b> () const</td></tr> </table> <ul> <li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li> <li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> <li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li> </ul> <a name="reimplemented-protected-functions"></a> <h2>Reimplemented Protected Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#changeEvent">changeEvent</a></b> ( QEvent * <i>ev</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qframe.html#paintEvent">paintEvent</a></b> ( QPaintEvent * )</td></tr> </table> <ul> <li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li> <li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> <li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li> <li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li> <li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li> <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li> <li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li> </ul> <a name="details"></a> <!-- $$$QFrame-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QFrame class is the base class of widgets that can have a frame.</p> <p><a href="qmenu.html">QMenu</a> uses this to "raise" the menu above the surrounding screen. <a href="qprogressbar.html">QProgressBar</a> has a "sunken" look. <a href="qlabel.html">QLabel</a> has a flat look. The frames of widgets like these can be changed.</p> <pre class="cpp"> <span class="type"><a href="qlabel.html">QLabel</a></span> label(<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>); label<span class="operator">.</span><a href="qframe.html#setFrameStyle">setFrameStyle</a>(<span class="type">QFrame</span><span class="operator">::</span>Panel <span class="operator">|</span> <span class="type">QFrame</span><span class="operator">::</span>Raised); label<span class="operator">.</span><a href="qframe.html#lineWidth-prop">setLineWidth</a>(<span class="number">2</span>); <span class="type"><a href="qprogressbar.html">QProgressBar</a></span> pbar(<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>); label<span class="operator">.</span><a href="qframe.html#setFrameStyle">setFrameStyle</a>(<span class="type">QFrame</span><span class="operator">::</span>NoFrame);</pre> <p>The QFrame class can also be used directly for creating simple placeholder frames without any contents.</p> <p>The frame style is specified by a <a href="qframe.html#Shape-enum">frame shape</a> and a <a href="qframe.html#Shadow-enum">shadow style</a> that is used to visually separate the frame from surrounding widgets. These properties can be set together using the <a href="qframe.html#setFrameStyle">setFrameStyle</a>() function and read with <a href="qframe.html#frameStyle">frameStyle</a>().</p> <p>The frame shapes are <a href="qframe.html#Shape-enum">NoFrame</a>, <a href="qframe.html#Shape-enum">Box</a>, <a href="qframe.html#Shape-enum">Panel</a>, <a href="qframe.html#Shape-enum">StyledPanel</a>, <a href="qframe.html#Shape-enum">HLine</a> and <a href="qframe.html#Shape-enum">VLine</a>; the shadow styles are <a href="qframe.html#Shadow-enum">Plain</a>, <a href="qframe.html#Shadow-enum">Raised</a> and <a href="qframe.html#Shadow-enum">Sunken</a>.</p> <p>A frame widget has three attributes that describe the thickness of the border: <a href="qframe.html#lineWidth-prop">lineWidth</a>, <a href="qframe.html#midLineWidth-prop">midLineWidth</a>, and <a href="qframe.html#frameWidth-prop">frameWidth</a>.</p> <ul> <li>The line width is the width of the frame border. It can be modified to customize the frame's appearance.</li> <li>The mid-line width specifies the width of an extra line in the middle of the frame, which uses a third color to obtain a special 3D effect. Notice that a mid-line is only drawn for <a href="qframe.html#Shape-enum">Box</a>, <a href="qframe.html#Shape-enum">HLine</a> and <a href="qframe.html#Shape-enum">VLine</a> frames that are raised or sunken.</li> <li>The frame width is determined by the frame style, and the <a href="qframe.html#frameWidth-prop">frameWidth</a>() function is used to obtain the value defined for the style used.</li> </ul> <p>The margin between the frame and the contents of the frame can be customized with the <a href="qwidget.html#setContentsMargins">QWidget::setContentsMargins</a>() function.</p> <a name="picture"></a><p>This table shows some of the combinations of styles and line widths:</p> <p class="centerAlign"><img src="images/frames.png" alt="Table of frame styles" /></p></div> <!-- @@@QFrame --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$Shadow$$$Plain$$$Raised$$$Sunken --> <h3 class="fn"><a name="Shadow-enum"></a>enum QFrame::<span class="name">Shadow</span></h3> <p>This enum type defines the types of shadow that are used to give a 3D effect to frames.</p> <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"><tt>QFrame::Plain</tt></td><td class="topAlign"><tt>0x0010</tt></td><td class="topAlign">the frame and contents appear level with the surroundings; draws using the palette <a href="qpalette.html#ColorRole-enum">QPalette::WindowText</a> color (without any 3D effect)</td></tr> <tr><td class="topAlign"><tt>QFrame::Raised</tt></td><td class="topAlign"><tt>0x0020</tt></td><td class="topAlign">the frame and contents appear raised; draws a 3D raised line using the light and dark colors of the current color group</td></tr> <tr><td class="topAlign"><tt>QFrame::Sunken</tt></td><td class="topAlign"><tt>0x0030</tt></td><td class="topAlign">the frame and contents appear sunken; draws a 3D sunken line using the light and dark colors of the current color group</td></tr> </table> <p>Shadow interacts with <a href="qframe.html#Shape-enum">QFrame::Shape</a>, the <a href="qframe.html#lineWidth-prop">lineWidth</a>() and the <a href="qframe.html#midLineWidth-prop">midLineWidth</a>(). See the picture of the frames in the main class documentation.</p> <p><b>See also </b><a href="qframe.html#Shape-enum">QFrame::Shape</a>, <a href="qframe.html#lineWidth-prop">lineWidth</a>(), and <a href="qframe.html#midLineWidth-prop">midLineWidth</a>().</p> <!-- @@@Shadow --> <!-- $$$Shape$$$NoFrame$$$Box$$$Panel$$$WinPanel$$$HLine$$$VLine$$$StyledPanel$$$PopupPanel$$$MenuBarPanel$$$ToolBarPanel$$$LineEditPanel$$$TabWidgetPanel$$$GroupBoxPanel --> <h3 class="fn"><a name="Shape-enum"></a>enum QFrame::<span class="name">Shape</span></h3> <p>This enum type defines the shapes of frame available.</p> <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"><tt>QFrame::NoFrame</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign"><a href="qframe.html">QFrame</a> draws nothing</td></tr> <tr><td class="topAlign"><tt>QFrame::Box</tt></td><td class="topAlign"><tt>0x0001</tt></td><td class="topAlign"><a href="qframe.html">QFrame</a> draws a box around its contents</td></tr> <tr><td class="topAlign"><tt>QFrame::Panel</tt></td><td class="topAlign"><tt>0x0002</tt></td><td class="topAlign"><a href="qframe.html">QFrame</a> draws a panel to make the contents appear raised or sunken</td></tr> <tr><td class="topAlign"><tt>QFrame::StyledPanel</tt></td><td class="topAlign"><tt>0x0006</tt></td><td class="topAlign">draws a rectangular panel with a look that depends on the current GUI style. It can be raised or sunken.</td></tr> <tr><td class="topAlign"><tt>QFrame::HLine</tt></td><td class="topAlign"><tt>0x0004</tt></td><td class="topAlign"><a href="qframe.html">QFrame</a> draws a horizontal line that frames nothing (useful as separator)</td></tr> <tr><td class="topAlign"><tt>QFrame::VLine</tt></td><td class="topAlign"><tt>0x0005</tt></td><td class="topAlign"><a href="qframe.html">QFrame</a> draws a vertical line that frames nothing (useful as separator)</td></tr> <tr><td class="topAlign"><tt>QFrame::WinPanel</tt></td><td class="topAlign"><tt>0x0003</tt></td><td class="topAlign">draws a rectangular panel that can be raised or sunken like those in Windows 2000. Specifying this shape sets the line width to 2 pixels. WinPanel is provided for compatibility. For GUI style independence we recommend using StyledPanel instead.</td></tr> </table> <p>When it does not call <a href="qstyle.html">QStyle</a>, Shape interacts with <a href="qframe.html#Shadow-enum">QFrame::Shadow</a>, the <a href="qframe.html#lineWidth-prop">lineWidth</a>() and the <a href="qframe.html#midLineWidth-prop">midLineWidth</a>() to create the total result. See the picture of the frames in the main class documentation.</p> <p><b>See also </b><a href="qframe.html#Shadow-enum">QFrame::Shadow</a>, <a href="qwidget.html#style">QFrame::style</a>(), and <a href="qstyle.html#drawPrimitive">QStyle::drawPrimitive</a>().</p> <!-- @@@Shape --> <!-- $$$StyleMask$$$Shadow_Mask$$$Shape_Mask$$$MShadow$$$MShape --> <h3 class="fn"><a name="StyleMask-enum"></a>enum QFrame::<span class="name">StyleMask</span></h3> <p>This enum defines two constants that can be used to extract the two components of <a href="qframe.html#frameStyle">frameStyle</a>():</p> <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"><tt>QFrame::Shadow_Mask</tt></td><td class="topAlign"><tt>0x00f0</tt></td><td class="topAlign">The <a href="qframe.html#Shadow-enum">Shadow</a> part of <a href="qframe.html#frameStyle">frameStyle</a>()</td></tr> <tr><td class="topAlign"><tt>QFrame::Shape_Mask</tt></td><td class="topAlign"><tt>0x000f</tt></td><td class="topAlign">The <a href="qframe.html#Shape-enum">Shape</a> part of <a href="qframe.html#frameStyle">frameStyle</a>()</td></tr> </table> <p>Normally, you don't need to use these, since <a href="qframe.html#frameShadow-prop">frameShadow</a>() and <a href="qframe.html#frameShape-prop">frameShape</a>() already extract the <a href="qframe.html#Shadow-enum">Shadow</a> and the <a href="qframe.html#Shape-enum">Shape</a> parts of <a href="qframe.html#frameStyle">frameStyle</a>().</p> <p><b>See also </b><a href="qframe.html#frameStyle">frameStyle</a>() and <a href="qframe.html#setFrameStyle">setFrameStyle</a>().</p> <!-- @@@StyleMask --> </div> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$frameRect-prop$$$frameRect$$$setFrameRectconstQRect& --> <h3 class="fn"><a name="frameRect-prop"></a><span class="name">frameRect</span> : <span class="type"><a href="qrect.html">QRect</a></span></h3> <p>This property holds the frame's rectangle.</p> <p>The frame's rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting the rectangle does does <i>not</i> cause a widget update. The frame rectangle is automatically adjusted when the widget changes size.</p> <p>If you set the rectangle to a null rectangle (for example, <a href="qrect.html">QRect</a>(0, 0, 0, 0)), then the resulting frame rectangle is equivalent to the <a href="qwidget.html#rect-prop">widget rectangle</a>.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QRect </td><td class="memItemRight bottomAlign"><span class="name"><b>frameRect</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFrameRect</b></span> ( const QRect & )</td></tr> </table> <!-- @@@frameRect --> <!-- $$$frameShadow-prop$$$frameShadow$$$setFrameShadowShadow --> <h3 class="fn"><a name="frameShadow-prop"></a><span class="name">frameShadow</span> : <span class="type"><a href="qframe.html#Shadow-enum">Shadow</a></span></h3> <p>This property holds the frame shadow value from the frame style.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> Shadow </td><td class="memItemRight bottomAlign"><span class="name"><b>frameShadow</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFrameShadow</b></span> ( Shadow )</td></tr> </table> <p><b>See also </b><a href="qframe.html#frameStyle">frameStyle</a>() and <a href="qframe.html#frameShape-prop">frameShape</a>().</p> <!-- @@@frameShadow --> <!-- $$$frameShape-prop$$$frameShape$$$setFrameShapeShape --> <h3 class="fn"><a name="frameShape-prop"></a><span class="name">frameShape</span> : <span class="type"><a href="qframe.html#Shape-enum">Shape</a></span></h3> <p>This property holds the frame shape value from the frame style.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> Shape </td><td class="memItemRight bottomAlign"><span class="name"><b>frameShape</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFrameShape</b></span> ( Shape )</td></tr> </table> <p><b>See also </b><a href="qframe.html#frameStyle">frameStyle</a>() and <a href="qframe.html#frameShadow-prop">frameShadow</a>().</p> <!-- @@@frameShape --> <!-- $$$frameWidth-prop$$$frameWidth --> <h3 class="fn"><a name="frameWidth-prop"></a><span class="name">frameWidth</span> : const <span class="type">int</span></h3> <p>This property holds the width of the frame that is drawn.</p> <p>Note that the frame width depends on the <a href="qframe.html#setFrameStyle">frame style</a>, not only the line width and the mid-line width. For example, the style specified by <a href="qframe.html#Shape-enum">NoFrame</a> always has a frame width of 0, whereas the style <a href="qframe.html#Shape-enum">Panel</a> has a frame width equivalent to the line width.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>frameWidth</b></span> () const</td></tr> </table> <p><b>See also </b><a href="qframe.html#lineWidth-prop">lineWidth</a>(), <a href="qframe.html#midLineWidth-prop">midLineWidth</a>(), and <a href="qframe.html#frameStyle">frameStyle</a>().</p> <!-- @@@frameWidth --> <!-- $$$lineWidth-prop$$$lineWidth$$$setLineWidthint --> <h3 class="fn"><a name="lineWidth-prop"></a><span class="name">lineWidth</span> : <span class="type">int</span></h3> <p>This property holds the line width.</p> <p>Note that the <i>total</i> line width for frames used as separators (<a href="qframe.html#Shape-enum">HLine</a> and <a href="qframe.html#Shape-enum">VLine</a>) is specified by <a href="qframe.html#frameWidth-prop">frameWidth</a>.</p> <p>The default value is 1.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>lineWidth</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLineWidth</b></span> ( int )</td></tr> </table> <p><b>See also </b><a href="qframe.html#midLineWidth-prop">midLineWidth</a> and <a href="qframe.html#frameWidth-prop">frameWidth</a>.</p> <!-- @@@lineWidth --> <!-- $$$midLineWidth-prop$$$midLineWidth$$$setMidLineWidthint --> <h3 class="fn"><a name="midLineWidth-prop"></a><span class="name">midLineWidth</span> : <span class="type">int</span></h3> <p>This property holds the width of the mid-line.</p> <p>The default value is 0.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>midLineWidth</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMidLineWidth</b></span> ( int )</td></tr> </table> <p><b>See also </b><a href="qframe.html#lineWidth-prop">lineWidth</a> and <a href="qframe.html#frameWidth-prop">frameWidth</a>.</p> <!-- @@@midLineWidth --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QFrame[overload1]$$$QFrameQWidget*Qt::WindowFlags --> <h3 class="fn"><a name="QFrame"></a>QFrame::<span class="name">QFrame</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>f</i> = 0 )</h3> <p>Constructs a frame widget with frame style <a href="qframe.html#Shape-enum">NoFrame</a> and a 1-pixel frame width.</p> <p>The <i>parent</i> and <i>f</i> arguments are passed to the <a href="qwidget.html">QWidget</a> constructor.</p> <!-- @@@QFrame --> <!-- $$$~QFrame[overload1]$$$~QFrame --> <h3 class="fn"><a name="dtor.QFrame"></a>QFrame::<span class="name">~QFrame</span> ()</h3> <p>Destroys the frame.</p> <!-- @@@~QFrame --> <!-- $$$changeEvent[overload1]$$$changeEventQEvent* --> <h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> QFrame::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>ev</i> )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p> <!-- @@@changeEvent --> <!-- $$$event[overload1]$$$eventQEvent* --> <h3 class="fn"><a name="event"></a><span class="type">bool</span> QFrame::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p> <!-- @@@event --> <!-- $$$frameStyle[overload1]$$$frameStyle --> <h3 class="fn"><a name="frameStyle"></a><span class="type">int</span> QFrame::<span class="name">frameStyle</span> () const</h3> <p>Returns the frame style.</p> <p>The default value is <a href="qframe.html#Shadow-enum">QFrame::Plain</a>.</p> <p><b>See also </b><a href="qframe.html#setFrameStyle">setFrameStyle</a>(), <a href="qframe.html#frameShape-prop">frameShape</a>(), and <a href="qframe.html#frameShadow-prop">frameShadow</a>().</p> <!-- @@@frameStyle --> <!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* --> <h3 class="fn"><a name="paintEvent"></a><span class="type">void</span> QFrame::<span class="name">paintEvent</span> ( <span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> * )<tt> [virtual protected]</tt></h3> <p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p> <!-- @@@paintEvent --> <!-- $$$setFrameStyle[overload1]$$$setFrameStyleint --> <h3 class="fn"><a name="setFrameStyle"></a><span class="type">void</span> QFrame::<span class="name">setFrameStyle</span> ( <span class="type">int</span> <i>style</i> )</h3> <p>Sets the frame style to <i>style</i>.</p> <p>The <i>style</i> is the bitwise OR between a frame shape and a frame shadow style. See the picture of the frames in the main class documentation.</p> <p>The frame shapes are given in <a href="qframe.html#Shape-enum">QFrame::Shape</a> and the shadow styles in <a href="qframe.html#Shadow-enum">QFrame::Shadow</a>.</p> <p>If a mid-line width greater than 0 is specified, an additional line is drawn for <a href="qframe.html#Shadow-enum">Raised</a> or <a href="qframe.html#Shadow-enum">Sunken</a> <a href="qframe.html#Shape-enum">Box</a>, <a href="qframe.html#Shape-enum">HLine</a>, and <a href="qframe.html#Shape-enum">VLine</a> frames. The mid-color of the current color group is used for drawing middle lines.</p> <p><b>See also </b><a href="qframe.html#frameStyle">frameStyle</a>().</p> <!-- @@@setFrameStyle --> <!-- $$$sizeHint[overload1]$$$sizeHint --> <h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QFrame::<span class="name">sizeHint</span> () const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p> <!-- @@@sizeHint --> </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>