ソースを参照

Reorganize code and connect query button to new tab method

Steve Pieper 15 年 前
コミット
96d9480c5b

+ 1 - 3
Libs/DICOM/Widgets/CMakeLists.txt

@@ -22,12 +22,11 @@ SET(KIT_SRCS
   ctkDICOMServerNodeWidget.h
   ctkDICOMQueryWidget.cpp
   ctkDICOMQueryWidget.h
-  ctkDICOMCommandWidget.cpp
-  ctkDICOMCommandWidget.h
   )
 
 # Headers that should run through moc
 SET(KIT_MOC_SRCS
+  ctkDICOMQueryRetrieveWidget.h
   )
 
 # UI files - includes new widgets
@@ -37,7 +36,6 @@ SET(KIT_UI_FORMS
   Resources/UI/ctkDICOMQueryRetrieveWidget.ui
   Resources/UI/ctkDICOMServerNodeWidget.ui
   Resources/UI/ctkDICOMQueryWidget.ui
-  Resources/UI/ctkDICOMCommandWidget.ui
 )
 
 # Resources

+ 99 - 8
Libs/DICOM/Widgets/Resources/UI/ctkDICOMQueryRetrieveWidget.ui

@@ -40,10 +40,107 @@
     </widget>
    </item>
    <item>
-    <widget class="ctkDICOMCommandWidget" name="widget" native="true"/>
+    <widget class="QWidget" name="commandFrame" native="true">
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
+      <item>
+       <widget class="QLabel" name="label">
+        <property name="text">
+         <string>Retrieve To</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="comboBox">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <item>
+         <property name="text">
+          <string>Set Directory...</string>
+         </property>
+        </item>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>90</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="queryButton">
+        <property name="text">
+         <string>Query</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="reteiveButton">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="text">
+         <string>Retrieve</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <spacer name="horizontalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>90</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="refreshButton">
+        <property name="enabled">
+         <bool>false</bool>
+        </property>
+        <property name="text">
+         <string>Refresh</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
    </item>
    <item>
-    <widget class="QTreeView" name="treeView"/>
+    <widget class="QTabWidget" name="results">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <property name="enabled">
+       <bool>true</bool>
+      </property>
+      <attribute name="title">
+       <string>Local</string>
+      </attribute>
+      <widget class="QTreeView" name="treeView">
+       <property name="geometry">
+        <rect>
+         <x>20</x>
+         <y>60</y>
+         <width>719</width>
+         <height>224</height>
+        </rect>
+       </property>
+      </widget>
+     </widget>
+    </widget>
    </item>
   </layout>
  </widget>
@@ -60,12 +157,6 @@
    <header>ctkDICOMServerNodeWidget.h</header>
    <container>1</container>
   </customwidget>
-  <customwidget>
-   <class>ctkDICOMCommandWidget</class>
-   <extends>QWidget</extends>
-   <header>ctkDICOMCommandWidget.h</header>
-   <container>1</container>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>

+ 3 - 53
Libs/DICOM/Widgets/Resources/UI/ctkDICOMQueryWidget.ui

@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>500</width>
-    <height>332</height>
+    <width>566</width>
+    <height>339</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -31,7 +31,7 @@
         </size>
        </property>
        <property name="currentIndex">
-        <number>0</number>
+        <number>2</number>
        </property>
        <widget class="QWidget" name="Name">
         <attribute name="title">
@@ -179,16 +179,6 @@
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_5">
          <item>
-          <widget class="QCheckBox" name="checkBox_7">
-           <property name="text">
-            <string>Scenes</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
           <widget class="QCheckBox" name="checkBox">
            <property name="text">
             <string>CT</string>
@@ -209,46 +199,6 @@
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="checkBox_4">
-           <property name="text">
-            <string>Segmentation</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="checkBox_3">
-           <property name="text">
-            <string>Surface Models</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="checkBox_2">
-           <property name="text">
-            <string>Diffusion</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="checkBox_6">
-           <property name="text">
-            <string>Meshes</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
           <widget class="QPushButton" name="pushButton_2">
            <property name="text">
             <string>Any</string>

+ 12 - 0
Libs/DICOM/Widgets/ctkDICOMQueryRetrieveWidget.cpp

@@ -1,4 +1,6 @@
 
+#include <QTreeView>
+
 // ctkDICOMWidgets includes
 #include "ctkDICOMQueryRetrieveWidget.h"
 #include "ui_ctkDICOMQueryRetrieveWidget.h"
@@ -25,6 +27,8 @@ ctkDICOMQueryRetrieveWidget::ctkDICOMQueryRetrieveWidget(QWidget* _parent):Super
   CTK_D(ctkDICOMQueryRetrieveWidget);
   
   d->setupUi(this);
+
+  connect(d->queryButton, SIGNAL(clicked()), this, SLOT(processQuery()));
 }
 
 //----------------------------------------------------------------------------
@@ -32,4 +36,12 @@ ctkDICOMQueryRetrieveWidget::~ctkDICOMQueryRetrieveWidget()
 {
 }
 
+//----------------------------------------------------------------------------
+void ctkDICOMQueryRetrieveWidget::processQuery()
+{
+  CTK_D(ctkDICOMQueryRetrieveWidget);
+
+  QTreeView *queryResults = new QTreeView;
+  d->results->addTab(queryResults, "Query Results");
+}
 

+ 4 - 0
Libs/DICOM/Widgets/ctkDICOMQueryRetrieveWidget.h

@@ -33,11 +33,15 @@ class ctkDICOMQueryRetrieveWidgetPrivate;
 
 class CTK_DICOM_WIDGETS_EXPORT ctkDICOMQueryRetrieveWidget : public QWidget
 {
+Q_OBJECT;
 public:
   typedef QWidget Superclass;
   explicit ctkDICOMQueryRetrieveWidget(QWidget* parent=0);
   virtual ~ctkDICOMQueryRetrieveWidget();
 
+public slots:
+    void processQuery();
+
 private:
   CTK_DECLARE_PRIVATE(ctkDICOMQueryRetrieveWidget);
 };