Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 3720

qtbase5-doc-5.12.6-2.mga7.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" />
<!-- qdesktopwidget.qdoc -->
  <title>QDesktopWidget Class | Qt Widgets 5.12.6</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.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QDesktopWidget</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></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-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#obtaining-a-desktop-widget">Obtaining a Desktop Widget</a></li>
<li class="level2"><a href="#screen-geometry">Screen Geometry</a></li>
<li class="level2"><a href="#use-of-the-primary-screen">Use of the Primary Screen</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QDesktopWidget Class</h1>
<!-- $$$QDesktopWidget-brief -->
<p>The <a href="qdesktopwidget.html">QDesktopWidget</a> class provides access to screen information on multi-head systems. <a href="#details">More...</a></p>
<!-- @@@QDesktopWidget -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QDesktopWidget&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="qwidget.html">QWidget</a></td></tr></table></div><p><b>This class is obsolete.</b> It is provided to keep old source code working. We strongly advise against using it in new code.</p>
<ul>
<li><a href="qdesktopwidget-members.html">List of all members, including inherited members</a></li>
<li><a href="qdesktopwidget-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QRect </td><td class="memItemRight bottomAlign"><b><a href="qdesktopwidget.html#availableGeometry">availableGeometry</a></b>(const QWidget *<i>widget</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QRect </td><td class="memItemRight bottomAlign"><b><a href="qdesktopwidget.html#screenGeometry">screenGeometry</a></b>(const QWidget *<i>widget</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdesktopwidget.html#screenNumber">screenNumber</a></b>(const QWidget *<i>widget</i> = nullptr) const</td></tr>
</table></div>
<ul>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qdesktopwidget.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
<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="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/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>
<!-- $$$QDesktopWidget-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qdesktopwidget.html">QDesktopWidget</a> class provides access to screen information on multi-head systems.</p>
<p>Systems with more than one graphics card and monitor can manage the physical screen space available either as multiple desktops, or as a large virtual desktop.</p>
<p>This class provides information about the user's desktop, such as its total size, number of screens, the geometry of each screen, and whether they are configured as separate desktops or a single virtual desktop.</p>
<p>Widgets provided by Qt use this class to place tooltips, menus and dialog boxes on the correct screen for their parent or application widgets. Applications can use this class to obtain information that can be used to save window positions, or to place child widgets and dialogs on one particular screen.</p>
<a name="obtaining-a-desktop-widget"></a>
<h3 id="obtaining-a-desktop-widget">Obtaining a Desktop Widget</h3>
<p>The <a href="qapplication.html#desktop">QApplication::desktop</a>() function is used to get an instance of <a href="qdesktopwidget.html">QDesktopWidget</a>.</p>
<p>The widget's <a href="qdesktopwidget.html#screenGeometry">screenGeometry</a>() function provides information about the geometry of the available screens with. The number of screens available is returned by <a href="qdesktopwidget-obsolete.html#screenCount-prop">screenCount</a>, and the <a href="qdesktopwidget-obsolete.html#screenCountChanged">screenCountChanged</a>() signal is emitted when screens are added or removed. The screen number that a particular point or widget is located in is returned by <a href="qdesktopwidget.html#screenNumber">screenNumber</a>().</p>
<a name="screen-geometry"></a>
<h3 id="screen-geometry">Screen Geometry</h3>
<p>To obtain the dimensions of a particular screen, call the <a href="qdesktopwidget.html#screenGeometry">screenGeometry</a>() function. On some desktop environments, not all of the screen is available for applications to use; for example, an application dock or menu bar may take up some space. Use the <a href="qdesktopwidget.html#availableGeometry">availableGeometry</a>() function to obtain the available area for applications.</p>
<p><a href="qdesktopwidget.html">QDesktopWidget</a> also inherits the <a href="qwidget.html">QWidget</a> properties, <a href="qwidget.html#width-prop">width</a>() and <a href="qwidget.html#height-prop">height</a>(), which specify the size of the desktop. However, for desktops with multiple screens, the size of the desktop is the union of all the screen sizes, so <a href="qwidget.html#width-prop">width</a>() and <a href="qwidget.html#height-prop">height</a>() should <i>not</i> be used for computing the size of a widget to be placed on one of the screens.</p>
<p>On systems that are configured to use the available screens as a single, large virtual desktop, the <a href="qdesktopwidget-obsolete.html#virtualDesktop-prop">virtualDesktop</a> property will be set to true. In this case, the widget's size is usually the size of the bounding rectangle of all the screens.</p>
<a name="use-of-the-primary-screen"></a>
<h3 id="use-of-the-primary-screen">Use of the Primary Screen</h3>
<p>For an application, the screen where the main widget resides is the primary screen. This is stored in the <a href="qdesktopwidget-obsolete.html#primaryScreen-prop">primaryScreen</a> property. All windows opened in the context of the application should be constrained to the boundaries of the primary screen; for example, it would be inconvenient if a dialog box popped up on a different screen, or split over two screens.</p>
<p class="centerAlign"><img src="images/qdesktopwidget.png" alt="Managing Multiple Screens" /></p><p>In the illustration above, Application One's primary screen is screen 0, and App Two's primary screen is screen 1.</p>
</div>
<p><b>See also </b><a href="qapplication.html">QApplication</a> and <a href="qapplication.html#desktop">QApplication::desktop</a>().</p>
<!-- @@@QDesktopWidget -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$availableGeometry[overload1]$$$availableGeometryconstQWidget* -->
<h3 class="fn" id="availableGeometry"><a name="availableGeometry"></a>const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QDesktopWidget::<span class="name">availableGeometry</span>(const <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the available geometry of the screen which contains <i>widget</i>.</p>
<p><b>See also </b><a href="qdesktopwidget.html#screenGeometry">screenGeometry</a>().</p>
<!-- @@@availableGeometry -->
<!-- $$$screenGeometry[overload1]$$$screenGeometryconstQWidget* -->
<h3 class="fn" id="screenGeometry"><a name="screenGeometry"></a>const <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> QDesktopWidget::<span class="name">screenGeometry</span>(const <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the geometry of the screen which contains <i>widget</i>.</p>
<!-- @@@screenGeometry -->
<!-- $$$screenNumber[overload1]$$$screenNumberconstQWidget* -->
<h3 class="fn" id="screenNumber"><a name="screenNumber"></a><span class="type">int</span> QDesktopWidget::<span class="name">screenNumber</span>(const <span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>widget</i> = nullptr) const</h3>
<p>Returns the index of the screen that contains the largest part of <i>widget</i>, or -1 if the widget not on a screen.</p>
<p><b>See also </b><a href="qdesktopwidget-obsolete.html#primaryScreen-prop">primaryScreen</a>.</p>
<!-- @@@screenNumber -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>