Isis Developer Reference
AbstractProjectItemView.h
Go to the documentation of this file.
1 #ifndef AbstractProjectItemView_h
2 #define AbstractProjectItemView_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QMainWindow>
13 
14 class QAction;
15 class QDragEnterEvent;
16 class QWidget;
17 template <typename T> class QList;
18 
19 namespace Isis {
20 
21  class ProjectItem;
22  class ProjectItemModel;
23 
80 
81  Q_OBJECT
82 
83  public:
85 
86  virtual QSize sizeHint() const;
87 
88  virtual void setModel(ProjectItemModel *model);
89  virtual ProjectItemModel *model();
90 
91  virtual void dragEnterEvent(QDragEnterEvent *event);
92  virtual void dragMoveEvent(QDragMoveEvent *event);
93  virtual void dropEvent(QDropEvent *event);
94 
95  virtual void moveEvent(QMoveEvent *event);
96  virtual void resizeEvent(QResizeEvent *event);
97 
98  virtual void enterEvent(QEvent *event);
99  virtual void leaveEvent(QEvent *event);
100  virtual void enableActions();
101 
103 
104  virtual ProjectItem *currentItem();
106 
107  virtual ProjectItemModel *internalModel();
108  virtual void setInternalModel(ProjectItemModel *model);
109 
110  signals:
111  void windowChangeEvent(bool event);
112 
113  public slots:
114  virtual void addItem(ProjectItem *item);
115  virtual void addItems(QList<ProjectItem *> items);
116 
117  virtual void removeItem(ProjectItem *item);
118  virtual void removeItems(QList<ProjectItem *> items);
119 
120  virtual void disableActions();
121 
122  private:
123  ProjectItemModel *m_internalModel;
124  };
125 }
126 
127 #endif
Isis::AbstractProjectItemView::AbstractProjectItemView
AbstractProjectItemView(QWidget *parent=0)
Constructs the AbstractProjectItemView.
Definition: AbstractProjectItemView.cpp:34
Isis::ProjectItemModel
Provides access to data stored in a Project through Qt's model-view framework.
Definition: ProjectItemModel.h:132
AbstractProjectItemView.h
ProjectItem.h
Isis::AbstractProjectItemView::model
virtual ProjectItemModel * model()
Returns the model used by the view.
Definition: AbstractProjectItemView.cpp:83
Isis::AbstractProjectItemView::leaveEvent
virtual void leaveEvent(QEvent *event)
Disables actions when cursor leaves the view.
Definition: AbstractProjectItemView.cpp:188
QWidget
Isis::AbstractProjectItemView
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework.
Definition: AbstractProjectItemView.h:79
QList< QAction * >
Isis::AbstractProjectItemView::dropEvent
virtual void dropEvent(QDropEvent *event)
Drops the data into the internal model if it can accept the data.
Definition: AbstractProjectItemView.cpp:148
Isis::AbstractProjectItemView::setModel
virtual void setModel(ProjectItemModel *model)
Sets the model used by the view.
Definition: AbstractProjectItemView.cpp:69
Isis::AbstractProjectItemView::selectedItems
virtual QList< ProjectItem * > selectedItems()
Return the selected items of the model.
Definition: AbstractProjectItemView.cpp:238
Isis::ProjectItemProxyModel
Allows access to items in a ProjectItemModel through a proxy model.
Definition: ProjectItemProxyModel.h:70
QMainWindow
Isis::AbstractProjectItemView::addItems
virtual void addItems(QList< ProjectItem * > items)
Adds several items to the view.
Definition: AbstractProjectItemView.cpp:264
Isis::AbstractProjectItemView::removeItem
virtual void removeItem(ProjectItem *item)
Removes an item to the view.
Definition: AbstractProjectItemView.cpp:278
Isis::AbstractProjectItemView::currentItem
virtual ProjectItem * currentItem()
Returns the current item of the model.
Definition: AbstractProjectItemView.cpp:228
Isis::AbstractProjectItemView::enableActions
virtual void enableActions()
Enables toolbars and toolpad actions.
Definition: AbstractProjectItemView.cpp:206
Isis::AbstractProjectItemView::enterEvent
virtual void enterEvent(QEvent *event)
Enables actions when cursor enters the view.
Definition: AbstractProjectItemView.cpp:178
Isis::AbstractProjectItemView::addItem
virtual void addItem(ProjectItem *item)
Adds an item to the view.
Definition: AbstractProjectItemView.cpp:250
ProjectItemProxyModel.h
Isis::AbstractProjectItemView::windowChangeEvent
void windowChangeEvent(bool event)
Isis::AbstractProjectItemView::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
Accepts the drag enter event if the internal model can accept the mime data.
Definition: AbstractProjectItemView.cpp:119
Isis::AbstractProjectItemView::setInternalModel
virtual void setInternalModel(ProjectItemModel *model)
Sets the internal model of the view.
Definition: AbstractProjectItemView.cpp:97
Isis::ProjectItemModel::selectedItems
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Definition: ProjectItemModel.cpp:158
Isis::AbstractProjectItemView::internalModel
virtual ProjectItemModel * internalModel()
Returns the internal model of the view.
Definition: AbstractProjectItemView.cpp:108
Isis::AbstractProjectItemView::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Accepts the drag event if the internal model can accept the mime data.
Definition: AbstractProjectItemView.cpp:134
ProjectItemModel.h
Isis::AbstractProjectItemView::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Definition: AbstractProjectItemView.cpp:166
Isis::AbstractProjectItemView::disableActions
virtual void disableActions()
Disables toolbars and toolpad actions.
Definition: AbstractProjectItemView.cpp:196
Isis::AbstractProjectItemView::removeItems
virtual void removeItems(QList< ProjectItem * > items)
Removes several items from the view.
Definition: AbstractProjectItemView.cpp:292
Isis::AbstractProjectItemView::sizeHint
virtual QSize sizeHint() const
Returns the suggested size.
Definition: AbstractProjectItemView.cpp:53
Isis::ProjectItemModel::currentItem
ProjectItem * currentItem()
Returns the current item of the internal selection model.
Definition: ProjectItemModel.cpp:139
Isis::AbstractProjectItemView::contextMenuActions
virtual QList< QAction * > contextMenuActions()
Returns a list of actions appropriate for a context menu.
Definition: AbstractProjectItemView.cpp:218
QAction
Isis::AbstractProjectItemView::moveEvent
virtual void moveEvent(QMoveEvent *event)
Definition: AbstractProjectItemView.cpp:159
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ProjectItem
Represents an item of a ProjectItemModel in Qt's model-view framework.
Definition: ProjectItem.h:134