KD Chart API Documentation 3.1
Loading...
Searching...
No Matches
kdganttabstractgrid.cpp
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#include "kdganttabstractgrid.h"
12#include "kdganttabstractgrid_p.h"
13
14#include <QRectF>
15
16using namespace KDGantt;
17
30 : QObject(parent)
31 , _d(new Private)
32{
33}
34
37{
38 delete _d;
39}
40
41#define d d_func()
42
47{
48 d->model = model;
49}
50
53{
54 return d->model;
55}
56
61{
62 d->root = idx;
63}
64
67{
68 return d->root;
69}
70
75{
76 // First check if the data is valid,
77 // TODO: review if true is the right choice
78 if (!c.startIndex().isValid() || !c.endIndex().isValid())
79 return true;
80
83 return (ss.end() <= es.start());
84}
85
91qreal AbstractGrid::mapToChart(const QVariant &value) const
92{
93 Q_UNUSED(value);
94 return -1.0;
95}
96
102{
103 Q_UNUSED(x);
104 return QVariant();
105}
106
144{
145 Q_UNUSED(paint);
146 Q_UNUSED(rect);
147}
148
153{
154 Q_UNUSED(paint);
155 Q_UNUSED(rect);
156}
157
158#include "moc_kdganttabstractgrid.cpp"
~AbstractGrid() override
Destructor.
virtual Span mapToChart(const QModelIndex &idx) const =0
Implement this to map from the data in the model to the location of the corresponding item in the vie...
QAbstractItemModel * model() const
virtual void setRootIndex(const QModelIndex &idx)
Sets the root index used by this grid implementation.
virtual void drawForeground(QPainter *paint, const QRectF &rect)
virtual void drawBackground(QPainter *paint, const QRectF &rect)
bool isSatisfiedConstraint(const Constraint &c) const
QModelIndex rootIndex() const
virtual void setModel(QAbstractItemModel *model)
Sets the QAbstractItemModel used by this grid implementation.
AbstractGrid(QObject *parent=nullptr)
Constructor.
virtual bool mapFromChart(const Span &span, const QModelIndex &idx, const QList< Constraint > &constraints=QList< Constraint >()) const =0
Implement this to update the model data based on the location of the item.
A class used to represent a dependency.
QModelIndex endIndex() const
QModelIndex startIndex() const
A class representing a start point and a length.
bool isValid() const const
T qobject_cast(QObject *object)

© 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 Thu Apr 11 2024 00:04:50 for KD Chart API Documentation by doxygen 1.9.8