Ivo Wolf 13 anni fa
parent
commit
db035ee59c

+ 13 - 1
Applications/ctkDICOMHost/ctkDICOMHostMainLogic.cpp

@@ -26,13 +26,14 @@ ctkDICOMHostMainLogic::ctkDICOMHostMainLogic(ctkHostedAppPlaceholderWidget* plac
   SendData(false)
 {
   this->Host = new ctkExampleDicomHost(PlaceHolderForHostedApp);
-  this->HostControls = new ctkExampleHostControlWidget(Host, placeHolderForControls);
+  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()));
+  connect(this->PlaceHolderForHostedApp,SIGNAL(resized()),this,SLOT(placeHolderResized()));
 
   QTreeView * treeview = dicomAppWidget->findChild<QTreeView*>("TreeView");
   QItemSelectionModel* selectionmodel = treeview->selectionModel();
@@ -141,3 +142,14 @@ void ctkDICOMHostMainLogic::publishSelectedData()
     this->Host->getDicomAppService()->bringToFront(rect);
   }
 }
+
+//----------------------------------------------------------------------------
+void ctkDICOMHostMainLogic::placeHolderResized()
+{
+  ///the following does not work (yet)
+  //if((this->Host) && (this->Host->getApplicationState() != ctkDicomAppHosting::EXIT))
+  //{
+  //  QRect rect (this->PlaceHolderForHostedApp->getAbsolutePosition());
+  //  this->Host->getDicomAppService()->bringToFront(rect);
+  //}
+}

+ 1 - 0
Applications/ctkDICOMHost/ctkDICOMHostMainLogic.h

@@ -26,6 +26,7 @@ protected slots:
   void onTreeSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
   void publishSelectedData();
   void onAppReady();
+  void placeHolderResized();
 signals:
   void TreeSelectionChanged(const QString &);
   void SelectionValid(bool);

+ 13 - 13
Applications/ctkDICOMHost/ctkDICOMHostMainWidget.ui

@@ -63,6 +63,19 @@
     </layout>
    </item>
    <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>299</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
     <layout class="QHBoxLayout" name="horizontalLayout_2">
      <item>
       <widget class="QPushButton" name="configureHostedApp">
@@ -90,19 +103,6 @@
      </item>
     </layout>
    </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>299</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <customwidgets>