[PyQt] Another pyuic/qstring problem
gokcen at pardus.org.tr
gokcen at pardus.org.tr
Tue Sep 28 20:16:21 BST 2010
Hello,
I'm using latest sip/pyqt snapshots and latest Qt 4.7.0. When I try to run
this code:
----------------------
from PyQt4 import uic
from PyQt4.Qt import QApplication
import sys
app = QApplication(sys.argv)
uic.loadUi("system-config-printer.ui")
----------------------
I got the trace below:
----------------------
Traceback (most recent call last):
File "hede.py", line 9, in <module>
uic.loadUi("/usr/share/kde4/apps/system-config-printer-kde/system-config-printer.ui")
File "/usr/lib/python2.7/site-packages/PyQt4/uic/__init__.py", line 188,
in loadUi
return DynamicUILoader().loadUi(uifile, baseinstance)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/Loader/loader.py", line
28, in loadUi
return self.parse(filename, QtCore.QFileInfo(filename).path())
File "/usr/lib/python2.7/site-packages/PyQt4/uic/uiparser.py", line 830,
in parse
actor(elem)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/uiparser.py", line 675,
in createUserInterface
self.wprops.setProperties(self.toplevelWidget, elem)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/properties.py", line
369, in setProperties
prop_value = self.convert(prop, widget)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/properties.py", line
334, in convert
return func(prop[0], **args)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/properties.py", line
162, in _iconset
return self.icon_cache.get_icon(prop)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/icon_cache.py", line
28, in get_icon
iset = _IconSet(iconset, self._base_dir)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/icon_cache.py", line
61, in __init__
self._fallback = self._file_name(iconset.text, base_dir)
File "/usr/lib/python2.7/site-packages/PyQt4/uic/icon_cache.py", line
85, in _file_name
fname = os.path.join(base_dir, fname)
File "/usr/lib/python2.7/posixpath.py", line 67, in join
elif path == '' or path.endswith('/'):
AttributeError: 'QString' object has no attribute 'endswith'
----------------------
This may be related to the QString workaround in loader.py:
26 # By using QFileInfo.path() rather than os.path.dirname() we
allow
27 # QString file names.
28 return self.parse(filename, QtCore.QFileInfo(filename).path())
Any ideas?
--
Gökçen Eraslan
More information about the PyQt
mailing list