本文整理汇总了C++中getSetting函数的典型用法代码示例。如果您正苦于以下问题:C++ getSetting函数的具体用法?C++ getSetting怎么用?C++ getSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSetting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getSetting
/** Loads the saved Message Log settings */
void
MessageLog::loadSettings()
{
/* Set Max Count widget */
uint maxMsgCount = getSetting(SETTING_MAX_MSG_COUNT,
DEFAULT_MAX_MSG_COUNT).toUInt();
ui.spnbxMaxCount->setValue(maxMsgCount);
ui.listMessages->setMaximumMessageCount(maxMsgCount);
ui.listNotifications->setMaximumItemCount(maxMsgCount);
/* Set whether or not logging to file is enabled */
_enableLogging = getSetting(SETTING_ENABLE_LOGFILE,
DEFAULT_ENABLE_LOGFILE).toBool();
QString logfile = getSetting(SETTING_LOGFILE,
DEFAULT_LOGFILE).toString();
ui.lineFile->setText(QDir::convertSeparators(logfile));
rotateLogFile(logfile);
ui.chkEnableLogFile->setChecked(_logFile.isOpen());
/* Set the checkboxes accordingly */
_filter = getSetting(SETTING_MSG_FILTER, DEFAULT_MSG_FILTER).toUInt();
ui.chkTorErr->setChecked(_filter & tc::ErrorSeverity);
ui.chkTorWarn->setChecked(_filter & tc::WarnSeverity);
ui.chkTorNote->setChecked(_filter & tc::NoticeSeverity);
ui.chkTorInfo->setChecked(_filter & tc::InfoSeverity);
ui.chkTorDebug->setChecked(_filter & tc::DebugSeverity);
registerLogEvents();
/* Filter the message log */
QApplication::setOverrideCursor(Qt::WaitCursor);
ui.listMessages->filter(_filter);
QApplication::restoreOverrideCursor();
}
开发者ID:Bodyfarm,项目名称:vidalia,代码行数:34,代码来源:MessageLog.cpp
示例2: Modifier
//------------------------------------------------------------------------------
ImpactObject::ImpactObject(const Setting &setting, Domain *domain):
Modifier(domain)
{
startTime = getSetting(setting, {"startTime"});
endTime = getSetting(setting, {"endTime"});
ks = getSetting(setting, {"ks"});
R = getSetting(setting, {"R"});
velocity = getSetting(setting, {"velocity"});
// Dimensionless scaling
// f = F/V^2 = -ks(r' - R')^2 /L0^4
// f' = f L0^4 / E0 = -ks/E0 (r' - R')^2
//
// OR
//
// F = -ks'(r' - R')^2 E0 L0^2
// b = F/V = -ks(r - R)^2 / V
// b = -ks'(r' - R')^2 / V' E0/L0
// b' = -ks'(r' - R')^ 2 / V'
const Scaling &scaling = domain->scaling();
if(scaling.dimensionlessScaling)
{
ks /= scaling.E;
R /= scaling.L;
velocity /= scaling.V;
}
// Setting the center of the sphere
double spacing = domain->latticeSpacing();
centerOfSphere[X] = domain->getDomain()[X][1] + R - 0.5*spacing;
centerOfSphere[Y] = 0.5*( domain->getDomain()[Y][1] - domain->getDomain()[Y][0] );
centerOfSphere[Z] = 0.5*( domain->getDomain()[Z][1] - domain->getDomain()[Z][0] );
tPrev = 0; // TODO: should be initial time.
}
开发者ID:ttnghia,项目名称:Peridynamics,代码行数:35,代码来源:impactobject.cpp
示例3: getVoiceList
void TTSFestival::updateVoiceList()
{
QStringList voiceList = getVoiceList(getSetting(eSERVERPATH)->current().toString());
getSetting(eVOICE)->setList(voiceList);
if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0));
else getSetting(eVOICE)->setCurrent("");
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:7,代码来源:ttsfestival.cpp
示例4: Q_UNUSED
bool
Dropbox::writeFile(QByteArray &data, QString remotename, RideFile *ride)
{
Q_UNUSED(ride);
// this must be performed asyncronously and call made
// to notifyWriteCompleted(QString remotename, QString message) when done
// do we have a token ?
QString token = getSetting(GC_DROPBOX_TOKEN, "").toString();
if (token == "") return false;
// is the path set ?
QString path = getSetting(GC_DROPBOX_FOLDER, "").toString();
if (path == "") return false;
// lets connect and get basic info on the root directory
QString url("https://content.dropboxapi.com/1/files_put/auto/" + path + "/" + remotename + "?overwrite=true&autorename=false");
// request using the bearer token
QNetworkRequest request(url);
request.setRawHeader("Authorization", (QString("Bearer %1").arg(token)).toLatin1());
// put the file
QNetworkReply *reply = nam->put(request, data);
// catch finished signal
connect(reply, SIGNAL(finished()), this, SLOT(writeFileCompleted()));
// remember
mapReply(reply,remotename);
return true;
}
开发者ID:lumanz,项目名称:GoldenCheetah,代码行数:33,代码来源:Dropbox.cpp
示例5: InitialConfiguration
//------------------------------------------------------------------------------
InitialFromImage::InitialFromImage(const Setting& parameters):
InitialConfiguration(parameters)
{
const Setting & latticePoints = getSetting(parameters, {"initialConfiguration",
"latticePoints"});
// Setting the intial grid size and dimension
nParticles = 1;
dim = latticePoints.getLength();
nXYZ.zeros();
for(int d=0; d<dim; d++)
{
nXYZ[d] = latticePoints[d];
nParticles *= nXYZ[d];
}
// Setting the domain
vector<VEC2> dom;
for(int i=0; i<dim; i++)
{
VEC2 iDomain;
iDomain = { 0 , spacing*nXYZ[i]};
dom.push_back(iDomain);
}
domain.setDomain(dom);
string pathXZ = getSetting(parameters, {"initialConfiguration",
"pathXZ"});
}
开发者ID:ttnghia,项目名称:Peridynamics,代码行数:31,代码来源:initialfromimage.cpp
示例6: init_ui
void init_ui(int *argcp, char ***argvp)
{
QVariant v;
application = new QApplication(*argcp, *argvp);
// the Gtk theme makes things unbearably ugly
// so switch to Oxygen in this case
if (application->style()->objectName() == "gtk+")
application->setStyle("Oxygen");
#if QT_VERSION < 0x050000
// ask QString in Qt 4 to interpret all char* as UTF-8,
// like Qt 5 does.
// 106 is "UTF-8", this is faster than lookup by name
// [http://www.iana.org/assignments/character-sets/character-sets.xml]
QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106));
#endif
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
QCoreApplication::setApplicationName("Subsurface");
QSettings s;
s.beginGroup("GeneralSettings");
prefs.default_filename = getSetting(s, "default_filename");
s.endGroup();
s.beginGroup("DiveComputer");
default_dive_computer_vendor = getSetting(s, "dive_computer_vendor");
default_dive_computer_product = getSetting(s,"dive_computer_product");
default_dive_computer_device = getSetting(s, "dive_computer_device");
s.endGroup();
return;
}
开发者ID:richardsonlima,项目名称:subsurface,代码行数:33,代码来源:qt-gui.cpp
示例7: persite
// Apply per-site settings when going to new sites
static void persite(webview * const view, const char * const url) {
tab * const cur = findtab(view);
if (!cur || cur->state != TS_WEB)
return;
char site[120];
url2site(url, site, 120, true);
setting *s = NULL;
if (cur->js == TRI_AUTO) {
s = getSetting("general.javascript", site);
view->setBool(WK_SETTING_JS, s->val.u);
}
if (cur->css == TRI_AUTO) {
s = getSetting("general.css", site);
view->setBool(WK_SETTING_CSS, s->val.u);
}
if (cur->img == TRI_AUTO) {
s = getSetting("general.images", site);
view->setBool(WK_SETTING_IMG, s->val.u);
}
s = getSetting("general.localstorage", site);
view->setBool(WK_SETTING_LOCALSTORAGE, s->val.u);
s = getSetting("user.css", site);
view->setChar(WK_SETTING_USER_CSS, s->val.c);
}
开发者ID:BertieJim,项目名称:fifth,代码行数:32,代码来源:tabs.cpp
示例8: printd
// open by connecting and getting a basic list of folders available
bool
PolarFlow::open(QStringList &errors)
{
printd("PolarFlow::open\n");
// do we have a token
QString token = getSetting(GC_POLARFLOW_TOKEN, "").toString();
if (token == "") {
errors << "You must authorise with PolarFlow first";
return false;
}
// use the configed URL
QString url = QString("%1/rest/users/delegates/users")
.arg(getSetting(GC_POLARFLOW_URL, "https://whats.todaysplan.com.au").toString());
printd("URL used: %s\n", url.toStdString().c_str());
// request using the bearer token
QNetworkRequest request(url);
request.setRawHeader("Authorization", (QString("Bearer %1").arg(token)).toLatin1());
QNetworkReply *reply = nam->get(request);
// blocking request
QEventLoop loop;
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() != QNetworkReply::NoError) {
qDebug() << "error" << reply->errorString();
errors << tr("Network Problem reading PolarFlow data");
return false;
}
// did we get a good response ?
QByteArray r = reply->readAll();
printd("response: %s\n", r.toStdString().c_str());
QJsonParseError parseError;
QJsonDocument document = QJsonDocument::fromJson(r, &parseError);
// if path was returned all is good, lets set root
if (parseError.error == QJsonParseError::NoError) {
printd("NoError");
// we have a root
root_ = newCloudServiceEntry();
// path name
root_->name = "/";
root_->isDir = true;
root_->size = 0;
} else {
errors << tr("problem parsing PolarFlow data");
}
// ok so far ?
if (errors.count()) return false;
return true;
}
开发者ID:GoldenCheetah,项目名称:GoldenCheetah,代码行数:61,代码来源:PolarFlow.cpp
示例9: getSetting
/** Restores the last size and location of the window. */
void
VidaliaWindow::restoreWindowState()
{
#if QT_VERSION >= 0x040200
QByteArray geometry = getSetting("Geometry", QByteArray()).toByteArray();
if (geometry.isEmpty())
adjustSize();
else
restoreGeometry(geometry);
#else
QRect screen = QDesktopWidget().availableGeometry();
/* Restore the window size. */
QSize size = getSetting("Size", QSize()).toSize();
if (!size.isEmpty()) {
size = size.boundedTo(screen.size());
resize(size);
}
/* Restore the window position. */
QPoint pos = getSetting("Position", QPoint()).toPoint();
if (!pos.isNull() && screen.contains(pos)) {
move(pos);
}
#endif
}
开发者ID:IRET0x00,项目名称:vidalia,代码行数:27,代码来源:VidaliaWindow.cpp
示例10: FractureCriterion
//------------------------------------------------------------------------------
SimplePdFracture::SimplePdFracture(const Setting ¶meters, Domain *domain):
FractureCriterion(domain)
{
(void) parameters;
alpha = getSetting(parameters, {"alpha"});
compressiveScaleFactor = getSetting(parameters, {"compressiveScaleFactor"});
}
开发者ID:ttnghia,项目名称:Peridynamics,代码行数:8,代码来源:simplepdfracture.cpp
示例11: QObject
LocationWatcher::LocationWatcher(QObject *parent)
: QObject(parent)
{
openDB();
source = QGeoPositionInfoSource::createDefaultSource(this);
setinterval(getSetting("time"));
setgpsmode(getSetting("usegps"));
}
开发者ID:qwazix,项目名称:oobProfile,代码行数:8,代码来源:locationwatcher.cpp
示例12: qDebug
void TTSSapi::updateVoiceList()
{
qDebug() << "update voiceList";
QStringList voiceList = getVoiceList(getSetting(eLANGUAGE)->current().toString());
getSetting(eVOICE)->setList(voiceList);
if(voiceList.size() > 0) getSetting(eVOICE)->setCurrent(voiceList.at(0));
else getSetting(eVOICE)->setCurrent("");
}
开发者ID:a-martinez,项目名称:rockbox,代码行数:8,代码来源:ttssapi.cpp
示例13: saveSettings
void TTSFestival::saveSettings()
{
//save settings in user config
RbSettings::setSubValue("festival-server",RbSettings::TtsPath,getSetting(eSERVERPATH)->current().toString());
RbSettings::setSubValue("festival-client",RbSettings::TtsPath,getSetting(eCLIENTPATH)->current().toString());
RbSettings::setSubValue("festival",RbSettings::TtsVoice,getSetting(eVOICE)->current().toString());
RbSettings::sync();
}
开发者ID:BurntBrunch,项目名称:rockbox-fft,代码行数:9,代码来源:ttsfestival.cpp
示例14: getSetting
CameraSettings CameraIIDC::getCameraSettings(){
// Get settings:
CameraSettings settings;
settings.gain = getSetting(cam, DC1394_FEATURE_GAIN);
settings.shutter = getSetting(cam, DC1394_FEATURE_SHUTTER);
return settings;
}
开发者ID:1125lbs,项目名称:slstudio,代码行数:9,代码来源:CameraIIDC.cpp
示例15: getSetting
void TTSFestival::updateVoiceDescription()
{
// get voice Info with current voice and path
currentPath = getSetting(eSERVERPATH)->current().toString();
QString info = getVoiceInfo(getSetting(eVOICE)->current().toString());
currentPath = "";
getSetting(eVOICEDESC)->setCurrent(info);
}
开发者ID:a-martinez,项目名称:rockbox,代码行数:9,代码来源:ttsfestival.cpp
示例16: getSetting
void GeneralSettingsPage::apply()
{
auto language = language_box->currentData();
if (language != getSetting(Settings::General_Language)
|| translation_file != getSetting(Settings::General_TranslationFile).toString())
{
// Show an message box in the new language.
TranslationUtil translation((QLocale::Language)language.toInt(), translation_file);
auto new_language = translation.getLocale().language();
switch (new_language)
{
case QLocale::AnyLanguage:
case QLocale::C:
case QLocale::English:
QMessageBox::information(window(), QLatin1String("Notice"), QLatin1String("The program must be restarted for the language change to take effect!"));
break;
default:
qApp->installEventFilter(this);
qApp->installTranslator(&translation.getQtTranslator());
qApp->installTranslator(&translation.getAppTranslator());
QMessageBox::information(window(), tr("Notice"), tr("The program must be restarted for the language change to take effect!"));
qApp->removeTranslator(&translation.getAppTranslator());
qApp->removeTranslator(&translation.getQtTranslator());
qApp->removeEventFilter(this);
}
setSetting(Settings::General_Language, new_language);
setSetting(Settings::General_TranslationFile, translation_file);
#if defined(Q_OS_MAC)
// The native [file] dialogs will use the first element of the
// AppleLanguages array in the application's .plist file -
// and this file is also the one used by QSettings.
const QString mapper_language(translation.getLocale().name().left(2));
QSettings().setValue(QLatin1String{"AppleLanguages"}, { mapper_language });
#endif
}
setSetting(Settings::General_OpenMRUFile, open_mru_check->isChecked());
setSetting(Settings::HomeScreen_TipsVisible, tips_visible_check->isChecked());
setSetting(Settings::General_NewOcd8Implementation, ocd_importer_check->isChecked());
setSetting(Settings::General_RetainCompatiblity, compatibility_check->isChecked());
setSetting(Settings::General_PixelsPerInch, ppi_edit->value());
auto name_latin1 = encoding_box->currentText().toLatin1();
if (name_latin1 == "System"
|| QTextCodec::codecForName(name_latin1))
{
setSetting(Settings::General_Local8BitEncoding, name_latin1);
}
int interval = autosave_interval_edit->value();
if (!autosave_check->isChecked())
interval = -interval;
setSetting(Settings::General_AutosaveInterval, interval);
}
开发者ID:999999333,项目名称:mapper,代码行数:56,代码来源:general_settings_page.cpp
示例17: ctx
bool Map::load (const std::string& name)
{
ScopedPtr<IMapContext> ctx(getMapContext(name));
resetCurrentMap();
if (name.empty()) {
info(LOG_MAP, "no map name given");
return false;
}
info(LOG_MAP, "load map " + name);
if (!ctx->load(false)) {
error(LOG_MAP, "failed to load the map " + name);
return false;
}
ctx->save();
_settings = ctx->getSettings();
_startPositions = ctx->getStartPositions();
_name = ctx->getName();
_title = ctx->getTitle();
_width = getSetting(msn::WIDTH, "-1").toInt();
_height = getSetting(msn::HEIGHT, "-1").toInt();
_solution = getSolution();
const std::string solutionSteps = string::toString(_solution.length());
_settings.insert(std::make_pair("best", solutionSteps));
info(LOG_MAP, "Solution has " + solutionSteps + " steps");
if (_width <= 0 || _height <= 0) {
error(LOG_MAP, "invalid map dimensions given");
return false;
}
const std::vector<MapTileDefinition>& mapTileList = ctx->getMapTileDefinitions();
for (std::vector<MapTileDefinition>::const_iterator i = mapTileList.begin(); i != mapTileList.end(); ++i) {
const SpriteType& t = i->spriteDef->type;
info(LOG_MAP, "sprite type: " + t.name + ", " + i->spriteDef->id);
MapTile *mapTile = new MapTile(*this, i->x, i->y, getEntityTypeForSpriteType(t));
mapTile->setSpriteID(i->spriteDef->id);
mapTile->setAngle(randBetweenf(-0.1, 0.1f));
loadEntity(mapTile);
}
info(LOG_MAP, String::format("map loading done with %i tiles", mapTileList.size()));
ctx->onMapLoaded();
_frontend->onMapLoaded();
const LoadMapMessage msg(_name, _title);
_serviceProvider->getNetwork().sendToAllClients(msg);
_mapRunning = true;
return true;
}
开发者ID:ptitSeb,项目名称:caveexpress,代码行数:56,代码来源:Map.cpp
示例18: remove
void Settings::saveSettings(){
remove("settings.ini");
std::ofstream fileStream("settings.ini", std::ofstream::out);
if (fileStream.is_open()){
fileStream << "screenWidth=" << getSetting("screenWidth") << std::endl;
fileStream << "screenHeight=" << getSetting("screenHeight") << std::endl;
fileStream << "fullscreen=" << getSetting("fullscreen") << std::endl;
}
fileStream.close();
}
开发者ID:Tim-Snow,项目名称:SDL_Engine_and_Arena_Game,代码行数:12,代码来源:Settings.cpp
示例19: getSetting
void EncoderLame::saveSettings()
{
if(m_symbolsResolved) {
RbSettings::setSubValue("lame", RbSettings::EncoderVolume,
getSetting(VOLUME)->current().toDouble());
RbSettings::setSubValue("lame", RbSettings::EncoderQuality,
getSetting(QUALITY)->current().toDouble());
m_encoderVolume =
RbSettings::subValue("lame", RbSettings::EncoderVolume).toDouble();
m_encoderQuality =
RbSettings::subValue("lame", RbSettings::EncoderQuality).toDouble();
}
}
开发者ID:4nykey,项目名称:rockbox,代码行数:13,代码来源:encoderlame.cpp
示例20: getSetting
void EncRbSpeex::saveSettings()
{
//save settings in user config
RbSettings::setSubValue("rbspeex",RbSettings::EncoderVolume,
getSetting(eVOLUME)->current().toDouble());
RbSettings::setSubValue("rbspeex",RbSettings::EncoderQuality,
getSetting(eQUALITY)->current().toDouble());
RbSettings::setSubValue("rbspeex",RbSettings::EncoderComplexity,
getSetting(eCOMPLEXITY)->current().toInt());
RbSettings::setSubValue("rbspeex",RbSettings::EncoderNarrowBand,
getSetting(eNARROWBAND)->current().toBool());
RbSettings::sync();
}
开发者ID:a-martinez,项目名称:rockbox,代码行数:14,代码来源:encoders.cpp
注:本文中的getSetting函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论