[PyKDE] Qt v4.2 Support

V. Armando Sole sole at esrf.fr
Tue Oct 17 09:04:33 BST 2006


Hi

At 19:24 15/10/2006 +0100, Phil Thompson wrote:
>Tonight's PyQt4 snapshot will have full support for Qt v4.2 (except for the
>QtDBus module).

I had problems to build the latest snapshot (PyQt4-gpl-20061015 with 
sip4-snapshot-20061015) under Windows XP with VS2003 and Qt 4.2.0.

There semm to be an inconsistency between qapplication.sip and 
qx11embed_x11.sip. In order to be able to compile, I had to add an #ifdef 
WS_X11 in front of the lines 202 and 218 of qapplication.sip.

That allowed to get to the end of the compilation. However, I encounter 
other problems that I do not know if they are related or not.

The example below works under windows with Qt 4.1.3 and a relatively old 
sip. However, latest snapshots (at least in my system) identify/return 
self.header() as a QFrame instead of a QHeaderView object.

Best regards,

Armando

import PyQt4.Qt as qt

class TestTree(qt.QTreeWidget):
     def __init__(self, parent=None):
         qt.QTreeWidget.__init__(self, parent)

         self.setSelectionMode(qt.QAbstractItemView.ExtendedSelection)
         labels = ["X", "S#", "Command", "Points", "Nb. Mca"]
         ncols  = len(labels)
         self.setColumnCount(ncols)
         self.setHeaderLabels(labels)
         print self.header()
         try:
             self.header().setStretchLastSection(False)
         except:
             print "self.header().setStretchLastSection(False) error"
         try:
             self.header().setResizeMode(0, qt.QHeaderView.Custom)
             self.header().setResizeMode(1, qt.QHeaderView.Custom)
             self.header().setResizeMode(2, qt.QHeaderView.Stretch)
             self.header().setResizeMode(3, qt.QHeaderView.Custom)
             self.header().setResizeMode(4, qt.QHeaderView.Custom)
         except:
             print "self.header().setResizeMode error"

def test():
     a = qt.QApplication([])
     w = TestTree()
     w.show()
     qt.QObject.connect(a, qt.SIGNAL("lastWindowClosed()"),
                        a, qt.SLOT("quit()"))

     a.exec_()

if __name__ == "__main__":
     test()







More information about the PyQt mailing list