ctkDICOMHostMainLogic::ctkDICOMHostMainLogic(ctkHostedAppPlaceholderWidget* placeHolder, ctkDICOMAppWidget* dicomAppWidget, QWidget* placeHolderForControls) : QObject(placeHolder), PlaceHolderForHostedApp(placeHolder), DicomAppWidget(dicomAppWidget), PlaceHolderForControls(placeHolderForControls), ValidSelection(false), SendData(false) { this->Host = new ctkExampleDicomHost(PlaceHolderForHostedApp); this->HostControls = new ctkExampleHostControlWidget(Host, PlaceHolderForControls); Data = new ctkDicomAppHosting::AvailableData; disconnect(this->Host,SIGNAL(startProgress()),this->Host,SLOT(onStartProgress())); connect(this->Host,SIGNAL(appReady()),this,SLOT(onAppReady()), Qt::QueuedConnection); connect(this->Host,SIGNAL(startProgress()),this,SLOT(publishSelectedData()), Qt::QueuedConnection); connect(this->PlaceHolderForHostedApp,SIGNAL(resized()),this,SLOT(placeHolderResized())); QTreeView * treeview = dicomAppWidget->findChild<QTreeView*>("TreeView"); QItemSelectionModel* selectionmodel = treeview->selectionModel(); connect(selectionmodel, SIGNAL(selectionChanged ( const QItemSelection &, const QItemSelection & )), this, SLOT(onTreeSelectionChanged(const QItemSelection &, const QItemSelection &))); connect(this->Host, SIGNAL(dataAvailable()), this, SLOT(onDataAvailable())); connect( qApp, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuit()) ); }
//---------------------------------------------------------------------------- ctkExampleDicomHost::ctkExampleDicomHost(ctkHostedAppPlaceholderWidget* placeholderWidget, int hostPort, int appPort) : ctkDicomAbstractHost(hostPort, appPort), PlaceholderWidget(placeholderWidget), exitingApplication(false) { connect(this,SIGNAL(appReady()),SLOT(onAppReady())); connect(this,SIGNAL(startProgress()),this,SLOT(onStartProgress())); connect(this,SIGNAL(releaseAvailableResources()),this,SLOT(onReleaseAvailableResources())); connect(this,SIGNAL(resumed()),this,SLOT(onResumed())); connect(this,SIGNAL(completed()),this,SLOT(onCompleted())); connect(this,SIGNAL(suspended()),this,SLOT(onSuspended())); connect(this,SIGNAL(canceled()),this,SLOT(onCanceled())); connect(this,SIGNAL(exited()),this,SLOT(onExited())); }
//---------------------------------------------------------------------------- ctkExampleDicomAppLogic::ctkExampleDicomAppLogic(): ctkDicomAbstractApp(ctkExampleDicomAppPlugin::getPluginContext()), AppWidget(0) { connect(this, SIGNAL(startProgress()), this, SLOT(onStartProgress()), Qt::QueuedConnection); connect(this, SIGNAL(resumeProgress()), this, SLOT(onResumeProgress()), Qt::QueuedConnection); connect(this, SIGNAL(suspendProgress()), this, SLOT(onSuspendProgress()), Qt::QueuedConnection); connect(this, SIGNAL(cancelProgress()), this, SLOT(onCancelProgress()), Qt::QueuedConnection); connect(this, SIGNAL(exitHostedApp()), this, SLOT(onExitHostedApp()), Qt::QueuedConnection); connect(this, SIGNAL(dataAvailable()), this, SLOT(onDataAvailable())); //notify Host we are ready. try { getHostInterface()->notifyStateChanged(ctkDicomAppHosting::IDLE); } catch(...) { qDebug() << "ctkDicomAbstractApp: Could not getHostInterface()"; } }