本文整理汇总了C++中KActionCollection::setShortcutsConfigurable方法的典型用法代码示例。如果您正苦于以下问题:C++ KActionCollection::setShortcutsConfigurable方法的具体用法?C++ KActionCollection::setShortcutsConfigurable怎么用?C++ KActionCollection::setShortcutsConfigurable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KActionCollection
的用法示例。
在下文中一共展示了KActionCollection::setShortcutsConfigurable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createActions
void KMReaderWin::createActions()
{
KActionCollection *ac = mActionCollection;
if (!ac) {
return;
}
//
// Message Menu
//
// new message to
mMailToComposeAction = new QAction(QIcon::fromTheme(QStringLiteral("mail-message-new")),
i18n("New Message To..."), this);
ac->addAction(QStringLiteral("mail_new"), mMailToComposeAction);
ac->setShortcutsConfigurable(mMailToComposeAction, false);
connect(mMailToComposeAction, &QAction::triggered, this, &KMReaderWin::slotMailtoCompose);
// reply to
mMailToReplyAction = new QAction(QIcon::fromTheme(QStringLiteral("mail-reply-sender")),
i18n("Reply To..."), this);
ac->addAction(QStringLiteral("mailto_reply"), mMailToReplyAction);
ac->setShortcutsConfigurable(mMailToReplyAction, false);
connect(mMailToReplyAction, &QAction::triggered, this, &KMReaderWin::slotMailtoReply);
// forward to
mMailToForwardAction = new QAction(QIcon::fromTheme(QStringLiteral("mail-forward")),
i18n("Forward To..."), this);
ac->setShortcutsConfigurable(mMailToForwardAction, false);
ac->addAction(QStringLiteral("mailto_forward"), mMailToForwardAction);
connect(mMailToForwardAction, &QAction::triggered, this, &KMReaderWin::slotMailtoForward);
// add to addressbook
mAddAddrBookAction = new QAction(QIcon::fromTheme(QStringLiteral("contact-new")),
i18n("Add to Address Book"), this);
ac->setShortcutsConfigurable(mAddAddrBookAction, false);
ac->addAction(QStringLiteral("add_addr_book"), mAddAddrBookAction);
connect(mAddAddrBookAction, &QAction::triggered, this, &KMReaderWin::slotMailtoAddAddrBook);
mAddEmailToExistingContactAction = new QAction(QIcon::fromTheme(QStringLiteral("contact-new")),
i18n("Add to Existing Contact"), this);
ac->setShortcutsConfigurable(mAddEmailToExistingContactAction, false);
ac->addAction(QStringLiteral("add_to_existing_contact"), mAddAddrBookAction);
connect(mAddEmailToExistingContactAction, &QAction::triggered, this, &KMReaderWin::slotMailToAddToExistingContact);
// open in addressbook
mOpenAddrBookAction = new QAction(QIcon::fromTheme(QStringLiteral("view-pim-contacts")),
i18n("Open in Address Book"), this);
ac->setShortcutsConfigurable(mOpenAddrBookAction, false);
ac->addAction(QStringLiteral("openin_addr_book"), mOpenAddrBookAction);
connect(mOpenAddrBookAction, &QAction::triggered, this, &KMReaderWin::slotMailtoOpenAddrBook);
// bookmark message
mAddBookmarksAction = new QAction(QIcon::fromTheme(QStringLiteral("bookmark-new")), i18n("Bookmark This Link"), this);
ac->setShortcutsConfigurable(mAddBookmarksAction, false);
ac->addAction(QStringLiteral("add_bookmarks"), mAddBookmarksAction);
connect(mAddBookmarksAction, &QAction::triggered, this, &KMReaderWin::slotAddBookmarks);
mEditContactAction = new QAction(QIcon::fromTheme(QStringLiteral("view-pim-contacts")),
i18n("Edit contact..."), this);
ac->setShortcutsConfigurable(mEditContactAction, false);
ac->addAction(QStringLiteral("edit_contact"), mOpenAddrBookAction);
connect(mEditContactAction, &QAction::triggered, this, &KMReaderWin::slotEditContact);
// save URL as
mUrlSaveAsAction = new QAction(i18n("Save Link As..."), this);
ac->addAction(QStringLiteral("saveas_url"), mUrlSaveAsAction);
ac->setShortcutsConfigurable(mUrlSaveAsAction, false);
connect(mUrlSaveAsAction, &QAction::triggered, this, &KMReaderWin::slotUrlSave);
// find text
QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("edit-find")), i18n("&Find in Message..."), this);
ac->addAction(QStringLiteral("find_in_messages"), action);
connect(action, &QAction::triggered, this, &KMReaderWin::slotFind);
ac->setDefaultShortcut(action, KStandardShortcut::find().first());
// save Image On Disk
mImageUrlSaveAsAction = new QAction(i18n("Save Image On Disk..."), this);
ac->addAction(QStringLiteral("saveas_imageurl"), mImageUrlSaveAsAction);
ac->setShortcutsConfigurable(mImageUrlSaveAsAction, false);
connect(mImageUrlSaveAsAction, &QAction::triggered, this, &KMReaderWin::slotSaveImageOnDisk);
// View html options
mViewHtmlOptions = new QMenu(i18n("Show HTML Format"));
mViewAsHtml = new QAction(i18n("Show HTML format when mail comes from this contact"), mViewHtmlOptions);
ac->setShortcutsConfigurable(mViewAsHtml, false);
connect(mViewAsHtml, &QAction::triggered, this, &KMReaderWin::slotContactHtmlOptions);
mViewAsHtml->setCheckable(true);
mViewHtmlOptions->addAction(mViewAsHtml);
mLoadExternalReference = new QAction(i18n("Load external reference when mail comes for this contact"), mViewHtmlOptions);
ac->setShortcutsConfigurable(mLoadExternalReference, false);
connect(mLoadExternalReference, &QAction::triggered, this, &KMReaderWin::slotContactHtmlOptions);
mLoadExternalReference->setCheckable(true);
mViewHtmlOptions->addAction(mLoadExternalReference);
mShareImage = new QAction(i18n("Share image..."), this);
ac->addAction(QStringLiteral("share_imageurl"), mShareImage);
ac->setShortcutsConfigurable(mShareImage, false);
connect(mShareImage, &QAction::triggered, this, &KMReaderWin::slotShareImage);
}