23 #ifndef KDSME_VIEW_ABSTRACTSCENE_H
24 #define KDSME_VIEW_ABSTRACTSCENE_H
26 #include "kdsme_view_export.h"
32 class QAbstractItemModel;
34 class QItemSelectionModel;
40 class AbstractScenePrivate;
41 class AbstractSceneContextMenuEventPrivate;
51 Element* elementUnderCursor()
const;
54 QScopedPointer<AbstractSceneContextMenuEventPrivate> d;
60 Q_PROPERTY(QAbstractItemModel* model READ model WRITE setModel NOTIFY modelChanged)
61 Q_PROPERTY(QQuickItem* instantiator READ instantiator WRITE setInstantiator NOTIFY instantiatorChanged)
62 Q_PROPERTY(ViewState viewState READ viewState NOTIFY stateChanged FINAL)
63 Q_PROPERTY(Qt::ContextMenuPolicy ContextMenuPolicy READ contextMenuPolicy WRITE setContextMenuPolicy NOTIFY contextMenuPolicyChanged FINAL)
70 Q_DECLARE_FLAGS(EditTriggers, EditTrigger)
81 virtual void setModel(QAbstractItemModel *model);
82 QAbstractItemModel *model()
const;
84 virtual void setSelectionModel(QItemSelectionModel *selectionModel);
85 QItemSelectionModel *selectionModel()
const;
87 QQuickItem* instantiator()
const;
88 void setInstantiator(QQuickItem* instantiator);
90 void setEditTriggers(EditTriggers triggers);
91 EditTriggers editTriggers()
const;
93 void setContextMenuPolicy(Qt::ContextMenuPolicy contextMenuPolicy);
94 Qt::ContextMenuPolicy contextMenuPolicy()
const;
96 QObject* itemForIndex(
const QModelIndex& index)
const;
98 ViewState viewState()
const;
100 QModelIndex currentIndex()
const;
103 void setCurrentIndex(
const QModelIndex& index);
106 bool event(QEvent* event)
override;
109 virtual void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected);
110 virtual void currentChanged(
const QModelIndex& current,
const QModelIndex& previous);
112 virtual void rowsInserted(
const QModelIndex& parent,
int start,
int end);
113 virtual void rowsAboutToBeRemoved(
const QModelIndex& parent,
int start,
int end);
119 virtual void layoutChanged();
121 void setViewState(ViewState state);
124 void modelChanged(QAbstractItemModel* model);
125 void stateChanged(ViewState state);
126 void instantiatorChanged(QObject* instantiator);
127 void contextMenuPolicyChanged(Qt::ContextMenuPolicy contextMenuPolicy);
138 friend AbstractScenePrivate;
139 QScopedPointer<AbstractScenePrivate> d;
145 Q_DECLARE_METATYPE(
KDSME::AbstractScene::ViewState)
147 #endif // ABSTRACTVIEW_H
Definition: abstractscene.h:57
Definition: abstractexporter.h:33