[PyQt] Proposed fix for rare-used types of properties in the uic module

Vsevolod Novikov novikov at ci.nnov.ru
Tue Mar 25 14:58:16 GMT 2008


Hello All,

I've found that uic module doesn't recognize some rare-used types of
properties (which can be added as dynamic properties in the designer):
   - StringList
   - Char
   - UInt
   - LongLong
   - ULongLong
   - SizeF
   - Point
   - PointF
   - RectF

The applied patch is a proposed fix for the "PyQt4/uic/properties.py"
file to make these types of properties available.
I am using PyQt4 version 4.3.3 with Qt v.4.3.3

Regards,
Vsevolod Novikov
"Consul-Incom" Ltd,
Nizhny Novgorod
Russia


-------------- next part --------------
--- properties.py.orig	2008-03-25 16:31:28.000000000 +0300
+++ properties.py	2008-03-25 17:19:20.000000000 +0300
@@ -64,6 +64,34 @@
     def _bool(self, prop):
         return prop.text == 'true'
 
+    def _char(self, prop):
+    	return self._string(prop)
+    	
+    def _uInt(self, prop):
+    	return self._number(prop)
+
+    def _longLong(self, prop):
+    	return self._number(prop)
+
+    def _uLongLong(self, prop):
+    	return self._number(prop)
+
+    def _sizef(self, prop):
+        return QtCore.QSizeF(*[float(child.text) for child in prop])
+
+    def _point(self, prop):
+        return QtCore.QPoint(*[int(child.text) for child in prop])
+
+    def _pointf(self, prop):
+        return QtCore.QPointF(*[float(child.text) for child in prop])
+
+    def _rectf(self, prop):
+    	
+        return QtCore.QRectF(*[float(child.text) for child in prop])
+
+    def _stringlist(self, prop):
+    	return [ self._string(e) for e in prop ]
+
     def _string(self, prop):
         if prop.get("notr", None) == "true":
             return self._cstring(prop)


More information about the PyQt mailing list