<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- /builddir/build/BUILD/libqxt/src/gui/qxtwindowsystem.cpp --> <head> <title>QxtWindowSystem Class Reference</title> <link href="stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://libqxt.org"><img src="images/qxt-logo.png" width="50" height="40" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="classes.html"><font color="#004faf">Classes</font></a> · <a href="namespaces.html"><font color="#004faf">Namespaces</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td> <td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QxtWindowSystem Class Reference<br /><span class="small-subtitle">[<a href="qxtgui.html">QxtGui</a> module]</span> </h1> <p>The QxtWindowSystem class provides means for accessing native windows. <a href="#details">More...</a></p> <pre> #include <QxtWindowSystem></pre><ul> <li><a href="qxtwindowsystem-members.html">List of all members, including inherited members</a></li> </ul> <a name="static-public-members"></a> <h3>Static Public Members</h3> <ul> <li><div class="fn"></div>WId <b><a href="qxtwindowsystem.html#activeWindow">activeWindow</a></b> ()</li> <li><div class="fn"></div>WId <b><a href="qxtwindowsystem.html#findWindow">findWindow</a></b> ( const QString & <i>title</i> )</li> <li><div class="fn"></div>uint <b><a href="qxtwindowsystem.html#idleTime">idleTime</a></b> ()</li> <li><div class="fn"></div>WId <b><a href="qxtwindowsystem.html#windowAt">windowAt</a></b> ( const QPoint & <i>pos</i> )</li> <li><div class="fn"></div>QRect <b><a href="qxtwindowsystem.html#windowGeometry">windowGeometry</a></b> ( WId <i>window</i> )</li> <li><div class="fn"></div>QString <b><a href="qxtwindowsystem.html#windowTitle">windowTitle</a></b> ( WId <i>window</i> )</li> <li><div class="fn"></div>QStringList <b><a href="qxtwindowsystem.html#windowTitles">windowTitles</a></b> ()</li> <li><div class="fn"></div>WindowList <b><a href="qxtwindowsystem.html#windows">windows</a></b> ()</li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QxtWindowSystem class provides means for accessing native windows.</p> <p><b>Note:</b> The underlying window system might or might not allow one to alter states of windows belonging to other processes.</p> <p><b>Warning:</b> QxtWindowSystem is portable in principle, but be careful while using it since you are probably about to do something non-portable.</p> <a name="advanced-example-usage"></a> <h3>Advanced example usage:</h3> <pre> class NativeWindow : public QWidget { public: NativeWindow(WId wid) { QWidget::create(wid, false, false); <span class="comment">// window, initializeWindow, destroyOldWindow</span> } ~NativeWindow() { QWidget::destroy(false, false); <span class="comment">// destroyWindow, destroySubWindows</span> } };</pre> <pre> WindowList windows = QxtWindowSystem::windows(); QStringList titles = QxtWindowSystem::windowTitles(); bool ok = false; QString title = QInputDialog::getItem(0, "Choose Window", "Choose a window to be hid:", titles, 0, false, &ok); if (ok) { int index = titles.indexOf(title); if (index != -1) { NativeWindow window(windows.at(index)); window.hide(); } }</pre> <p><b>Note:</b> Currently supported platforms are <b>X11</b> and <b>Windows</b>.</p> <hr /> <h2>Member Function Documentation</h2> <h3 class="fn"><a name="activeWindow"></a><a href="http://doc.qtsoftware.com/4.5/qwidget.html#WId-typedef">WId</a> QxtWindowSystem::activeWindow () <tt> [static]</tt></h3> <p>Returns the native window system identifier of the active window if any.</p> <p>See also <a href="http://doc.qtsoftware.com/4.5/qapplication.html#activeWindow">QApplication::activeWindow</a>().</p> <h3 class="fn"><a name="findWindow"></a><a href="http://doc.qtsoftware.com/4.5/qwidget.html#WId-typedef">WId</a> QxtWindowSystem::findWindow ( const <a href="http://doc.qtsoftware.com/4.5/qstring.html">QString</a> & <i>title</i> ) <tt> [static]</tt></h3> <p>Returns the native window system identifier of the window if any with given <i>title</i>.</p> <p>Example usage:</p> <pre> WId wid = QxtWindowSystem::findWindow("Mail - Kontact"); QPixmap screenshot = QPixmap::grabWindow(wid);</pre> <p>See also <a href="http://doc.qtsoftware.com/4.5/qwidget.html#find">QWidget::find</a>().</p> <h3 class="fn"><a name="idleTime"></a><a href="http://doc.qtsoftware.com/4.5/qtglobal.html#uint-typedef">uint</a> QxtWindowSystem::idleTime () <tt> [static]</tt></h3> <p>Returns the system "idle time" ie. the time since last user input in milliseconds.</p> <h3 class="fn"><a name="windowAt"></a><a href="http://doc.qtsoftware.com/4.5/qwidget.html#WId-typedef">WId</a> QxtWindowSystem::windowAt ( const <a href="http://doc.qtsoftware.com/4.5/qpoint.html">QPoint</a> & <i>pos</i> ) <tt> [static]</tt></h3> <p>Returns the native window system identifier of the window if any at <i>pos</i>.</p> <p>See also <a href="http://doc.qtsoftware.com/4.5/qapplication.html#widgetAt">QApplication::widgetAt</a>().</p> <h3 class="fn"><a name="windowGeometry"></a><a href="http://doc.qtsoftware.com/4.5/qrect.html">QRect</a> QxtWindowSystem::windowGeometry ( <a href="http://doc.qtsoftware.com/4.5/qwidget.html#WId-typedef">WId</a> <i>window</i> ) <tt> [static]</tt></h3> <p>Returns the geometry of the native <i>window</i>.</p> <p>See also <a href="http://doc.qtsoftware.com/4.5/qwidget.html#frameGeometry-prop">QWidget::frameGeometry</a>().</p> <h3 class="fn"><a name="windowTitle"></a><a href="http://doc.qtsoftware.com/4.5/qstring.html">QString</a> QxtWindowSystem::windowTitle ( <a href="http://doc.qtsoftware.com/4.5/qwidget.html#WId-typedef">WId</a> <i>window</i> ) <tt> [static]</tt></h3> <p>Returns the title of the native <i>window</i>.</p> <p>See also <a href="http://doc.qtsoftware.com/4.5/qwidget.html#windowTitle-prop">QWidget::windowTitle</a>() and <a href="qxtwindowsystem.html#windowTitles">windowTitles</a>().</p> <h3 class="fn"><a name="windowTitles"></a><a href="http://doc.qtsoftware.com/4.5/qstringlist.html">QStringList</a> QxtWindowSystem::windowTitles () <tt> [static]</tt></h3> <p>Returns a list of native window titles.</p> <p>See also <a href="http://doc.qtsoftware.com/4.5/qwidget.html#windowTitle-prop">QWidget::windowTitle</a>(), <a href="qxtwindowsystem.html#windowTitle">windowTitle</a>(), and <a href="qxtwindowsystem.html#windows">windows</a>().</p> <h3 class="fn"><a name="windows"></a>WindowList QxtWindowSystem::windows () <tt> [static]</tt></h3> <p>Returns the list of native window system identifiers.</p> <p>See also <a href="http://doc.qtsoftware.com/4.5/qapplication.html#topLevelWidgets">QApplication::topLevelWidgets</a>() and <a href="qxtwindowsystem.html#windowTitles">windowTitles</a>().</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td align="left">Copyright © 2007-2010 <a href="mailto:foundation@libqxt.org">Qxt Foundation</a></td> <td align="right"><div align="right"> <a href="http://libqxt.org">Qxt</a> 0.6.1</div></td> </tr></table></div></address></body> </html>