On Sun, 05 Mar 2006 14:41:10 +0100 "V. Armando Sole" <[EMAIL PROTECTED]> wrote:
> Hi! > > In order to be able to use the same code with PyQt3 and PyQt4, I had > written a small Qt4.py wrapper to simplify simple cases. > > from PyQt4.QtCore import * > from PyQt4.QtGui import * There are two namespaces Qt: one in QtCore and one in QtGui. Qt.Vertical is part of QtCore, but this gets wiped out by your import: from PyQt4.QtGui import * Gerard > QIconSet = QIcon > QWMatrix = QMatrix > print "Qt.Vertical = ", Qt.Vertical > print "QSplitter = ", QSplitter > QSplitter.Vertical = Qt.Vertical > Qt.WDestructiveClose = Qt.WA_DeleteOnClose > class QPopupMenu(QMenu): > def insertItem(self, *var): > QMenu.addAction(self,*var) > > > if __name__ == "__main__": > print "test passed" > > > The goal was to be able to type: > try: > import Qt4 as qt > except: > import qt > > in my code in order to get the source independent of a PyQt3 or a PyQt4 > installation. > > My problem is the above code was working till the 20060218 snapshot > inclusive. However, later snapshots do not allow it giving an error about > Vertical not being an attribute of Qt. My question is if the code should > never have worked. > > Thanks, > > Armando > _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde