本文整理汇总了C++中settings::Manager::value方法的典型用法代码示例。如果您正苦于以下问题:C++ Manager::value方法的具体用法?C++ Manager::value怎么用?C++ Manager::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings::Manager
的用法示例。
在下文中一共展示了Manager::value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: main
int main( int argc, char *argv[] )
{
QApplication app(argc, argv);
QStringList arguments (QApplication::arguments());
arguments.pop_front(); // application path
// Pass files to existing instance and quit
SingleInstanceGuard guard;
if (guard.tryConnect(arguments))
return 0;
// Set up translations
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
QTranslator scideTranslator;
scideTranslator.load("scide_" + QLocale::system().name());
app.installTranslator(&scideTranslator);
// Set up style
app.setStyle( new ScIDE::Style(app.style()) );
// Go...
Main * main = Main::instance();
MainWindow *win = new MainWindow(main);
// NOTE: load session after GUI is created, so that GUI can respond
Settings::Manager *settings = main->settings();
SessionManager *sessions = main->sessionManager();
QString startSessionName = settings->value("IDE/startWithSession").toString();
if (startSessionName == "last") {
QString lastSession = sessions->lastSession();
if (!lastSession.isEmpty()) {
sessions->openSession(lastSession);
}
}
else if (!startSessionName.isEmpty()) {
sessions->openSession(startSessionName);
}
if (!sessions->currentSession()) {
win->restoreWindowState();
sessions->newSession();
}
win->show();
foreach (QString argument, arguments) {
main->documentManager()->open(argument);
}
示例3: main
int main( int argc, char *argv[] )
{
QApplication app(argc, argv);
QStringList arguments (QApplication::arguments());
arguments.pop_front(); // application path
// Pass files to existing instance and quit
SingleInstanceGuard guard;
if (guard.tryConnect(arguments))
return 0;
// Set up translations
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
char resourcePath[PATH_MAX];
sc_GetResourceDirectory(resourcePath, PATH_MAX);
QString ideTranslationPath = QString(resourcePath) + "/translations";
bool translationLoaded;
// Load fallback translator that only handles plural forms in English
QTranslator fallbackTranslator;
translationLoaded = fallbackTranslator.load( "scide", ideTranslationPath );
app.installTranslator(&fallbackTranslator);
if (!translationLoaded)
qWarning("scide warning: Failed to load fallback translation file.");
// Load translator for locale
QString ideTranslationFile = "scide_" + QLocale::system().name();
QTranslator scideTranslator;
scideTranslator.load( ideTranslationFile, ideTranslationPath );
app.installTranslator(&scideTranslator);
// Set up style
app.setStyle( new ScIDE::Style(app.style()) );
// Go...
Main * main = Main::instance();
MainWindow *win = new MainWindow(main);
// NOTE: load session after GUI is created, so that GUI can respond
Settings::Manager *settings = main->settings();
SessionManager *sessions = main->sessionManager();
// NOTE: window has to be shown before restoring its geometry,
// or else restoring maximized state will fail, if it has ever before
// been saved un-maximized.
win->show();
QString startSessionName = settings->value("IDE/startWithSession").toString();
if (startSessionName == "last") {
QString lastSession = sessions->lastSession();
if (!lastSession.isEmpty()) {
sessions->openSession(lastSession);
}
}
else if (!startSessionName.isEmpty()) {
sessions->openSession(startSessionName);
}
if (!sessions->currentSession()) {
win->restoreWindowState();
sessions->newSession();
}
foreach (QString argument, arguments) {
main->documentManager()->open(argument);
}