本文整理汇总了C++中ConfigurationManager::value方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigurationManager::value方法的具体用法?C++ ConfigurationManager::value怎么用?C++ ConfigurationManager::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationManager
的用法示例。
在下文中一共展示了ConfigurationManager::value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: restoreHistory
void ActionDialog::restoreHistory()
{
ConfigurationManager *cm = ConfigurationManager::instance();
int maxCount = cm->value("command_history_size").toInt();
ui->comboBoxCommands->setMaxCount(maxCount);
QFile file( dataFilename() );
file.open(QIODevice::ReadOnly);
QDataStream in(&file);
QVariant v;
ui->comboBoxCommands->clear();
ui->comboBoxCommands->addItem(QString());
while( !in.atEnd() ) {
in >> v;
if (v.canConvert(QVariant::String)) {
// backwards compatibility with versions up to 1.8.2
QVariantMap values;
values["cmd"] = v;
ui->comboBoxCommands->addItem(commandToLabel(v.toString()), values);
} else {
QVariantMap values = v.value<QVariantMap>();
ui->comboBoxCommands->addItem(commandToLabel(values["cmd"].toString()), v);
}
}
ui->comboBoxCommands->setCurrentIndex(0);
}
示例2: loadSettings
void ActionDialog::loadSettings()
{
ConfigurationManager *cm = ConfigurationManager::instance();
restoreHistory();
ui->comboBoxInputFormat->clear();
ui->comboBoxInputFormat->addItems(standardFormats);
ui->comboBoxInputFormat->setCurrentIndex(cm->value("action_has_input").toBool() ? 1 : 0);
ui->comboBoxOutputFormat->clear();
ui->comboBoxOutputFormat->addItems(standardFormats);
ui->comboBoxOutputFormat->setCurrentIndex(cm->value("action_has_output").toBool() ? 1 : 0);
ui->separatorEdit->setText(cm->value("action_separator").toString());
ui->comboBoxOutputTab->setEditText(cm->value("action_output_tab").toString());
}
示例3: loadFromConfiguration
void ClipboardBrowserShared::loadFromConfiguration()
{
ConfigurationManager *cm = ConfigurationManager::instance();
editor = cm->value("editor").toString();
maxItems = cm->value("maxitems").toInt();
formats = ItemFactory::instance()->formatsToSave();
maxImageWidth = cm->value("max_image_width").toInt();
maxImageHeight = cm->value("max_image_height").toInt();
textWrap = cm->value("text_wrap").toBool();
commands = cm->commands();
viMode = cm->value("vi").toBool();
saveOnReturnKey = !cm->value("edit_ctrl_return").toBool();
moveItemOnReturnKey = cm->value("move").toBool();
}
示例4: loadFromConfiguration
void ClipboardBrowserShared::loadFromConfiguration()
{
ConfigurationManager *cm = ConfigurationManager::instance();
editor = cm->value("editor").toString();
maxItems = cm->value("maxitems").toInt();
textWrap = cm->value("text_wrap").toBool();
viMode = cm->value("vi").toBool();
saveOnReturnKey = !cm->value("edit_ctrl_return").toBool();
moveItemOnReturnKey = cm->value("move").toBool();
minutesToExpire = cm->value("expire_tab").toInt();
}
示例5: restoreHistory
void ActionDialog::restoreHistory()
{
ConfigurationManager *cm = ConfigurationManager::instance();
int maxCount = cm->value("command_history_size").toInt();
ui->cmdEdit->setMaxCount(maxCount);
QFile file( dataFilename() );
file.open(QIODevice::ReadOnly);
QDataStream in(&file);
QVariant v;
ui->cmdEdit->clear();
while( !in.atEnd() ) {
in >> v;
ui->cmdEdit->addItem(v.toString());
}
ui->cmdEdit->setCurrentIndex(0);
ui->cmdEdit->lineEdit()->selectAll();
}