From pykde Thu Mar 23 12:24:40 2006 From: Torsten Marek Date: Thu, 23 Mar 2006 12:24:40 +0000 To: pykde Subject: Re: [PyKDE] PyQt4 uic bug Message-Id: <44229388.2020408 () gmx ! net> X-MARC-Message: https://marc.info/?l=pykde&m=114311693819796 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0999310122==" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============0999310122== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig39846B8ACFF7CA24C5E041E0" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig39846B8ACFF7CA24C5E041E0 Content-Type: multipart/mixed; boundary="------------020103080100080005020209" This is a multi-part message in MIME format. --------------020103080100080005020209 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Eric Gach wrote: > Hi, >=20 > There seems to be a problem with pyuic4 and generating the code when > using QDockWidget. There's a setting that can be seen in the Qt Designe= r > for QDockWidget that is called "docked". This isn't documented in the Q= t > documentation for QDockWidget, which is why it gave me so much trouble.= :) >=20 > It seems that when this setting is true (or 1 in the XML output), it > calls the addDockWidget method of the window it's using to make sure th= e > dock widget is properly docked in the designated area. The pyuic4 > program doesn't seem to pick up on this and add it into the code > anywhere. I solved it myself by just adding this code: >=20 > self.MainWindow.addDockWidget(QtCore.Qt.LeftDockWidgetArea, > self.ui.dockWidget) >=20 > I added this into my class that uses the uic generated code. Other than= > that, everything else seems to be working great! >=20 > Thanks for the great work! > Eric Gach >=20 Hi, This just happens if the dock widget happens to be in a main window, whic= h was not covered by my test suite. Here's a patch that should fix the problem, could you test it? best regards Torsten --=20 Torsten Marek ID: A244C858 -- FP: 1902 0002 5DFC 856B F146 894C 7CC5 451E A244 C858 Keyserver: subkeys.pgp.net --------------020103080100080005020209 Content-Type: text/plain; name="dockwidget-in-mw.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="dockwidget-in-mw.diff" =3D=3D=3D modified file 'a/uic/Compiler/qtproxies.py' --- a/uic/Compiler/qtproxies.py=09 +++ b/uic/Compiler/qtproxies.py=09 @@ -170,6 +170,8 @@ class Qt(ProxyClass): class CursorShape(LiteralProxyClass): module =3D "QtCore.Qt" + class DockWidgetArea(LiteralProxyClass): + module =3D "QtCore.Qt" =20 class QListWidgetItem(ProxyClass): module =3D "QtGui" =3D=3D=3D modified file 'a/uic/uiparser.py' --- a/uic/uiparser.py=09 +++ b/uic/uiparser.py=09 @@ -169,7 +169,10 @@ self.stack.topwidget.setMenuBar(widget) elif isinstance(widget, QtGui.QStatusBar): self.stack.topwidget.setStatusBar(widget) - =20 + elif isinstance(widget, QtGui.QDockWidget): + dwArea =3D self.wprops.getAttribute(elem, "dockWidgetAre= a") + self.stack.topwidget.addDockWidget( + QtCore.Qt.DockWidgetArea(dwArea), widget) =20 def createSpacer(self, elem): width =3D int(elem.findtext("property/size/width")) --------------020103080100080005020209-- --------------enig39846B8ACFF7CA24C5E041E0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEIpOPfMVFHqJEyFgRAocbAKCsFtlArUIgawDixyLFUyGMawQMpACgwYzl wId3czgkcI/njhydqI3qDA4= =UEdu -----END PGP SIGNATURE----- --------------enig39846B8ACFF7CA24C5E041E0-- --===============0999310122== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde --===============0999310122==--