本文整理汇总了C++中KstDataSourcePtr::supportsTimeConversions方法的典型用法代码示例。如果您正苦于以下问题:C++ KstDataSourcePtr::supportsTimeConversions方法的具体用法?C++ KstDataSourcePtr::supportsTimeConversions怎么用?C++ KstDataSourcePtr::supportsTimeConversions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstDataSourcePtr
的用法示例。
在下文中一共展示了KstDataSourcePtr::supportsTimeConversions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCompletion
void KstVectorDialogI::updateCompletion() {
QString current_text = Field->currentText();
Field->clear();
/* update filename list and ll axes combo boxes */
KST::dataSourceList.lock().readLock();
KstDataSourcePtr ds = *KST::dataSourceList.findFileName(FileName->url());
KST::dataSourceList.lock().readUnlock();
delete _configWidget; // FIXME: very inefficient!!!!
_configWidget = 0L;
QStringList list;
if (ds) {
ds->readLock();
list = ds->fieldList();
Field->setEditable(!ds->fieldListIsComplete());
_configWidget = ds->configWidget();
ds->readUnlock();
} else {
QString type;
bool complete = false;
list = KstDataSource::fieldListForSource(FileName->url(), QString::null, &type, &complete);
Field->setEditable(!complete);
if (!list.isEmpty() && !type.isEmpty()) {
_configWidget = KstDataSource::configWidgetForSource(FileName->url(), type);
}
}
_configure->setEnabled(_configWidget);
_fieldCompletion = Field->completionObject();
Field->insertStringList(list);
if (_fieldCompletion) {
_fieldCompletion->clear();
_fieldCompletion->insertItems(list);
}
if (!current_text.isEmpty() && (list.contains(current_text) || Field->editable())) {
Field->setCurrentText(current_text);
}
_kstDataRange->setAllowTime(ds && ds->supportsTimeConversions());
}
示例2: updateTimeCombo
void KstChangeNptsDialogI::updateTimeCombo() {
KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
uint cnt = CurveList->count();
bool supportsTime = true;
for (uint i = 0; i < cnt; ++i) {
if (CurveList->isSelected(i)) {
KstRVectorPtr vector = *(rvl.findTag(CurveList->text(i)));
if (vector) {
vector->readLock();
KstDataSourcePtr ds = vector->dataSource();
vector->unlock();
if (ds) {
ds->readLock();
supportsTime = ds->supportsTimeConversions();
ds->unlock();
if (!supportsTime) {
break;
}
}
}
}
}
_kstDataRange->setAllowTime(supportsTime);
}
示例3: updateCompletion
void KstVectorDialogI::updateCompletion() {
QString current_text = _w->Field->currentText();
_w->Field->clear();
// update filename list and ll axes combo boxes
KST::dataSourceList.lock().readLock();
KstDataSourcePtr ds = *KST::dataSourceList.findReusableFileName(_w->FileName->url());
KST::dataSourceList.lock().unlock();
delete _configWidget;
_configWidget = 0L;
QStringList list;
if (ds) {
ds->readLock();
list = ds->fieldList();
_w->Field->setEditable(!ds->fieldListIsComplete());
_configWidget = ds->configWidget();
ds->unlock();
_w->Field->setEnabled(true);
_w->_connect->hide();
_w->_kstDataRange->setAllowTime(ds->supportsTimeConversions());
} else {
QString type;
bool complete = false;
QString u = _w->FileName->url();
KURL url;
if (QFile::exists(u) && QFileInfo(u).isRelative()) {
url.setPath(u);
} else {
url = KURL::fromPathOrURL(u);
}
if (!_inTest && !url.isLocalFile() && url.protocol() != "file" && !url.protocol().isEmpty()) {
_w->_connect->show();
} else if (url.isValid()) {
list = KstDataSource::fieldListForSource(u, QString::null, &type, &complete);
if (!_inTest || (_inTest && !list.isEmpty())) {
_w->_connect->hide();
}
}
_w->Field->setEditable(!complete);
_w->Field->setEnabled(!list.isEmpty());
if (!list.isEmpty() && !type.isEmpty()) {
_configWidget = KstDataSource::configWidgetForSource(u, type);
}
_w->_kstDataRange->setAllowTime(KstDataSource::supportsTime(u, type));
}
_w->_configure->setEnabled(_configWidget);
_fieldCompletion = _w->Field->completionObject();
_w->Field->insertStringList(list);
if (_fieldCompletion) {
_fieldCompletion->clear();
_fieldCompletion->insertItems(list);
}
if (!current_text.isEmpty() && (list.contains(current_text) || _w->Field->editable())) {
_w->Field->setCurrentText(current_text);
}
_ok->setEnabled(_w->Field->isEnabled() || _editMultipleMode);
}