本文整理汇总了C++中ActionList::constEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionList::constEnd方法的具体用法?C++ ActionList::constEnd怎么用?C++ ActionList::constEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionList
的用法示例。
在下文中一共展示了ActionList::constEnd方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addActionsToToolBar
static void addActionsToToolBar(const ActionList &actions, QToolBar *t)
{
const ActionList::const_iterator cend = actions.constEnd();
for (ActionList::const_iterator it = actions.constBegin(); it != cend; ++it) {
QAction *action = *it;
if (action->property(QDesignerActions::defaultToolbarPropertyName).toBool())
t->addAction(action);
}
}
示例2: addActionsToToolBar
static void addActionsToToolBar(const ActionList &actions, QToolBar *t)
{
const ActionList::const_iterator cend = actions.constEnd();
for (ActionList::const_iterator it = actions.constBegin(); it != cend; ++it) {
QAction *action = *it;
if (!action->icon().isNull())
t->addAction(action);
}
}
示例3: objectNameList
static QStringList objectNameList(QDesignerFormWindowInterface *form)
{
typedef QList<QAction*> ActionList;
typedef QList<QButtonGroup *> ButtonGroupList;
QStringList result;
QWidget *mainContainer = form->mainContainer();
if (!mainContainer)
return result;
// Add main container container pages (QStatusBar, QWizardPages) etc.
// to the list. Pages of containers on the form are not added, however.
if (const QDesignerContainerExtension *c = qt_extension<QDesignerContainerExtension *>(form->core()->extensionManager(), mainContainer)) {
const int count = c->count();
for (int i = 0 ; i < count; i++)
addWidgetToObjectList(c->widget(i), result);
}
const QDesignerFormWindowCursorInterface *cursor = form->cursor();
const int widgetCount = cursor->widgetCount();
for (int i = 0; i < widgetCount; ++i)
addWidgetToObjectList(cursor->widget(i), result);
const QDesignerMetaDataBaseInterface *mdb = form->core()->metaDataBase();
// Add managed actions and actions with managed menus
const ActionList actions = mainContainer->findChildren<QAction*>();
if (!actions.empty()) {
const ActionList::const_iterator cend = actions.constEnd();
for (ActionList::const_iterator it = actions.constBegin(); it != cend; ++it) {
QAction *a = *it;
if (!a->isSeparator()) {
if (QMenu *menu = a->menu()) {
if (mdb->item(menu))
result.push_back(menu->objectName());
} else {
if (mdb->item(a))
result.push_back(a->objectName());
}
}
}
}
// Add managed buttons groups
const ButtonGroupList buttonGroups = mainContainer->findChildren<QButtonGroup *>();
if (!buttonGroups.empty()) {
const ButtonGroupList::const_iterator cend = buttonGroups.constEnd();
for (ButtonGroupList::const_iterator it = buttonGroups.constBegin(); it != cend; ++it)
if (mdb->item(*it))
result.append((*it)->objectName());
}
result.sort();
return result;
}
示例4: addActions
void ZoomMenu::addActions(QMenu *m)
{
const ActionList za = m_menuActions->actions();
const ActionList::const_iterator cend = za.constEnd();
for (ActionList::const_iterator it = za.constBegin(); it != cend; ++it) {
m->addAction(*it);
if (zoomOf(*it) == 100)
m->addSeparator();
}
}
示例5: setZoom
void ZoomMenu::setZoom(int percent)
{
const ActionList za = m_menuActions->actions();
const ActionList::const_iterator cend = za.constEnd();
for (ActionList::const_iterator it = za.constBegin(); it != cend; ++it)
if (zoomOf(*it) == percent) {
(*it)->setChecked(true);
return;
}
}
示例6: handleContextMenuEvent
bool ToolBarEventFilter::handleContextMenuEvent(QContextMenuEvent * event )
{
event->accept();
const QPoint globalPos = event->globalPos();
const ActionList al = contextMenuActions(event->globalPos());
QMenu menu(0);
const ActionList::const_iterator acend = al.constEnd();
for (ActionList::const_iterator it = al.constBegin(); it != acend; ++it)
menu.addAction(*it);
menu.exec(globalPos);
return true;
}
示例7: handleContextMenuEvent
bool QDesignerMenuBar::handleContextMenuEvent(QWidget *, QContextMenuEvent *event)
{
event->accept();
m_currentIndex = actionIndexAt(this, mapFromGlobal(event->globalPos()), Qt::Horizontal);
update();
QMenu menu;
const ActionList al = contextMenuActions();
const ActionList::const_iterator acend = al.constEnd();
for (ActionList::const_iterator it = al.constBegin(); it != acend; ++it)
menu.addAction(*it);
menu.exec(event->globalPos());
return true;
}
示例8: mdiArea
// Create a MDI subwindow for the form.
QMdiSubWindow *DockedMainWindow::createMdiSubWindow(QWidget *fw, Qt::WindowFlags f, const QKeySequence &designerCloseActionShortCut)
{
QMdiSubWindow *rc = mdiArea()->addSubWindow(fw, f);
// Make action shortcuts respond only if focused to avoid conflicts with
// designer menu actions
if (designerCloseActionShortCut == QKeySequence(QKeySequence::Close)) {
const ActionList systemMenuActions = rc->systemMenu()->actions();
if (!systemMenuActions.empty()) {
const ActionList::const_iterator cend = systemMenuActions.constEnd();
for (ActionList::const_iterator it = systemMenuActions.constBegin(); it != cend; ++it) {
if ( (*it)->shortcut() == designerCloseActionShortCut) {
(*it)->setShortcutContext(Qt::WidgetShortcut);
break;
}
}
}
}
return rc;
}
示例9: addActionsToToolBarManager
static void addActionsToToolBarManager(const ActionList &al, const QString &title, QtToolBarManager *tbm)
{
const ActionList::const_iterator cend = al.constEnd();
for (ActionList::const_iterator it = al.constBegin(); it != cend; ++it)
tbm->addAction(*it, title);
}