[PATCH] Print: remove profile border when printing

Lubomir I. Ivanov neolit123 at gmail.com
Mon Oct 14 04:17:12 UTC 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

Custom widget frame styles such as 'Sunken' and 'Raised' which seem to
varry between OS will be captured as well:
http://harmattan-dev.nokia.com/docs/library/html/qt4/qframe.html#Shape-enum

So instead we temporarily set the profile frame to QFrame::NoFrame and
then restore it to the previous value.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 qt-ui/printlayout.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp
index 3ddc02a..d0f3f16 100644
--- a/qt-ui/printlayout.cpp
+++ b/qt-ui/printlayout.cpp
@@ -114,6 +114,8 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
 
 	// setup the profile widget
 	ProfileGraphicsView *profile = mainWindow()->graphics();
+	const int profileFrameStyle = profile->frameStyle();
+	profile->setFrameStyle(QFrame::NoFrame);
 	profile->clear();
 	profile->setPrintMode(true, !printOptions->color_selected);
 	QSize originalSize = profile->size();
@@ -178,6 +180,7 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
 	// cleanup
 	painter.end();
 	delete table;
+	profile->setFrameStyle(profileFrameStyle);
 	profile->setPrintMode(false);
 	profile->resize(originalSize);
 	profile->clear();
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list