• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kdgantt2

  • sources
  • kde-4.12
  • kdepim
  • kdgantt2
kdganttgraphicsscene.h
Go to the documentation of this file.
1 /****************************************************************************
2  ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB. All rights reserved.
3  **
4  ** This file is part of the KD Gantt library.
5  **
6  ** This file may be distributed and/or modified under the terms of the
7  ** GNU General Public License version 2 as published by the Free Software
8  ** Foundation and appearing in the file LICENSE.GPL included in the
9  ** packaging of this file.
10  **
11  ** Licensees holding valid commercial KD Gantt licenses may use this file in
12  ** accordance with the KD Gantt Commercial License Agreement provided with
13  ** the Software.
14  **
15  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  **
18  ** See http://www.kdab.net/kdgantt for
19  ** information about KD Gantt Commercial License Agreements.
20  **
21  ** Contact info@kdab.net if any conditions of this
22  ** licensing are not clear to you.
23  **
24  **********************************************************************/
25 #ifndef KDGANTTGRAPHICSSCENE_H
26 #define KDGANTTGRAPHICSSCENE_H
27 
28 #include <QDateTime>
29 #include <QList>
30 #include <QGraphicsScene>
31 #include <QModelIndex>
32 
33 #include "kdganttglobal.h"
34 
35 class QAbstractProxyModel;
36 class QItemSelectionModel;
37 class QPrinter;
38 
39 namespace KDGantt {
40  class AbstractGrid;
41  class AbstractRowController;
42  class GraphicsItem;
43  class Constraint;
44  class ConstraintModel;
45  class ConstraintGraphicsItem;
46  class ItemDelegate;
47 
48  class GraphicsScene : public QGraphicsScene {
49  Q_OBJECT
50  KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( GraphicsScene )
51  public:
52  explicit GraphicsScene( QObject* parent=0 );
53  virtual ~GraphicsScene();
54 
55  //qreal dateTimeToSceneX( const QDateTime& dt ) const;
56  //QDateTime sceneXtoDateTime( qreal x ) const;
57 
58  static QModelIndex mainIndex( const QModelIndex& idx );
59  static QModelIndex dataIndex( const QModelIndex& idx );
60 
61  QAbstractItemModel* model() const;
62  QAbstractProxyModel* summaryHandlingModel() const;
63  QModelIndex rootIndex() const;
64  ConstraintModel* constraintModel() const;
65  QItemSelectionModel* selectionModel() const;
66 
67  void insertItem( const QPersistentModelIndex&, GraphicsItem* );
68  void removeItem( const QModelIndex& );
69  using QGraphicsScene::removeItem;
70  GraphicsItem* findItem( const QModelIndex& ) const;
71  GraphicsItem* findItem( const QPersistentModelIndex& ) const;
72 
73  void updateItems();
74  void clearItems();
75  void deleteSubtree( const QModelIndex& );
76 
77  ConstraintGraphicsItem* findConstraintItem( const Constraint& ) const;
78  QList<ConstraintGraphicsItem*> findConstraintItems( const QModelIndex& idx ) const;
79  void clearConstraintItems();
80 
81  void setItemDelegate( ItemDelegate* );
82  ItemDelegate* itemDelegate() const;
83 
84  void setRowController( AbstractRowController* rc );
85  AbstractRowController* rowController() const;
86 
87  void setGrid( AbstractGrid* grid );
88  AbstractGrid* grid() const;
89 
90  bool isReadOnly() const;
91 
92  void updateRow( const QModelIndex& idx );
93  GraphicsItem* createItem( ItemType type ) const;
94 
95  /* used by GraphicsItem */
96  void itemEntered( const QModelIndex& );
97  void itemPressed( const QModelIndex& );
98  void itemClicked( const QModelIndex& );
99  void itemDoubleClicked( const QModelIndex& );
100  void setDragSource( GraphicsItem* item );
101  GraphicsItem* dragSource() const;
102 
103  /* Printing */
104  void print( QPrinter* printer, bool drawRowLabels = true );
105  void print( QPrinter* printer, qreal start, qreal end, bool drawRowLabels = true );
106  void print( QPainter* painter, const QRectF& target = QRectF(), bool drawRowLabels=true );
107  void print( QPainter* painter, qreal start, qreal end, const QRectF& target = QRectF(), bool drawRowLabels=true );
108 
109  Q_SIGNALS:
110  void gridChanged();
111 
112  void clicked( const QModelIndex & index );
113  void doubleClicked( const QModelIndex & index );
114  void entered( const QModelIndex & index );
115  void pressed( const QModelIndex & index );
116 
117  protected:
118  /*reimp*/ void helpEvent( QGraphicsSceneHelpEvent *helpEvent );
119  /*reimp*/ void drawBackground( QPainter* painter, const QRectF& rect );
120 
121  public Q_SLOTS:
122  void setModel( QAbstractItemModel* );
123  void setSummaryHandlingModel( QAbstractProxyModel* );
124  void setConstraintModel( ConstraintModel* );
125  void setRootIndex( const QModelIndex& idx );
126  void setSelectionModel( QItemSelectionModel* selectionmodel );
127  void setReadOnly( bool );
128 
129  private Q_SLOTS:
130  /* slots for ConstraintModel */
131  void slotConstraintAdded( const Constraint& );
132  void slotConstraintRemoved( const Constraint& );
133  void slotGridChanged();
134  private:
135  void doPrint( QPainter* painter, const QRectF& targetRect,
136  qreal start, qreal end,
137  QPrinter* printer, bool drawRowLabels );
138  };
139 }
140 
141 #endif /* KDGANTTGRAPHICSSCENE_H */
KDGantt::GraphicsScene::setReadOnly
void setReadOnly(bool)
Definition: kdganttgraphicsscene.cpp:286
QGraphicsScene
KDGantt::ItemDelegate
Class used to render gantt items in a KDGantt::GraphicsView.
Definition: kdganttitemdelegate.h:39
KDGantt::GraphicsScene::selectionModel
QItemSelectionModel * selectionModel() const
Definition: kdganttgraphicsscene.cpp:255
KDGantt::GraphicsScene::mainIndex
static QModelIndex mainIndex(const QModelIndex &idx)
Definition: kdganttgraphicsscene.cpp:301
KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)
Definition: kdganttglobal.h:121
KDGantt::GraphicsScene::clearItems
void clearItems()
Definition: kdganttgraphicsscene.cpp:490
KDGantt::GraphicsScene::doubleClicked
void doubleClicked(const QModelIndex &index)
KDGantt::GraphicsScene::itemDoubleClicked
void itemDoubleClicked(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:611
KDGantt::GraphicsScene::setSelectionModel
void setSelectionModel(QItemSelectionModel *selectionmodel)
Definition: kdganttgraphicsscene.cpp:249
KDGantt::GraphicsScene::setSummaryHandlingModel
void setSummaryHandlingModel(QAbstractProxyModel *)
Definition: kdganttgraphicsscene.cpp:216
kdganttglobal.h
KDGantt::GraphicsScene::grid
AbstractGrid * grid() const
Definition: kdganttgraphicsscene.cpp:281
KDGantt::GraphicsScene::setConstraintModel
void setConstraintModel(ConstraintModel *)
Definition: kdganttgraphicsscene.cpp:237
KDGantt::ItemType
ItemType
Definition: kdganttglobal.h:211
KDGantt::GraphicsScene::drawBackground
void drawBackground(QPainter *painter, const QRectF &rect)
Definition: kdganttgraphicsscene.cpp:566
KDGantt::GraphicsScene::dataIndex
static QModelIndex dataIndex(const QModelIndex &idx)
Definition: kdganttgraphicsscene.cpp:318
KDGantt::GraphicsScene::itemClicked
void itemClicked(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:606
KDGantt::GraphicsScene::updateItems
void updateItems()
Definition: kdganttgraphicsscene.cpp:497
QObject
KDGantt::GraphicsScene::setModel
void setModel(QAbstractItemModel *)
Definition: kdganttgraphicsscene.cpp:203
KDGantt::GraphicsScene::itemEntered
void itemEntered(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:596
KDGantt::GraphicsScene
Definition: kdganttgraphicsscene.h:48
KDGantt::GraphicsScene::setGrid
void setGrid(AbstractGrid *grid)
Definition: kdganttgraphicsscene.cpp:270
KDGantt::GraphicsScene::dragSource
GraphicsItem * dragSource() const
Definition: kdganttgraphicsscene.cpp:621
KDGantt::GraphicsScene::constraintModel
ConstraintModel * constraintModel() const
Definition: kdganttgraphicsscene.cpp:232
KDGantt::GraphicsScene::updateRow
void updateRow(const QModelIndex &idx)
Definition: kdganttgraphicsscene.cpp:370
KDGantt::GraphicsScene::summaryHandlingModel
QAbstractProxyModel * summaryHandlingModel() const
Definition: kdganttgraphicsscene.cpp:211
KDGantt::GraphicsScene::setRowController
void setRowController(AbstractRowController *rc)
Definition: kdganttgraphicsscene.cpp:260
KDGantt::AbstractGrid
Abstract baseclass for grids. A grid is used to convert between QModelIndex'es and gantt chart values...
Definition: kdganttabstractgrid.h:40
KDGantt::GraphicsScene::findConstraintItems
QList< ConstraintGraphicsItem * > findConstraintItems(const QModelIndex &idx) const
KDGantt::GraphicsScene::print
void print(QPrinter *printer, bool drawRowLabels=true)
Definition: kdganttgraphicsscene.cpp:632
KDGantt::GraphicsScene::clicked
void clicked(const QModelIndex &index)
KDGantt::GraphicsScene::entered
void entered(const QModelIndex &index)
KDGantt::GraphicsScene::helpEvent
void helpEvent(QGraphicsSceneHelpEvent *helpEvent)
Definition: kdganttgraphicsscene.cpp:552
KDGantt::GraphicsScene::pressed
void pressed(const QModelIndex &index)
KDGantt::GraphicsScene::removeItem
void removeItem(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:451
KDGantt::GraphicsScene::itemPressed
void itemPressed(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:601
KDGantt::GraphicsScene::GraphicsScene
GraphicsScene(QObject *parent=0)
Definition: kdganttgraphicsscene.cpp:160
KDGantt::GraphicsScene::findItem
GraphicsItem * findItem(const QModelIndex &) const
Definition: kdganttgraphicsscene.cpp:474
QAbstractProxyModel
KDGantt::GraphicsScene::isReadOnly
bool isReadOnly() const
Definition: kdganttgraphicsscene.cpp:291
KDGantt::GraphicsScene::findConstraintItem
ConstraintGraphicsItem * findConstraintItem(const Constraint &) const
Definition: kdganttgraphicsscene.cpp:524
KDGantt::GraphicsScene::setDragSource
void setDragSource(GraphicsItem *item)
Definition: kdganttgraphicsscene.cpp:616
KDGantt::GraphicsScene::itemDelegate
ItemDelegate * itemDelegate() const
Definition: kdganttgraphicsscene.cpp:192
KDGantt::GraphicsScene::deleteSubtree
void deleteSubtree(const QModelIndex &)
Definition: kdganttgraphicsscene.cpp:508
KDGantt::Constraint
A class used to represent a dependency.
Definition: kdganttconstraint.h:38
KDGantt::ConstraintGraphicsItem
Definition: kdganttconstraintgraphicsitem.h:35
KDGantt::GraphicsScene::rootIndex
QModelIndex rootIndex() const
Definition: kdganttgraphicsscene.cpp:227
KDGantt::GraphicsScene::rowController
AbstractRowController * rowController() const
Definition: kdganttgraphicsscene.cpp:265
KDGantt::GraphicsScene::~GraphicsScene
virtual ~GraphicsScene()
Definition: kdganttgraphicsscene.cpp:166
KDGantt::GraphicsScene::createItem
GraphicsItem * createItem(ItemType type) const
Definition: kdganttgraphicsscene.cpp:336
KDGantt::GraphicsScene::setItemDelegate
void setItemDelegate(ItemDelegate *)
Definition: kdganttgraphicsscene.cpp:185
KDGantt::GraphicsScene::insertItem
void insertItem(const QPersistentModelIndex &, GraphicsItem *)
Definition: kdganttgraphicsscene.cpp:418
KDGantt::GraphicsItem
Definition: kdganttgraphicsitem.h:42
KDGantt::AbstractRowController
Abstract baseclass for row controllers. A row controller is used by the GraphicsView to nagivate the ...
Definition: kdganttabstractrowcontroller.h:34
KDGantt::GraphicsScene::model
QAbstractItemModel * model() const
Definition: kdganttgraphicsscene.cpp:197
KDGantt::GraphicsScene::gridChanged
void gridChanged()
KDGantt::GraphicsScene::setRootIndex
void setRootIndex(const QModelIndex &idx)
Definition: kdganttgraphicsscene.cpp:222
KDGantt::GraphicsScene::clearConstraintItems
void clearConstraintItems()
Definition: kdganttgraphicsscene.cpp:529
KDGantt::ConstraintModel
Definition: kdganttconstraintmodel.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kdgantt2

Skip menu "kdgantt2"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal