| Home · Modules · Classes · Namespaces · Functions |
The QxtWindowSystem class provides means for accessing native windows. More...
#include <QxtWindowSystem>
The QxtWindowSystem class provides means for accessing native windows.
Note: The underlying window system might or might not allow one to alter states of windows belonging to other processes.
Warning: QxtWindowSystem is portable in principle, but be careful while using it since you are probably about to do something non-portable.
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: Currently supported platforms are X11 and Windows.
Returns the native window system identifier of the active window if any.
See also QApplication::activeWindow().
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 also QWidget::find().
Returns the system "idle time" ie. the time since last user input in milliseconds.
Returns the native window system identifier of the window if any at pos.
See also QApplication::widgetAt().
Returns the geometry of the native window.
See also QWidget::frameGeometry().
Returns the title of the native window.
See also QWidget::windowTitle() and windowTitles().
Returns a list of native window titles.
See also QWidget::windowTitle(), windowTitle(), and windows().
Returns the list of native window system identifiers.
See also QApplication::topLevelWidgets() and windowTitles().
| Copyright © 2007-2011 Qxt Foundation |
Qxt 0.6.2 |