[PyQt] moving from pyside, subclass problem
V. Armando Sole
sole at esrf.fr
Wed Jul 23 19:56:04 BST 2014
There is a difference that you do not notice if you are under Python 3.
As far as I have understood PySide uses API 2 irrespectively of the
Python version.
PyQt4 uses API 1 for python 2.x and API 2 for python 3.x. If you want
the same behavior in every case you have to force API to version 2.
Perhaps that is not your problem, but it is the main difference I have
encountered.
Best regards,
Armando
On 23.07.2014 19:50, Alan Ezust wrote:
> Are you also changing from Python 2 to Python 3?
> Check the QFavorislistModel.__init__() def and make sure that
> super(QAbstractItemModel, self).__init__(parent) is called properly
> from it.
>
> On Mon, Jul 21, 2014 at 3:16 AM, pisani arnaud
> <arnaud at pixels-universe.com> wrote:
>
>> Hi,
>> I’ m moving some scripts from pyside 1.2 to pyqt4 and have some
>> problems with subclass:
>>
>> I’ ve got a QListView that use a subclass of QAbstractListModel
>> as model.
>> With pyside evrything is ok, with pyqt4 i’ve got this error when
>> set the model :
>>
>> TypeError: QAbstractItemView.setModel(QAbstractItemModel): argument
>> 1 has unexpected type ‘QFavorislistModel’
>>
>> It’ s like my subclass of QAbstractListModel
>> ‘QFavorislistModel’ is not reconized as a QAbstractItemModel.
>>
>> I don’t understand what wrong and what are the differneces
>> between pyside and pyqt,
>> If somone can highlight me,
>> Thanks
>> Arnaud
>>
>> _______________________________________________
>> PyQt mailing list PyQt at riverbankcomputing.com
>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt [1]
>
>
>
> Links:
> ------
> [1] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
More information about the PyQt
mailing list