From 3a635825efeb210f7ec4854db602525d5e320cbb Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Fri, 19 Oct 2018 08:58:17 +0200 Subject: [PATCH] Formatting for basket and sales improved --- src/gui/basketmodel.cpp | 3 +++ src/gui/salemodel.cpp | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/basketmodel.cpp b/src/gui/basketmodel.cpp index 5f437ac..537ce92 100644 --- a/src/gui/basketmodel.cpp +++ b/src/gui/basketmodel.cpp @@ -33,7 +33,10 @@ QVariant BasketModel::data(const QModelIndex& index, int role) const return myFixedFont; case 3: myFixedFont.setPointSize(myFixedFont.pointSize() + 3); + myFixedFont.setBold(true); return myFixedFont; + default: + return myFont; } } diff --git a/src/gui/salemodel.cpp b/src/gui/salemodel.cpp index 689c6ad..1dda107 100644 --- a/src/gui/salemodel.cpp +++ b/src/gui/salemodel.cpp @@ -79,12 +79,14 @@ QVariant SaleModel::data(const QModelIndex& index, int role) const if (role == Qt::FontRole) { QFont myFont; + QFont myFixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); switch (index.column()) { case 0: - return myFont; + return myFixedFont; case 1: - return QFontDatabase::systemFont(QFontDatabase::FixedFont); + myFixedFont.setBold(true); + return myFixedFont; default: return myFont; } @@ -108,7 +110,7 @@ QVariant SaleModel::data(const QModelIndex& index, int role) const Article* article = static_cast(index.internalPointer()); switch (index.column()) { case 0: - return (std::string("Verk. ") + std::to_string(article->getSeller()->getSellerNo()) + " (" + article->getCompleteArticleNo() + ")").c_str(); + return (std::string("Verk. ") + article->getSeller()->getSellerNoAsString() + " (" + article->getCompleteArticleNo() + ")").c_str(); case 1: return article->getPriceAsString().c_str(); case 2: