Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
30class qSlicerModulesListViewPrivate;
33class QStandardItem;
34
35class Q_SLICER_BASE_QTGUI_EXPORT qSlicerModulesListView : public QListView
36{
37 Q_OBJECT
40 Q_PROPERTY(QStringList modules READ modules)
41 Q_PROPERTY(QStringList checkedModules READ checkedModules WRITE setCheckedModules NOTIFY checkedModulesChanged DESIGNABLE false)
42 Q_PROPERTY(QStringList uncheckedModules READ uncheckedModules WRITE setUncheckedModules NOTIFY uncheckedModulesChanged DESIGNABLE false)
43public:
45 typedef QListView Superclass;
46
48 explicit qSlicerModulesListView(QWidget* parent = nullptr);
49
52
56
58
60 QStringList modules() const;
61
62 bool isCheckBoxVisible() const;
65 QStringList checkedModules() const;
66
69 QStringList uncheckedModules() const;
70
71public slots:
75
76 void setCheckBoxVisible(bool show);
77
80 void setCheckedModules(const QStringList& moduleNames);
81
84 void setUncheckedModules(const QStringList& moduleNames);
85
89 void moveSelectedModules(int offset);
90
92signals:
94 void checkedModulesChanged(const QStringList&);
96 void uncheckedModulesChanged(const QStringList&);
97
98protected slots:
99 void addModules(const QStringList& moduleNames);
100 void addModule(const QString& moduleName);
102 void updateModules(const QStringList& moduleName);
103 void updateModule(const QString& moduleName);
104 void onItemChanged(QStandardItem* item);
105
106protected:
107 QScopedPointer<qSlicerModulesListViewPrivate> d_ptr;
108
109 void changeEvent(QEvent* e) override;
110 void keyPressEvent(QKeyEvent* event) override;
111
112private:
113 Q_DECLARE_PRIVATE(qSlicerModulesListView);
114 Q_DISABLE_COPY(qSlicerModulesListView);
115};
116
117#endif
void uncheckedModulesChanged(const QStringList &)
This signal is emitted when a module is unchecked.
void setUncheckedModules(const QStringList &moduleNames)
void checkedModulesChanged(const QStringList &)
This signal is emitted when a module is checked.
Q_INVOKABLE qSlicerModuleFactoryFilterModel * filterModel() const
void moveSelectedModules(int offset)
QScopedPointer< qSlicerModulesListViewPrivate > d_ptr
bool isCheckBoxVisible() const
void addModules(const QStringList &moduleNames)
void changeEvent(QEvent *e) override
void setCheckedModules(const QStringList &moduleNames)
bool checkBoxVisible
False by default.
void keyPressEvent(QKeyEvent *event) override
void updateModule(const QString &moduleName)
void addModule(const QString &moduleName)
void onItemChanged(QStandardItem *item)
QListView Superclass
Superclass typedef.
Q_INVOKABLE qSlicerAbstractModuleFactoryManager * factoryManager() const
void setFactoryManager(qSlicerAbstractModuleFactoryManager *manager)
qSlicerModulesListView(QWidget *parent=nullptr)
Constructor.
void setCheckBoxVisible(bool show)