feat: add NOTIFY for ProxyWindowBase.color

This commit is contained in:
outfoxxed 2024-02-12 16:01:07 -08:00
parent 424a45be05
commit bb16054b84
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 4 additions and 1 deletions

View file

@ -5,6 +5,7 @@
#include <qquickitem.h>
#include <qquickwindow.h>
#include <qtypes.h>
#include <qwindow.h>
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
}

View file

@ -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<QObject> 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<QObject> dataBacker(QQmlListProperty<QObject>* prop);