本文整理汇总了C++中ActionList::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionList::contains方法的具体用法?C++ ActionList::contains怎么用?C++ ActionList::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionList
的用法示例。
在下文中一共展示了ActionList::contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleDropEvent
bool ToolBarEventFilter::handleDropEvent(QDropEvent *event)
{
const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData());
if (!d)
return false;
if (d->actionList().isEmpty()) {
event->ignore();
hideDragIndicator();
return true;
}
QAction *action = d->actionList().first();
const ActionList actions = m_toolBar->actions();
if (!action || actions.contains(action)) {
event->ignore();
hideDragIndicator();
return true;
}
// Try to find action to 'insert before'. Click on action or in free area, else ignore.
QAction *beforeAction = 0;
const QPoint pos = event->pos();
const int index = actionIndexAt(m_toolBar, pos, m_toolBar->orientation());
if (index != -1) {
beforeAction = actions.at(index);
} else {
if (!freeArea(m_toolBar).contains(pos)) {
event->ignore();
hideDragIndicator();
return true;
}
}
event->acceptProposedAction();
QDesignerFormWindowInterface *fw = formWindow();
InsertActionIntoCommand *cmd = new InsertActionIntoCommand(fw);
cmd->init(m_toolBar, action, beforeAction);
fw->commandHistory()->push(cmd);
hideDragIndicator();
return true;
}