本文整理汇总了C++中KToggleAction::setShortcut方法的典型用法代码示例。如果您正苦于以下问题:C++ KToggleAction::setShortcut方法的具体用法?C++ KToggleAction::setShortcut怎么用?C++ KToggleAction::setShortcut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KToggleAction
的用法示例。
在下文中一共展示了KToggleAction::setShortcut方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupActions
void SayayinShell::setupActions()
{
KStandardAction::openNew(this, SLOT(fileNew()), actionCollection());
KStandardAction::open(this, SLOT(fileOpen()), actionCollection());
KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollection());
KStandardAction::preferences(this, SLOT(optionsPreferences()), actionCollection());
KToggleAction* toggleMenu = KStandardAction::showMenubar(this, SLOT(toggleMenu()), actionCollection());
toggleMenu->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M));
createStandardStatusBarAction();
setStandardToolBarMenuEnabled(true);
//KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection());
//KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
}
示例2: registerToolView
void GUIClient::registerToolView (ToolView *tv)
{
QString aname = QString("kate_mdi_toolview_") + tv->id;
// try to read the action shortcut
KShortcut sc;
KSharedConfig::Ptr cfg = KGlobal::config();
sc = KShortcut( cfg->group("Shortcuts").readEntry( aname, QString() ) );
KToggleAction *a = new ToggleToolViewAction(i18n("Show %1", tv->text), tv, this );
a->setShortcut(sc, KAction::ActiveShortcut); // no DefaultShortcut! see bug #144945
actionCollection()->addAction( aname.toLatin1(), a );
m_toolViewActions.append(a);
m_toolMenu->addAction(a);
m_toolToAction.insert (tv, a);
updateActions();
}
示例3: KToggleAction
KToggleAction* K3b::createToggleAction( QObject* parent,
const QString& text, const QString& icon, const
QKeySequence& shortcut, QObject* receiver, const char* slot,
KActionCollection* actionCollection,
const QString& actionName )
{
KToggleAction* action = new KToggleAction( parent );
action->setText( text );
if( !icon.isEmpty() ) {
action->setIcon( QIcon::fromTheme( icon ) );
}
action->setShortcut( shortcut );
if( receiver ) {
QObject::connect( action, SIGNAL(triggered(bool)),
receiver, slot );
}
if( actionCollection ) {
actionCollection->addAction( actionName, action );
}
return action;
}
示例4: initToolBars
void InlineEditors::initToolBars(KActionCollection *ac)
{
QFont defaultFont;
QColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
Global::bnpView->currentBasket()->textColor() :
palette().color(QPalette::Text));
// Init the RichTextEditor Toolbar:
richTextFont = new QFontComboBox(Global::mainWindow());
focusWidgetFilter = new FocusWidgetFilter(richTextFont);
richTextFont->setFixedWidth(richTextFont->sizeHint().width() * 2 / 3);
richTextFont->setCurrentFont(defaultFont.family());
KAction *action = ac->addAction("richtext_font");
action->setDefaultWidget(richTextFont);
action->setText(i18n("Font"));
action->setShortcut(Qt::Key_F6);
richTextFontSize = new FontSizeCombo(/*rw=*/true, Global::mainWindow());
richTextFontSize->setFontSize(defaultFont.pointSize());
action = ac->addAction("richtext_font_size");
action->setDefaultWidget(richTextFontSize);
action->setText(i18n("Font Size"));
action->setShortcut(Qt::Key_F7);
richTextColor = new KColorCombo(Global::mainWindow());
richTextColor->installEventFilter(focusWidgetFilter);
richTextColor->setFixedWidth(richTextColor->sizeHint().height() * 2);
richTextColor->setColor(textColor);
action = ac->addAction("richtext_color");
action->setDefaultWidget(richTextColor);
action->setText(i18n("Color"));
KToggleAction *ta = NULL;
ta = new KToggleAction(ac);
ac->addAction("richtext_bold", ta);
ta->setText(i18n("Bold"));
ta->setIcon(KIcon("format-text-bold"));
ta->setShortcut(KShortcut("Ctrl+B"));
richTextBold = ta;
ta = new KToggleAction(ac);
ac->addAction("richtext_italic", ta);
ta->setText(i18n("Italic"));
ta->setIcon(KIcon("format-text-italic"));
ta->setShortcut(KShortcut("Ctrl+I"));
richTextItalic = ta;
ta = new KToggleAction(ac);
ac->addAction("richtext_underline", ta);
ta->setText(i18n("Underline"));
ta->setIcon(KIcon("format-text-underline"));
ta->setShortcut(KShortcut("Ctrl+U"));
richTextUnderline = ta;
#if 0
ta = new KToggleAction(ac);
ac->addAction("richtext_super", ta);
ta->setText(i18n("Superscript"));
ta->setIcon(KIcon("text_super"));
richTextSuper = ta;
ta = new KToggleAction(ac);
ac->addAction("richtext_sub", ta);
ta->setText(i18n("Subscript"));
ta->setIcon(KIcon("text_sub"));
richTextSub = ta;
#endif
ta = new KToggleAction(ac);
ac->addAction("richtext_left", ta);
ta->setText(i18n("Align Left"));
ta->setIcon(KIcon("format-justify-left"));
richTextLeft = ta;
ta = new KToggleAction(ac);
ac->addAction("richtext_center", ta);
ta->setText(i18n("Centered"));
ta->setIcon(KIcon("format-justify-center"));
richTextCenter = ta;
ta = new KToggleAction(ac);
ac->addAction("richtext_right", ta);
ta->setText(i18n("Align Right"));
ta->setIcon(KIcon("format-justify-right"));
richTextRight = ta;
ta = new KToggleAction(ac);
ac->addAction("richtext_block", ta);
ta->setText(i18n("Justified"));
ta->setIcon(KIcon("format-justify-fill"));
richTextJustified = ta;
QActionGroup *alignmentGroup = new QActionGroup(this);
alignmentGroup->addAction(richTextLeft);
alignmentGroup->addAction(richTextCenter);
alignmentGroup->addAction(richTextRight);
alignmentGroup->addAction(richTextJustified);
ta = new KToggleAction(ac);
//.........这里部分代码省略.........