From 27953a89d1110d6cc82ff198e1c28f698104d554 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:00:17 +1100 Subject: internal: use QQmlListProperty Fix lsp errors --- plugin/src/Caelestia/Models/filesystemmodel.cpp | 4 ++-- plugin/src/Caelestia/Models/filesystemmodel.hpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'plugin/src/Caelestia/Models') diff --git a/plugin/src/Caelestia/Models/filesystemmodel.cpp b/plugin/src/Caelestia/Models/filesystemmodel.cpp index 3ceb1dd..e387ecd 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.cpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.cpp @@ -211,8 +211,8 @@ void FileSystemModel::setNameFilters(const QStringList& nameFilters) { update(); } -QList FileSystemModel::entries() const { - return m_entries; +QQmlListProperty FileSystemModel::entries() { + return QQmlListProperty(this, &m_entries); } void FileSystemModel::watchDirIfRecursive(const QString& path) { diff --git a/plugin/src/Caelestia/Models/filesystemmodel.hpp b/plugin/src/Caelestia/Models/filesystemmodel.hpp index cead43f..cf8eae8 100644 --- a/plugin/src/Caelestia/Models/filesystemmodel.hpp +++ b/plugin/src/Caelestia/Models/filesystemmodel.hpp @@ -8,6 +8,7 @@ #include #include #include +#include namespace caelestia::models { @@ -71,7 +72,7 @@ class FileSystemModel : public QAbstractListModel { Q_PROPERTY(Filter filter READ filter WRITE setFilter NOTIFY filterChanged) Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters NOTIFY nameFiltersChanged) - Q_PROPERTY(QList entries READ entries NOTIFY entriesChanged) + Q_PROPERTY(QQmlListProperty entries READ entries NOTIFY entriesChanged) public: enum Filter { @@ -109,7 +110,7 @@ public: [[nodiscard]] QStringList nameFilters() const; void setNameFilters(const QStringList& nameFilters); - [[nodiscard]] QList entries() const; + [[nodiscard]] QQmlListProperty entries(); signals: void pathChanged(); -- cgit v1.2.3-freya