<?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" /> <!-- qdrawutil.cpp --> <title>Qt 4.8: <qdrawutil.h> - Drawing Utility Functions</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 --> </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"> <h1 class="title"><qdrawutil.h> - Drawing Utility Functions</h1> <span class="subtitle"></span> <ul> </ul> <a name="Functionsx"></a> <h2>Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawBorderPixmap">qDrawBorderPixmap</a></b> ( QPainter * <i>painter</i>, const QRect & <i>target</i>, const QMargins & <i>margins</i>, const QPixmap & <i>pixmap</i> )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawPlainRect">qDrawPlainRect</a></b> ( QPainter * <i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QColor & <i>lineColor</i>, int <i>lineWidth</i> = 1, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawPlainRect-2">qDrawPlainRect</a></b> ( QPainter * <i>painter</i>, const QRect & <i>rect</i>, const QColor & <i>lineColor</i>, int <i>lineWidth</i> = 1, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a></b> ( QPainter * <i>painter</i>, int <i>x1</i>, int <i>y1</i>, int <i>x2</i>, int <i>y2</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = true, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeLine-2">qDrawShadeLine</a></b> ( QPainter * <i>painter</i>, const QPoint & <i>p1</i>, const QPoint & <i>p2</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = true, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a></b> ( QPainter * <i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadePanel-2">qDrawShadePanel</a></b> ( QPainter * <i>painter</i>, const QRect & <i>rect</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a></b> ( QPainter * <i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawShadeRect-2">qDrawShadeRect</a></b> ( QPainter * <i>painter</i>, const QRect & <i>rect</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, int <i>lineWidth</i> = 1, int <i>midLineWidth</i> = 0, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawWinButton">qDrawWinButton</a></b> ( QPainter * <i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawWinButton-2">qDrawWinButton</a></b> ( QPainter * <i>painter</i>, const QRect & <i>rect</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, const QBrush * <i>fill</i> = 0 )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a></b> ( QPainter * <i>painter</i>, int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>, const QPalette & <i>palette</i>, bool <i>sunken</i> = false, const QBrush * <i>fill</i> = 0 )</td></tr> </table> <!-- $$$<qdrawutil.h>-description --> <div class="descr"> <a name="details"></a> </div> <p><b>See also </b><a href="qpainter.html">QPainter</a>.</p> <!-- @@@<qdrawutil.h> --> <h2>Function Documentation</h2> <!-- $$$qDrawBorderPixmap[overload1]$$$qDrawBorderPixmapQPainter*constQRect&constQMargins&constQPixmap& --> <h3 class="fn"><a name="qDrawBorderPixmap"></a><span class="type">void</span> <span class="name">qDrawBorderPixmap</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>target</i>, const <span class="type"><a href="qmargins.html">QMargins</a></span> & <i>margins</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> & <i>pixmap</i> )</h3> <p>This is an overloaded function.</p> <p>The qDrawBorderPixmap function is for drawing a pixmap into the margins of a rectangle.</p> <p>Draws the given <i>pixmap</i> into the given <i>target</i> rectangle, using the given <i>painter</i>. The pixmap will be split into nine segments and drawn according to the <i>margins</i> structure.</p> <p>This function was introduced in Qt 4.6.</p> <!-- @@@qDrawBorderPixmap --> <!-- $$$qDrawPlainRect[overload1]$$$qDrawPlainRectQPainter*intintintintconstQColor&intconstQBrush* --> <h3 class="fn"><a name="qDrawPlainRect"></a><span class="type">void</span> <span class="name">qDrawPlainRect</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qcolor.html">QColor</a></span> & <i>lineColor</i>, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>Draws the plain rectangle beginning at (<i>x</i>, <i>y</i>) with the given <i>width</i> and <i>height</i>, using the specified <i>painter</i>, <i>lineColor</i> and <i>lineWidth</i>. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a plain rectangle:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Plain);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>() and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawPlainRect --> <!-- $$$qDrawPlainRect$$$qDrawPlainRectQPainter*constQRect&constQColor&intconstQBrush* --> <h3 class="fn"><a name="qDrawPlainRect-2"></a><span class="type">void</span> <span class="name">qDrawPlainRect</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>rect</i>, const <span class="type"><a href="qcolor.html">QColor</a></span> & <i>lineColor</i>, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>This is an overloaded function.</p> <p>Draws the plain rectangle specified by <i>rect</i> using the given <i>painter</i>, <i>lineColor</i> and <i>lineWidth</i>. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a plain rectangle:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Plain);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>() and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawPlainRect --> <!-- $$$qDrawShadeLine[overload1]$$$qDrawShadeLineQPainter*intintintintconstQPalette&boolintint --> <h3 class="fn"><a name="qDrawShadeLine"></a><span class="type">void</span> <span class="name">qDrawShadeLine</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, <span class="type">int</span> <i>x1</i>, <span class="type">int</span> <i>y1</i>, <span class="type">int</span> <i>x2</i>, <span class="type">int</span> <i>y2</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = true, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0 )</h3> <p>Draws a horizontal (<i>y1</i> == <i>y2</i>) or vertical (<i>x1</i> == <i>x2</i>) shaded line using the given <i>painter</i>. Note that nothing is drawn if <i>y1</i> != <i>y2</i> and <i>x1</i> != <i>x2</i> (i.e. the line is neither horizontal nor vertical).</p> <p>The provided <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors). The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The given <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="qpalette.html#mid">QPalette::mid</a>() color.</p> <p>The line appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded line:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>HLine <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawShadeLine --> <!-- $$$qDrawShadeLine$$$qDrawShadeLineQPainter*constQPoint&constQPoint&constQPalette&boolintint --> <h3 class="fn"><a name="qDrawShadeLine-2"></a><span class="type">void</span> <span class="name">qDrawShadeLine</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> & <i>p1</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> & <i>p2</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = true, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0 )</h3> <p>This is an overloaded function.</p> <p>Draws a horizontal or vertical shaded line between <i>p1</i> and <i>p2</i> using the given <i>painter</i>. Note that nothing is drawn if the line between the points would be neither horizontal nor vertical.</p> <p>The provided <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors). The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The given <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="qpalette.html#mid">QPalette::mid</a>() color.</p> <p>The line appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded line:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>HLine <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawShadeLine --> <!-- $$$qDrawShadePanel[overload1]$$$qDrawShadePanelQPainter*intintintintconstQPalette&boolintconstQBrush* --> <h3 class="fn"><a name="qDrawShadePanel"></a><span class="type">void</span> <span class="name">qDrawShadePanel</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>Draws the shaded panel beginning at (<i>x</i>, <i>y</i>) with the given <i>width</i> and <i>height</i> using the provided <i>painter</i> and the given <i>lineWidth</i>.</p> <p>The given <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors). The panel's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The panel appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded panel:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle( <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Panel <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>(), <a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawShadePanel --> <!-- $$$qDrawShadePanel$$$qDrawShadePanelQPainter*constQRect&constQPalette&boolintconstQBrush* --> <h3 class="fn"><a name="qDrawShadePanel-2"></a><span class="type">void</span> <span class="name">qDrawShadePanel</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>rect</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>This is an overloaded function.</p> <p>Draws the shaded panel at the rectangle specified by <i>rect</i> using the given <i>painter</i> and the given <i>lineWidth</i>.</p> <p>The given <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors). The panel's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The panel appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded panel:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle( <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Panel <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Sunken);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>(), <a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadeRect">qDrawShadeRect</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawShadePanel --> <!-- $$$qDrawShadeRect[overload1]$$$qDrawShadeRectQPainter*intintintintconstQPalette&boolintintconstQBrush* --> <h3 class="fn"><a name="qDrawShadeRect"></a><span class="type">void</span> <span class="name">qDrawShadeRect</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>Draws the shaded rectangle beginning at (<i>x</i>, <i>y</i>) with the given <i>width</i> and <i>height</i> using the provided <i>painter</i>.</p> <p>The provide <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors. The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="qpalette.html#mid">QPalette::mid</a>() color. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The rectangle appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded rectangle:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Raised);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), <a href="qdrawutil-h.html#qDrawPlainRect">qDrawPlainRect</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawShadeRect --> <!-- $$$qDrawShadeRect$$$qDrawShadeRectQPainter*constQRect&constQPalette&boolintintconstQBrush* --> <h3 class="fn"><a name="qDrawShadeRect-2"></a><span class="type">void</span> <span class="name">qDrawShadeRect</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>rect</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, <span class="type">int</span> <i>lineWidth</i> = 1, <span class="type">int</span> <i>midLineWidth</i> = 0, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>This is an overloaded function.</p> <p>Draws the shaded rectangle specified by <i>rect</i> using the given <i>painter</i>.</p> <p>The provide <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors. The given <i>lineWidth</i> specifies the line width for each of the lines; it is not the total line width. The <i>midLineWidth</i> specifies the width of a middle line drawn in the <a href="qpalette.html#mid">QPalette::mid</a>() color. The rectangle's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The rectangle appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded rectangle:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Box <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Raised);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadeLine">qDrawShadeLine</a>(), <a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), <a href="qdrawutil-h.html#qDrawPlainRect">qDrawPlainRect</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawShadeRect --> <!-- $$$qDrawWinButton[overload1]$$$qDrawWinButtonQPainter*intintintintconstQPalette&boolconstQBrush* --> <h3 class="fn"><a name="qDrawWinButton"></a><span class="type">void</span> <span class="name">qDrawWinButton</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>Draws the Windows-style button specified by the given point (<i>x</i>, <i>y</i>}, <i>width</i> and <i>height</i> using the provided <i>painter</i> with a line width of 2 pixels. The button's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The given <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors).</p> <p>The button appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>()-> Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p><b>See also </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>() and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawWinButton --> <!-- $$$qDrawWinButton$$$qDrawWinButtonQPainter*constQRect&constQPalette&boolconstQBrush* --> <h3 class="fn"><a name="qDrawWinButton-2"></a><span class="type">void</span> <span class="name">qDrawWinButton</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, const <span class="type"><a href="qrect.html">QRect</a></span> & <i>rect</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>This is an overloaded function.</p> <p>Draws the Windows-style button at the rectangle specified by <i>rect</i> using the given <i>painter</i> with a line width of 2 pixels. The button's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The given <i>palette</i> specifies the shading colors (<a href="qpalette.html#light">light</a>, <a href="qpalette.html#dark">dark</a> and <a href="qpalette.html#mid">middle</a> colors).</p> <p>The button appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>()-> Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p><b>See also </b><a href="qdrawutil-h.html#qDrawWinPanel">qDrawWinPanel</a>() and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawWinButton --> <!-- $$$qDrawWinPanel[overload1]$$$qDrawWinPanelQPainter*intintintintconstQPalette&boolconstQBrush* --> <h3 class="fn"><a name="qDrawWinPanel"></a><span class="type">void</span> <span class="name">qDrawWinPanel</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>, const <span class="type"><a href="qpalette.html">QPalette</a></span> & <i>palette</i>, <span class="type">bool</span> <i>sunken</i> = false, const <span class="type"><a href="qbrush.html">QBrush</a></span> * <i>fill</i> = 0 )</h3> <p>Draws the Windows-style panel specified by the given point(<i>x</i>, <i>y</i>), <i>width</i> and <i>height</i> using the provided <i>painter</i> with a line width of 2 pixels. The button's interior is filled with the <i>fill</i> brush unless <i>fill</i> is 0.</p> <p>The given <i>palette</i> specifies the shading colors. The panel appears sunken if <i>sunken</i> is true, otherwise raised.</p> <p><b>Warning:</b> This function does not look at <a href="qwidget.html#style">QWidget::style</a>() or <a href="qapplication.html#style">QApplication::style</a>(). Use the drawing functions in <a href="qstyle.html">QStyle</a> to make widgets that follow the current GUI style.</p> <p>Alternatively you can use a <a href="qframe.html">QFrame</a> widget and apply the <a href="qframe.html#setFrameStyle">QFrame::setFrameStyle</a>() function to display a shaded panel:</p> <pre class="cpp"> <span class="type"><a href="qframe.html">QFrame</a></span> frame: frame<span class="operator">.</span>setFrameStyle(<span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>WinPanel <span class="operator">|</span> <span class="type"><a href="qframe.html">QFrame</a></span><span class="operator">::</span>Raised);</pre> <p><b>See also </b><a href="qdrawutil-h.html#qDrawShadePanel">qDrawShadePanel</a>(), <a href="qdrawutil-h.html#qDrawWinButton">qDrawWinButton</a>(), and <a href="qstyle.html">QStyle</a>.</p> <!-- @@@qDrawWinPanel --> </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>