本文整理汇总了C++中ActionList::action方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionList::action方法的具体用法?C++ ActionList::action怎么用?C++ ActionList::action使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionList
的用法示例。
在下文中一共展示了ActionList::action方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void PsiToolBar::initialize( QString base, bool createUniqueActions )
{
d->base = base;
d->uniqueActions.clear();
// PsiOptions::instance()->getOption(base + ".").toString()
// setHorizontallyStretchable(PsiOptions::instance()->getOption(base + ".stretchable").toBool());
// setVerticallyStretchable(PsiOptions::instance()->getOption(base + ".stretchable").toBool());
setMovable (!PsiOptions::instance()->getOption(base + ".locked").toBool());
if ( d->psi ) {
ActionList actions = d->psi->actionList()->suitableActions( d->type );
QStringList keys = PsiOptions::instance()->getOption(base + ".actions").toStringList();
for (int j = 0; j < keys.size(); j++) {
IconAction *action = actions.action( keys[j] );
if ( action && action->isSeparator() ) {
addSeparator();
}
else if ( action ) {
if ( createUniqueActions ) {
action = action->copy();
d->uniqueActions.append( action );
}
action->addTo( this );
emit registerAction( action );
}
else {
qWarning("PsiToolBar::initialize(): action %s not found!", keys[j].latin1());
}
}
}
else {
qWarning("PsiToolBar::initialize(): psi is NULL!");
}
if (PsiOptions::instance()->getOption(base + ".visible").toBool()) {
show();
} else {
hide();
}
}
示例2: initialize
void PsiToolBar::initialize( Options::ToolbarPrefs &tbPref, bool createUniqueActions )
{
d->uniqueActions.clear();
setHorizontallyStretchable( tbPref.stretchable );
setVerticallyStretchable( tbPref.stretchable );
setMovingEnabled ( !tbPref.locked );
if ( d->psi ) {
ActionList actions = d->psi->actionList()->suitableActions( d->type );
QStringList keys = tbPref.keys;
for (int j = 0; j < keys.size(); j++) {
IconAction *action = actions.action( keys[j] );
if ( action && action->isSeparator() ) {
addSeparator();
}
else if ( action ) {
if ( createUniqueActions ) {
action = action->copy();
d->uniqueActions.append( action );
}
action->addTo( this );
emit registerAction( action );
}
else
qWarning("PsiToolBar::initialize(): action %s not found!", keys[j].latin1());
}
}
else
qWarning("PsiToolBar::initialize(): psi is NULL!");
if ( tbPref.on )
show();
else
hide();
tbPref.dirty = false;
}