kdganttlegend.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 distributed and/or modified under the terms of the
00007  ** GNU General Public License version 2 as published by the Free Software
00008  ** Foundation and appearing in the file LICENSE.GPL included in the
00009  ** packaging of this file.
00010  **
00011  ** Licensees holding valid commercial KD Gantt licenses may use this file in
00012  ** accordance with the KD Gantt Commercial License Agreement provided with
00013  ** the Software.
00014  **
00015  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017  **
00018  ** See http://www.kdab.net/kdgantt for
00019  **   information about KD Gantt Commercial License Agreements.
00020  **
00021  ** Contact info@kdab.net if any conditions of this
00022  ** licensing are not clear to you.
00023  **
00024  **********************************************************************/
00025 #ifndef KDGANTTLEGEND_H
00026 #define KDGANTTLEGEND_H
00027 
00028 #include <QAbstractItemView>
00029 
00030 #include "kdganttglobal.h"
00031 #include "kdganttstyleoptionganttitem.h"
00032 
00033 namespace KDGantt 
00034 {
00035     class KDCHART_EXPORT Legend : public QAbstractItemView
00036     {
00037         Q_OBJECT
00038         KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( Legend )
00039     public:
00040         explicit Legend( QWidget* parent = 0 );
00041         virtual ~Legend();
00042 
00043         /*reimp*/ QModelIndex indexAt( const QPoint& point ) const;
00044         /*reimp*/ QRect visualRect( const QModelIndex& index ) const;
00045 
00046         /*reimp*/ void scrollTo( const QModelIndex&, ScrollHint = EnsureVisible ){}
00047 
00048         /*reimp*/ QSize sizeHint() const;
00049         /*reimp*/ QSize minimumSizeHint() const;
00050 
00051         /*reimp*/ void setModel( QAbstractItemModel* model );
00052 
00053     protected:
00054         virtual QRect drawItem( QPainter* painter, const QModelIndex& index, const QPoint& pos = QPoint() ) const;
00055         virtual QSize measureItem( const QModelIndex& index, bool recursive = true ) const;
00056         virtual StyleOptionGanttItem getStyleOption( const QModelIndex& index ) const;
00057 
00058         /*reimp*/ void paintEvent( QPaintEvent* event );
00059 
00060         /*reimp*/ int horizontalOffset() const { return 0; }
00061         /*reimp*/ bool isIndexHidden( const QModelIndex& ) const { return false; }
00062         /*reimp*/ QModelIndex moveCursor( CursorAction, Qt::KeyboardModifiers ) { return QModelIndex(); }
00063         /*reimp*/ void setSelection( const QRect&, QItemSelectionModel::SelectionFlags ){}
00064         /*reimp*/ int verticalOffset() const { return 0; }
00065         /*reimp*/ QRegion visualRegionForSelection( const QItemSelection& ) const { return QRegion(); }
00066 
00067     protected Q_SLOTS:
00068         virtual void modelDataChanged();
00069     };
00070 }
00071 
00072 #endif

Generated on Thu Mar 4 23:19:13 2010 for KD Chart 2 by  doxygen 1.5.4