Snapshot/SnapshotFreehandGrabber.py

changeset 4689
957339210f40
parent 4631
5c1a96925da4
child 4692
7b3b75d494c8
--- a/Snapshot/SnapshotFreehandGrabber.py	Sat Jan 23 17:19:28 2016 +0100
+++ b/Snapshot/SnapshotFreehandGrabber.py	Sat Jan 23 17:37:26 2016 +0100
@@ -9,7 +9,8 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import pyqtSignal, Qt, QRect, QPoint, QTimer, qVersion
+from PyQt5.QtCore import pyqtSignal, Qt, QRect, QPoint, QTimer, QLocale, \
+    qVersion
 from PyQt5.QtGui import QPixmap, QColor, QRegion, QPainter, QPalette, \
     QPolygon, QPen, QBrush, QPaintEngine
 from PyQt5.QtWidgets import QWidget, QApplication, QToolTip
@@ -64,6 +65,7 @@
         self.__grabbing = False
         self.__dragStartPoint = QPoint()
         self.__selectionBeforeDrag = QPolygon()
+        self.__locale = QLocale()
         
         self.__helpTextRect = QRect()
         self.__helpText = self.tr(
@@ -162,9 +164,12 @@
         # rectangles (border included). This means that there is no 0px
         # selection, since a 0px wide rectangle will always be drawn as a line.
         boundingRect = self.__selection.boundingRect()
-        txt = "{0:n}, {1:n} ({2:n} x {3:n})".format(
-            boundingRect.x(), boundingRect.y(),
-            boundingRect.width(), boundingRect.height())
+        txt = "{0}, {1} ({2} x {3})".format(
+            self.__locale.toString(boundingRect.x()),
+            self.__locale.toString(boundingRect.y()),
+            self.__locale.toString(boundingRect.width()),
+            self.__locale.toString(boundingRect.height())
+        )
         textRect = painter.boundingRect(self.rect(), Qt.AlignLeft, txt)
         boundingRect = textRect.adjusted(-4, 0, 0, 0)
         

eric ide

mercurial