KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
kdganttlegend.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of the KD Chart library.
4**
5** SPDX-FileCopyrightText: 2001 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6**
7** SPDX-License-Identifier: MIT
8**
9****************************************************************************/
10
11#ifndef KDGANTTLEGEND_H
12#define KDGANTTLEGEND_H
13
14#include <QAbstractItemView>
15
16#include "kdganttglobal.h"
18
19namespace KDGantt {
20class KDGANTT_EXPORT Legend : public QAbstractItemView
21{
22 Q_OBJECT
24public:
25 explicit Legend(QWidget *parent = nullptr);
26 ~Legend() override;
27
28 /*reimp*/ QModelIndex indexAt(const QPoint &point) const override;
29 /*reimp*/ QRect visualRect(const QModelIndex &index) const override;
30
31 /*reimp*/ void scrollTo(const QModelIndex &, ScrollHint = EnsureVisible) override
32 {
33 }
34
35 /*reimp*/ QSize sizeHint() const override;
36 /*reimp*/ QSize minimumSizeHint() const override;
37
38 /*reimp*/ void setModel(QAbstractItemModel *model) override;
39
40protected:
41 virtual QRect drawItem(QPainter *painter, const QModelIndex &index, const QPoint &pos = QPoint()) const;
42 virtual QSize measureItem(const QModelIndex &index, bool recursive = true) const;
43 virtual StyleOptionGanttItem getStyleOption(const QModelIndex &index) const;
44
45 /*reimp*/ void paintEvent(QPaintEvent *event) override;
46
47 /*reimp*/ int horizontalOffset() const override
48 {
49 return 0;
50 }
51 /*reimp*/ bool isIndexHidden(const QModelIndex &) const override
52 {
53 return false;
54 }
56 {
57 return QModelIndex();
58 }
59 /*reimp*/ void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) override
60 {
61 }
62 /*reimp*/ int verticalOffset() const override
63 {
64 return 0;
65 }
66 /*reimp*/ QRegion visualRegionForSelection(const QItemSelection &) const override
67 {
68 return QRegion();
69 }
70
71protected Q_SLOTS:
72 virtual void modelDataChanged();
73};
74}
75
76#endif
Legend showing an image and a description for Gantt items.
void scrollTo(const QModelIndex &, ScrollHint=EnsureVisible) override
void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) override
int horizontalOffset() const override
QRegion visualRegionForSelection(const QItemSelection &) const override
QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override
bool isIndexHidden(const QModelIndex &) const override
int verticalOffset() const override
QStyleOption subclass for gantt items.
Contains KDGantt macros.
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)
typedef KeyboardModifiers

© 2001 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-chart/
Generated on Fri Apr 26 2024 00:04:57 for KD Chart API Documentation by doxygen 1.9.8