summaryrefslogtreecommitdiff
path: root/qicclient/product.hxx
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-07 10:19:35 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-10-07 10:19:35 +0800
commita68fc492cf86a14cf9cf95d9f9a764cdf5b01007 (patch)
tree3f309d8be302266d4590862112549bc310cb79f0 /qicclient/product.hxx
parentd82340151ce274930f42701f5a9a0c4db702cba4 (diff)
parent9fef837e6275697f4562f60c2546c5e025ec5435 (diff)
Merge branch 'master' into cmake
# Conflicts: # qicclient.pro
Diffstat (limited to 'qicclient/product.hxx')
-rw-r--r--qicclient/product.hxx40
1 files changed, 40 insertions, 0 deletions
diff --git a/qicclient/product.hxx b/qicclient/product.hxx
new file mode 100644
index 0000000..7271fe9
--- /dev/null
+++ b/qicclient/product.hxx
@@ -0,0 +1,40 @@
+#ifndef QICCLIENT_PRODUCT_HXX
+#define QICCLIENT_PRODUCT_HXX
+
+#include <icclient/product.h>
+
+namespace ICClient {
+
+ struct Product
+ {
+ enum ProductRoles {
+ SkuRole = Qt::UserRole + 1,
+ DescriptionRole,
+ CommentRole,
+ ImageRole,
+ PriceRole
+ };
+
+ Product(icclient_product* product)
+ : sku{product->sku}
+ , price{product->price}
+ {
+ if (product->description)
+ description
+ = QString{product->description};
+ if (product->comment)
+ comment = QString{product->comment};
+ if (product->image)
+ image = QString{product->image};
+ }
+
+ QString sku;
+ QString description;
+ QString comment;
+ QString image;
+ double price;
+ };
+
+}
+
+#endif // QICCLIENT_PRODUCT_HXX