23 #ifndef KDGANTTGRAPHICSSCENE_H
24 #define KDGANTTGRAPHICSSCENE_H
28 #include <QGraphicsScene>
29 #include <QModelIndex>
35 class QItemSelectionModel;
41 class AbstractRowController;
44 class ConstraintModel;
45 class ConstraintGraphicsItem;
58 static QModelIndex mainIndex(
const QModelIndex& idx );
59 static QModelIndex dataIndex(
const QModelIndex& idx );
61 QAbstractItemModel* model()
const;
63 QModelIndex rootIndex()
const;
65 QItemSelectionModel* selectionModel()
const;
67 void insertItem(
const QPersistentModelIndex&,
GraphicsItem* );
68 void removeItem(
const QModelIndex& );
69 using QGraphicsScene::removeItem;
71 GraphicsItem* findItem(
const QPersistentModelIndex& )
const;
75 void deleteSubtree(
const QModelIndex& );
79 void clearConstraintItems();
87 void setGrid( AbstractGrid* grid );
88 AbstractGrid* grid()
const;
90 bool isReadOnly()
const;
92 void updateRow(
const QModelIndex& idx );
96 void itemEntered(
const QModelIndex& );
97 void itemPressed(
const QModelIndex& );
98 void itemClicked(
const QModelIndex& );
99 void itemDoubleClicked(
const QModelIndex& );
104 void print( QPrinter* printer,
bool drawRowLabels =
true,
bool drawColumnLabels =
true );
105 void print( QPrinter* printer, qreal start, qreal end,
bool drawRowLabels =
true,
bool drawColumnLabels =
true );
106 void print( QPainter* painter,
const QRectF& target = QRectF(),
bool drawRowLabels=
true,
bool drawColumnLabels =
true );
107 void print( QPainter* painter, qreal start, qreal end,
const QRectF& target = QRectF(),
bool drawRowLabels=
true,
bool drawColumnLabels =
true );
112 void clicked(
const QModelIndex & index );
113 void qrealClicked(
const QModelIndex & index );
114 void entered(
const QModelIndex & index );
115 void pressed(
const QModelIndex & index );
118 void helpEvent( QGraphicsSceneHelpEvent *helpEvent );
119 void drawBackground( QPainter* painter,
const QRectF& rect );
120 void drawForeground( QPainter* painter,
const QRectF& rect );
123 void setModel( QAbstractItemModel* );
126 void setRootIndex(
const QModelIndex& idx );
127 void setSelectionModel( QItemSelectionModel* selectionmodel );
128 void setReadOnly(
bool );
134 void slotGridChanged();
136 void doPrint( QPainter* painter,
const QRectF& targetRect,
137 qreal start, qreal end,
138 QPrinter* printer,
bool drawRowLabels,
bool drawColumnLabels );