瀏覽代碼

Change ctkDICOMAppWidget from QMainWindow to QWidget

Changed the type in the .h and .ui files so that the
widget can be reused in other places (like the AppHosting
examples)
Steve Pieper 14 年之前
父節點
當前提交
8e00df3eb3
共有 2 個文件被更改,包括 121 次插入137 次删除
  1. 119 135
      Libs/DICOM/Widgets/Resources/UI/ctkDICOMAppWidget.ui
  2. 2 2
      Libs/DICOM/Widgets/ctkDICOMAppWidget.h

+ 119 - 135
Libs/DICOM/Widgets/Resources/UI/ctkDICOMAppWidget.ui

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>ctkDICOMAppWidget</class>
- <widget class="QMainWindow" name="ctkDICOMAppWidget">
+ <widget class="QWidget" name="ctkDICOMAppWidget">
   <property name="geometry">
    <rect>
     <x>0</x>
@@ -19,140 +19,124 @@
   <property name="windowTitle">
    <string>ctkDICOMAppWidget</string>
   </property>
-  <widget class="QWidget" name="centralwidget">
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <item>
-     <layout class="QHBoxLayout" name="topLayout">
-      <item>
-       <widget class="QLabel" name="label">
-        <property name="maximumSize">
-         <size>
-          <width>100</width>
-          <height>20</height>
-         </size>
-        </property>
-        <property name="text">
-         <string>LocalDatabase:</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="ctkDirectoryButton" name="directoryButton" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>200</width>
-          <height>20</height>
-         </size>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <spacer name="horizontalSpacer">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>40</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-     </layout>
-    </item>
-    <item>
-     <layout class="QHBoxLayout" name="queryLayout" stretch="1,0">
-      <item>
-       <widget class="QTreeView" name="treeView">
-        <property name="alternatingRowColors">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <layout class="QVBoxLayout" name="searchOptionLayout">
-        <item>
-         <widget class="ctkDICOMQueryWidget" name="searchOption" native="true"/>
-        </item>
-        <item>
-         <spacer name="verticalSpacer">
-          <property name="orientation">
-           <enum>Qt::Vertical</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>20</width>
-            <height>40</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </item>
-    <item>
-     <layout class="QHBoxLayout" name="viewerLayout">
-      <item>
-       <widget class="ctkDICOMThumbnailListWidget" name="thumbnailsWidget" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>200</height>
-         </size>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QWidget" name="previewWidget" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>256</width>
-          <height>256</height>
-         </size>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>739</width>
-     <height>25</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menuFile">
-    <property name="title">
-     <string>File</string>
-    </property>
-   </widget>
-   <addaction name="menuFile"/>
-  </widget>
-  <widget class="QStatusBar" name="statusbar"/>
-  <widget class="QToolBar" name="toolBar">
-   <property name="windowTitle">
-    <string>toolBar</string>
-   </property>
-   <property name="floatable">
-    <bool>true</bool>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionImport"/>
-   <addaction name="actionExport"/>
-   <addaction name="actionQuery"/>
-   <addaction name="actionSend"/>
-  </widget>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QToolBar" name="toolBar">
+     <property name="windowTitle">
+      <string>toolBar</string>
+     </property>
+     <property name="floatable">
+      <bool>true</bool>
+     </property>
+     <addaction name="actionImport"/>
+     <addaction name="actionExport"/>
+     <addaction name="actionQuery"/>
+     <addaction name="actionSend"/>
+    </widget>
+   </item>
+   <item>
+    <widget class="QStatusBar" name="statusbar"/>
+   </item>
+   <item>
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <item>
+      <layout class="QHBoxLayout" name="topLayout">
+       <item>
+        <widget class="QLabel" name="label">
+         <property name="maximumSize">
+          <size>
+           <width>100</width>
+           <height>20</height>
+          </size>
+         </property>
+         <property name="text">
+          <string>LocalDatabase:</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="ctkDirectoryButton" name="directoryButton" native="true">
+         <property name="minimumSize">
+          <size>
+           <width>200</width>
+           <height>20</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="queryLayout" stretch="1,0">
+       <item>
+        <widget class="QTreeView" name="treeView">
+         <property name="alternatingRowColors">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QVBoxLayout" name="searchOptionLayout">
+         <item>
+          <widget class="ctkDICOMQueryWidget" name="searchOption" native="true"/>
+         </item>
+         <item>
+          <spacer name="verticalSpacer">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>40</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <layout class="QHBoxLayout" name="viewerLayout">
+       <item>
+        <widget class="ctkDICOMThumbnailListWidget" name="thumbnailsWidget" native="true">
+         <property name="minimumSize">
+          <size>
+           <width>0</width>
+           <height>200</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QWidget" name="previewWidget" native="true">
+         <property name="minimumSize">
+          <size>
+           <width>256</width>
+           <height>256</height>
+          </size>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
   <action name="actionImport">
    <property name="text">
     <string>Import</string>

+ 2 - 2
Libs/DICOM/Widgets/ctkDICOMAppWidget.h

@@ -30,11 +30,11 @@ class QModelIndex;
 class ctkDICOMAppWidgetPrivate;
 class ctkDICOMThumbnailWidget;
 
-class CTK_DICOM_WIDGETS_EXPORT ctkDICOMAppWidget : public QMainWindow
+class CTK_DICOM_WIDGETS_EXPORT ctkDICOMAppWidget : public QWidget
 {
 Q_OBJECT;
 public:
-  typedef QMainWindow Superclass;
+  typedef QWidget Superclass;
   explicit ctkDICOMAppWidget(QWidget* parent=0);
   virtual ~ctkDICOMAppWidget();