// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #ifndef ERRORLISTMODEL_H #define ERRORLISTMODEL_H #include class QQmlError; class ErrorListModel : public QAbstractListModel { Q_OBJECT public: explicit ErrorListModel(QObject *parent = nullptr); void setErrorList(const QList &errorList); Q_INVOKABLE void selectRow(int row); private: bool isIndexValid(const QModelIndex &index) const; // QAbstractItemModel interface int rowCount(const QModelIndex &parent = QModelIndex{}) const final; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const final; signals: void errorPositionSelected(int line, int column); public slots: void selectIndex(const QModelIndex &index); private: QList m_errorList; }; #endif // ERRORLISTMODEL_H