Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

WindowManagement Class Reference
[QtBaseModule]

The WindowManagement class allows you to monitor and control the application windows in the system. More...

    #include <WindowManagement>

Inherits QObject.

Public Types

  • enum DockArea { Top, Bottom, Left, Right }

Public Functions

  • 29 public functions inherited from QObject

Signals

  • void windowActive ( const QString & caption, const QRect & rect, WId window )
  • void windowCaption ( const QString & caption )

Static Public Members

  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The WindowManagement class allows you to monitor and control the application windows in the system.

The WindowManagement class allows server windows to be protected, preventing other windows from obscuring them, and docked to the edge of the screen.

The WindowManagement class also updates the value space with the following keys that can be used to track window status:

KeyDescription
/UI/ActiveWindow/TitleThe title of the currently active window
/UI/ActiveWindow/RectThe rectangle of the currently active window
/UI/ActiveWindow/CaptionThe caption of the currently active window. The caption is the same as the title except that it isn't changed for popup windows that only consume a small part of the screen.

These value space keys are updated if either the WindowManagement task is running, or at least one instance of the WindowManagement class has been instantiated.

This class is part of the Qt Extended server and cannot be used by other Qt Extended applications.


Member Type Documentation

enum WindowManagement::DockArea

The DockArea enum type defines the areas where widgets can be docked:

ConstantValueDescription
WindowManagement::Top0- the top of the screen.
WindowManagement::Bottom1- the Bottom of the screen.
WindowManagement::Left2- the Left of the screen.
WindowManagement::Right3- the Right of the screen.


Member Function Documentation

WindowManagement::WindowManagement ( QObject * parent = 0 )

Construct a new WindowManagement instance with the specified parent.

QString WindowManagement::activeAppName ()   [static]

Returns a reference to the name of the active application, ie the one that is visible. If there is no active application, the string is returned empty.

void WindowManagement::closeWindow ( WId winId )   [static]

Sends a close message to the window winId. This is used for applications that do not support the Qt Extended soft menu bar.

See also supportsSoftMenus().

void WindowManagement::dockWindow ( QWidget * window, DockArea placement, int screen = -1 )   [static]

Docks a top-level widget window on a side of the screen specified by placement. The widget is placed according to the order that it was docked, its sizeHint() and whether previously docked widgets are visible. The desktop area available to QWidget::showMaximized() will exclude any visible docked widgets.

For example, if a widget is docked at the bottom of the screen, its sizeHint() will define its height and it will use the full width of the screen. If a widget is then docked to the right, its sizeHint() will define its width and it will be as high as possible without covering the widget docked at the bottom.

This function is useful for reserving system areas such as taskbars and input methods that should not be covered by applications. Even after calling this method, an application can manually position itself over the docked window. To prevent this, also call WindowManagement::protectWindow() on the window.

void WindowManagement::dockWindow ( QWidget * window, DockArea placement, const QSize & size, int screen = -1 )   [static]

This is an overloaded member function, provided for convenience.

Normally the QWidget::sizeHint() of the docked widget is used to determine its docked size. If the sizeHint() is not correct, the size parameter can be used to override it. The window, placement and screen parameters are used as above.

void WindowManagement::hideDockedWindow ( QWidget * window )   [static]

Hides the docked window. While you can call QWidget::hide() on the docked window, using this function will result in smoother screen updates.

void WindowManagement::protectWindow ( QWidget * window )   [static]

Prevent application windows from being raised above the provided toplevel window. If an application window attempts to obscure any of the protected region, the protected window will immediately be raised above it.

void WindowManagement::setLowestWindow ( QWidget * window )   [static]

Sets window as the lowest in the screen stacking order, below all normal and docked windows. This is normally used only for the QAbstractServerInterface widget.

void WindowManagement::showDockedWindow ( QWidget * window )   [static]

Shows the docked window. While you can call QWidget::show() on the docked window, using this function may result in smoother screen updates.

bool WindowManagement::supportsSoftMenus ( WId winId )   [static]

Returns true if winId supports the Qt Extended soft menu bar via the QSoftMenuBar class; false otherwise.

Under QWS, this function always returns true. Under X11, it will return false if the application uses a widget toolkit other than that of Qtopia. The soft menu bar changes its behavior so that the "back" button will send a close message to the foreign application using closeWindow().

See also closeWindow().

void WindowManagement::windowActive ( const QString & caption, const QRect & rect, WId window )   [signal]

Emitted whenever a window becomes active or the active window's caption changes. rect is the rectangle covered by the window.

void WindowManagement::windowCaption ( const QString & caption )   [signal]

Emitted whenever the active window caption changes.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Construire l'avenir : (ré-)introduction aux composants de Qt Quick

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web