PropertySheetKeySequenceValue ActionModel::actionShortCut(const QDesignerPropertySheetExtension *sheet) { const int index = sheet->indexOf(QLatin1String("shortcut")); if (index == -1) return PropertySheetKeySequenceValue(); return qvariant_cast<PropertySheetKeySequenceValue>(sheet->property(index)); }
// shortcut is a fake property, need to retrieve it via property sheet. PropertySheetKeySequenceValue ActionModel::actionShortCut(QDesignerFormEditorInterface *core, QAction *action) { QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core->extensionManager(), action); if (!sheet) return PropertySheetKeySequenceValue(); return actionShortCut(sheet); }
ActionData NewActionDialog::actionData() const { ActionData rc; rc.text = actionText(); rc.name = actionName(); rc.toolTip = m_ui->tooltipEditor->text(); rc.icon = m_ui->iconSelector->icon(); rc.checkable = m_ui->checkableCheckBox->checkState() == Qt::Checked; rc.keysequence = PropertySheetKeySequenceValue(m_ui->keySequenceEdit->keySequence()); return rc; }