|
Isis 3 Programmer Reference
|
9 #include "ProjectItemTreeView.h"
11 #include <QAbstractItemView>
12 #include <QDesktopWidget>
17 #include <QVBoxLayout>
20 #include "ProjectItem.h"
21 #include "ProjectItemModel.h"
47 setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
62 QDesktopWidget deskTop;
63 QRect availableSpace = deskTop.availableGeometry(deskTop.primaryScreen());
64 return QSize(.15 * availableSpace.width(), .5 * availableSpace.height());
98 m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
132 if (event->type() == QEvent::DragEnter) {
135 else if (event->type() == QEvent::Drop) {
139 return AbstractProjectItemView::eventFilter(watched, event);
Provides access to data stored in a Project through Qt's model-view framework.
virtual ProjectItemModel * model()
Returns the model used by the view.
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework.
~ProjectItemTreeView()
Default destructor.
QItemSelectionModel * selectionModel()
Returns the internal selection model.
virtual QSize sizeHint() const
Returns the suggested size.
QTreeView * treeView()
Returns the tree view.
bool isControlList() const
Returns true if a ControlList is stored in the data of the item.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
virtual void setInternalModel(ProjectItemModel *model)
Sets the internal model of the view.
QTreeView * m_treeView
The tree view (widget)
bool eventFilter(QObject *watched, QEvent *event)
Filters out drag and drop events so that they are handled by the ProjectItemTreeView.
ProjectItemTreeView(QWidget *parent=0)
Constructs a ProjectItemTreeView.
virtual ProjectItemModel * internalModel()
Returns the internal model of the view.
ProjectItem * parent() const
Returns the parent item of this item.
virtual void setInternalModel(ProjectItemModel *model)
Sets the model so that the internal proxy model exactly matches the source model.
void onItemAdded(ProjectItem *item)
Expands the parent project item in the tree view to show the added item.
This is free and unencumbered software released into the public domain.
Represents an item of a ProjectItemModel in Qt's model-view framework.