[PyKDE] QtDesigner - simpler proxy

Roland Schulz mail at r2s2.de
Sun Nov 2 18:44:00 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 02 November 2003 17:30, you wrote:
> On Sunday November 2 2003 03:36, Roland Schulz wrote:
> > On Sunday 02 November 2003 09:02, Jim Bublitz wrote:
> > > I haven't played around with this much yet, but it seems to
> > > work just fine. The one thing that needs to be done is that
> > > the Python widget needs to provide size hints so that the
> > > proxy widget can size itself properly - the "FileChooser"
> > > widget isn't very pretty in QtDesigner without those, but it
> > > seems to work.
> >
> > This can be done by overwriting minimumSIze, maximumSize,
> > minimumSizeHint, sizeHint (and -width, -height), passing the
> > function onto the proxyed Python object, right?
>
> I thnk you just need to overload sizeHint or something in that
> category in the Python widget itself.
I'm not sure, is it the default behavior of an widget to get the results for 
all these functions from its children?
What is displayed incorrect? On my computer in my version it diplays correct - 
exacltly like the c++ version. Funny is that the preview looks little bit 
different from the version in the edit mode. In the preview there is no space 
between the button and the lineedit. But this is the same in the C++ version.

> > The only open question is than, if connected signals and slots
> > in the preview can be made working and if setting properties
> > will work. But to test this the metaobject has to work in the
> > first place.
>
> I would think you'd have to "lift" the signals/slots from the
> child widget to the parent in something like FileChooser, but in
> the Python widget as is already done in this case:
>
>     def setFileName(self,fn):
>         self.lineEdit.setText(fn)
>
> I'm not sure how to handle the child widgets' signals. Probably
> something like:
>
> in constructor:
>
>     self.connect (self.lineEdit, SIGNAL ("textChanged (const
>         QString&"), self.textChanged)
>
> -----
>     def textChanged (self, s):
>         self.emit (PYSIGNAL ("textChanged"), (s, ))
>
> But I would think any "compound" widget will have to do the same
> thing, and in C++ or Python. For example, QListView doesn't
> expose it's viewport widget in QtDesigner.
In what way is QListView a "compound" widget? Do you mean QListViewItem or 
QListViewPrivate as part? Both don't have singals/slots.

> > Could you send me the your current version. Even better would
> > be to put it up on cvs. In case you do my sf username is:
> > rolandschulz (ID: 269060), so you can give me cvs write
> > access.
>
> I don't maintain any kind of CVS. I'll post a copy sometime today
You have write access to the pykde.sf.net cvs as developer. 
Just import qtdesinger
http://sourceforge.net/docman/display_doc.php?docid=14033&group_id=1#commandimport
http://sourceforge.net/cvs/?group_id=61057
and add me as developer for pykde. 
If you don't want to add me as a developer to pykde, I can create a new 
project for the plugin. If you don't want to import it, I'll do after you 
send it me and added me as developer. Of course we don't have to use cvs, but 
I think this would make it a lot easier (and would reduce traffic on the 
mailinglist).

regards
Roland
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQE/pUIDV/hlvQgMogsRArLsAKCwJ0sIcbE/Jf6QXObQiDsVzChd7gCg4SlA
0ete760Jk2K4LUzLhz72srM=
=HqwI
-----END PGP SIGNATURE-----




More information about the PyQt mailing list