- apparently it works, needs further testing
git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@319 014f5005-505e-4b48-8d0a-63407b615a7c
This commit is contained in:
@@ -32,14 +32,27 @@ def get_py_str(a):
|
||||
'''Returns a python string out of a QString'''
|
||||
if pyqt:
|
||||
return str(a.toUtf8())
|
||||
return a #Already a python string in PySide
|
||||
return str(a.encode("utf-8")) #Already a python string in PySide
|
||||
|
||||
def set_utf8_text(component,text):
|
||||
if pyqt:
|
||||
if not pyqt:
|
||||
component.setText(text.decode("utf-8"))
|
||||
else:
|
||||
component.setText(QtCore.QString.fromUtf8(text))
|
||||
def get_filename(filename):
|
||||
if pyqt:
|
||||
return str(filename.toUtf8())
|
||||
return filename[0]
|
||||
return filename[0]
|
||||
def add_list_item(l,item):
|
||||
if pyqt:
|
||||
history_item=QtCore.QString()
|
||||
history_item.append(item)
|
||||
hitem=QtGui.QListWidgetItem(None,0)
|
||||
hitem.setText(history_item)
|
||||
l.addItem (hitem)
|
||||
l.setCurrentItem(hitem)
|
||||
else:
|
||||
hitem=QtGui.QListWidgetItem(None,0)
|
||||
hitem.setText(item)
|
||||
l.addItem (hitem)
|
||||
l.setCurrentItem(hitem)
|
Reference in New Issue
Block a user