Quellcode durchsuchen

Added initial ctkXNATBrowser application.

Sascha Zelzer vor 12 Jahren
Ursprung
Commit
628b109c29

+ 39 - 0
Applications/ctkXNATBrowser/CMakeLists.txt

@@ -0,0 +1,39 @@
+project(ctkXNATBrowser)
+
+#
+# See CTK/CMake/ctkMacroBuildApp.cmake for details
+#
+
+set(KIT_SRCS
+  ctkXNATBrowserMain.cpp
+  ctkXNATBrowserMainWindow.cpp
+)
+
+# Headers that should run through moc
+set(KIT_MOC_SRCS
+  ctkXNATBrowserMainWindow.h
+)
+
+# UI files
+set(KIT_UI_FORMS
+  ctkXNATBrowserMainWindow.ui
+)
+
+# Resources
+set(KIT_resources
+)
+
+# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
+# The following macro will read the target libraries from the file 'target_libraries.cmake'
+ctkFunctionGetTargetLibraries(KIT_target_libraries)
+
+ctkMacroBuildApp(
+  NAME ${PROJECT_NAME}
+  SRCS ${KIT_SRCS}
+  MOC_SRCS ${KIT_MOC_SRCS}
+  UI_FORMS ${KIT_UI_FORMS}
+  TARGET_LIBRARIES ${KIT_target_libraries}
+  RESOURCES ${KIT_resources}
+  )
+
+target_link_libraries(${PROJECT_NAME} ${QT_LIBRARIES})

+ 37 - 0
Applications/ctkXNATBrowser/ctkXNATBrowserMain.cpp

@@ -0,0 +1,37 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+// Qt includes
+#include <QApplication>
+
+#include "ctkXNATBrowserMainWindow.h"
+
+int main(int argc, char** argv)
+{
+  QApplication myApp(argc, argv);
+  myApp.setOrganizationName("CommonTK");
+  myApp.setApplicationName("XNATBrowser");
+
+  ctkXNATBrowserMainWindow mainWindow;
+  mainWindow.show();
+
+  return myApp.exec();
+}

+ 35 - 0
Applications/ctkXNATBrowser/ctkXNATBrowserMainWindow.cpp

@@ -0,0 +1,35 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#include "ctkXNATBrowserMainWindow.h"
+#include "ui_ctkXNATBrowserMainWindow.h"
+
+ctkXNATBrowserMainWindow::ctkXNATBrowserMainWindow(QWidget *parent) :
+  QMainWindow(parent),
+  ui(new Ui::ctkXNATBrowserMainWindow)
+{
+  ui->setupUi(this);
+}
+
+ctkXNATBrowserMainWindow::~ctkXNATBrowserMainWindow()
+{
+  delete ui;
+}

+ 43 - 0
Applications/ctkXNATBrowser/ctkXNATBrowserMainWindow.h

@@ -0,0 +1,43 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) German Cancer Research Center,
+    Division of Medical and Biological Informatics
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+=============================================================================*/
+
+#ifndef CTKXNATBROWSERMAINWINDOW_H
+#define CTKXNATBROWSERMAINWINDOW_H
+
+#include <QMainWindow>
+
+namespace Ui {
+class ctkXNATBrowserMainWindow;
+}
+
+class ctkXNATBrowserMainWindow : public QMainWindow
+{
+  Q_OBJECT
+
+public:
+  explicit ctkXNATBrowserMainWindow(QWidget *parent = 0);
+  ~ctkXNATBrowserMainWindow();
+
+private:
+  Ui::ctkXNATBrowserMainWindow *ui;
+};
+
+#endif // CTKXNATBROWSERMAINWINDOW_H

+ 102 - 0
Applications/ctkXNATBrowser/ctkXNATBrowserMainWindow.ui

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ctkXNATBrowserMainWindow</class>
+ <widget class="QMainWindow" name="ctkXNATBrowserMainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout_3">
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Projects</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QListWidget" name="projectsList"/>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <layout class="QVBoxLayout" name="verticalLayout_2">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Experiments</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QListWidget" name="experimentsList"/>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+    <item>
+     <widget class="QGroupBox" name="detailsGroupBox">
+      <property name="title">
+       <string>Details</string>
+      </property>
+     </widget>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>27</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menu_File">
+    <property name="title">
+     <string>&amp;File</string>
+    </property>
+    <addaction name="action_Quit"/>
+   </widget>
+   <addaction name="menu_File"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <action name="action_Quit">
+   <property name="text">
+    <string>&amp;Quit</string>
+   </property>
+  </action>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>action_Quit</sender>
+   <signal>triggered()</signal>
+   <receiver>ctkXNATBrowserMainWindow</receiver>
+   <slot>close()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>399</x>
+     <y>299</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

+ 9 - 0
Applications/ctkXNATBrowser/target_libraries.cmake

@@ -0,0 +1,9 @@
+#
+# See CMake/ctkFunctionGetTargetLibraries.cmake
+#
+# This file should list the libraries required to build the current CTK application.
+#
+
+set(target_libraries
+  CTKXNATWidgets
+  )

+ 4 - 0
CMakeLists.txt

@@ -589,6 +589,10 @@ if(CTK_USE_QTTESTING)
                 CTK_BUILD_EXAMPLES)
 endif()
 
+ctk_app_option(ctkXNATBrowser
+               "Build the XNAT Browser application" OFF
+               CTK_BUILD_EXAMPLES)
+
 # Save the set of enabled apps in a cache file
 set(_enabled_apps)
 foreach(_app ${CTK_APPS})