docs: add macro hints for typegen to paper over weird interfaces

This commit is contained in:
outfoxxed 2024-02-26 00:30:25 -08:00
parent c0faebc700
commit 0034edd0f8
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 24 additions and 9 deletions

2
docs

@ -1 +1 @@
Subproject commit d603e3de533c74248621943bc85034620f4ef8c7 Subproject commit cc201afd3a352a28f5daddbe00d7aed974d52d30

11
src/core/doc.hpp Normal file
View file

@ -0,0 +1,11 @@
#pragma once
// hide a property, function, or signal from typegen
#define QSDOC_HIDE
// override the base class as seen by typegen
#define QSDOC_BASECLASS(baseclass)
// make the type visible in the docs even if not a QML_ELEMENT
#define QSDOC_ELEMENT
#define QSDOC_NAMED_ELEMENT(name)

View file

@ -2,6 +2,7 @@
#include <qtmetamacros.h> #include <qtmetamacros.h>
#include "doc.hpp"
#include "windowinterface.hpp" #include "windowinterface.hpp"
class Anchors { class Anchors {
@ -94,6 +95,7 @@ Q_ENUM_NS(Enum);
/// } /// }
/// ``` /// ```
class PanelWindowInterface: public WindowInterface { class PanelWindowInterface: public WindowInterface {
QSDOC_NAMED_ELEMENT(PanelWindow);
// clang-format off // clang-format off
Q_OBJECT; Q_OBJECT;
/// Anchors attach a shell window to the sides of the screen. /// Anchors attach a shell window to the sides of the screen.

View file

@ -7,10 +7,12 @@
#include <qtmetamacros.h> #include <qtmetamacros.h>
#include <qtypes.h> #include <qtypes.h>
#include "../core/doc.hpp"
#include "../core/proxywindow.hpp" #include "../core/proxywindow.hpp"
#include "layershell.hpp" #include "layershell.hpp"
class WaylandLayershell: public ProxyWindowBase { class WaylandLayershell: public ProxyWindowBase {
QSDOC_BASECLASS(PanelWindowInterface);
// clang-format off // clang-format off
Q_OBJECT; Q_OBJECT;
/// The shell layer the window sits in. Defaults to `Layer.Top`. /// The shell layer the window sits in. Defaults to `Layer.Top`.
@ -22,10 +24,10 @@ class WaylandLayershell: public ProxyWindowBase {
/// The degree of keyboard focus taken. Defaults to `KeyboardFocus.None`. /// The degree of keyboard focus taken. Defaults to `KeyboardFocus.None`.
Q_PROPERTY(KeyboardFocus::Enum keyboardFocus READ keyboardFocus WRITE setKeyboardFocus NOTIFY keyboardFocusChanged); Q_PROPERTY(KeyboardFocus::Enum keyboardFocus READ keyboardFocus WRITE setKeyboardFocus NOTIFY keyboardFocusChanged);
Q_PROPERTY(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged); QSDOC_HIDE Q_PROPERTY(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged);
Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged); QSDOC_HIDE Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged);
Q_PROPERTY(ExclusionMode::Enum exclusionMode READ exclusionMode WRITE setExclusionMode NOTIFY exclusionModeChanged); QSDOC_HIDE Q_PROPERTY(ExclusionMode::Enum exclusionMode READ exclusionMode WRITE setExclusionMode NOTIFY exclusionModeChanged);
Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged); QSDOC_HIDE Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged);
QML_ATTACHED(WaylandLayershell); QML_ATTACHED(WaylandLayershell);
QML_ELEMENT; QML_ELEMENT;
// clang-format on // clang-format on
@ -68,10 +70,10 @@ signals:
void layerChanged(); void layerChanged();
void namespaceChanged(); void namespaceChanged();
void keyboardFocusChanged(); void keyboardFocusChanged();
void anchorsChanged(); QSDOC_HIDE void anchorsChanged();
void exclusiveZoneChanged(); QSDOC_HIDE void exclusiveZoneChanged();
void exclusionModeChanged(); QSDOC_HIDE void exclusionModeChanged();
void marginsChanged(); QSDOC_HIDE void marginsChanged();
private slots: private slots:
void updateAutoExclusion(); void updateAutoExclusion();