[QGIS Commit] r8658 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Jun 20 05:10:03 EDT 2008


Author: mhugent
Date: 2008-06-20 05:10:02 -0400 (Fri, 20 Jun 2008)
New Revision: 8658

Modified:
   trunk/qgis/src/core/qgsprojectfiletransform.cpp
Log:
Use QPrinter instead of QPixmap to find out screen resolution

Modified: trunk/qgis/src/core/qgsprojectfiletransform.cpp
===================================================================
--- trunk/qgis/src/core/qgsprojectfiletransform.cpp	2008-06-19 08:33:23 UTC (rev 8657)
+++ trunk/qgis/src/core/qgsprojectfiletransform.cpp	2008-06-20 09:10:02 UTC (rev 8658)
@@ -22,7 +22,7 @@
 #include "qgslogger.h"
 #include <QTextStream>
 #include <QDomDocument>
-#include <QPixmap> //to find out screen resolution
+#include <QPrinter> //to find out screen resolution
 
 typedef QgsProjectVersion PFV;
 
@@ -242,8 +242,8 @@
   if ( ! mDom.isNull() )
     {
       //Change 'outlinewidth' in QgsSymbol
-      QPixmap thePixmap;
-      int screenDpi = (thePixmap.logicalDpiX() + thePixmap.logicalDpiY()) / 2;
+      QPrinter myPrinter ( QPrinter::ScreenResolution ); 
+      int screenDpi = myPrinter.resolution();
       double widthScaleFactor = 25.4 / screenDpi;
 
       QDomNodeList outlineWidthList = mDom.elementsByTagName("outlinewidth");



More information about the QGIS-commit mailing list