本文整理汇总了C++中ScalarSelector::allowDirectEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarSelector::allowDirectEntry方法的具体用法?C++ ScalarSelector::allowDirectEntry怎么用?C++ ScalarSelector::allowDirectEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarSelector
的用法示例。
在下文中一共展示了ScalarSelector::allowDirectEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createInputScalar
void KstBasicDialogI::createInputScalar(const QString &name, int row) {
QLabel *label = new QLabel(name + ":", _w->_frame);
ScalarSelector *widget = new ScalarSelector(_w->_frame,
name.latin1());
connect(widget, SIGNAL(newScalarCreated()),
this, SIGNAL(modified()));
widget->allowDirectEntry(true);
_grid->addWidget(label, row, 0);
label->show();
_grid->addWidget(widget, row, 1);
widget->show();
}
示例2: generateEntries
void KstPluginDialogI::generateEntries(bool input, int& cnt, QWidget *parent, QGridLayout *grid, const QValueList<Plugin::Data::IOValue>& table) {
QString scalarLabelTemplate, vectorLabelTemplate, stringLabelTemplate;
if (input) {
stringLabelTemplate = i18n("Input string - %1:");
scalarLabelTemplate = i18n("Input scalar - %1:");
vectorLabelTemplate = i18n("Input vector - %1:");
} else {
stringLabelTemplate = i18n("Output string - %1:");
scalarLabelTemplate = i18n("Output scalar - %1:");
vectorLabelTemplate = i18n("Output vector - %1:");
}
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = table.begin(); it != table.end(); ++it) {
QString labellabel;
bool scalar = false;
bool string = false;
switch ((*it)._type) {
case Plugin::Data::IOValue::PidType:
continue;
case Plugin::Data::IOValue::StringType:
labellabel = stringLabelTemplate.arg((*it)._name);
string = true;
break;
case Plugin::Data::IOValue::FloatType:
labellabel = scalarLabelTemplate.arg((*it)._name);
scalar = true;
break;
case Plugin::Data::IOValue::TableType:
if ((*it)._subType == Plugin::Data::IOValue::FloatSubType ||
(*it)._subType == Plugin::Data::IOValue::FloatNonVectorSubType) {
labellabel = vectorLabelTemplate.arg((*it)._name);
} else {
// unsupported
continue;
}
break;
default:
// unsupported
continue;
}
QLabel *label = new QLabel(labellabel, parent, input ? "Input label" : "Output label");
QWidget *widget = 0L;
if (input) {
if (scalar) {
ScalarSelector *w = new ScalarSelector(parent, (*it)._name.latin1());
widget = w;
connect(w->_scalar, SIGNAL(activated(const QString&)), this, SLOT(updateScalarTooltip(const QString&)));
connect(widget, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
if (!(*it)._default.isEmpty()) {
w->_scalar->insertItem((*it)._default);
w->_scalar->setCurrentText((*it)._default);
}
KstScalarPtr p = *KST::scalarList.findTag(w->_scalar->currentText());
w->allowDirectEntry(true);
if (p) {
p->readLock();
QToolTip::remove(w->_scalar);
QToolTip::add(w->_scalar, QString::number(p->value()));
p->unlock();
}
} else if (string) {
StringSelector *w = new StringSelector(parent, (*it)._name.latin1());
widget = w;
connect(w->_string, SIGNAL(activated(const QString&)), this, SLOT(updateStringTooltip(const QString&)));
connect(widget, SIGNAL(newStringCreated()), this, SIGNAL(modified()));
if (!(*it)._default.isEmpty()) {
w->_string->insertItem((*it)._default);
w->_string->setCurrentText((*it)._default);
}
KstStringPtr p = *KST::stringList.findTag(w->_string->currentText());
w->allowDirectEntry(true);
if (p) {
p->readLock();
QToolTip::remove(w->_string);
QToolTip::add(w->_string, p->value());
p->unlock();
}
} else {
widget = new VectorSelector(parent, (*it)._name.latin1());
connect(widget, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
}
} else {