From 73fd022b1e240ad52f9ce6982835b34a8a3ede00 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 8 Mar 2024 21:07:16 -0800 Subject: [PATCH] build: slightly improve qmltype generation qmlls still sucks too much for this to be very useful --- CMakeLists.txt | 1 + src/core/panelinterface.hpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index facd98c..ad112dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ endif() find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS}) qt_standard_project_setup(REQUIRES 6.6) +set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules) add_subdirectory(src/core) add_subdirectory(src/io) diff --git a/src/core/panelinterface.hpp b/src/core/panelinterface.hpp index f3c463f..b46c25c 100644 --- a/src/core/panelinterface.hpp +++ b/src/core/panelinterface.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include "doc.hpp" @@ -11,6 +12,7 @@ class Anchors { Q_PROPERTY(bool right MEMBER mRight); Q_PROPERTY(bool top MEMBER mTop); Q_PROPERTY(bool bottom MEMBER mBottom); + QML_VALUE_TYPE(anchors); public: [[nodiscard]] bool horizontalConstraint() const noexcept { return this->mLeft && this->mRight; } @@ -37,6 +39,7 @@ class Margins { Q_PROPERTY(qint32 right MEMBER mRight); Q_PROPERTY(qint32 top MEMBER mTop); Q_PROPERTY(qint32 bottom MEMBER mBottom); + QML_VALUE_TYPE(margins); public: [[nodiscard]] bool operator==(const Margins& other) const noexcept { @@ -94,7 +97,6 @@ Q_ENUM_NS(Enum); /// } /// ``` class PanelWindowInterface: public WindowInterface { - QSDOC_NAMED_ELEMENT(PanelWindow); // clang-format off Q_OBJECT; /// Anchors attach a shell window to the sides of the screen. @@ -116,6 +118,7 @@ class PanelWindowInterface: public WindowInterface { /// Defaults to `ExclusionMode.Auto`. Q_PROPERTY(ExclusionMode::Enum exclusionMode READ exclusionMode WRITE setExclusionMode NOTIFY exclusionModeChanged); // clang-format on + QSDOC_NAMED_ELEMENT(PanelWindow); public: explicit PanelWindowInterface(QObject* parent = nullptr): WindowInterface(parent) {}