Exemple #1
0
void AM2DScanView::makeConnections()
{
	// connect resize event from graphicsView to resize the stuff inside the view
	connect(gExclusiveView_, SIGNAL(resized(QSizeF)), this, SLOT(resizeExclusiveViews()), Qt::QueuedConnection);
	connect(gMultiView_, SIGNAL(resized(QSizeF)), this, SLOT(resizeMultiViews()), Qt::QueuedConnection);

	connect(scansModel_, SIGNAL(exclusiveDataSourceChanged(QString)), this, SLOT(onExclusiveDataSourceChanged(QString)));
	connect(scansModel_, SIGNAL(scanAdded(AMScan*)), this, SLOT(onScanAdded(AMScan*)));
	connect(exclusiveView_, SIGNAL(selectedRectChanged(QRectF)), this, SLOT(onSelectedRectChanged(QRectF)));
	connect(exclusive2DScanBar_, SIGNAL(showSpectra(bool)), this, SLOT(setSpectrumViewVisibility(bool)));
	connect(exclusiveView_, SIGNAL(dataPositionChanged(QPointF)), this, SLOT(onDataPositionChanged(QPointF)));
}
void ViewmdaWidget1D::setModel(ViewmdaModel *M) {
	m_model=M;
	
	connect(m_model,SIGNAL(arrayChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(dimensionsChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(currentIndexChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(currentSliceChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(selectedPointsChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(selectedRectChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(zoomRectChanged()),this,SLOT(slot_update_plot()));
	connect(m_model,SIGNAL(windowsChanged()),this,SLOT(slot_update_plot()));
}
void ViewmdaModel::setSelectedRect(const QRect &R,bool elliptical_selection) {
	if ((m_elliptical_selection==elliptical_selection)&&(m_selected_rect==R)) return;
	m_selected_rect=R;
	m_elliptical_selection=elliptical_selection;
	emit selectedRectChanged();
}