KD Chart API Documentation  3.1
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 
19 namespace KDGantt {
20 class KDGANTT_EXPORT Legend : public QAbstractItemView
21 {
22  Q_OBJECT
24 public:
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 
40 protected:
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  }
55  /*reimp*/ QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override
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 
71 protected Q_SLOTS:
72  virtual void modelDataChanged();
73 };
74 }
75 
76 #endif
Legend showing an image and a description for Gantt items.
Definition: kdganttlegend.h:21
void scrollTo(const QModelIndex &, ScrollHint=EnsureVisible) override
Definition: kdganttlegend.h:31
void setSelection(const QRect &, QItemSelectionModel::SelectionFlags) override
Definition: kdganttlegend.h:59
int horizontalOffset() const override
Definition: kdganttlegend.h:47
QRegion visualRegionForSelection(const QItemSelection &) const override
Definition: kdganttlegend.h:66
QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers) override
Definition: kdganttlegend.h:55
bool isIndexHidden(const QModelIndex &) const override
Definition: kdganttlegend.h:51
int verticalOffset() const override
Definition: kdganttlegend.h:62
QStyleOption subclass for gantt items.
Contains KDGantt macros.
#define KDGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC(X)

© 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 by doxygen 1.9.1