本文整理汇总了C++中ActionList::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionList::erase方法的具体用法?C++ ActionList::erase怎么用?C++ ActionList::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionList
的用法示例。
在下文中一共展示了ActionList::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveCommandFromList
bool CKeyBindings::RemoveCommandFromList(ActionList& al, const std::string& command)
{
bool success = false;
ActionList::iterator it = al.begin();
while (it != al.end()) {
if (it->command == command) {
it = al.erase(it);
success = true;
} else {
++it;
}
}
return success;
}
示例2: QObject
ToolBarManager::ToolBarManager(QMainWindow *configureableMainWindow,
QWidget *parent,
QMenu *toolBarMenu,
const QDesignerActions *actions,
const QList<QToolBar *> &toolbars,
const QList<QDesignerToolWindow*> &toolWindows) :
QObject(parent),
m_configureableMainWindow(configureableMainWindow),
m_parent(parent),
m_toolBarMenu(toolBarMenu),
m_manager(new QtToolBarManager(this)),
m_configureAction(new QAction(tr("Configure Toolbars..."), this)),
m_toolbars(toolbars)
{
m_configureAction->setMenuRole(QAction::NoRole);
m_configureAction->setObjectName(QLatin1String("__qt_configure_tool_bars_action"));
connect(m_configureAction, SIGNAL(triggered()), this, SLOT(configureToolBars()));
m_manager->setMainWindow(configureableMainWindow);
foreach(QToolBar *tb, m_toolbars) {
const QString title = tb->windowTitle();
m_manager->addToolBar(tb, title);
addActionsToToolBarManager(tb->actions(), title, m_manager);
}
addActionsToToolBarManager(actions->windowActions()->actions(), tr("Window"), m_manager);
addActionsToToolBarManager(actions->helpActions()->actions(), tr("Help"), m_manager);
// Filter out the device profile preview actions which have int data().
ActionList previewActions = actions->styleActions()->actions();
ActionList::iterator it = previewActions.begin();
for ( ; (*it)->isSeparator() || (*it)->data().type() == QVariant::Int; ++it) ;
previewActions.erase(previewActions.begin(), it);
addActionsToToolBarManager(previewActions, tr("Style"), m_manager);
const QString dockTitle = tr("Dock views");
foreach (QDesignerToolWindow *tw, toolWindows) {
if (QAction *action = tw->action())
m_manager->addAction(action, dockTitle);
}
m_manager->addAction(m_configureAction, tr("Toolbars"));
updateToolBarMenu();
}