From 3fc49f2f2838c69be14bcf60c6cf756825b2bbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Tue, 9 May 2023 13:17:19 +0800 Subject: Constructor using C version, & no setData --- interchange/admin.hxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'interchange') diff --git a/interchange/admin.hxx b/interchange/admin.hxx index 4642e76..f9abdb2 100644 --- a/interchange/admin.hxx +++ b/interchange/admin.hxx @@ -17,15 +17,11 @@ namespace QInterchange { Q_PROPERTY(bool super READ super WRITE setSuper NOTIFY superChanged) public: - explicit Admin(QObject* parent = nullptr) : - QObject{parent}, - m_userName{""}, - m_password{""}, - m_name{""}, - m_super{false}, - m_data{nullptr} - {} + explicit Admin(QObject *parent = nullptr); + explicit Admin(struct interchange_admin admin, + QObject *parent = nullptr); ~Admin() {} + QString const& userName() const { return m_userName; } QString const& password() const { return m_password; } QString const& name() const { return m_name; } @@ -49,18 +45,20 @@ namespace QInterchange { void logOut(); signals: + void loggedIn(const QString &response); void userNameChanged(); void passwordChanged(); void nameChanged(); void superChanged(); + protected: + void emitLogin(const QString &response); + private: QString m_userName; QString m_password; QString m_name; bool m_super; - interchange_admin* m_data; - inline void setData(interchange_admin* data); }; } -- cgit v1.2.3