diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 21:30:40 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 21:30:40 -0700 |
commit | 2552b027aea21a222b4087d5616c452a4bca1dde (patch) | |
tree | 73dd512863a379db1dbbc0e5058c4f5fd8df2009 /qt-ui | |
parent | a4d1163d21c5347ac69eee98def182a104db490b (diff) | |
download | subsurface-2552b027aea21a222b4087d5616c452a4bca1dde.tar.gz |
Printing: use more appropriate font sizes
2-up and 6-up need different fonts.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/models.cpp | 7 | ||||
-rw-r--r-- | qt-ui/models.h | 2 | ||||
-rw-r--r-- | qt-ui/printlayout.cpp | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index da1680409..4df9c54f2 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1854,6 +1854,11 @@ void ProfilePrintModel::setDive(struct dive *divePtr) // reset(); } +void ProfilePrintModel::setFontsize(double size) +{ + fontSize = size; +} + int ProfilePrintModel::rowCount(const QModelIndex &parent) const { return 12; @@ -1967,7 +1972,7 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const } case Qt::FontRole: { QFont font; - font.setPointSize(6); + font.setPointSizeF(fontSize); if (row == 0 && col == 0) { font.setBold(true); } diff --git a/qt-ui/models.h b/qt-ui/models.h index bb73c4f61..0eca7c1b4 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -380,6 +380,7 @@ class ProfilePrintModel : public QAbstractTableModel { private: int diveId; + double fontSize; QString truncateString(char *str, const int maxlen) const; public: @@ -388,6 +389,7 @@ public: int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; void setDive(struct dive *divePtr); + void setFontsize(double size); }; class GasSelectionModel : public QStringListModel { diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 159cd04db..59b6d392a 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -166,6 +166,7 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) const int padPT = 5; // create a model and table ProfilePrintModel model; + model.setFontsize(divesPerColumn == 1 ? 6.5 : 4.5); QPointer<QTableView> table(createProfileTable(&model, scaledW)); // profilePrintTableMaxH updates after the table is created const int tableH = profilePrintTableMaxH; |