Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

  • Qt 4.8
  • Qt3SupportLight
  • Q3ActionGroup

Q3ActionGroup Class

TheQ3ActionGroup class groups actions together.More...

Header:#include <Q3ActionGroup>
Inherits:Q3Action

Properties

Public Functions

Q3ActionGroup(QObject * parent, const char * name = 0)
Q3ActionGroup(QObject * parent, const char * name, bool exclusive)
~Q3ActionGroup()
voidadd(Q3Action * action)
voidaddSeparator()
voidinsert(Q3Action * action)
boolisExclusive() const
voidsetExclusive(bool)
voidsetUsesDropDown(bool enable)
boolusesDropDown() const

Reimplemented Public Functions

virtual booladdTo(QWidget * w)
virtual boolremoveFrom(QWidget * w)
virtual voidsetEnabled(bool enable)
virtual voidsetIconSet(const QIcon & icon)
virtual voidsetMenuText(const QString & text)
virtual voidsetOn(bool on)
virtual voidsetText(const QString & txt)
virtual voidsetToggleAction(bool toggle)
virtual voidsetToolTip(const QString & text)
virtual voidsetVisible(bool visible)
virtual voidsetWhatsThis(const QString & text)
  • 21 public functions inherited fromQ3Action
  • 29 public functions inherited fromQObject

Signals

voidactivated(Q3Action * action)
voidselected(Q3Action * action)

Protected Functions

virtual voidaddedTo(QWidget * actionWidget, QWidget * container, Q3Action * a)
virtual voidaddedTo(int index, Q3PopupMenu * menu, Q3Action * a)

Reimplemented Protected Functions

virtual voidaddedTo(QWidget * actionWidget, QWidget * container)
virtual voidaddedTo(int index, Q3PopupMenu * menu)
virtual voidchildEvent(QChildEvent * e)
  • 2 protected functions inherited fromQ3Action
  • 8 protected functions inherited fromQObject

Additional Inherited Members

  • 6 public slots inherited fromQ3Action
  • 1 public slot inherited fromQObject
  • 7 static public members inherited fromQObject

Detailed Description

TheQ3ActionGroup 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 theiractivated() (and for toggle actions,toggled()) signals as usual.

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

Action group actions appear as individual menu options and toolbar buttons. For exclusive action groups usesetUsesDropDown() 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 usingadd(), but normally they are added by creating the action with the action group as parent. Actions can have separators dividing them usingaddSeparator(). Action groups are added to widgets withaddTo().

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:

boolisExclusive() const
voidsetExclusive(bool)

See alsoQ3Action::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'sQ3Action::text andQ3Action::iconSet properties shown. Non-exclusive groups are represented by a tool button showing theirQ3Action::iconSet andtext() property.

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

Changing usesDropDown only affectssubsequent calls toaddTo().

This property's default is false.

Access functions:

boolusesDropDown() const
voidsetUsesDropDown(bool enable)

Member Function Documentation

Q3ActionGroup::Q3ActionGroup(QObject * parent, constchar * name = 0)

Constructs an action group calledname, with parentparent.

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

Q3ActionGroup::Q3ActionGroup(QObject * parent, constchar * name,bool exclusive)

Constructs an action group calledname, with parentparent.

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

See alsoexclusive.

Q3ActionGroup::~Q3ActionGroup()

Destroys the object and frees allocated resources.

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

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

The argument is theaction which was activated.

See alsosetExclusive(),isOn(), andQ3Action::toggled().

void Q3ActionGroup::add(Q3Action * action)

Adds actionaction 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 alsoaddTo().

void Q3ActionGroup::addSeparator()

Adds a separator to the group.

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

Reimplemented fromQ3Action::addTo().

Adds this action group to the widgetw.

IfisExclusive() is false orusesDropDown() 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 bothisExclusive() andusesDropDown() are true, the actions are presented either in a combobox (ifw is a toolbar) or in a submenu (ifw is a menu).

All actions should be added to the action groupbefore the action group is added to the widget. If actions are added to the action groupafter the action group has been added to the widget these later actions willnot appear.

See alsosetExclusive(),setUsesDropDown(), andremoveFrom().

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

This function is called from theaddTo() function when it has created a widget (actionWidget) for the child actiona in thecontainer.

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

This is an overloaded function.

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

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

Reimplemented fromQ3Action::addedTo().

This is an overloaded function.

This function is called from theaddTo() function when it has created a widget (actionWidget) in thecontainer.

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

Reimplemented fromQ3Action::addedTo().

This is an overloaded function.

This function is called from theaddTo() function when it has created a menu item at the index positionindex in the popup menumenu.

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

Reimplemented fromQObject::childEvent().

void Q3ActionGroup::insert(Q3Action * action)

Use add(action) instead.

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

Reimplemented fromQ3Action::removeFrom().

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

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

The argument is theaction whose state changed to "on".

See alsosetExclusive(),isOn(), andQ3Action::toggled().

[virtual]void Q3ActionGroup::setEnabled(bool enable)

Reimplemented fromQ3Action::setEnabled().

[virtual]void Q3ActionGroup::setIconSet(constQIcon & icon)

Reimplemented fromQ3Action::setIconSet().

[virtual]void Q3ActionGroup::setMenuText(constQString & text)

Reimplemented fromQ3Action::setMenuText().

[virtual]void Q3ActionGroup::setOn(bool on)

Reimplemented fromQ3Action::setOn().

[virtual]void Q3ActionGroup::setText(constQString & txt)

Reimplemented fromQ3Action::setText().

[virtual]void Q3ActionGroup::setToggleAction(bool toggle)

Reimplemented fromQ3Action::setToggleAction().

[virtual]void Q3ActionGroup::setToolTip(constQString & text)

Reimplemented fromQ3Action::setToolTip().

[virtual]void Q3ActionGroup::setVisible(bool visible)

Reimplemented fromQ3Action::setVisible().

[virtual]void Q3ActionGroup::setWhatsThis(constQString & text)

Reimplemented fromQ3Action::setWhatsThis().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp