[PyKDE] KTrader woes?

Sundance sundance at ierne.eu.org
Thu Sep 11 15:55:01 BST 2003

I heard Jim Bublitz said:

> You'd have to talk to KDE and TrollTech about that - that's
> built-in behaviour in the KDE/Qt C++ libs. Some things do throw
> an exception/error msgs, like trying to use widgets without a
> QApplication/KApplication instance exisiting (although the msg
> usually complains about a missing QPainter instance). I would
> imagine KTrader is looking for some other connection the
> KApplication establishes with KDE.

Oookay. Well, darn!
Thanks for the explanation. I'll go to bed a tad less ignorant tonight. 

> Nah - you got a segfault. Just not a very delicate warning. :)

Yeah. You'd think it would at LEAST have the grace of saying something 
like, "Ooh, something bad happened, sir, I'm gonna have to crash, but 
beforehand I wish to beg you to accept my apologies! *blarg*"

This being said -- any remote chance that we could be able to install a 
signal handler, so that we can tell the user, "Whoops, something bad 
happened in method <blah> of class <doubleblah>. Did you think of 
creating a KApplication instance before calling this?" or something 
like that?

And then there's KApplication itself, where checking that the first 
argument is a non-empty list ought to be relatively trivial, no...? Or 
does the way sip works prevent such checks at the Python level?

Or maybe it's just not worth it at all. I don't know. *g*

> PyKDE-3.8 (rc releases are at
> http://www.sourceforge.net/projects/pykde) has a bunch of
> application templates you can use to get started.

Way cool. :D
For us Gentoo users, I'll have to tweak the ebuild so that the examples, 
templates and all get installed under the doc directory rather than 
silently trashed, which is a bit dumb if you ask me.

> Seems pretty difficult - my guess would be the most appropriate
> route would be a tutorial/better docs/more example programs -
> that's in the works, but takes a while to accomplish.

That, and at least a basic knowledge of how to do things, and how not 
to. I suppose the right way to go about this would be to define a set 
of 'typical' apps (I'm thinking, for instance, small but potentially 
useful tools such as a 'universal' viewer based on KParts, a RSS 
newsticker panel applet, maybe a Konqueror sidebar plug-in showing info 
about the selected files based on their type, etc) and tutorialize 
their coding.

Does that sound like a good idea? I mean, for the latter two, is 
extending KDE with Python stable enough that it can be done at all? I 
know there were threads this summer about problems related to panel 

If at all possible, I think I'll give it a try once I know more about 
PyKDE. It really deserves to be better known!

> The KDE
> libs classref docs are pretty good, even if C++ oriented. You
> find them at http://www.kde.org in the documentation section,
> along with a lot of tutorial stuff.

Yeah, I know, I've already started browsing the lot of them. Way 
interesting stuff, and very impressive. KDE is even better under the 
hood than it looks!

-- S.

More information about the PyQt mailing list