aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/printlayout.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-11 12:55:48 +0300
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-11 12:55:48 +0300
commit3aae3ff5472d6deada4908fe599714ecdd7e6b61 (patch)
treee5d3ccf1fb6294952f074d00483807c29a3896c4 /qt-ui/printlayout.cpp
parenta4982c93cd4481dd3d587f1d927121f026f61c50 (diff)
downloadsubsurface-3aae3ff5472d6deada4908fe599714ecdd7e6b61.tar.gz
Print: mark some functions in PrintLayout as 'const'
It might be a good practice to declare certain class 'helper' functions as constant members. But I don't think there are performance benefits to that other than the readability ones. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/printlayout.cpp')
-rw-r--r--qt-ui/printlayout.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp
index f33b372e1..6b81dd616 100644
--- a/qt-ui/printlayout.cpp
+++ b/qt-ui/printlayout.cpp
@@ -80,17 +80,17 @@ void PrintLayout::setup()
scaleY = (qreal)printerDpi/(qreal)screenDpiY;
}
-void PrintLayout::printSixDives()
+void PrintLayout::printSixDives() const
{
// nop
}
-void PrintLayout::printTwoDives()
+void PrintLayout::printTwoDives() const
{
// nop
}
-void PrintLayout::printTable()
+void PrintLayout::printTable() const
{
QTextDocument doc;
QSizeF pageSize;
@@ -149,7 +149,7 @@ void PrintLayout::printTable()
doc.print(printer);
}
-QString PrintLayout::insertTableHeadingRow()
+QString PrintLayout::insertTableHeadingRow() const
{
int i;
QString ret("<tr>");
@@ -159,7 +159,7 @@ QString PrintLayout::insertTableHeadingRow()
return ret;
}
-QString PrintLayout::insertTableHeadingCol(int col)
+QString PrintLayout::insertTableHeadingCol(int col) const
{
QString ret("<th align='left' width='");
ret += tableColumnWidths.at(col);
@@ -169,7 +169,7 @@ QString PrintLayout::insertTableHeadingCol(int col)
return ret;
}
-QString PrintLayout::insertTableDataRow(struct dive *dive)
+QString PrintLayout::insertTableDataRow(struct dive *dive) const
{
// use the DiveItem class
struct DiveItem di;
@@ -188,7 +188,7 @@ QString PrintLayout::insertTableDataRow(struct dive *dive)
return ret;
}
-QString PrintLayout::insertTableDataCol(QString data)
+QString PrintLayout::insertTableDataCol(QString data) const
{
return "<td>" + data + "</td>";
}