QxtWindowSystem Class Reference
[QxtGui module]

QxtWindowSystem provides means for accessing native windows. More...

 #include <QxtWindowSystem>

Public Static Functions


Detailed Description

note Note: The underlying window system might or might not allow one to alter states of windows belonging to other processes.
warning Warning: QxtWindowSystem is portable in principle, but be careful while using it since you are probably about to do something non-portable.

Advanced example usage:

class NativeWindow : public QWidget {
     public:
     NativeWindow(WId wid) {
         QWidget::create(wid, false, false); // window, initializeWindow, destroyOldWindow
     }
     ~NativeWindow() {
         QWidget::destroy(false, false); // destroyWindow, destroySubWindows
     }
};

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();
     }
}

note Note: Currently supported platforms are X11 and Windows.

Member Documentation

WindowList windows ( ) static

Returns the list of native window system identifiers.

see See also: QApplication::topLevelWidgets(), windowTitles()




WId activeWindow ( ) static

Returns the native window system identifier of the active window if any.

see See also: QApplication::activeWindow()




WId findWindow ( const QString & title ) static

Returns the native window system identifier of the window if any with given title.

Example usage:

WId wid = QxtWindowSystem::findWindow("Mail - Kontact");
QPixmap screenshot = QPixmap::grabWindow(wid);

see See also: QWidget::find()




WId windowAt ( const QPoint & pos ) static

Returns the native window system identifier of the window if any at pos.

see See also: QApplication::widgetAt()




QString windowTitle ( WId window ) static

Returns the title of the native window.

see See also: QWidget::windowTitle(), windowTitles()




QStringList windowTitles ( ) static

Returns a list of native window titles.

see See also: QWidget::windowTitle(), windowTitle(), windows()




QRect windowGeometry ( WId window ) static

Returns the geometry of the native window.

see See also: QWidget::frameGeometry()




uint idleTime ( ) static

Returns the system "idle time" ie. the time since last user input in milliseconds.






Copyright © 2007 Qxt Foundation Trademarks
Qt Extension Library 0.4