Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerModulesListView.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Copyright (c) Kitware Inc.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16  This file was originally developed by Julien Finet, Kitware Inc.
17  and was partially funded by NIH grant 3P41RR013218-12S1
18 
19 ==============================================================================*/
20 
21 #ifndef __qSlicerModulesListView_h
22 #define __qSlicerModulesListView_h
23 
24 // Qt includes
25 #include <QListView>
26 
27 // QtGUI includes
28 #include "qSlicerBaseQTGUIExport.h"
29 
30 class qSlicerModulesListViewPrivate;
33 class QStandardItem;
34 
35 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerModulesListView : public QListView
36 {
37  Q_OBJECT
39  Q_PROPERTY(bool checkBoxVisible READ isCheckBoxVisible WRITE setCheckBoxVisible )
40  Q_PROPERTY(QStringList checkedModules READ checkedModules
41  WRITE setCheckedModules NOTIFY checkedModulesChanged
42  DESIGNABLE false)
43  Q_PROPERTY(QStringList uncheckedModules READ uncheckedModules
44  WRITE setUncheckedModules NOTIFY uncheckedModulesChanged
45  DESIGNABLE false)
46 public:
48  typedef QListView Superclass;
49 
51  explicit qSlicerModulesListView(QWidget* parent = 0);
52 
54  virtual ~qSlicerModulesListView();
55 
58  void setFactoryManager(qSlicerAbstractModuleFactoryManager* manager);
59  qSlicerAbstractModuleFactoryManager* factoryManager()const;
60 
61  qSlicerModuleFactoryFilterModel* filterModel()const;
62 
64  QStringList modules()const;
65 
66  bool isCheckBoxVisible()const;
69  QStringList checkedModules()const;
70 
73  QStringList uncheckedModules()const;
74 
75 public slots:
76  void setCheckBoxVisible(bool show);
79  void setCheckedModules(const QStringList& moduleNames);
80 
83  void setUncheckedModules(const QStringList& moduleNames);
84 
85  void hideSelectedModules();
86  void moveLeftSelectedModules();
87  void moveRightSelectedModules();
88  void moveSelectedModules(int offset);
89 
90  void scrollToSelectedModules();
91 signals:
93  void checkedModulesChanged(const QStringList&);
95  void uncheckedModulesChanged(const QStringList&);
96 
97 protected slots:
98  void addModules(const QStringList& moduleNames);
99  void addModule(const QString& moduleName);
100  void updateModules();
101  void updateModules(const QStringList& moduleName);
102  void updateModule(const QString& moduleName);
103  void onItemChanged(QStandardItem* item);
104 
105 protected:
106  QScopedPointer<qSlicerModulesListViewPrivate> d_ptr;
107 
108  virtual void keyPressEvent(QKeyEvent * event);
109 
110 private:
111  Q_DECLARE_PRIVATE(qSlicerModulesListView);
112  Q_DISABLE_COPY(qSlicerModulesListView);
113 };
114 
115 #endif
116 
QListView Superclass
Superclass typedef.
QScopedPointer< qSlicerModulesListViewPrivate > d_ptr