all: use fully qualified type names in Q_PROPERTY

Fixes type deduction issues with qmllint/qmlls.
This commit is contained in:
outfoxxed 2024-11-01 01:43:22 -07:00
parent a931adf033
commit 746b0e70d7
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
14 changed files with 52 additions and 40 deletions

View file

@ -13,6 +13,7 @@ namespace qs::hyprland::ipc {
class HyprlandMonitor: public QObject {
Q_OBJECT;
// clang-format off
Q_PROPERTY(qint32 id READ id NOTIFY idChanged);
Q_PROPERTY(QString name READ name NOTIFY nameChanged);
Q_PROPERTY(QString description READ description NOTIFY descriptionChanged);
@ -28,7 +29,8 @@ class HyprlandMonitor: public QObject {
/// > property, run @@Hyprland.refreshMonitors() and wait for this property to update.
Q_PROPERTY(QVariantMap lastIpcObject READ lastIpcObject NOTIFY lastIpcObjectChanged);
/// The currently active workspace on this monitor. May be null.
Q_PROPERTY(HyprlandWorkspace* activeWorkspace READ activeWorkspace NOTIFY activeWorkspaceChanged);
Q_PROPERTY(qs::hyprland::ipc::HyprlandWorkspace* activeWorkspace READ activeWorkspace NOTIFY activeWorkspaceChanged);
// clang-format on
QML_ELEMENT;
QML_UNCREATABLE("HyprlandMonitors must be retrieved from the HyprlandIpc object.");

View file

@ -14,16 +14,18 @@ namespace qs::hyprland::ipc {
class HyprlandIpcQml: public QObject {
Q_OBJECT;
// clang-format off
/// Path to the request socket (.socket.sock)
Q_PROPERTY(QString requestSocketPath READ requestSocketPath CONSTANT);
/// Path to the event socket (.socket2.sock)
Q_PROPERTY(QString eventSocketPath READ eventSocketPath CONSTANT);
/// The currently focused hyprland monitor. May be null.
Q_PROPERTY(HyprlandMonitor* focusedMonitor READ focusedMonitor NOTIFY focusedMonitorChanged);
Q_PROPERTY(qs::hyprland::ipc::HyprlandMonitor* focusedMonitor READ focusedMonitor NOTIFY focusedMonitorChanged);
/// All hyprland monitors.
Q_PROPERTY(ObjectModel<HyprlandMonitor>* monitors READ monitors CONSTANT);
Q_PROPERTY(ObjectModel<qs::hyprland::ipc::HyprlandMonitor>* monitors READ monitors CONSTANT);
/// All hyprland workspaces.
Q_PROPERTY(ObjectModel<HyprlandWorkspace>* workspaces READ workspaces CONSTANT);
Q_PROPERTY(ObjectModel<qs::hyprland::ipc::HyprlandWorkspace>* workspaces READ workspaces CONSTANT);
// clang-format on
QML_NAMED_ELEMENT(Hyprland);
QML_SINGLETON;

View file

@ -24,7 +24,7 @@ class Toplevel: public QObject {
Q_PROPERTY(QString appId READ appId NOTIFY appIdChanged);
Q_PROPERTY(QString title READ title NOTIFY titleChanged);
/// Parent toplevel if this toplevel is a modal/dialog, otherwise null.
Q_PROPERTY(Toplevel* parent READ parent NOTIFY parentChanged);
Q_PROPERTY(qs::wayland::toplevel_management::Toplevel* parent READ parent NOTIFY parentChanged);
/// If the window is currently activated or focused.
///
/// Activation can be requested with the @@activate() function.
@ -141,13 +141,15 @@ private:
/// wayland protocol.
class ToplevelManagerQml: public QObject {
Q_OBJECT;
// clang-format off
/// All toplevel windows exposed by the compositor.
Q_PROPERTY(ObjectModel<Toplevel>* toplevels READ toplevels CONSTANT);
Q_PROPERTY(ObjectModel<qs::wayland::toplevel_management::Toplevel>* toplevels READ toplevels CONSTANT);
/// Active toplevel or null.
///
/// > [!INFO] If multiple are active, this will be the most recently activated one.
/// > Usually compositors will not report more than one toplevel as active at a time.
Q_PROPERTY(Toplevel* activeToplevel READ activeToplevel NOTIFY activeToplevelChanged);
Q_PROPERTY(qs::wayland::toplevel_management::Toplevel* activeToplevel READ activeToplevel NOTIFY activeToplevelChanged);
// clang-format on
QML_NAMED_ELEMENT(ToplevelManager);
QML_SINGLETON;