From 3bb1e0c14ac7adccadfb71aba33cf2fb54e91850 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: Mon, 13 Mar 2023 08:32:29 +0800 Subject: Catalog constructor takes a copy of the C struct --- interchange/catalog.hxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'interchange') diff --git a/interchange/catalog.hxx b/interchange/catalog.hxx index 9e96a3e..115c30a 100644 --- a/interchange/catalog.hxx +++ b/interchange/catalog.hxx @@ -14,11 +14,11 @@ namespace QInterchange { public: Catalog(QObject* parent = nullptr) : QAbstractListModel{parent} {} - Catalog(struct interchange_catalog* catalog, QObject* parent = nullptr); - ~Catalog(); + Catalog(struct interchange_catalog catalog, + QObject* parent = nullptr); + ~Catalog() {} int rowCount(QModelIndex const& parent = QModelIndex()) const Q_DECL_OVERRIDE; QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - struct interchange_catalog const* constData() const { return m_data; } void addProduct(Product const& product); protected: @@ -26,7 +26,6 @@ namespace QInterchange { private: QList products; - struct interchange_catalog* m_data; }; } -- cgit v1.2.3