28 #include <QVBoxLayout>
51 QBoxLayout *layout =
new QVBoxLayout;
53 layout->setContentsMargins(0, 0, 0, 0);
88 m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
121 if (event->type() == QEvent::DragEnter) {
124 else if (event->type() == QEvent::Drop) {
128 return AbstractProjectItemView::eventFilter(watched, event);
void onItemAdded(ProjectItem *item)
Expands the parent project item in the tree view to show the added item.
QTreeView * treeView()
Returns the tree view.
~ProjectItemTreeView()
Default destructor.
virtual void setInternalModel(ProjectItemModel *model)
Sets the internal model of the view.
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
ProjectItem * parent() const
Returns the parent item of this item.
QTreeView * m_treeView
The tree view (widget)
AbstractProjectItemView is a base class for views of a ProjectItemModel in Qt's model-view framework...
Provides access to data stored in a Project through Qt's model-view framework.
virtual ProjectItemModel * internalModel()
Returns the internal model of the view.
QItemSelectionModel * selectionModel()
Returns the internal selection model.
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.
bool isControlList() const
Returns true if a ControlList is stored in the data of the item.
Represents an item of a ProjectItemModel in Qt's model-view framework.
virtual void setInternalModel(ProjectItemModel *model)
Sets the model so that the internal proxy model exactly matches the source model. ...