KGantt

kganttabstractgrid.cpp
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KGantt library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#include "kganttabstractgrid.h"
10#include "kganttabstractgrid_p.h"
11
12#include <QRectF>
13
14using namespace KGantt;
15
16
18 : QObject( parent ),
19 _d( new Private )
20{
21}
22
24{
25 delete _d;
26}
27
28#define d d_func()
29
31{
32 d->model = model;
33}
34
36{
37 return d->model;
38}
39
41{
42 d->root = idx;
43}
44
46{
47 return d->root;
48}
49
51{
52 // First check if the data is valid,
53 // TODO: review if true is the right choice
54 if ( !c.startIndex().isValid() || !c.endIndex().isValid() ) return true;
55
56 Span ss = mapToChart( c.startIndex() );
57 Span es = mapToChart( c.endIndex() );
58 return ( ss.end() <= es.start() );
59}
60
61qreal AbstractGrid::mapToChart( const QVariant& value ) const
62{
63 Q_UNUSED( value );
64 return -1.0;
65}
66
68{
69 Q_UNUSED( x );
70 return QVariant();
71}
72
74{
75 Q_UNUSED(paint);
76 Q_UNUSED(rect);
77}
78
80{
81 Q_UNUSED(paint);
82 Q_UNUSED(rect);
83}
84
85
86#include "moc_kganttabstractgrid.cpp"
87
QAbstractItemModel * model() const
virtual void setRootIndex(const QModelIndex &idx)
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)
virtual Span mapToChart(const QModelIndex &idx) const =0
virtual bool mapFromChart(const Span &span, const QModelIndex &idx, const QList< Constraint > &constraints=QList< Constraint >()) const =0
AbstractGrid(QObject *parent=nullptr)
A class used to represent a dependency.
QModelIndex endIndex() const
QModelIndex startIndex() const
A class representing a start point and a length.
Global namespace.
bool isValid() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.