[QGIS Commit] r14446 - in trunk/qgis/src: app core ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Oct 29 08:38:34 EDT 2010


Author: mhugent
Date: 2010-10-29 05:38:34 -0700 (Fri, 29 Oct 2010)
New Revision: 14446

Modified:
   trunk/qgis/src/app/qgslabelinggui.cpp
   trunk/qgis/src/core/qgspallabeling.cpp
   trunk/qgis/src/ui/qgslabelingguibase.ui
Log:
Fix for bug #3143, apply double values for label sizes

Modified: trunk/qgis/src/app/qgslabelinggui.cpp
===================================================================
--- trunk/qgis/src/app/qgslabelinggui.cpp	2010-10-29 05:24:47 UTC (rev 14445)
+++ trunk/qgis/src/app/qgslabelinggui.cpp	2010-10-29 12:38:34 UTC (rev 14446)
@@ -406,7 +406,7 @@
   {
     fontSizeUnitString = tr( "map units" );
   }
-  lblFontName->setText( QString( "%1, %2 %3" ).arg( font.family() ).arg( font.pointSize() ).arg( fontSizeUnitString ) );
+  lblFontName->setText( QString( "%1, %2 %3" ).arg( font.family() ).arg( font.pointSizeF() ).arg( fontSizeUnitString ) );
   lblFontPreview->setFont( font );
   updatePreview();
 }

Modified: trunk/qgis/src/core/qgspallabeling.cpp
===================================================================
--- trunk/qgis/src/core/qgspallabeling.cpp	2010-10-29 05:24:47 UTC (rev 14445)
+++ trunk/qgis/src/core/qgspallabeling.cpp	2010-10-29 12:38:34 UTC (rev 14446)
@@ -263,10 +263,11 @@
   placement = ( Placement ) layer->customProperty( "labeling/placement" ).toInt();
   placementFlags = layer->customProperty( "labeling/placementFlags" ).toUInt();
   QString fontFamily = layer->customProperty( "labeling/fontFamily" ).toString();
-  int fontSize = layer->customProperty( "labeling/fontSize" ).toInt();
+  double fontSize = layer->customProperty( "labeling/fontSize" ).toDouble();
   int fontWeight = layer->customProperty( "labeling/fontWeight" ).toInt();
   bool fontItalic = layer->customProperty( "labeling/fontItalic" ).toBool();
   textFont = QFont( fontFamily, fontSize, fontWeight, fontItalic );
+  textFont.setPointSizeF( fontSize ); //double precision needed because of map units
   textColor = _readColor( layer, "labeling/textColor" );
   enabled = layer->customProperty( "labeling/enabled" ).toBool();
   priority = layer->customProperty( "labeling/priority" ).toInt();
@@ -295,7 +296,7 @@
   layer->setCustomProperty( "labeling/placementFlags", ( unsigned int )placementFlags );
 
   layer->setCustomProperty( "labeling/fontFamily", textFont.family() );
-  layer->setCustomProperty( "labeling/fontSize", textFont.pointSize() );
+  layer->setCustomProperty( "labeling/fontSize", textFont.pointSizeF() );
   layer->setCustomProperty( "labeling/fontWeight", textFont.weight() );
   layer->setCustomProperty( "labeling/fontItalic", textFont.italic() );
 

Modified: trunk/qgis/src/ui/qgslabelingguibase.ui
===================================================================
--- trunk/qgis/src/ui/qgslabelingguibase.ui	2010-10-29 05:24:47 UTC (rev 14445)
+++ trunk/qgis/src/ui/qgslabelingguibase.ui	2010-10-29 12:38:34 UTC (rev 14446)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>504</width>
-    <height>686</height>
+    <width>515</width>
+    <height>692</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -568,6 +568,9 @@
              <layout class="QHBoxLayout" name="horizontalLayout">
               <item>
                <widget class="QDoubleSpinBox" name="mFontSizeSpinBox">
+                <property name="decimals">
+                 <number>4</number>
+                </property>
                 <property name="maximum">
                  <double>999999999.000000000000000</double>
                 </property>



More information about the QGIS-commit mailing list