
Definition at line 87 of file q3action.cpp.
Public Types | |
| enum | Update |
Public Member Functions | |
| Q3ActionPrivate (Q3Action *act) | |
| ~Q3ActionPrivate () | |
| void | update (uint upd=EverythingElse) |
| QString | menuText () const |
| QString | toolTip () const |
| QString | statusTip () const |
Public Attributes | |
| QIcon * | icon |
| QString | text |
| QString | menutext |
| QString | tooltip |
| QString | statustip |
| QString | whatsthis |
| QKeySequence | key |
| Q3Accel * | accel |
| int | accelid |
| uint | enabled: 1 |
| uint | visible: 1 |
| uint | toggleaction: 1 |
| uint | on: 1 |
| uint | forceDisabled: 1 |
| uint | forceInvisible: 1 |
| Q3ActionGroupPrivate * | d_group |
| Q3Action * | action |
| QList< Action4Item * > | action4items |
| QList< MenuItem * > | menuitems |
| QList< QToolButton * > | toolbuttons |
| QList< ComboItem * > | comboitems |
Classes | |
| struct | Action4Item |
| struct | ComboItem |
| struct | MenuItem |
Definition at line 136 of file q3action.cpp.
00136 { Icons = 1, Visibility = 2, State = 4, EverythingElse = 8 };
| Q3ActionPrivate::Q3ActionPrivate | ( | Q3Action * | act | ) |
Definition at line 145 of file q3action.cpp.
00146 : icon(0), 00147 #ifndef QT_NO_ACCEL 00148 key(0), accel(0), accelid(0), 00149 #endif 00150 enabled(true), visible(true), toggleaction(false), on(false), 00151 forceDisabled(false), forceInvisible(false) 00152 , d_group(0), action(act) 00153 { 00154 }
| Q3ActionPrivate::~Q3ActionPrivate | ( | ) |
Definition at line 156 of file q3action.cpp.
References accel, Q3ActionPrivate::Action4Item::action, action, action4items, QList< T >::at(), QList< T >::begin(), QComboBox::clear(), comboitems, QList< T >::end(), i, icon, menuitems, QObject::parent(), qDeleteAll(), Q3ActionGroup::removeFrom(), QList< T >::size(), tb, and toolbuttons.
00157 { 00158 QList<QToolButton*>::Iterator ittb(toolbuttons.begin()); 00159 QToolButton *tb; 00160 00161 while (ittb != toolbuttons.end()) { 00162 tb = *ittb; 00163 ++ittb; 00164 delete tb; 00165 } 00166 00167 QList<Q3ActionPrivate::MenuItem*>::Iterator itmi(menuitems.begin()); 00168 Q3ActionPrivate::MenuItem* mi; 00169 while (itmi != menuitems.end()) { 00170 mi = *itmi; 00171 ++itmi; 00172 Q3PopupMenu* menu = mi->popup; 00173 if (menu->findItem(mi->id)) 00174 menu->removeItem(mi->id); 00175 } 00176 qDeleteAll(menuitems); 00177 00178 QList<Q3ActionPrivate::Action4Item*>::Iterator itmi4(action4items.begin()); 00179 Q3ActionPrivate::Action4Item* mi4; 00180 while (itmi4 != action4items.end()) { 00181 mi4 = *itmi4; 00182 ++itmi4; 00183 mi4->widget->removeAction(mi4->action); 00184 } 00185 delete Q3ActionPrivate::Action4Item::action; 00186 Q3ActionPrivate::Action4Item::action = 0; 00187 qDeleteAll(action4items); 00188 00189 QList<Q3ActionPrivate::ComboItem*>::Iterator itci(comboitems.begin()); 00190 Q3ActionPrivate::ComboItem* ci; 00191 while (itci != comboitems.end()) { 00192 ci = *itci; 00193 ++itci; 00194 QComboBox* combo = ci->combo; 00195 combo->clear(); 00196 Q3ActionGroup *group = ::qobject_cast<Q3ActionGroup*>(action->parent()); 00197 if (group) { 00198 QObjectList siblings = group->queryList("Q3Action"); 00199 00200 for (int i = 0; i < siblings.size(); ++i) { 00201 Q3Action *sib = ::qobject_cast<Q3Action*>(siblings.at(i)); 00202 sib->removeFrom(combo); 00203 } 00204 for (int i = 0; i < siblings.size(); ++i) { 00205 Q3Action *sib = ::qobject_cast<Q3Action*>(siblings.at(i)); 00206 if (sib == action) 00207 continue; 00208 sib->addTo(combo); 00209 } 00210 } 00211 } 00212 qDeleteAll(comboitems); 00213 00214 #ifndef QT_NO_ACCEL 00215 delete accel; 00216 #endif 00217 delete icon; 00218 }
Here is the call graph for this function:

| void Q3ActionPrivate::update | ( | uint | upd = EverythingElse |
) |
Definition at line 249 of file q3action.cpp.
References accel, accelid, Q3ActionPrivate::Action4Item::action, action, QList< T >::begin(), comboitems, enabled, QList< T >::end(), EverythingElse, icon, Icons, QString::isEmpty(), key, menuitems, Q3Action::menuText(), menuText(), on, QIcon::pixmap(), Q3Accel::setEnabled(), Q3Accel::setWhatsThis(), statusTip(), t, text, toggleaction, toolbuttons, toolTip(), Visibility, visible, and whatsthis.
Referenced by Q3Action::addTo(), Q3Action::setAccel(), Q3Action::setEnabled(), Q3Action::setIconSet(), Q3Action::setMenuText(), Q3Action::setOn(), Q3Action::setStatusTip(), Q3Action::setText(), Q3Action::setToggleAction(), Q3Action::setToolTip(), Q3Action::setVisible(), and Q3Action::setWhatsThis().
00250 { 00251 for (QList<MenuItem*>::Iterator it(menuitems.begin()); it != menuitems.end(); ++it) { 00252 MenuItem* mi = *it; 00253 QString t = menuText(); 00254 #ifndef QT_NO_ACCEL 00255 if (key) 00256 t += '\t' + (QString)QKeySequence(key); 00257 #endif 00258 if (upd & State) { 00259 mi->popup->setItemEnabled(mi->id, enabled); 00260 if (toggleaction) 00261 mi->popup->setItemChecked(mi->id, on); 00262 } 00263 if (upd & Visibility) 00264 mi->popup->setItemVisible(mi->id, visible); 00265 00266 if (upd & Icons) 00267 if (icon) 00268 mi->popup->changeItem(mi->id, *icon, t); 00269 else 00270 mi->popup->changeItem(mi->id, QIcon(), t); 00271 if (upd & EverythingElse) { 00272 mi->popup->changeItem(mi->id, t); 00273 if (!whatsthis.isEmpty()) 00274 mi->popup->setWhatsThis(mi->id, whatsthis); 00275 if (toggleaction) { 00276 mi->popup->setCheckable(true); 00277 mi->popup->setItemChecked(mi->id, on); 00278 } 00279 } 00280 } 00281 if(QAction *act = Action4Item::action) { 00282 if (upd & Visibility) 00283 act->setVisible(visible); 00284 if (upd & Icons) { 00285 if (icon) 00286 act->setIcon(*icon); 00287 else 00288 act->setIcon(QIcon()); 00289 } 00290 if (upd & EverythingElse) { 00291 QString text = action->menuText(); 00292 #ifndef QT_NO_ACCEL 00293 if (key) 00294 text += '\t' + (QString)QKeySequence(key); 00295 #endif 00296 act->setText(text); 00297 act->setToolTip(statusTip()); 00298 act->setWhatsThis(whatsthis); 00299 } 00300 } 00301 for (QList<QToolButton*>::Iterator it2(toolbuttons.begin()); it2 != toolbuttons.end(); ++it2) { 00302 QToolButton* btn = *it2; 00303 if (upd & State) { 00304 btn->setEnabled(enabled); 00305 if (toggleaction) 00306 btn->setOn(on); 00307 } 00308 if (upd & Visibility) 00309 visible ? btn->show() : btn->hide(); 00310 if (upd & Icons) { 00311 if (icon) 00312 btn->setIconSet(*icon); 00313 else 00314 btn->setIconSet(QIcon()); 00315 } 00316 if (upd & EverythingElse) { 00317 btn->setToggleButton(toggleaction); 00318 if (!text.isEmpty()) 00319 btn->setTextLabel(text, false); 00320 #ifndef QT_NO_TOOLTIP 00321 btn->setToolTip(toolTip()); 00322 #endif 00323 #ifndef QT_NO_STATUSTIP 00324 btn->setStatusTip(statusTip()); 00325 #endif 00326 #ifndef QT_NO_WHATSTHIS 00327 QWhatsThis::remove(btn); 00328 if (!whatsthis.isEmpty()) 00329 QWhatsThis::add(btn, whatsthis); 00330 #endif 00331 } 00332 } 00333 #ifndef QT_NO_ACCEL 00334 if (accel) { 00335 accel->setEnabled(enabled && visible); 00336 if (!whatsthis.isEmpty()) 00337 accel->setWhatsThis(accelid, whatsthis); 00338 } 00339 #endif 00340 // Only used by actiongroup 00341 for (QList<ComboItem*>::Iterator it3(comboitems.begin()); it3 != comboitems.end(); ++it3) { 00342 ComboItem *ci = *it3; 00343 if (!ci->combo) 00344 return; 00345 if (ci->id == -1) { 00346 ci->id = ci->combo->count(); 00347 if (icon) 00348 ci->combo->insertItem(icon->pixmap(), text); 00349 else 00350 ci->combo->insertItem(text); 00351 } else { 00352 if (icon) 00353 ci->combo->changeItem(icon->pixmap(), text, ci->id); 00354 else 00355 ci->combo->changeItem(text, ci->id); 00356 } 00357 } 00358 }
Here is the call graph for this function:

| QString Q3ActionPrivate::menuText | ( | ) | const |
Definition at line 360 of file q3action.cpp.
References QString::isNull(), menutext, t, and text.
Referenced by Q3Action::menuText(), and update().
00361 { 00362 if (menutext.isNull()) { 00363 QString t(text); 00364 t.replace('&', "&&"); 00365 return t; 00366 } 00367 return menutext; 00368 }
Here is the call graph for this function:

| QString Q3ActionPrivate::toolTip | ( | ) | const |
Definition at line 370 of file q3action.cpp.
References accel, accelid, QString::isNull(), text, and tooltip.
Referenced by statusTip(), Q3Action::toolTip(), and update().
00371 { 00372 if (tooltip.isNull()) { 00373 #ifndef QT_NO_ACCEL 00374 if (accel) 00375 return text + " (" + (QString)QKeySequence(accel->key(accelid)) + ")"; 00376 #endif 00377 return text; 00378 } 00379 return tooltip; 00380 }
Here is the call graph for this function:

| QString Q3ActionPrivate::statusTip | ( | ) | const |
Definition at line 382 of file q3action.cpp.
References QString::isNull(), statustip, and toolTip().
Referenced by Q3Action::statusTip(), and update().
Here is the call graph for this function:

Definition at line 92 of file q3action.cpp.
Referenced by Q3Action::addTo(), Q3Action::iconSet(), Q3Action::setIconSet(), update(), and ~Q3ActionPrivate().
Definition at line 93 of file q3action.cpp.
Referenced by menuText(), Q3Action::Q3Action(), Q3Action::setText(), Q3Action::text(), toolTip(), and update().
Definition at line 94 of file q3action.cpp.
Referenced by menuText(), Q3Action::Q3Action(), and Q3Action::setMenuText().
Definition at line 96 of file q3action.cpp.
Referenced by Q3Action::setStatusTip(), and statusTip().
Definition at line 97 of file q3action.cpp.
Referenced by Q3Action::setWhatsThis(), update(), and Q3Action::whatsThis().
Definition at line 99 of file q3action.cpp.
Referenced by Q3Action::accel(), Q3Action::setAccel(), and update().
Definition at line 100 of file q3action.cpp.
Referenced by Q3Action::setAccel(), toolTip(), update(), and ~Q3ActionPrivate().
Definition at line 101 of file q3action.cpp.
Referenced by Q3Action::setAccel(), toolTip(), and update().
Definition at line 103 of file q3action.cpp.
Referenced by Q3Action::isEnabled(), Q3Action::setEnabled(), and update().
Definition at line 104 of file q3action.cpp.
Referenced by Q3Action::isVisible(), Q3Action::setVisible(), and update().
Definition at line 105 of file q3action.cpp.
Referenced by Q3Action::addTo(), Q3Action::isToggleAction(), Q3Action::Q3Action(), Q3Action::setToggleAction(), and update().
| uint Q3ActionPrivate::on |
Definition at line 106 of file q3action.cpp.
Referenced by Q3Action::isOn(), Q3Action::setOn(), Q3Action::setToggleAction(), and update().
Definition at line 109 of file q3action.cpp.
Definition at line 131 of file q3action.cpp.
Referenced by Q3Action::addTo(), Q3Action::removeFrom(), and ~Q3ActionPrivate().
Definition at line 132 of file q3action.cpp.
Referenced by Q3Action::addTo(), Q3Action::menuStatusText(), Q3Action::objectDestroyed(), Q3Action::removeFrom(), update(), and ~Q3ActionPrivate().
Definition at line 133 of file q3action.cpp.
Referenced by Q3Action::addTo(), Q3Action::objectDestroyed(), Q3Action::removeFrom(), update(), and ~Q3ActionPrivate().
Definition at line 134 of file q3action.cpp.
Referenced by Q3Action::addTo(), Q3Action::objectDestroyed(), Q3Action::removeFrom(), update(), and ~Q3ActionPrivate().
1.5.1