Browse Source

Display received infos by notifyDataAvailable

Ivo Wolf 14 years ago
parent
commit
43ffdf23d1

+ 8 - 1
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -61,7 +61,7 @@ bool ctkExampleDicomAppLogic::bringToFront(const QRect& /*requestedScreenArea*/)
 
 void ctkExampleDicomAppLogic::do_something()
 {
-  QPushButton *button = new QPushButton("Button from App");
+  button = new QPushButton("Button from App");
   try
   {
 
@@ -125,6 +125,13 @@ bool ctkExampleDicomAppLogic::notifyDataAvailable(ctkDicomAppHosting::AvailableD
 {
   Q_UNUSED(data)
   Q_UNUSED(lastData)
+  QString s;
+  s = "Received notifyDataAvailable with patients.count()= " + QString().setNum(data.patients.count());
+  if(data.patients.count()>0)
+  {
+    s=s+" name:"+data.patients.begin()->name+" studies.count(): "+QString().setNum(data.patients.begin()->studies.count());
+  }
+  button->setText(s);
   return false;
 }
 

+ 4 - 0
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic_p.h

@@ -30,6 +30,8 @@
 
 struct ctkDicomHostInterface;
 
+class QPushButton;
+
 class ctkExampleDicomAppLogic : public QObject, public ctkDicomAppInterface
 {
   Q_OBJECT
@@ -72,6 +74,8 @@ private:
 
   ctkServiceTracker<ctkDicomHostInterface*> hostTracker;
 
+  QPushButton *button;
+
 }; // ctkExampleDicomAppLogic
 
 #endif // ctkExampleDicomAppLogic_P_H