6#ifndef FONTSTYLEMODEL_H
7#define FONTSTYLEMODEL_H
9#include <QAbstractItemModel>
44 Q_INVOKABLE
int rowForStyle(
const qreal &weight,
const qreal &width,
const int &styleMode,
const qreal &styleValue);
51 QModelIndex
index(
int row,
int column,
const QModelIndex &
parent = QModelIndex())
const override;
52 QModelIndex
parent(
const QModelIndex &child)
const;
55 QVariant
data(
const QModelIndex &
index,
int role)
const override;
56 QHash<int, QByteArray>
roleNames()
const override;
59 const QScopedPointer<Private>
d;
The FontStyleModel class.
Q_INVOKABLE void setFromTextPropertiesModel(KoSvgTextPropertiesModel *textPropertiesModel)
Update styles model from current text properties.
Q_INVOKABLE QVariantHash axesValues(int row)
Q_INVOKABLE int styleModeValue(int row)
int rowCount(const QModelIndex &parent) const override
Q_INVOKABLE qreal weightValue(int row)
QModelIndex parent(const QModelIndex &child) const
int columnCount(const QModelIndex &parent) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Q_INVOKABLE qreal widthValue(int row)
QVariant data(const QModelIndex &index, int role) const override
QHash< int, QByteArray > roleNames() const override
@ AxisValues
other axis values
@ Width
qreal, represents 'wdth'
@ Weight
qreal, represents 'wgth'
@ Slant
qreal, represents 'slnt'
Q_INVOKABLE qreal slantValue(int row)
Q_INVOKABLE int rowForStyle(const qreal &weight, const qreal &width, const int &styleMode, const qreal &styleValue)
Find the closest style that represents the current width, weight and stylemode.
const QScopedPointer< Private > d
void setStylesInfo(QList< KoSvgText::FontFamilyStyleInfo > styles)
Set the base style info;.
FontStyleModel(QObject *parent=nullptr)
The KoSvgTextPropertiesModel class.