Browse Source

Created a plugin for the Qt Designer for the ctkDICOMTableManager.ui

Andreas Fetzer 11 years ago
parent
commit
2066414c49

+ 4 - 0
Libs/DICOM/Widgets/Plugins/CMakeLists.txt

@@ -15,6 +15,9 @@ set(PLUGIN_SRCS
 
   ctkDICOMQueryRetrieveWidgetPlugin.cpp
   ctkDICOMQueryRetrieveWidgetPlugin.h
+
+  ctkDICOMTableViewPlugin.cpp
+  ctkDICOMTableViewPlugin.h
   )
 
 # Headers that should run through moc
@@ -22,6 +25,7 @@ set(PLUGIN_MOC_SRCS
   ctkDICOMWidgetsPlugins.h
 
   ctkDICOMQueryRetrieveWidgetPlugin.h
+  ctkDICOMTableViewPlugin.h
   )
 
 # Resources

+ 68 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMTableViewPlugin.cpp

@@ -0,0 +1,68 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// CTK includes
+#include "ctkDICOMTableViewPlugin.h"
+#include "ctkDICOMTableView.h"
+
+//-----------------------------------------------------------------------------
+ctkDICOMTableViewPlugin::ctkDICOMTableViewPlugin(QObject* pluginParent)
+  : QObject(pluginParent)
+{
+}
+
+//-----------------------------------------------------------------------------
+QWidget *ctkDICOMTableViewPlugin::createWidget(QWidget *parentForWidget)
+{
+  ctkDICOMTableView* newWidget = new ctkDICOMTableView(parentForWidget);
+  return newWidget;
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMTableViewPlugin::domXml() const
+{
+  return "<widget class=\"ctkDICOMTableView\" \
+          name=\"DICOMTableView\">\n"
+          "</widget>\n";
+}
+
+// --------------------------------------------------------------------------
+QIcon ctkDICOMTableViewPlugin::icon() const
+{
+  return QIcon(":/Icons/listview.png");
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMTableViewPlugin::includeFile() const
+{
+  return "ctkDICOMTableView.h";
+}
+
+//-----------------------------------------------------------------------------
+bool ctkDICOMTableViewPlugin::isContainer() const
+{
+  return false;
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMTableViewPlugin::name() const
+{
+  return "ctkDICOMTableView";
+}

+ 45 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMTableViewPlugin.h

@@ -0,0 +1,45 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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 __ctkDICOMTableViewPlugin_h
+#define __ctkDICOMTableViewPlugin_h
+
+// CTK include
+#include "ctkDICOMWidgetsAbstractPlugin.h"
+
+class CTK_DICOM_WIDGETS_PLUGINS_EXPORT ctkDICOMTableViewPlugin
+  : public QObject
+  , public ctkDICOMWidgetsAbstractPlugin
+{
+  Q_OBJECT
+
+public:
+  ctkDICOMTableViewPlugin(QObject *_parent = 0);
+
+  QWidget *createWidget(QWidget *_parent);
+  QString  domXml() const;
+  QIcon    icon() const;
+  QString  includeFile() const;
+  bool     isContainer() const;
+  QString  name() const;
+
+};
+
+#endif

+ 2 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsPlugins.h

@@ -27,6 +27,7 @@
 // CTK includes
 #include "ctkDICOMWidgetsPluginsExport.h"
 #include "ctkDICOMQueryRetrieveWidgetPlugin.h"
+#include "ctkDICOMTableViewPlugin.h"
 
 /// \class Group the plugins in one library
 class CTK_DICOM_WIDGETS_PLUGINS_EXPORT ctkDICOMWidgetsPlugins
@@ -41,6 +42,7 @@ public:
     {
     QList<QDesignerCustomWidgetInterface *> plugins;
     plugins << new ctkDICOMQueryRetrieveWidgetPlugin;
+    plugins << new ctkDICOMTableViewPlugin;
     return plugins;
     }
 };