Q3ActionGroupPrivate Class Reference

Collaboration diagram for Q3ActionGroupPrivate:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 220 of file q3action.cpp.

Public Member Functions

void update (const Q3ActionGroup *)

Public Attributes

uint exclusive: 1
uint dropdown: 1
QList< Q3Action * > actions
Q3Actionselected
Q3ActionseparatorAction
QList< Action4Item * > action4items
QList< QComboBox * > comboboxes
QList< QToolButton * > menubuttons
QList< MenuItem * > menuitems
QList< Q3PopupMenu * > popupmenus

Classes

struct  Action4Item
struct  MenuItem


Member Function Documentation

void Q3ActionGroupPrivate::update ( const Q3ActionGroup  ) 

Definition at line 1303 of file q3action.cpp.

References Q3Action::accel(), Q3ActionGroupPrivate::Action4Item::action, actions, QList< T >::begin(), comboboxes, QList< T >::end(), Q3Action::iconSet(), index, Q3Action::isEnabled(), QIcon::isNull(), QString::isNull(), Q3Action::isVisible(), menubuttons, menuitems, Q3Action::menuText(), QMenu::popup(), popupmenus, QString::size(), Q3Action::text(), Q3Action::toolTip(), and Q3Action::whatsThis().

Referenced by Q3ActionGroup::addTo(), Q3ActionGroup::setEnabled(), Q3ActionGroup::setIconSet(), Q3ActionGroup::setMenuText(), Q3ActionGroup::setOn(), Q3ActionGroup::setText(), Q3ActionGroup::setToggleAction(), Q3ActionGroup::setToolTip(), Q3ActionGroup::setVisible(), and Q3ActionGroup::setWhatsThis().

01304 {
01305     for (QList<Q3Action*>::Iterator it(actions.begin()); it != actions.end(); ++it) {
01306         if (that->isEnabled() && !(*it)->d->forceDisabled)
01307             (*it)->setEnabled(true);
01308         else if (!that->isEnabled() && (*it)->isEnabled()) {
01309             (*it)->setEnabled(false);
01310             (*it)->d->forceDisabled = false;
01311         }
01312   if (that->isVisible() && !(*it)->d->forceInvisible) {
01313       (*it)->setVisible(true);
01314   } else if (!that->isVisible() && (*it)->isVisible()) {
01315       (*it)->setVisible(false);
01316       (*it)->d->forceInvisible = false;
01317   }
01318     }
01319     for (QList<QComboBox*>::Iterator cb(comboboxes.begin()); cb != comboboxes.end(); ++cb) {
01320         QComboBox *combobox = *cb;
01321         combobox->setEnabled(that->isEnabled());
01322         combobox->setShown(that->isVisible());
01323 
01324 #ifndef QT_NO_TOOLTIP
01325         QToolTip::remove(combobox);
01326         if (that->toolTip().size())
01327             QToolTip::add(combobox, that->toolTip());
01328 #endif
01329 #ifndef QT_NO_WHATSTHIS
01330         QWhatsThis::remove(combobox);
01331         if (that->whatsThis().size())
01332             QWhatsThis::add(combobox, that->whatsThis());
01333 #endif
01334 
01335     }
01336     for (QList<QToolButton*>::Iterator mb(menubuttons.begin()); mb != menubuttons.end(); ++mb) {
01337         QToolButton *button = *mb;
01338         button->setEnabled(that->isEnabled());
01339         button->setShown(that->isVisible());
01340 
01341         if (!that->text().isNull())
01342             button->setTextLabel(that->text());
01343         if (!that->iconSet().isNull())
01344             button->setIconSet(that->iconSet());
01345 
01346 #ifndef QT_NO_TOOLTIP
01347         QToolTip::remove(*mb);
01348         if (that->toolTip().size())
01349             QToolTip::add(button, that->toolTip());
01350 #endif
01351 #ifndef QT_NO_WHATSTHIS
01352         QWhatsThis::remove(button);
01353         if (that->whatsThis().size())
01354             QWhatsThis::add(button, that->whatsThis());
01355 #endif
01356     }
01357     if(QAction *act = Q3ActionGroupPrivate::Action4Item::action) {
01358         act->setVisible(that->isVisible());
01359         act->setEnabled(that->isEnabled());
01360     }
01361     for (QList<Q3ActionGroupPrivate::MenuItem*>::Iterator pu(menuitems.begin()); pu != menuitems.end(); ++pu) {
01362         QWidget* parent = (*pu)->popup->parentWidget();
01363         if (::qobject_cast<Q3PopupMenu*>(parent)) {
01364             Q3PopupMenu* ppopup = (Q3PopupMenu*)parent;
01365             ppopup->setItemEnabled((*pu)->id, that->isEnabled());
01366             ppopup->setItemVisible((*pu)->id, that->isVisible());
01367         } else {
01368             (*pu)->popup->setEnabled(that->isEnabled());
01369         }
01370     }
01371     for (QList<Q3PopupMenu*>::Iterator pm(popupmenus.begin()); pm != popupmenus.end(); ++pm) {
01372         Q3PopupMenu *popup = *pm;
01373         Q3PopupMenu *parent = ::qobject_cast<Q3PopupMenu*>(popup->parentWidget());
01374         if (!parent)
01375             continue;
01376 
01377         int index;
01378         parent->findPopup(popup, &index);
01379         int id = parent->idAt(index);
01380         if (!that->iconSet().isNull())
01381             parent->changeItem(id, that->iconSet(), that->menuText());
01382         else
01383             parent->changeItem(id, that->menuText());
01384         parent->setItemEnabled(id, that->isEnabled());
01385 #ifndef QT_NO_ACCEL
01386         parent->setAccel(that->accel(), id);
01387 #endif
01388     }
01389 }

Here is the call graph for this function:


Member Data Documentation

uint Q3ActionGroupPrivate::exclusive

Definition at line 223 of file q3action.cpp.

Referenced by Q3ActionGroup::addTo(), Q3ActionGroup::isExclusive(), Q3ActionGroup::Q3ActionGroup(), and Q3ActionGroup::setExclusive().

uint Q3ActionGroupPrivate::dropdown

Definition at line 224 of file q3action.cpp.

Referenced by Q3ActionGroup::addTo(), Q3ActionGroup::Q3ActionGroup(), Q3ActionGroup::removeFrom(), Q3ActionGroup::setUsesDropDown(), and Q3ActionGroup::usesDropDown().

QList<Q3Action*> Q3ActionGroupPrivate::actions

Definition at line 225 of file q3action.cpp.

Referenced by Q3ActionGroup::add(), Q3ActionGroup::addSeparator(), Q3ActionGroup::addTo(), Q3ActionGroup::childDestroyed(), Q3ActionGroup::childToggled(), Q3ActionGroup::internalComboBoxActivated(), Q3ActionGroup::internalComboBoxHighlighted(), Q3ActionGroup::internalToggle(), Q3ActionGroup::removeFrom(), Q3ActionGroup::setOn(), Q3ActionGroup::setToggleAction(), Q3ActionGroup::setToolTip(), Q3ActionGroup::setWhatsThis(), and update().

Q3Action* Q3ActionGroupPrivate::selected

Definition at line 226 of file q3action.cpp.

Referenced by Q3ActionGroup::childDestroyed(), Q3ActionGroup::childToggled(), Q3ActionGroup::internalComboBoxActivated(), and Q3ActionGroup::Q3ActionGroup().

Q3Action* Q3ActionGroupPrivate::separatorAction

Definition at line 227 of file q3action.cpp.

Referenced by Q3ActionGroup::addSeparator(), Q3ActionGroup::Q3ActionGroup(), and Q3ActionGroup::~Q3ActionGroup().

QList<Action4Item *> Q3ActionGroupPrivate::action4items

Definition at line 239 of file q3action.cpp.

Referenced by Q3ActionGroup::add(), Q3ActionGroup::addTo(), Q3ActionGroup::removeFrom(), and Q3ActionGroup::~Q3ActionGroup().

QList<QComboBox*> Q3ActionGroupPrivate::comboboxes

Definition at line 240 of file q3action.cpp.

Referenced by Q3ActionGroup::add(), Q3ActionGroup::addTo(), Q3ActionGroup::childEvent(), Q3ActionGroup::internalToggle(), Q3ActionGroup::objectDestroyed(), Q3ActionGroup::removeFrom(), update(), and Q3ActionGroup::~Q3ActionGroup().

QList<QToolButton*> Q3ActionGroupPrivate::menubuttons

Definition at line 241 of file q3action.cpp.

Referenced by Q3ActionGroup::add(), Q3ActionGroup::addTo(), Q3ActionGroup::childEvent(), Q3ActionGroup::objectDestroyed(), Q3ActionGroup::removeFrom(), update(), and Q3ActionGroup::~Q3ActionGroup().

QList<MenuItem*> Q3ActionGroupPrivate::menuitems

Definition at line 242 of file q3action.cpp.

Referenced by Q3ActionGroup::add(), Q3ActionGroup::addTo(), Q3ActionGroup::childEvent(), Q3ActionGroup::objectDestroyed(), Q3ActionGroup::removeFrom(), update(), and Q3ActionGroup::~Q3ActionGroup().

QList<Q3PopupMenu*> Q3ActionGroupPrivate::popupmenus

Definition at line 243 of file q3action.cpp.

Referenced by Q3ActionGroup::addTo(), Q3ActionGroup::objectDestroyed(), update(), and Q3ActionGroup::~Q3ActionGroup().


The documentation for this class was generated from the following file:
Generated on Thu Mar 15 15:40:43 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1