• 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
kdganttgraphicsview.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 KDGANTTGRAPHICSVIEW_H
26 #define KDGANTTGRAPHICSVIEW_H
27 
28 #include <QGraphicsView>
29 
30 #include "kdganttglobal.h"
31 
32 class QModelIndex;
33 class QAbstractItemModel;
34 class QAbstractProxyModel;
35 class QItemSelectionModel;
36 
37 namespace KDGantt {
38  class AbstractRowController;
39  class AbstractGrid;
40  class GraphicsItem;
41  class ConstraintModel;
42  class ItemDelegate;
43 
44  class KDGANTT_EXPORT GraphicsView : public QGraphicsView {
45  Q_OBJECT
46  KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(GraphicsView)
47 
48  Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
49 
50  Q_PRIVATE_SLOT( d, void slotGridChanged() )
51  Q_PRIVATE_SLOT( d, void slotHorizontalScrollValueChanged( int ) )
52  Q_PRIVATE_SLOT( d, void slotHeaderContextMenuRequested( const QPoint& ) )
53  /* slots for QAbstractItemModel signals */
54  Q_PRIVATE_SLOT( d, void slotColumnsInserted( const QModelIndex& parent, int start, int end ) )
55  Q_PRIVATE_SLOT( d, void slotColumnsRemoved( const QModelIndex& parent, int start, int end ) )
56  Q_PRIVATE_SLOT( d, void slotDataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight ) )
57  Q_PRIVATE_SLOT( d, void slotLayoutChanged() )
58  Q_PRIVATE_SLOT( d, void slotModelReset() )
59  Q_PRIVATE_SLOT( d, void slotRowsInserted( const QModelIndex& parent, int start, int end ) )
60  Q_PRIVATE_SLOT( d, void slotRowsAboutToBeRemoved( const QModelIndex& parent, int start, int end ) )
61  Q_PRIVATE_SLOT( d, void slotRowsRemoved( const QModelIndex& parent, int start, int end ) )
62 
63  Q_PRIVATE_SLOT( d, void slotItemClicked( const QModelIndex& idx ) )
64  Q_PRIVATE_SLOT( d, void slotItemDoubleClicked( const QModelIndex& idx ) )
65  public:
66 
67  explicit GraphicsView( QWidget* parent=0 );
68  virtual ~GraphicsView();
69 
70  QAbstractItemModel* model() const;
71  QAbstractProxyModel* summaryHandlingModel() const;
72  ConstraintModel* constraintModel() const;
73  QModelIndex rootIndex() const;
74  QItemSelectionModel* selectionModel() const;
75  AbstractRowController* rowController() const;
76  AbstractGrid* grid() const;
77  ItemDelegate* itemDelegate() const;
78 
79  bool isReadOnly() const;
80 
81  void setHeaderContextMenuPolicy( Qt::ContextMenuPolicy );
82  Qt::ContextMenuPolicy headerContextMenuPolicy() const;
83 
84  QModelIndex indexAt( const QPoint& pos ) const;
85 
86  virtual void addConstraint( const QModelIndex& from,
87  const QModelIndex& to,
88  Qt::KeyboardModifiers modifiers );
89 
90  void clearItems();
91  void updateRow( const QModelIndex& );
92  void updateScene();
93 
94  public Q_SLOTS:
95  void updateSceneRect();
96 
97  public:
98  void deleteSubtree( const QModelIndex& );
99 
100  void print( QPrinter* printer, bool drawRowLabels = true );
101  void print( QPrinter* printer, qreal start, qreal end, bool drawRowLabels = true );
102  void print( QPainter* painter, const QRectF& target = QRectF(), bool drawRowLabels = true );
103  void print( QPainter* painter, qreal start, qreal end,
104  const QRectF& target = QRectF(), bool drawRowLabels = true );
105 
106  public Q_SLOTS:
107  void setModel( QAbstractItemModel* );
108  void setSummaryHandlingModel( QAbstractProxyModel* model );
109  void setConstraintModel( ConstraintModel* );
110  void setRootIndex( const QModelIndex& );
111  void setSelectionModel( QItemSelectionModel* );
112  void setRowController( AbstractRowController* );
113  void setGrid( AbstractGrid* );
114  void setItemDelegate( ItemDelegate* delegate );
115  void setReadOnly( bool );
116 
117  Q_SIGNALS:
118  void activated( const QModelIndex & index );
119  void clicked( const QModelIndex & index );
120  void doubleClicked( const QModelIndex & index );
121  void entered( const QModelIndex & index );
122  void pressed( const QModelIndex & index );
123  void headerContextMenuRequested( const QPoint& pt );
124 
125  protected:
126  /*reimp*/void resizeEvent( QResizeEvent* );
127  private:
128  friend class View;
129 
130  GraphicsItem* createItem( ItemType type ) const;
131  };
132 }
133 
134 #endif /* KDGANTTGRAPHICSVIEW_H */
135 
KDGantt::ItemDelegate
Class used to render gantt items in a KDGantt::GraphicsView.
Definition: kdganttitemdelegate.h:39
KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)
Definition: kdganttglobal.h:121
KDGantt::View
This widget that consists of a QTreeView and a GraphicsView.
Definition: kdganttview.h:47
KDGantt::GraphicsView
The GraphicsView class provides a model/view implementation of a gantt chart.
Definition: kdganttgraphicsview.h:44
kdganttglobal.h
QWidget
KDGantt::ItemType
ItemType
Definition: kdganttglobal.h:211
KDGANTT_EXPORT
#define KDGANTT_EXPORT
Definition: kdgantt_export.h:40
KDGantt::AbstractGrid
Abstract baseclass for grids. A grid is used to convert between QModelIndex'es and gantt chart values...
Definition: kdganttabstractgrid.h:40
d
#define d
Definition: kdganttabstractgrid.cpp:53
QAbstractProxyModel
QGraphicsView
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::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