all: use UntypedObjectModel instead of ObjectModel in Q_PROPERTY

Fixes qmllint/qmlls type deduction for ObjectModels
This commit is contained in:
outfoxxed 2024-11-01 03:12:07 -07:00
parent 746b0e70d7
commit 98cdb87181
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
9 changed files with 33 additions and 11 deletions

View file

@ -5,6 +5,7 @@
#include <qqmlintegration.h>
#include <qtmetamacros.h>
#include "../../../core/doc.hpp"
#include "../../../core/model.hpp"
#include "../../../core/qmlscreen.hpp"
#include "connection.hpp"
@ -22,9 +23,11 @@ class HyprlandIpcQml: public QObject {
/// The currently focused hyprland monitor. May be null.
Q_PROPERTY(qs::hyprland::ipc::HyprlandMonitor* focusedMonitor READ focusedMonitor NOTIFY focusedMonitorChanged);
/// All hyprland monitors.
Q_PROPERTY(ObjectModel<qs::hyprland::ipc::HyprlandMonitor>* monitors READ monitors CONSTANT);
QSDOC_TYPE_OVERRIDE(ObjectModel<qs::hyprland::ipc::HyprlandMonitor>*);
Q_PROPERTY(UntypedObjectModel* monitors READ monitors CONSTANT);
/// All hyprland workspaces.
Q_PROPERTY(ObjectModel<qs::hyprland::ipc::HyprlandWorkspace>* workspaces READ workspaces CONSTANT);
QSDOC_TYPE_OVERRIDE(ObjectModel<qs::hyprland::ipc::HyprlandWorkspace>*);
Q_PROPERTY(UntypedObjectModel* workspaces READ workspaces CONSTANT);
// clang-format on
QML_NAMED_ELEMENT(Hyprland);
QML_SINGLETON;