本文整理汇总了C++中Option::getOptionString方法的典型用法代码示例。如果您正苦于以下问题:C++ Option::getOptionString方法的具体用法?C++ Option::getOptionString怎么用?C++ Option::getOptionString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Option
的用法示例。
在下文中一共展示了Option::getOptionString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeControl
void InputDialog::initializeControl(Option const& opt, QLineEdit* edit) {
connectControl(opt, edit);
edit->setToolTip(opt.getDescription());
Action* action = new Action(
boost::bind(&QLineEdit::setText, edit, opt.getOptionString()) );
m_resetActions.push_back(action);
Update* update = new Update(
boost::bind(
static_cast<void(*)(QLineEdit*, QString const&)>(SetControl), edit, _1));
QString name = opt.getName();
m_setUpdates[name] = update;
}
示例2: initializeControl
void InputDialog::initializeControl(Option const& opt, QLineEdit* edit)
{
connectControl(opt, edit);
edit->setToolTip(prependRemName(opt.getName(), opt.getDescription()));
Action* action = new Action(
boost::bind(&QLineEdit::setText, edit, opt.getOptionString()) );
m_resetActions.push_back(action);
Update* update = new Update(
boost::bind(
static_cast<void(*)(QLineEdit*, QString const&)>(SetControl), edit, _1));
QString name = opt.getName();
m_setUpdates[name] = update;
if (opt.getType() == Option::Type_Array) {
QRegExp rx("^\\[(\\d+,?)+\\]$");
QValidator* validator(new QRegExpValidator(rx, this));
edit->setValidator(validator);
//edit->setMask("");
}
}
示例3: insert
//! Inserts an Option into the database, overwriting the record if the
//! option name already exists. The user is prompted if an overwrite will
//! occur and if \var promptOnOverwrite is set to true.
bool OptionDatabase::insert(Option const& opt, bool const promptOnOverwrite)
{
Option tmp;
QString name(opt.getName());
if ( get(name, tmp) ) {
if (promptOnOverwrite) {
QString msg("Option name ");
msg += name;
msg += " already exists in database, overwrite?";
int ret = QMsgBox::question(0, "Option Exists",msg,
QMessageBox::Ok | QMessageBox::Cancel);
if (ret == QMessageBox::Cancel) {
return false;
}
}
remove(name,false);
}
QString buf("insert into options( 'Name', 'Type', 'Default', 'Options', "
"'Description', 'Implementation' ) values ( '");
buf += opt.getName() + "', ";
buf += QString::number(opt.getType()) + ", ";
buf += QString::number(opt.getDefaultIndex()) + ", '";
buf += opt.getOptionString() + "', "; // No quote!
QSqlField desc("Description", QVariant::String);
desc.setValue(opt.getDescription());
buf += QSqlDatabase::database("QChem").driver()->formatValue(desc);
buf += ", ";
buf += QString::number(opt.getImplementation()) + ");";
qDebug() << "Database insert: " << buf;
return execute(buf);
}