From bb16054b844349760bc9c66c710a5182f2ef880b Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 12 Feb 2024 16:01:07 -0800 Subject: [PATCH] feat: add NOTIFY for ProxyWindowBase.color --- src/cpp/proxywindow.cpp | 2 ++ src/cpp/proxywindow.hpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpp/proxywindow.cpp b/src/cpp/proxywindow.cpp index 262229be..5177732d 100644 --- a/src/cpp/proxywindow.cpp +++ b/src/cpp/proxywindow.cpp @@ -5,6 +5,7 @@ #include #include #include +#include ProxyWindowBase::~ProxyWindowBase() { if (this->window != nullptr) { @@ -25,6 +26,7 @@ void ProxyWindowBase::earlyInit(QObject* old) { QObject::connect(this->window, &QWindow::visibilityChanged, this, &ProxyWindowBase::visibleChanged); QObject::connect(this->window, &QWindow::widthChanged, this, &ProxyWindowBase::widthChanged); QObject::connect(this->window, &QWindow::heightChanged, this, &ProxyWindowBase::heightChanged); + QObject::connect(this->window, &QQuickWindow::colorChanged, this, &ProxyWindowBase::colorChanged); // clang-format on } diff --git a/src/cpp/proxywindow.hpp b/src/cpp/proxywindow.hpp index 19d8b4c5..c62f3746 100644 --- a/src/cpp/proxywindow.hpp +++ b/src/cpp/proxywindow.hpp @@ -43,7 +43,7 @@ class ProxyWindowBase: public Scavenger { /// > } /// > } /// > ``` - Q_PROPERTY(QColor color READ color WRITE setColor); + Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged); Q_PROPERTY(QQmlListProperty data READ data); Q_CLASSINFO("DefaultProperty", "data"); @@ -83,6 +83,7 @@ signals: void visibleChanged(bool visible); void widthChanged(qint32 width); void heightChanged(qint32 width); + void colorChanged(QColor color); private: static QQmlListProperty dataBacker(QQmlListProperty* prop);