Updated QtGui modue to works with python 2.x and 3.x

This commit is contained in:
Renato Filho 2011-10-06 11:38:31 -03:00 • committed by Hugo Parente Lima
commit d9dd319232
15 changed files with 94 additions and 71 deletions

View file

@ -1,6 +1,6 @@
import unittest
from PySide.QtCore import *
from PySide.QtGui import *
import py3kcompat as py3k
from PySide.QtGui import QStandardItemModel, QStandardItem
class MyItemModel(QStandardItemModel):
def __init__(self,parent=None):
@ -9,12 +9,12 @@ class MyItemModel(QStandardItemModel):
def mimeTypes(self):
mtypes = super(MyItemModel,self).mimeTypes()
mtypes.append(u'application/my-form')
mtypes.append(py3k.unicode_('application/my-form'))
return mtypes
def mimeData(self,indexes):
self.__mimedata = super(MyItemModel,self).mimeData(indexes)
self.__mimedata.setData(u'application/my-form', 'hi')
self.__mimedata.setData(py3k.unicode_('application/my-form'), 'hi')
return self.__mimedata
class TestBug660(unittest.TestCase):