From b4a0813712cb3ae9a5b7acd8d15d6e0608f8c39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodn=C3=A1r=20Zsombor?= <bodzsoaa@sch.bme.hu> Date: Sun, 21 Feb 2021 14:34:06 +0100 Subject: [PATCH] Add properties --- webchannel/muebchannel.cc | 4 ++++ webchannel/muebchannel.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/webchannel/muebchannel.cc b/webchannel/muebchannel.cc index 4104101..b521b9f 100644 --- a/webchannel/muebchannel.cc +++ b/webchannel/muebchannel.cc @@ -13,6 +13,10 @@ MuebChannel::MuebChannel(QObject *parent) &MuebChannel::FrameChanged); } +qint32 MuebChannel::width() const { return transmitter_.width(); } + +qint32 MuebChannel::height() const { return transmitter_.height(); } + void MuebChannel::ReceiveFrame(QString frame) { auto idx = frame.indexOf(','); diff --git a/webchannel/muebchannel.h b/webchannel/muebchannel.h index b0d797a..0e7a314 100644 --- a/webchannel/muebchannel.h +++ b/webchannel/muebchannel.h @@ -13,10 +13,16 @@ */ class MuebChannel : public QObject { Q_OBJECT + Q_PROPERTY(qint32 width READ width CONSTANT) + Q_PROPERTY(qint32 height READ height CONSTANT) public: explicit MuebChannel(QObject* parent = nullptr); + qint32 width() const; + + qint32 height() const; + signals: /* This signal is emitted from the C++ side and the text displayed on the -- GitLab