Krita Source Code Documentation
Loading...
Searching...
No Matches
KoMarkerModel.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2011 Thorsten Zachmann <zachmann@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KOMARKERMODEL_H
8#define KOMARKERMODEL_H
9
10#include <KoFlake.h>
11#include <QAbstractListModel>
12#include <QExplicitlySharedDataPointer>
13
14
15class KoMarker;
16
17class KoMarkerModel : public QAbstractListModel
18{
19public:
20 KoMarkerModel(const QList<KoMarker*> markers, KoFlake::MarkerPosition position, QObject *parent = 0);
21 ~KoMarkerModel() override;
22
23 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
24 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
25
26 int markerIndex(KoMarker *marker) const;
27
28 // returns index of the newly added temporary marker
30 // removes a temporary marker added by \ref addTemporaryMarker
32
33 int temporaryMarkerPosition() const;
34
35 QVariant marker(int index, int role = Qt::UserRole) const;
37
38private:
42};
43
44#endif /* KOMARKERMODEL_H */
int m_temporaryMarkerPosition
QList< QExplicitlySharedDataPointer< KoMarker > > m_markers
QVariant marker(int index, int role=Qt::UserRole) const
int temporaryMarkerPosition() const
~KoMarkerModel() override
KoFlake::MarkerPosition m_markerPosition
KoFlake::MarkerPosition position() const
KoMarkerModel(const QList< KoMarker * > markers, KoFlake::MarkerPosition position, QObject *parent=0)
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void removeTemporaryMarker()
int addTemporaryMarker(KoMarker *marker)
int markerIndex(KoMarker *marker) const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
MarkerPosition
Definition KoFlake.h:41