本文整理汇总了C++中QAction::inherits方法的典型用法代码示例。如果您正苦于以下问题:C++ QAction::inherits方法的具体用法?C++ QAction::inherits怎么用?C++ QAction::inherits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAction
的用法示例。
在下文中一共展示了QAction::inherits方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFromConfig
void ActionsEditor::loadFromConfig(QObject *o, QSettings *set) {
qDebug("ActionsEditor::loadFromConfig");
set->beginGroup("actions");
QAction *action;
QString accelText;
QList<QAction *> actions = o->findChildren<QAction *>();
for (int n=0; n < actions.count(); n++) {
action = static_cast<QAction*> (actions[n]);
if (!action->objectName().isEmpty() && !action->inherits("QWidgetAction")) {
#if USE_MULTIPLE_SHORTCUTS
QString current = shortcutsToString(action->shortcuts());
accelText = set->value(action->objectName(), current).toString();
action->setShortcuts( stringToShortcuts( accelText ) );
#else
accelText = set->value(action->objectName(), action->shortcut().toString()).toString();
action->setShortcut(QKeySequence(accelText));
#endif
}
}
set->endGroup();
}
示例2: addActions
void ActionsEditor::addActions(QWidget *widget) {
QAction *action;
QList<QAction *> actions = widget->findChildren<QAction *>();
for (int n=0; n < actions.count(); n++) {
action = static_cast<QAction*> (actions[n]);
/*
if (!action->objectName().isEmpty()) {
qDebug("ActionsEditor::addActions: action # %d: '%s' menu: %d", n, action->objectName().toUtf8().constData(), action->menu()!=0);
}
*/
if (!action->objectName().isEmpty() && !action->inherits("QWidgetAction") && (action->menu()==0) )
actionsList.append(action);
}
updateView();
}