本文整理汇总了C++中AMDataSource::signalSource方法的典型用法代码示例。如果您正苦于以下问题:C++ AMDataSource::signalSource方法的具体用法?C++ AMDataSource::signalSource怎么用?C++ AMDataSource::signalSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMDataSource
的用法示例。
在下文中一共展示了AMDataSource::signalSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onSetViewIndexChanged
void AMDataSourcesEditor::onSetViewIndexChanged(const QModelIndex &selected, const QModelIndex &deselected) {
removeDetailEditor();
// Nothing selected?
////////////////////////
if(!selected.isValid()) {
nameEdit_->clear();
descriptionEdit_->clear();
descriptionEdit_->setReadOnly(true);
addDataSourceButton_->setDisabled(true);
return;
}
addDataSourceButton_->setEnabled(true);
// Scan selected? (No selected data source)
/////////////////////////
if(!selected.parent().isValid()) {
nameEdit_->clear();
descriptionEdit_->clear();
descriptionEdit_->setReadOnly(true);
return;
}
// Data source selected.
/////////////////
// Remove old connection to the data source description.
int oldSi = deselected.parent().row();
int oldDi = deselected.row();
AMDataSource *oldDataSource = model_->dataSourceAt(oldSi, oldDi);
if (oldDataSource)
disconnect(oldDataSource->signalSource(), SIGNAL(infoChanged()), this, SLOT(onDataSourceDescriptionChanged()));
// Setup new data source.
int si = selected.parent().row();
int di = selected.row();
AMDataSource* dataSource = model_->dataSourceAt(si, di);
if(!dataSource)
return;
connect(dataSource->signalSource(), SIGNAL(infoChanged()), this, SLOT(onDataSourceDescriptionChanged()));
nameEdit_->setText(dataSource->name());
descriptionEdit_->setText(dataSource->description());
descriptionEdit_->setReadOnly(false);
installDetailEditor(dataSource->createEditorWidget());
// Set the new selected data source as the exclusive view preference.
model_->setExclusiveDataSourceByName(dataSource->name());
}
示例2: onInputSourceDeleted
void AMAnalysisBlock::onInputSourceDeleted(void* deletedSource) {
// this implementation is just like calling setInputDataSources() with an empty list, except we don't want to call deregisterObserver() on the deleted input source. (In a single-threaded situation, this would be okay, but if the deleted() signal came through a queued signal-slot connection, then that object might already be deleted)
for(int i=0; i<inputDataSourceCount(); i++) {
AMDataSource* oldSource = inputDataSourceAt(i);
if(oldSource != deletedSource) {
disconnect(oldSource->signalSource(), SIGNAL(deleted(void*)), this, SLOT(onInputSourceDeleted(void*)));
oldSource->deregisterObserver(this);
}
}
示例3: setInputDataSources
bool AMAnalysisBlock::setInputDataSources(const QList<AMDataSource*>& dataSources) {
// if a non-empty set of data sources has been provided, and they are not acceptable, return false. (An empty list must always be acceptable)
if(!dataSources.isEmpty() && !areInputDataSourcesAcceptable(dataSources)) {
AMErrorMon::report(AMErrorReport(this, AMErrorReport::Alert, -98, QString("There was an error connecting the input data sources to this analysis component '%1: %2'. The data sources provided weren't acceptable. This can happen if they have the wrong dimension, don't provide enough data, etc.").arg(name()).arg(description())));
return false;
}
for(int i=0; i<inputDataSourceCount(); i++) {
AMDataSource* oldSource = inputDataSourceAt(i);
disconnect(oldSource->signalSource(), SIGNAL(deleted(void*)), this, SLOT(onInputSourceDeleted(void*)));
oldSource->deregisterObserver(this);
}
for(int i=0; i<dataSources.count(); i++) {
AMDataSource* newSource = dataSources.at(i);
connect(newSource->signalSource(), SIGNAL(deleted(void*)), this, SLOT(onInputSourceDeleted(void*)));
dataSources.at(i)->registerObserver(this);
}
setInputDataSourcesImplementation(dataSources);
emit inputSourcesChanged();
return true;
}