Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about python (old posts, page 5)

Rapid Application development using PyQt and Eric3 ... in realtime!

Now, this is not a tu­to­ri­al in the sense that you gonna learn how to do stuff.

How­ev­er, it may show you what is pos­si­ble!

So, hop in and en­ter the won­der­ful world of one evening of de­vel­op­ment in the com­pa­ny of PyQt, Er­ic3, and Python.

Post-facto inheritance

Now, I did­n't ex­pect this to work at al­l!

A QlistView is a sort of tree wid­get, and is drag&­drop en­abled.

The trick is, you have to reim­ple­ment dragOb­jec­t() so it re­turns a drag­gable thingie af­ter you drag some­thing.

But, since I am us­ing de­sign­er to draw the form­s, I have to use a re­al QListView, not a child class.

Co­nun­drum? Cus­tom wid­get in de­sign­er? Not with python!

def myDragObject(self):

re­turn QTextDrag("­some­thing",­self)

self­.tree.__­class__.­dragOb­jec­t=my­DragOb­ject

And that work­s! I know it should work in python, but QListView is im­ple­ment­ed in a C++ mod­ule!

The guys that did PyQt re­al­ly made it well.

Nice side effect

Looks like the kind fel­lows at kde-red­hat.s­f.net have a work­ing PyKDE, and I got it while I was up­grad­ing.

That's use­ful be­cause I re­al­ly want­ed to hack some in­to KrSN (the RSS ag­gre­ga­tor tool I once wrote), and it needs PyKDE.

I had­n't done it be­cause build­ing PyKDE on a PI­I, 233MHZ, 128MB of RAM (the on­ly one I have on the In­ter­net) is re­al­ly NOT fun. But once I got it on RP­M, us­ing it works just fine :-)

Advogato post for 2003-10-15 01:00:42

Now, if this appears in the site, bartleblog has advogato support..

And you, read­er­s, if you want a slow, not ful­ly func­tion­al PyQt based ad­voga­to (and oth­er blogs) ed­i­tor, then you can use it too, just search for bartle­blog in sf.net.

Now, if I im­ple­ment­ed caching, and cor­rect date for­mat­ting, and a de­cent HTML edit­ing in­ter­face, this could even be a de­cent ap­p.


Contents © 2000-2020 Roberto Alsina