MauiKit TextEditor

linenumbermodel.h
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#pragma once
5
6#include <QAbstractItemModel>
7#include <QQmlEngine>
8
9class LineNumberModel : public QAbstractListModel
10{
12 QML_ELEMENT
13
14 Q_PROPERTY(int lineCount READ lineCount WRITE setLineCount NOTIFY lineCountChanged)
15
16public:
17 explicit LineNumberModel(QObject *parent = nullptr);
18
19 int lineCount() const;
20 void setLineCount(int lineCount);
21
22 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
23 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
24
26 void lineCountChanged();
27
28private:
29 int m_lineCount = 0;
30};
31
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
DisplayRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Aug 30 2024 11:55:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.