From 7f4aca0bba24d4616ed78c288bc89b12ac6a3c84 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: Fri, 31 Mar 2023 14:19:05 +0800 Subject: Add name to Item --- interchange/ord.hxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'interchange') diff --git a/interchange/ord.hxx b/interchange/ord.hxx index 985f923..7405c55 100644 --- a/interchange/ord.hxx +++ b/interchange/ord.hxx @@ -11,13 +11,16 @@ namespace QInterchange { struct Item { enum ItemRoles { - QuantityRole = Product::PriceRole + 1 + QuantityRole = Product::PriceRole + 1, + NameRole }; Item(interchange_ord_item item) : product{item.product}, - quantity{item.quantity} {} + quantity{item.quantity}, + name{item.name} {} Product product; unsigned int quantity; + QString name; bool operator==(Item const& item) { return product.sku == item.product.sku; -- cgit v1.2.3