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  · 

Q3GroupBox Class Reference
[Qt3Support module]

The Q3GroupBox widget provides a group box frame with a title. More...

 #include <Q3GroupBox>

This class is part of the Qt 3 support library. It is provided to keep old source code working. We strongly advise against using it in new code. See Porting to Qt 4 for more information.

Inherits QGroupBox.

Inherited by Q3ButtonGroup, Q3HGroupBox, and Q3VGroupBox.


Properties


Public Functions

Q3GroupBox ( QWidget * parent = 0, const char * name = 0 )
Q3GroupBox ( const QString & title, QWidget * parent = 0, const char * name = 0 )
Q3GroupBox ( int strips, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 )
Q3GroupBox ( int strips, Qt::Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 )
~Q3GroupBox ()
void addSpace ( int size )
int columns () const
FrameShape frameShadow () const
FrameShape frameShape () const
int frameStyle () const
int insideMargin () const
int insideSpacing () const
int lineWidth () const
int margin () const
int midLineWidth () const
Qt::Orientation orientation () const
virtual void setColumnLayout ( int strips, Qt::Orientation direction )
void setColumns ( int )
void setFrameShadow ( FrameShape )
void setFrameShape ( FrameShape )
void setFrameStyle ( int style )
void setInsideMargin ( int m )
void setInsideSpacing ( int s )
void setLineWidth ( int )
void setMargin ( int margin )
void setMidLineWidth ( int )
void setOrientation ( Qt::Orientation )
  • 10 public functions inherited from QGroupBox
  • 217 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 13 public functions inherited from QPaintDevice

Reimplemented Protected Functions

virtual void changeEvent ( QEvent * ev )
virtual void childEvent ( QChildEvent * c )
virtual bool event ( QEvent * e )
virtual void resizeEvent ( QResizeEvent * e )
  • 10 protected functions inherited from QGroupBox
  • 37 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice

Additional Inherited Members

  • 1 public slot inherited from QGroupBox
  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject
  • 2 signals inherited from QGroupBox
  • 1 signal inherited from QWidget
  • 1 signal inherited from QObject
  • 4 static public members inherited from QWidget
  • 5 static public members inherited from QObject
  • 10 protected functions inherited from QGroupBox
  • 37 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 Q3GroupBox widget provides a group box frame with a title.

A group box provides a frame, a title and a keyboard shortcut, and displays various other widgets inside itself. The title is on top, the keyboard shortcut moves keyboard focus to one of the group box's child widgets, and the child widgets are usually laid out horizontally (or vertically) inside the frame.

The simplest way to use it is to create a group box with the desired number of columns (or rows) and orientation, and then just create widgets with the group box as parent.

It is also possible to change the orientation() and number of columns() after construction, or to ignore all the automatic layout support and manage the layout yourself. You can add 'empty' spaces to the group box with addSpace().

Q3GroupBox also lets you set the title() (normally set in the constructor) and the title's alignment().

You can change the spacing used by the group box with setInsideMargin() and setInsideSpacing(). To minimize space consumption, you can remove the right, left and bottom edges of the frame with setFlat().

See also QButtonGroup.


Property Documentation

columns : int

This property holds the number of columns or rows (depending on Q3GroupBox::orientation) in the group box.

Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is best to set the number of columns directly in the constructor.

Access functions:

int columns () const
void setColumns ( int )

frameRect : const QRect

This property holds the bounding rectangle of the frame of the group box.

frameShadow : FrameShape

This property holds the frame shadow value from the frame style.

Access functions:

FrameShape frameShadow () const
void setFrameShadow ( FrameShape )

See also frameStyle().

frameShape : FrameShape

This property holds the frame shape value from the frame style.

Access functions:

FrameShape frameShape () const
void setFrameShape ( FrameShape )

See also frameStyle() and frameShadow().

lineWidth : int

This property holds this property holds the width of the line.

Access functions:

int lineWidth () const
void setLineWidth ( int )

See also frameStyle() and frameShadow().

margin : int

This property holds the width of the margin around the contents of the group box.

Access functions:

int margin () const
void setMargin ( int margin )

midLineWidth : int

This property holds this property holds the width of the mid-line.

Access functions:

int midLineWidth () const
void setMidLineWidth ( int )

See also frameStyle() and frameShadow().

orientation : Qt::Orientation

This property holds the group box's orientation.

A horizontal group box arranges its children in columns, while a vertical group box arranges them in rows.

Usually it is not a good idea to set this property because it is slow (it does a complete layout). It is better to set the orientation directly in the constructor.

Access functions:

Qt::Orientation orientation () const
void setOrientation ( Qt::Orientation )

Member Function Documentation

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

Constructs a group box widget with no title.

The parent and name arguments are passed to the QWidget constructor.

This constructor does not do automatic layout.

Q3GroupBox::Q3GroupBox ( const QString & title, QWidget * parent = 0, const char * name = 0 )

Constructs a group box with the title title.

The parent and name arguments are passed to the QWidget constructor.

This constructor does not do automatic layout.

Q3GroupBox::Q3GroupBox ( int strips, Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0 )

Constructs a group box with no title. Child widgets will be arranged in strips rows or columns (depending on orientation).

The parent and name arguments are passed to the QWidget constructor.

Q3GroupBox::Q3GroupBox ( int strips, Qt::Orientation orientation, const QString & title, QWidget * parent = 0, const char * name = 0 )

Constructs a group box titled title. Child widgets will be arranged in strips rows or columns (depending on orientation).

The parent and name arguments are passed to the QWidget constructor.

Q3GroupBox::~Q3GroupBox ()

Destroys the group box.

void Q3GroupBox::addSpace ( int size )

Adds an empty cell at the next free position. If size is greater than 0, the empty cell takes size to be its fixed width (if orientation() is Horizontal) or height (if orientation() is Vertical).

Use this method to separate the widgets in the group box or to skip the next free cell. For performance reasons, call this method after calling setColumnLayout() or by changing the Q3GroupBox::columns or Q3GroupBox::orientation properties. It is generally a good idea to call these methods first (if needed at all), and insert the widgets and spaces afterwards.

void Q3GroupBox::changeEvent ( QEvent * ev )   [virtual protected]

Reimplemented from QWidget::changeEvent().

void Q3GroupBox::childEvent ( QChildEvent * c )   [virtual protected]

Reimplemented from QObject::childEvent().

bool Q3GroupBox::event ( QEvent * e )   [virtual protected]

Reimplemented from QObject::event().

int Q3GroupBox::frameStyle () const

Returns the frame style.

See also setFrameStyle().

int Q3GroupBox::insideMargin () const

Returns the width of the empty space between the items in the group and the frame of the group.

Only applies if the group box has a defined orientation.

The default is usually 11, by may vary depending on the platform and style.

See also setInsideMargin() and orientation.

int Q3GroupBox::insideSpacing () const

Returns the width of the empty space between each of the items in the group.

Only applies if the group box has a defined orientation.

The default is usually 5, by may vary depending on the platform and style.

See also setInsideSpacing() and orientation.

void Q3GroupBox::resizeEvent ( QResizeEvent * e )   [virtual protected]

Reimplemented from QWidget::resizeEvent().

void Q3GroupBox::setColumnLayout ( int strips, Qt::Orientation direction )   [virtual]

Changes the layout of the group box. This function is only useful in combination with the default constructor that does not take any layout information. This function will put all existing children in the new layout. It is not good Qt programming style to call this function after children have been inserted. Sets the number of columns or rows to be strips, depending on direction.

See also orientation and columns.

void Q3GroupBox::setFrameStyle ( int style )

Sets the frame style to style. The style is the bitwise OR between a frame shape and a frame shadow style.

See also frameStyle().

void Q3GroupBox::setInsideMargin ( int m )

Sets the width of the inside margin to m pixels.

See also insideMargin().

void Q3GroupBox::setInsideSpacing ( int s )

Sets the width of the empty space between each of the items in the group to s pixels.

See also insideSpacing().

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 103
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 56
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 90
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 31
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 231
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 103
  7. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
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.6-snapshot
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