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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QDockWidget Class Reference
[QtGui module]

The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop. More...

 #include <QDockWidget>

Inherits QWidget.

Public Types

Properties

  • 55 properties inherited from QWidget
  • 1 property inherited from QObject

Public Functions

  • 195 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 12 public functions inherited from QPaintDevice

Signals

Additional Inherited Members

  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject
  • 4 static public members inherited from QWidget
  • 5 static public members inherited from QObject
  • 38 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget

Detailed Description

The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop.

QDockWidget provides the concept of dock widgets, also know as tool palettes or utility windows. Dock windows are secondary windows placed in the dock widget area around the central widget in a QMainWindow.

Dock windows can be moved inside their current area, moved into new areas and floated (e.g. undocked) by the end-user. The QDockWidget API allows the programmer to restrict the dock widgets ability to move, float and close, as well as the areas in which they can be placed.

Appearance

A QDockWidget consists of a title bar and the content area. The titlebar displays the dock widgets window title, a float button and a close button. Depending on the state of the QDockWidget, the float and close buttons may be either disabled or not shown at all.

The visual appearance of the title bar and buttons is dependent on the style in use.

See also QMainWindow and Dock Widgets Example.


Member Type Documentation

enum QDockWidget::DockWidgetFeature
flags QDockWidget::DockWidgetFeatures

ConstantValueDescription
QDockWidget::DockWidgetClosable0x01The dock widget can be closed.
QDockWidget::DockWidgetMovable0x02The dock widget can be moved between docks by the user.
QDockWidget::DockWidgetFloatable0x04The dock widget can be detached from the main window, and floated as an independent window.
QDockWidget::AllDockWidgetFeaturesDockWidgetFeatureMaskThe dock widget can be closed, moved, and floated.
QDockWidget::NoDockWidgetFeatures0x00The dock widget cannot be closed, moved, or floated.

The DockWidgetFeatures type is a typedef for QFlags<DockWidgetFeature>. It stores an OR combination of DockWidgetFeature values.


Property Documentation

allowedAreas : Qt::DockWidgetAreas

This property holds areas where the dock widget may be placed.

The default is Qt::AllDockWidgetAreas.

Access functions:

  • Qt::DockWidgetAreas allowedAreas () const
  • void setAllowedAreas ( Qt::DockWidgetAreas areas )

See also Qt::DockWidgetArea.

features : DockWidgetFeatures

This property holds whether the dock widget is movable, closable, and floatable.

Access functions:

  • DockWidgetFeatures features () const
  • void setFeatures ( DockWidgetFeatures features )

See also DockWidgetFeature.

floating : bool

This property holds whether the dock widget is floating.

A floating dock widget is presented to the user as an independent window "on top" of its parent QMainWindow, instead of being docked in the QMainWindow.

Access functions:

  • bool isFloating () const
  • void setFloating ( bool floating )

See also isWindow().


Member Function Documentation

QDockWidget::QDockWidget ( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )

Constructs a QDockWidget with parent parent and window flags flags. The dock widget will be placed in the left dock widget area.

The window title is set to title. This title is used when the QDockWidget is docked and undocked. It is also used in the context menu provided by QMainWindow.

See also setWindowTitle().

QDockWidget::QDockWidget ( QWidget * parent = 0, Qt::WindowFlags flags = 0 )

Constructs a QDockWidget with parent parent and window flags flags. The dock widget will be placed in the left dock widget area.

QDockWidget::~QDockWidget ()

Destroys the dock widget.

void QDockWidget::allowedAreasChanged ( Qt::DockWidgetAreas allowedAreas )   [signal]

This signal is emitted when the allowedAreas property changes. The allowedAreas parameter gives the new value of the property.

void QDockWidget::featuresChanged ( QDockWidget::DockWidgetFeatures features )   [signal]

This signal is emitted when the features property changes. The features parameter gives the new value of the property.

bool QDockWidget::isAreaAllowed ( Qt::DockWidgetArea area ) const

Returns true if this dock widget can be placed in the given area; otherwise returns false.

void QDockWidget::setWidget ( QWidget * widget )

Sets the widget for the dock widget to widget.

See also widget().

QAction * QDockWidget::toggleViewAction () const

Returns a checkable action that can be used to show or close this dock widget.

The action's text is set to the dock widget's window title.

See also QAction::text and QWidget::windowTitle.

void QDockWidget::topLevelChanged ( bool topLevel )   [signal]

This signal is emitted when the floating property changes. The topLevel parameter is true if the dock widget is now floating; otherwise it is false.

See also isWindow().

QWidget * QDockWidget::widget () const

Returns the widget for the dock widget. This function returns zero if the widget has not been set.

See also setWidget().

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 Developer Network au hasard

Logo

Comment fermer une application

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 4.2
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