Sophie

Sophie

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

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" />
<!-- qstyle.cpp -->
  <title>Styling | 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 >Styling</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="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Styling</h1>
<span class="subtitle"></span>
<!-- $$$qwidget-styling.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt's built-in widgets use the <a href="qstyle.html">QStyle</a> class to perform nearly all of their drawing. <a href="qstyle.html">QStyle</a> is an abstract base class that encapsulates the look and feel of a GUI, and can be used to make the widgets look exactly like the equivalent native widgets or to give the widgets a custom look.</p>
<p>Qt provides a set of <a href="qstyle.html">QStyle</a> subclasses that emulate the native look of the different platforms supported by Qt (QWindowsStyle, QMacStyle, etc.)&#x2e; These styles are built into the Qt GUI module, other styles can be made available using Qt's plugin mechansim.</p>
<p>Most functions for drawing style elements take four arguments:</p>
<ul>
<li>an enum value specifying which graphical element to draw</li>
<li>a <a href="qstyleoption.html">QStyleOption</a> object specifying how and where to render that element</li>
<li>a <a href="../qtgui/qpainter.html">QPainter</a> object that should be used to draw the element</li>
<li>a <a href="qwidget.html">QWidget</a> object on which the drawing is performed (optional)</li>
</ul>
<p>The style gets all the information it needs to render the graphical element from the <a href="qstyleoption.html">QStyleOption</a> class. The widget is passed as the last argument in case the style needs it to perform special effects (such as animated default buttons on macOS), but it isn't mandatory. In fact, <a href="qstyle.html">QStyle</a> can be used to draw on any paint device (not just widgets), in which case the widget argument is a zero pointer.</p>
<p class="centerAlign"><img src="images/paintsystem-stylepainter.png" alt="" /></p><p>The paint system also provides the <a href="qstylepainter.html">QStylePainter</a> class inheriting from <a href="../qtgui/qpainter.html">QPainter</a>. <a href="qstylepainter.html">QStylePainter</a> is a convenience class for drawing <a href="qstyle.html">QStyle</a> elements inside a widget, and extends <a href="../qtgui/qpainter.html">QPainter</a> with a set of high-level drawing functions implemented on top of <a href="qstyle.html">QStyle</a>'s API. The advantage of using <a href="qstylepainter.html">QStylePainter</a> is that the parameter lists get considerably shorter.</p>
<div class="table"><table class="generic" width="100%">
 <tr valign="top" class="odd"><td ><img src="images/paintsystem-icon.png" alt="" /></td><td ><b>QIcon</b><p>The <a href="../qtgui/qicon.html">QIcon</a> class provides scalable icons in different modes and states.</p>
<p><a href="../qtgui/qicon.html">QIcon</a> can generate pixmaps reflecting an icon's state, mode and size. These pixmaps are generated from the set of pixmaps made available to the icon, and are used by Qt widgets to show an icon representing a particular action.</p>
<p>The rendering of a <a href="../qtgui/qicon.html">QIcon</a> object is handled by the <a href="../qtgui/qiconengine.html">QIconEngine</a> class. Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.</p>
</td></tr>
</table></div>
<p>For more information about widget styling and appearance, see the <a href="style-reference.html">Styles and Style Aware Widgets</a>.</p>
</div>
<!-- @@@qwidget-styling.html -->
        </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>