[PyKDE] brain-deadness

tech at bishop.dhs.org tech at bishop.dhs.org
Mon Jan 6 07:14:00 GMT 2003


On Sun, Jan 05, 2003 at 09:53:37PM -0800, Greg Fortune wrote:
> On Sunday 05 January 2003 07:43 pm, tech at bishop.dhs.org wrote:
> > Working through the examples in Boudewijn's book, I've come across
> > something.  In chap. 7, it discussing using signals and slots to create
> > a little xml parser, which then displays in a tree list view.  It just
> > so happens that my next project is using xml and pyqt, so this
> > interested me.  However, (and I must be even more braindead than usual
> > to not understand this) how do I associate the "data" with the "tag"?
> > For instance, when you have a contruct like this: <tag>this is
> > data</tag>, the unknown_starttag signal is fired when it reaches <tag>,
> > and the handle_data signal is fired when it gets to "this is data", but
> > I'm not getting how you would say that "when unknown_starttag fires on
> > tag == "tag", then next handle_data should be directed to foo, which is
> > what I want/need.
> >
> > Example code is attached (direct from the book!), along with example xml
> > file (and you might see what my project is ;-).  I don't need working
> > code in response, just a general idea of what to do.  Oh, and "get more
> > sleep, idiot" would be valid, but non-helpful B-)
> >
> > Thanks,
> >
> > D.A.Bishop
> 
> 
> I haven't used the ListView much, but I think the following patch will work. 
> All you needed to do was add a column for the data and then do "some stuff" 
> in the Data function...  If the patch doesn't work for you, I can send the 
> altered file.  Note: ignore my variable names, etc, 'cause I just hacked 
> until it worked ;o)

Thank you, between your example code and some theory that Gordon sent me
off list, I'm on my way.

Thanks again!

D.A.Bishop




More information about the PyQt mailing list