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  ·  Classes  ·  Annotées  ·  Hiérarchie  ·  Fonctions  ·  Structure  · 

QWorkspace Class Reference
[ workspace module ]


The QWorkspace widget provides a workspace window that can contain decorated windows, e.g. for MDI. More...

#include <qworkspace.h>

Inherits QWidget.

List of all member functions.

Public Members

Public Slots

Signals


Detailed Description

The QWorkspace widget provides a workspace window that can contain decorated windows, e.g. for MDI.

An MDI application has one main window with a menu bar. The central widget of this window is a workspace. The workspace itself contains zero, one or more document windows, each of which displays a document.

The workspace itself is an ordinary Qt widget. It has a standard constructor that takes a parent widget and an object name. The parent window is usually a QMainWindow, but it need not be.

Document windows (alias MDI windows) are also ordinary Qt widgets, that have the workspace as parent widget. When you call show(), hide(), showMaximized(), setCaption(), etc on a document window, it is shown, hidden etc. with a frame, caption, icon and icon text, just as you'd expect. You can provide widget flags which will be used for the layout of the decoration or the behaviour of the widget itself. To change the geometry of the MDI windows it is necessary to make the necessary function calls to the parentWidget() of the widget, as this will move or resize the decorated window.

A document window becomes active when it gets the keyboard focus. You can activate it using setFocus(), and the user can activate it by moving focus in the normal ways. The workspace emits a signal windowActivated() when it detects the activation change, and the function activeWindow() always returns a pointer to the active document window.

The convenience function windowList() returns a list of all document windows. This is useful to create a popup menu "&Windows" on the fly, for example.

QWorkspace provides two built-in layout strategies for child windows, cascade() and tile(). Both are slots, so you can easily connect menu entries to them.

In case the toplevel window contains a menu bar and a document window is maximized, QWorkspace moves the document window's minimize, restore and close buttons from the document window's frame to the workspace window's menu bar, and inserts a window operations menu on the extreme left of the menu bar.

Warning: User interface research indicates that most users have problems with MDI applications. Use this class cautiously.


Member Function Documentation

QWorkspace::QWorkspace ( QWidget * parent=0, const char * name=0 )

Constructs a workspace with a parent and a name

QWorkspace::~QWorkspace ()

Destroys the object and frees any allocated resources.

QWidget* QWorkspace::activeWindow () const

Returns the active window, or 0 if no window is active.

void QWorkspace::cascade () [slot]

Arranges all child windows in a cascade pattern

See also tile().

void QWorkspace::childEvent ( QChildEvent * e ) [virtual protected]

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QObject.

bool QWorkspace::eventFilter ( QObject * o, QEvent * e ) [virtual protected]

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QObject.

void QWorkspace::resizeEvent ( QResizeEvent * ) [virtual protected]

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

void QWorkspace::showEvent ( QShowEvent * e ) [virtual protected]

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

QSize QWorkspace::sizeHint () const [virtual]

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

QSizePolicy QWorkspace::sizePolicy () const [virtual]

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QWidget.

void QWorkspace::tile () [slot]

Arranges all child windows in a tile pattern

See also cascade().

void QWorkspace::windowActivated ( QWidget * w ) [signal]

This signal is emitted when the window widget w becomes active. Note that w can be null, and that more than one signal may be fired for one activation event.

See also activeWindow() and windowList().

QWidgetList QWorkspace::windowList () const

Returns a list of all windows.


Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2005 Trolltech, all rights reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année

Le Qt Developer Network au hasard

Logo

Utiliser QML et QtWebKit avec PySide

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. 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 2.3
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