Krita Source Code Documentation
Loading...
Searching...
No Matches
KoLineStyleModel_p.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2007 Jan Hambrecht <jaham@gmx.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef KOLINESTYLEMODEL_H
7#define KOLINESTYLEMODEL_H
8
9#include <QAbstractListModel>
10
11#include <QVector>
12
14class KoLineStyleModel : public QAbstractListModel
15{
16public:
17 explicit KoLineStyleModel(QObject *parent = 0);
18 ~KoLineStyleModel() override {}
19 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
20 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
21
23 bool addCustomStyle(const QVector<qreal> &style);
25 int setLineStyle(Qt::PenStyle style, const QVector<qreal> &dashes);
26private:
30};
31
32#endif
The line style model managing the style data.
KoLineStyleModel(QObject *parent=0)
bool addCustomStyle(const QVector< qreal > &style)
adds the given style to the model
int setLineStyle(Qt::PenStyle style, const QVector< qreal > &dashes)
selects the given style
QList< QVector< qreal > > m_styles
the added styles
QVector< qreal > m_tempStyle
a temporary added style
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
~KoLineStyleModel() override
bool m_hasTempStyle
state of the temporary style
int rowCount(const QModelIndex &parent=QModelIndex()) const override