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

kdgantt

kdganttgraphicsview.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB.  All rights reserved.
00003  **
00004  ** This file is part of the KD Gantt library.
00005  **
00006  ** This file may be used under the terms of the GNU General Public
00007  ** License versions 2.0 or 3.0 as published by the Free Software
00008  ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
00009  ** included in the packaging of this file.  Alternatively you may (at
00010  ** your option) use any later version of the GNU General Public
00011  ** License if such license has been publicly approved by
00012  ** Klarälvdalens Datakonsult AB (or its successors, if any).
00013  ** 
00014  ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
00015  ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
00016  ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
00017  ** not expressly granted herein.
00018  ** 
00019  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021  **
00022  **********************************************************************/
00023 #ifndef KDGANTTGRAPHICSVIEW_H
00024 #define KDGANTTGRAPHICSVIEW_H
00025 
00026 #include <QGraphicsView>
00027 
00028 #include "kdganttglobal.h"
00029 
00030 class QModelIndex;
00031 class QAbstractItemModel;
00032 class QAbstractProxyModel;
00033 class QItemSelectionModel;
00034 
00035 namespace KDGantt {
00036     class AbstractRowController;
00037     class AbstractGrid;
00038     class GraphicsItem;
00039     class ConstraintModel;
00040     class ItemDelegate;
00041 
00042     class KDGANTT_EXPORT GraphicsView : public QGraphicsView {
00043         Q_OBJECT
00044         KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(GraphicsView)
00045 
00046         Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
00047 
00048         Q_PRIVATE_SLOT( d, void slotGridChanged() )
00049         Q_PRIVATE_SLOT( d, void slotHorizontalScrollValueChanged( int ) )
00050         /* slots for QAbstractItemModel signals */
00051         Q_PRIVATE_SLOT( d, void slotColumnsInserted( const QModelIndex& parent,  int start, int end ) )
00052         Q_PRIVATE_SLOT( d, void slotColumnsRemoved( const QModelIndex& parent,  int start, int end ) )
00053         Q_PRIVATE_SLOT( d, void slotDataChanged( const QModelIndex& topLeft, const QModelIndex& bottomRight ) )
00054         Q_PRIVATE_SLOT( d, void slotLayoutChanged() )
00055         Q_PRIVATE_SLOT( d, void slotModelReset() )
00056         Q_PRIVATE_SLOT( d, void slotRowsInserted( const QModelIndex& parent,  int start, int end ) )
00057         Q_PRIVATE_SLOT( d, void slotRowsAboutToBeRemoved( const QModelIndex& parent,  int start, int end ) )
00058         Q_PRIVATE_SLOT( d, void slotRowsRemoved( const QModelIndex& parent,  int start, int end ) )
00059 
00060         Q_PRIVATE_SLOT( d, void slotItemClicked( const QModelIndex& idx ) )
00061         Q_PRIVATE_SLOT( d, void slotItemDoubleClicked( const QModelIndex& idx ) )
00062     public:
00063 
00064         explicit GraphicsView( QWidget* parent=0 );
00065         virtual ~GraphicsView();
00066 
00067         QAbstractItemModel* model() const;
00068         QAbstractProxyModel* summaryHandlingModel() const;
00069         ConstraintModel* constraintModel() const;
00070         QModelIndex rootIndex() const;
00071         QItemSelectionModel* selectionModel() const;
00072         AbstractRowController* rowController() const;
00073         AbstractGrid* grid() const;
00074         ItemDelegate* itemDelegate() const;
00075 
00076         bool isReadOnly() const;
00077 
00078         QModelIndex indexAt( const QPoint& pos ) const;
00079 
00080         virtual void addConstraint( const QModelIndex& from,
00081                                     const QModelIndex& to,
00082                                     Qt::KeyboardModifiers modifiers );
00083 
00084         void clearItems();
00085         void updateRow( const QModelIndex& );
00086         void updateScene();
00087         void updateSceneRect();
00088         void deleteSubtree( const QModelIndex& );
00089 
00090         void print( QPainter* painter, const QRectF& target = QRectF(), const QRectF& source = QRectF(), bool drawRowLabels=true, bool drawHeader=true );
00091         QRectF printRect(bool drawRowLabels=true );
00092         void renderHeader( QPainter* painter, const QRectF& target, const QRectF& source, Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio );
00093         qreal headerHeight() const;
00094         
00095     public Q_SLOTS:
00096         void setModel( QAbstractItemModel* );
00097         void setSummaryHandlingModel( QAbstractProxyModel* model );
00098         void setConstraintModel( ConstraintModel* );
00099         void setRootIndex( const QModelIndex& );
00100         void setSelectionModel( QItemSelectionModel* );
00101         void setRowController( AbstractRowController* );
00102         void setGrid( AbstractGrid* );
00103         void setItemDelegate( ItemDelegate* delegate );
00104         void setReadOnly( bool );
00105 
00106     Q_SIGNALS:
00107         void activated( const QModelIndex & index );
00108         void clicked( const QModelIndex & index );
00109         void doubleClicked( const QModelIndex & index );
00110         void entered( const QModelIndex & index );
00111         void pressed( const QModelIndex & index );
00112 
00113     protected:
00114         /*reimp*/void resizeEvent( QResizeEvent* );
00115     private:
00116         friend class View;
00117 
00118         GraphicsItem* createItem( ItemType type ) const;
00119     };
00120 }
00121 
00122 #endif /* KDGANTTGRAPHICSVIEW_H */
00123 

kdgantt

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal