diff --git a/src/gui/basketmodel.cpp b/src/gui/basketmodel.cpp index 537ce92..2ac1931 100644 --- a/src/gui/basketmodel.cpp +++ b/src/gui/basketmodel.cpp @@ -22,6 +22,9 @@ QVariant BasketModel::data(const QModelIndex& index, int role) const QFont myFont; QFont myFixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); + if (myFixedFont.fixedPitch() == false) { + myFixedFont.setFamily("monospace"); + } switch (index.column()) { case 0: @@ -130,4 +133,4 @@ bool BasketModel::removeRows(int row, int count, const QModelIndex& parent) marketplace_->getBasket().end()); emit endRemoveRows(); return true; -} \ No newline at end of file +} diff --git a/src/gui/reportdialog.cpp b/src/gui/reportdialog.cpp index 5559598..3a84ec4 100644 --- a/src/gui/reportdialog.cpp +++ b/src/gui/reportdialog.cpp @@ -76,6 +76,9 @@ void ReportDialog::onPrintReportButtonClicked() painter.begin(&printer); QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); + if (fixedFont.fixedPitch() == false) { // workaround for QTBUG-54623 + fixedFont.setFamily("monospace"); // https://bugreports.qt.io/browse/QTBUG-54623 + } fixedFont.setPointSize(12); for (unsigned int i = 1; i <= numPages; ++i) { @@ -220,4 +223,4 @@ void ReportDialog::onReportViewSelectionChanged(const QItemSelection& selected, } else { ui_.printSellerReceiptButton->setEnabled(false); } -} \ No newline at end of file +} diff --git a/src/gui/salemodel.cpp b/src/gui/salemodel.cpp index 1dda107..0476b24 100644 --- a/src/gui/salemodel.cpp +++ b/src/gui/salemodel.cpp @@ -80,6 +80,9 @@ QVariant SaleModel::data(const QModelIndex& index, int role) const if (role == Qt::FontRole) { QFont myFont; QFont myFixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); + if (myFixedFont.fixedPitch() == false) { + myFixedFont.setFamily("monospace"); + } switch (index.column()) { case 0: @@ -199,4 +202,4 @@ bool SaleModel::removeRows(int row, int count, const QModelIndex& parent) } return true; -} \ No newline at end of file +}