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  · 

Q3ActionGroup Class Reference
[Qt3Support module]

The Q3ActionGroup class groups actions together. More...

 #include <Q3ActionGroup>

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 Q3Action.

Properties

Public Functions

  • 21 public functions inherited from Q3Action
  • 29 public functions inherited from QObject

Signals

Protected Functions

  • virtual void addedTo ( QWidget * actionWidget, QWidget * container, Q3Action * a )
  • virtual void addedTo ( int index, Q3PopupMenu * menu, Q3Action * a )
  • 2 protected functions inherited from Q3Action
  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 6 public slots inherited from Q3Action
  • 1 public slot inherited from QObject
  • 5 static public members inherited from QObject

Detailed Description

The Q3ActionGroup class groups actions together.

In some situations it is useful to group actions together. For example, if you have a left justify action, a right justify action and a center action, only one of these actions should be active at any one time, and one simple way of achieving this is to group the actions together in an action group.

An action group can also be added to a menu or a toolbar as a single unit, with all the actions within the action group appearing as separate menu options and toolbar buttons.

The actions in an action group emit their activated() (and for toggle actions, toggled()) signals as usual.

The setExclusive() function is used to ensure that only one action is active at any one time: it should be used with actions which have their toggleAction set to true.

Action group actions appear as individual menu options and toolbar buttons. For exclusive action groups use setUsesDropDown() to display the actions in a subwidget of any widget the action group is added to. For example, the actions would appear in a combobox in a toolbar or as a submenu in a menu.

Actions can be added to an action group using add(), but normally they are added by creating the action with the action group as parent. Actions can have separators dividing them using addSeparator(). Action groups are added to widgets with addTo().


Property Documentation

exclusive : bool

This property holds whether the action group does exclusive toggling.

If exclusive is true only one toggle action in the action group can ever be active at any one time. If the user chooses another toggle action in the group the one they chose becomes active and the one that was active becomes inactive.

Access functions:

  • bool isExclusive () const
  • void setExclusive ( bool )

See also Q3Action::toggleAction.

usesDropDown : bool

This property holds whether the group's actions are displayed in a subwidget of the widgets the action group is added to.

Exclusive action groups added to a toolbar display their actions in a combobox with the action's Q3Action::text and Q3Action::iconSet properties shown. Non-exclusive groups are represented by a tool button showing their Q3Action::iconSet and text() property.

In a popup menu the member actions are displayed in a submenu.

Changing usesDropDown only affects subsequent calls to addTo().

This property's default is false.

Access functions:

  • bool usesDropDown () const
  • void setUsesDropDown ( bool enable )

Member Function Documentation

Q3ActionGroup::Q3ActionGroup ( QObject * parent, const char * name = 0 )

Constructs an action group called name, with parent parent.

The action group is exclusive by default. Call setExclusive(false) to make the action group non-exclusive.

Q3ActionGroup::Q3ActionGroup ( QObject * parent, const char * name, bool exclusive )

Constructs an action group called name, with parent parent.

If exclusive is true only one toggle action in the group will ever be active.

See also exclusive.

Q3ActionGroup::~Q3ActionGroup ()

Destroys the object and frees allocated resources.

void Q3ActionGroup::activated ( Q3Action * action )   [signal]

This signal is emitted from groups when one of its actions gets activated.

The argument is the action which was activated.

See also setExclusive(), isOn(), and Q3Action::toggled().

void Q3ActionGroup::add ( Q3Action * action )

Adds action action to this group.

Normally an action is added to a group by creating it with the group as parent, so this function is not usually used.

See also addTo().

void Q3ActionGroup::addSeparator ()

Adds a separator to the group.

bool Q3ActionGroup::addTo ( QWidget * w )   [virtual]

Adds this action group to the widget w.

If isExclusive() is false or usesDropDown() is false, the actions within the group are added to the widget individually. For example, if the widget is a menu, the actions will appear as individual menu options, and if the widget is a toolbar, the actions will appear as toolbar buttons.

If both isExclusive() and usesDropDown() are true, the actions are presented either in a combobox (if w is a toolbar) or in a submenu (if w is a menu).

All actions should be added to the action group before the action group is added to the widget. If actions are added to the action group after the action group has been added to the widget these later actions will not appear.

Reimplemented from Q3Action.

See also setExclusive(), setUsesDropDown(), and removeFrom().

void Q3ActionGroup::addedTo ( QWidget * actionWidget, QWidget * container, Q3Action * a )   [virtual protected]

This function is called from the addTo() function when it has created a widget (actionWidget) for the child action a in the container.

void Q3ActionGroup::addedTo ( int index, Q3PopupMenu * menu, Q3Action * a )   [virtual protected]

This is an overloaded function.

This function is called from the addTo() function when it has created a menu item for the child action at the index position index in the popup menu menu.

void Q3ActionGroup::insert ( Q3Action * action )

Use add(action) instead.

void Q3ActionGroup::selected ( Q3Action * action )   [signal]

This signal is emitted from exclusive groups when toggle actions change state.

The argument is the action whose state changed to "on".

See also setExclusive(), isOn(), and Q3Action::toggled().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  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. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
Page suivante

Le Qt Quarterly au hasard

Logo

Déployer dans le Bazaar

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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.5
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