[PyQt] Re: ConvertToSubClass problem

Matteo Bertini naufraghi at develer.com
Wed Nov 19 11:05:50 GMT 2008


Matt Newell ha scritto:
> Could you be more specific about the situation that is failing.  What actual 
> type is the object, and what is the return type of the function being called?
> 
> Matt
> 

matteo at focault:~/src$ cat bug_q3listview.py

import sys
from PyQt4.Qt import *

if __name__ == "__main__":
    a = QApplication([])
    w = Q3ListView()
    w.addColumn("prova")
    i = Q3ListViewItem(w, "row1")
    print i, w.firstChild()
    print w, i.listView()
    w.show()
    #a.exec_()

### before the IsSubtype Fix

matteo at focault:~/src$ python bug_q3listview.py
bug_q3listview.py:7: DeprecationWarning: Q3ListView constructor is
deprecated
  w = Q3ListView()
bug_q3listview.py:9: DeprecationWarning: Q3ListViewItem constructor is
deprecated
  i = Q3ListViewItem(w, "row1")
<PyQt4.Qt3Support.Q3ListViewItem object at 0x7f80e1b08628>
<PyQt4.Qt3Support.Q3ListViewItem object at 0x7f80e1b08628>
<PyQt4.Qt3Support.Q3ListView object at 0x7f80e1b085a0>
<PyQt4.QtGui.QFrame object at 0x7f80e1b086b0>
             ^^^^^^
## After the fix

matteo at focault:~/src$ python bug_q3listview.py
bug_q3listview.py:7: DeprecationWarning: Q3ListView constructor is
deprecated
  w = Q3ListView()
bug_q3listview.py:9: DeprecationWarning: Q3ListViewItem constructor is
deprecated
  i = Q3ListViewItem(w, "row1")
<PyQt4.Qt3Support.Q3ListViewItem object at 0x7f8f31eec628>
<PyQt4.Qt3Support.Q3ListViewItem object at 0x7f8f31eec628>
<PyQt4.Qt3Support.Q3ListView object at 0x7f8f31eec5a0>
<PyQt4.Qt3Support.Q3ListView object at 0x7f8f31eec5a0>
                  ^^^^^^^^^^

You can download the pyqt3support code from
http://www.develer.com/oss/PyQt3Support


More information about the PyQt mailing list