本文整理汇总了C++中settings::Manager::beginGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ Manager::beginGroup方法的具体用法?C++ Manager::beginGroup怎么用?C++ Manager::beginGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings::Manager
的用法示例。
在下文中一共展示了Manager::beginGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startLanguage
void ScProcess::startLanguage (void)
{
if (state() != QProcess::NotRunning) {
statusMessage(tr("Interpreter is already running."));
return;
}
Settings::Manager *settings = Main::settings();
settings->beginGroup("IDE/interpreter");
QString workingDirectory = settings->value("runtimeDir").toString();
QString configFile = settings->value("configFile").toString();
settings->endGroup();
QString sclangCommand;
#ifdef Q_OS_MAC
sclangCommand = standardDirectory(ScResourceDir) + "/../MacOS/sclang";
#else
sclangCommand = "sclang";
#endif
QStringList sclangArguments;
if(!configFile.isEmpty())
sclangArguments << "-l" << configFile;
sclangArguments << "-i" << "scqt";
if(!workingDirectory.isEmpty())
setWorkingDirectory(workingDirectory);
QProcess::start(sclangCommand, sclangArguments);
bool processStarted = QProcess::waitForStarted();
if (!processStarted)
emit statusMessage(tr("Failed to start interpreter!"));
}
示例2: 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) );
//.........这里部分代码省略.........