本文整理汇总了C++中ScalarSelector::update方法的典型用法代码示例。如果您正苦于以下问题:C++ ScalarSelector::update方法的具体用法?C++ ScalarSelector::update怎么用?C++ ScalarSelector::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScalarSelector
的用法示例。
在下文中一共展示了ScalarSelector::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateForm
void KstPluginDialogI::updateForm() {
KstSharedPtr<Plugin> plugin = PluginCollection::self()->plugin(_pluginList[_w->PluginCombo->currentItem()]);
if (plugin) {
const QValueList<Plugin::Data::IOValue>& itable = plugin->data()._inputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin(); it != itable.end(); ++it) {
if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "VectorSelector");
assert(field);
if (field) {
VectorSelector *vs = static_cast<VectorSelector*>(field);
vs->update();
}
} else if ((*it)._type == Plugin::Data::IOValue::StringType) { // string
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "StringSelector");
assert(field);
if (field) {
StringSelector *ss = static_cast<StringSelector*>(field);
ss->update();
}
} else if ((*it)._type == Plugin::Data::IOValue::PidType) {
// Nothing
} else {
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "ScalarSelector");
assert(field);
if (field) {
ScalarSelector *ss = static_cast<ScalarSelector*>(field);
ss->update();
}
}
}
}
}
示例2: update
void KstPluginDialogI::update(int new_index) {
Q_UNUSED(new_index);
QString selectedVector;
QString selectedScalar;
KstSharedPtr<Plugin> pPtr;
pPtr = PluginCollection::self()->plugin(_pluginList[PluginCombo->currentItem()]);
if( pPtr != NULL ) {
const QValueList<Plugin::Data::IOValue>& itable = pPtr->data()._inputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin(); it != itable.end(); ++it) {
if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
QObject *field = _frameWidget->child((*it)._name.latin1(), "VectorSelector");
assert(field);
if (field) {
VectorSelector *vs = static_cast<VectorSelector*>(field);
vs->update();
}
} else {
QObject *field = _frameWidget->child((*it)._name.latin1(), "ScalarSelector");
assert(field);
if (field) {
ScalarSelector *ss = static_cast<ScalarSelector*>(field);
ss->update();
}
}
}
}
}
示例3: fillVectorScalarCombos
void KstPluginDialogI::fillVectorScalarCombos(KstSharedPtr<Plugin> plugin) {
bool DPvalid = false;
KstCPluginPtr pp = kst_cast<KstCPlugin>(_dp);
if (pp) {
pp->readLock();
DPvalid = pp->isValid();
pp->unlock();
}
if (plugin) {
if (DPvalid) {
pp->readLock();
}
// Update input vector and scalar combos
const QValueList<Plugin::Data::IOValue>& itable = plugin->data()._inputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin();
it != itable.end(); ++it) {
if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "VectorSelector");
assert(field);
if (field) {
VectorSelector *vs = static_cast<VectorSelector*>(field);
QString selectedVector = vs->selectedVector();
vs->update();
if (DPvalid) {
vs->setSelection(pp->inputVectors()[(*it)._name]->tag().displayString());
} else {
vs->setSelection(selectedVector);
}
}
} else if ((*it)._type == Plugin::Data::IOValue::StringType) {
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "StringSelector");
assert(field);
if (field) {
StringSelector *ss = static_cast<StringSelector*>(field);
QString selectedString = ss->selectedString();
ss->update();
if (DPvalid) {
ss->setSelection(pp->inputStrings()[(*it)._name]->tag().displayString());
} else {
ss->setSelection(selectedString);
}
}
} else if ((*it)._type == Plugin::Data::IOValue::PidType) {
// Nothing
} else {
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "ScalarSelector");
assert(field);
if (field) {
ScalarSelector *ss = static_cast<ScalarSelector*>(field);
QString selectedScalar = ss->selectedScalar();
ss->update();
if (DPvalid) {
ss->setSelection(pp->inputScalars()[(*it)._name]->tag().displayString());
} else {
ss->setSelection(selectedScalar);
}
}
}
}
// Update output vector and scalar lineedits
if (DPvalid) {
const QValueList<Plugin::Data::IOValue>& otable = plugin->data()._outputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = otable.begin(); it != otable.end(); ++it) {
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "QLineEdit");
assert(field);
if (field) {
QLineEdit *li = static_cast<QLineEdit*>(field);
QString ts;
if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
ts = pp->outputVectors()[(*it)._name]->tagName();
} else if ((*it)._type == Plugin::Data::IOValue::PidType) {
} else if ((*it)._type == Plugin::Data::IOValue::StringType) {
ts = pp->outputStrings()[(*it)._name]->tagName();
} else { // scalar
ts = pp->outputScalars()[(*it)._name]->tagName();
}
li->setText(ts);
}
}
pp->unlock();
}
} else { // invalid plugin
PluginCollection *pc = PluginCollection::self();
QString cur = _pluginList[_w->PluginCombo->currentItem()];
Plugin::Data pdata = pc->pluginList()[pc->pluginNameList()[cur]];
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = pdata._outputs.begin(); it != pdata._outputs.end(); ++it) {
QObject *field = _w->_pluginInputOutputFrame->child((*it)._name.latin1(), "QLineEdit");
if (field) {
static_cast<QLineEdit*>(field)->setText(QString::null);
}
}
}
}
示例4: updatePlugin
void KstPluginDialogI::updatePlugin(int new_index) {
QString selectedVector;
QString selectedScalar;
int oldSelect = Select->currentItem();
int oldCount = Select->count();
KstPluginList pl = kstObjectSubList<KstDataObject, KstPlugin>(KST::dataObjectList);
Select->clear();
for (KstPluginList::iterator it = pl.begin(); it != pl.end(); ++it) {
Select->insertItem((*it)->tagName());
}
if (new_index == -2 || Select->count() == 0) {
Select->insertItem(i18n("P%1-%2").arg(Select->count()+1).arg(newPluginString));
Select->setCurrentItem(Select->count()-1);
} else if (new_index >= 0 && new_index < Select->count()) {
Select->setCurrentItem(new_index);
} else if (oldCount != Select->count()) {
Select->setCurrentItem(Select->count()-1);
} else {
Select->setCurrentItem(oldSelect < Select->count() ? oldSelect : Select->count()-1);
}
if (_pluginList.isEmpty()) {
updatePluginList();
}
KstPluginPtr plugin = pl[Select->currentItem()];
if (!plugin) {
kdWarning() << "Couldn't find plugin in list: " << Select->currentItem() << endl;
return;
}
int oldPluginIndex = PluginCombo->currentItem();
int newPluginIndex = _pluginList.findIndex(plugin->plugin()->data()._name);
bool updateCombos = (newPluginIndex != oldPluginIndex);
if (updateCombos) {
PluginCombo->setCurrentItem(newPluginIndex);
pluginChanged(PluginCombo->currentItem());
}
KstSharedPtr<Plugin> pPtr = PluginCollection::self()->plugin(_pluginList[PluginCombo->currentItem()]);
if( pPtr != 0 ) {
// Update input vector and scalar combos
const QValueList<Plugin::Data::IOValue>& itable = pPtr->data()._inputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = itable.begin(); it != itable.end(); ++it) {
if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
QObject *field = _frameWidget->child((*it)._name.latin1(), "VectorSelector");
assert(field);
if (field) {
VectorSelector *vs = static_cast<VectorSelector*>(field);
selectedVector = vs->selectedVector();
if (!updateCombos) {
vs->update();
}
if (plugin.data() && plugin->isValid()) {
vs->setSelection(plugin->inputVectors()[(*it)._name]->tagName());
} else {
vs->setSelection(selectedVector);
}
}
} else {
QObject *field = _frameWidget->child((*it)._name.latin1(), "ScalarSelector");
assert(field);
if (field) {
ScalarSelector *ss = static_cast<ScalarSelector*>(field);
selectedScalar = ss->selectedScalar( );
if (!updateCombos) {
ss->update();
}
if (plugin.data() && plugin->isValid()) {
ss->setSelection(plugin->inputScalars()[(*it)._name]->tagName());
} else {
ss->setSelection(selectedScalar);
}
}
}
}
// Update output vector and scalar lineedits
// const QValueList<Plugin::Data::IOValue>& otable = plugin->plugin()->data()._outputs;
if (plugin.data() && plugin->isValid()) {
const QValueList<Plugin::Data::IOValue>& otable = pPtr->data()._outputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = otable.begin(); it != otable.end(); ++it) {
QObject *field = _frameWidget->child((*it)._name.latin1(), "QLineEdit");
assert(field);
if (field) {
QLineEdit *li = static_cast<QLineEdit*>(field);
QString ts;
if ((*it)._type == Plugin::Data::IOValue::TableType) { // vector
ts = plugin->outputVectors()[(*it)._name]->tagName();
} else { // scalar
ts = plugin->outputScalars()[(*it)._name]->tagName();
}
li->setText(ts);
}
}
//.........这里部分代码省略.........