Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
qSlicerModuleFactoryFilterModel.h
Go to the documentation of this file.
00001 /*==============================================================================
00002 
00003   Program: 3D Slicer
00004 
00005   Copyright (c) Kitware Inc.
00006 
00007   See COPYRIGHT.txt
00008   or http://www.slicer.org/copyright/copyright.txt for details.
00009 
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   This file was originally developed by Julien Finet, Kitware Inc.
00017   and was partially funded by NIH grant 3P41RR013218-12S1
00018 
00019 ==============================================================================*/
00020 
00021 #ifndef __qSlicerModuleFactoryFilterModel_h
00022 #define __qSlicerModuleFactoryFilterModel_h
00023 
00024 // Qt includes
00025 #include <QSortFilterProxyModel>
00026 #include <QStringList>
00027 
00028 // QtGUI includes
00029 #include "qSlicerBaseQTGUIExport.h"
00030 class qSlicerModuleFactoryFilterModelPrivate;
00031 
00032 class Q_SLICER_BASE_QTGUI_EXPORT qSlicerModuleFactoryFilterModel
00033   : public QSortFilterProxyModel
00034 {
00035   Q_OBJECT
00037   Q_PROPERTY(bool showToLoad READ showToLoad WRITE setShowToLoad)
00039   Q_PROPERTY(bool showToIgnore READ showToIgnore WRITE setShowToIgnore)
00041   Q_PROPERTY(bool showLoaded READ showLoaded WRITE setShowLoaded)
00043   Q_PROPERTY(bool showIgnored READ showIgnored WRITE setShowIgnored)
00045   Q_PROPERTY(bool showFailed READ showFailed WRITE setShowFailed)
00046 
00049   Q_PROPERTY(QStringList showModules READ showModules WRITE setShowModules NOTIFY showModulesChanged)
00051   Q_PROPERTY(bool hideAllWhenShowModulesIsEmpty READ hideAllWhenShowModulesIsEmpty WRITE setHideAllWhenShowModulesIsEmpty)
00052 public:
00054   typedef QSortFilterProxyModel Superclass;
00055 
00057   explicit qSlicerModuleFactoryFilterModel(QObject* parent = 0);
00058 
00060   virtual ~qSlicerModuleFactoryFilterModel();
00061 
00062   bool showToLoad()const;
00063   bool showToIgnore()const;
00064   bool showLoaded()const;
00065   bool showIgnored()const;
00066   bool showFailed()const;
00067 
00068   QStringList showModules()const;
00069 
00070   bool hideAllWhenShowModulesIsEmpty()const;
00071   void setHideAllWhenShowModulesIsEmpty(bool hide);
00072   virtual Qt::DropActions supportedDropActions()const;
00073   virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action,
00074                             int row, int column, const QModelIndex &parent);
00075 
00076 public slots:
00077   void setShowToLoad(bool show);
00078   void setShowToIgnore(bool show);
00079   void setShowLoaded(bool show);
00080   void setShowIgnored(bool show);
00081   void setShowFailed(bool show);
00082 
00083   void setShowModules(const QStringList& modules);
00084 
00085 signals:
00086   void showModulesChanged(const QStringList&)const;
00087 protected:
00088   QScopedPointer<qSlicerModuleFactoryFilterModelPrivate> d_ptr;
00089 
00090   virtual bool lessThan(const QModelIndex& leftIndex,
00091                         const QModelIndex& rightIndex)const;
00092   virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent)const;
00093 
00094 private:
00095   Q_DECLARE_PRIVATE(qSlicerModuleFactoryFilterModel);
00096   Q_DISABLE_COPY(qSlicerModuleFactoryFilterModel);
00097 };
00098 
00099 #endif
00100 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines