瀏覽代碼

Use and react on bringToFront messages

Ivo Wolf 13 年之前
父節點
當前提交
42603939e0

+ 6 - 0
Applications/ctkDICOMHost/ctkDICOMHostMainLogic.cpp

@@ -87,6 +87,9 @@ void ctkDICOMHostMainLogic::onAppReady()
   {
     bool reply = this->Host->getDicomAppService()->setState(ctkDicomAppHosting::INPROGRESS);
     qDebug() << "  setState(INPROGRESS) returned: " << reply;
+
+    QRect rect (this->PlaceHolderForHostedApp->getAbsolutePosition());
+    this->Host->getDicomAppService()->bringToFront(rect);
   }
 }
 
@@ -130,5 +133,8 @@ void ctkDICOMHostMainLogic::publishSelectedData()
     }
     qDebug() << "  notifyDataAvailable returned: " << success;
     SendData=false;
+
+    QRect rect (this->PlaceHolderForHostedApp->getAbsolutePosition());
+    this->Host->getDicomAppService()->bringToFront(rect);
   }
 }

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

@@ -26,6 +26,7 @@
 #include <QPushButton>
 #include <QApplication>
 #include <QLabel>
+#include <QRect>
 
 // CTK includes
 #include "ctkDICOMImage.h"
@@ -63,10 +64,12 @@ ctkExampleDicomAppLogic::~ctkExampleDicomAppLogic()
 }
 
 //----------------------------------------------------------------------------
-bool ctkExampleDicomAppLogic::bringToFront(const QRect& /*requestedScreenArea*/)
+bool ctkExampleDicomAppLogic::bringToFront(const QRect& requestedScreenArea)
 {
   if(this->AppWidget!=NULL)
   {
+    this->AppWidget->move(requestedScreenArea.topLeft());
+    this->AppWidget->resize(requestedScreenArea.size());
     this->AppWidget->activateWindow();
     this->AppWidget->raise();
   }