KGantt

kganttsummaryhandlingproxymodel.h
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#ifndef KGANTTSUMMARYHANDLINGPROXYMODEL_H
10#define KGANTTSUMMARYHANDLINGPROXYMODEL_H
11
12#include "kganttforwardingproxymodel.h"
13
14namespace KGantt {
15
16
17 /*!\class KGantt::SummaryHandlingProxyModel
18 * \brief Proxy model that supports summary gantt items.
19 *
20 * This proxy model provides the functionality of summary items.
21 * A summary item is an item with type KGantt::TypeSummary and
22 * zero or more children in the model that it summarizes.
23 * GraphicsView itself does not dictate any policy for summary items,
24 * instead the logic for making the summary items start and end points
25 * span it's children is provided by this proxy.
26 *
27 * The start and end times of a summary is the min/max of the
28 * start/end times of it's children.
29 *
30 * \see GraphicsView::setModel
31 */
32 class KGANTT_EXPORT SummaryHandlingProxyModel : public ForwardingProxyModel {
33 Q_OBJECT
34 KGANTT_DECLARE_PRIVATE_BASE_POLYMORPHIC( SummaryHandlingProxyModel )
35 public:
36
37
38 /*! Constructor. Creates a new SummaryHandlingProxyModel with
39 * parent \a parent
40 */
41 explicit SummaryHandlingProxyModel( QObject* parent = nullptr );
43
44
45
46 /*! Sets the model to be used as the source model for this proxy.
47 * The proxy does not take ownership of the model.
48 * \see QAbstractProxyModel::setSourceModel
49 */
50 /*reimp*/ void setSourceModel( QAbstractItemModel* model ) override;
51
52
53
54 /*! \see QAbstractItemModel::data */
55 /*reimp*/ QVariant data( const QModelIndex& proxyIndex, int role = Qt::DisplayRole) const override;
56
57
58 /*! \see QAbstractItemModel::setData */
59 /*reimp*/ bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole ) override;
60
61
62
63 /*! \see QAbstractItemModel::flags */
64 /*reimp*/ Qt::ItemFlags flags( const QModelIndex& idx ) const override;
65
66 protected:
67 /*reimp*/ void sourceModelReset() override;
68 /*reimp*/ void sourceLayoutChanged() override;
69 /*reimp*/ void sourceDataChanged( const QModelIndex& from, const QModelIndex& to ) override;
70 /*reimp*/ void sourceColumnsAboutToBeInserted( const QModelIndex& idx, int start, int end ) override;
71 /*reimp*/ void sourceColumnsAboutToBeRemoved( const QModelIndex& idx, int start, int end ) override;
72 /*reimp*/ void sourceRowsAboutToBeInserted( const QModelIndex& idx, int start, int end ) override;
73 /*reimp*/ void sourceRowsAboutToBeRemoved( const QModelIndex&, int start, int end ) override;
74 };
75}
76
77#endif /* KGANTTSUMMARYHANDLINGPROXYMODEL_H */
78
Proxy model that supports summary gantt items.
Q_SCRIPTABLE Q_NOREPLY void start()
Global namespace.
DisplayRole
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.