当前位置: 首页>>代码示例>>C++>>正文


C++ Manager::shortcut方法代码示例

本文整理汇总了C++中settings::Manager::shortcut方法的典型用法代码示例。如果您正苦于以下问题:C++ Manager::shortcut方法的具体用法?C++ Manager::shortcut怎么用?C++ Manager::shortcut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在settings::Manager的用法示例。


在下文中一共展示了Manager::shortcut方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createMenus

void MainWindow::createMenus()
{
    Settings::Manager *s = mMain->settings();
    s->beginGroup("IDE/shortcuts");

    new QShortcut( s->shortcut("cmdLineFocus"), this, SLOT(toggleComandLineFocus()) );

    QAction *act;

    // File

    mActions[Quit] = act = new QAction(
        QIcon::fromTheme("application-exit"), tr("&Quit..."), this);
    act->setShortcut(s->shortcut("quit"));
    act->setStatusTip(tr("Quit SuperCollider IDE"));
    QObject::connect( act, SIGNAL(triggered()), this, SLOT(onQuit()) );

    // View
    mActions[ShowDocList] = act = new QAction(tr("&Documents"), this);
    act->setStatusTip(tr("Show/Hide the Documents dock"));
    act->setCheckable(true);
    connect(act, SIGNAL(triggered(bool)), mDocListDock, SLOT(setVisible(bool)));
    connect(mDocListDock, SIGNAL(visibilityChanged(bool)), act, SLOT(setChecked(bool)));

    // Language

    mActions[EvaluateCurrentFile] = act = new QAction(
        QIcon::fromTheme("media-playback-start"), tr("Evaluate &File"), this);
    act->setStatusTip(tr("Evaluate current File"));
    connect(act, SIGNAL(triggered()), this, SLOT(evaluateCurrentFile()));

    mActions[EvaluateSelection] = act = new QAction(
        QIcon::fromTheme("media-playback-start"), tr("&Evaluate Selection"), this);
    act->setShortcut(s->shortcut("evaluateSelection"));
    act->setStatusTip(tr("Evaluate selection or current line"));
    connect(act, SIGNAL(triggered()), this, SLOT(evaluateSelection()));

    mActions[EvaluateRegion] = act = new QAction(
    QIcon::fromTheme("media-playback-start"), tr("&Evaluate Region"), this);
    act->setShortcut(s->shortcut("evaluateRegion"));
    act->setStatusTip(tr("Evaluate current region"));
    connect(act, SIGNAL(triggered()), this, SLOT(evaluateRegion()));

    mMain->scProcess()->action(ScIDE::SCProcess::StopMain)
        ->setShortcut(s->shortcut("stopMain"));

    // Settings

    mActions[ShowSettings] = act = new QAction(tr("&Configure IDE..."), this);
    act->setStatusTip(tr("Show configuration dialog"));
    connect(act, SIGNAL(triggered()), this, SLOT(showSettings()));

    // Help

    mActions[BrowseHelp] = act = new QAction(
    QIcon::fromTheme("system-help"), tr("&Browse Help"), this);
    act->setStatusTip(tr("Open help browser on the Browse page."));
    //connect(act, SIGNAL(triggered()), this, SLOT(browseHelp()));
    mCodeEvalMapper.setMapping(act, "HelpBrowser.openBrowsePage");
    connect(act, SIGNAL(triggered()), &mCodeEvalMapper, SLOT(map()));

    mActions[SearchHelp] = act = new QAction(
    QIcon::fromTheme("system-help"), tr("&Search Help"), this);
    act->setStatusTip(tr("Open help browser on the Search page."));
    //connect(act, SIGNAL(triggered()), this, SLOT(searchHelp()));
    mCodeEvalMapper.setMapping(act, "HelpBrowser.openSearchPage");
    connect(act, SIGNAL(triggered()), &mCodeEvalMapper, SLOT(map()));

    mActions[HelpForSelection] = act = new QAction(
    QIcon::fromTheme("system-help"), tr("&Help for Selection"), this);
    act->setShortcut(s->shortcut("helpForSelection"));
    act->setStatusTip(tr("Find help for selected text"));
    connect(act, SIGNAL(triggered()), this, SLOT(helpForSelection()));

    s->endGroup(); // IDE/shortcuts;

    QMenu *menu;
    QMenu *submenu;

    menu = new QMenu(tr("&File"), this);
    menu->addAction( mEditors->action(MultiEditor::DocNew) );
    menu->addAction( mEditors->action(MultiEditor::DocOpen) );
    menu->addAction( mEditors->action(MultiEditor::DocSave) );
    menu->addAction( mEditors->action(MultiEditor::DocSaveAs) );
    menu->addSeparator();
    menu->addAction( mEditors->action(MultiEditor::DocClose) );
    menu->addSeparator();
    menu->addAction( mActions[Quit] );

    menuBar()->addMenu(menu);

    menu = new QMenu(tr("&Edit"), this);
    menu->addAction( mEditors->action(MultiEditor::Undo) );
    menu->addAction( mEditors->action(MultiEditor::Redo) );
    menu->addSeparator();
    menu->addAction( mEditors->action(MultiEditor::Cut) );
    menu->addAction( mEditors->action(MultiEditor::Copy) );
    menu->addAction( mEditors->action(MultiEditor::Paste) );
    menu->addSeparator();
    menu->addAction( mEditors->action(MultiEditor::Find) );
//.........这里部分代码省略.........
开发者ID:jleben,项目名称:supercollider,代码行数:101,代码来源:main_window.cpp


注:本文中的settings::Manager::shortcut方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。