[PyKDE] Custom interface

Greg Fortune lists at gregfortune.com
Sat Jan 10 05:45:01 GMT 2004


On Friday 09 January 2004 11:42 am, Eron Lloyd wrote:
> Hey, thanks! You've definately got the right idea. One of the whole goals
> this widget should be able to support is flexible ballot layout, and Layout
> Managers are probably the way to go. I read in the PyQt book that I can
> create my own types of layout managers:
>
> "It's also quite possible to build a new layoutmanager on QLayout, one, for
> instance, that manages playing cards on a stack, or perhaps items in
> circle.
>
> You can not only add widgets to layouts; but also layouts. In this way,
> quite complex layouts can achieved with very little pain."
>
> Going in this direction, perhaps the best approach would be to work with
> QGridLayout, which can have items span multiple rows/columns. If that
> doesn't work, I'll look into coding my own.

I wouldn't bother creating your own layout manager.  As they suggest, just use 
a couple of embedded layouts until you acheive the effect you want.  If you 
want some example .ui files of some tools I develop, let me know.

>
> Because even local elections can have several hundred seats & candidates,
> precise layouts would be work-intensive for each race. What essentially

What I meant was pixel perfect layout for pieces of the layout... For example, 
if the name needs to be exactly 212 pixels from the left edge and 23 pixels 
below the last name, you are able to be that precise in Qt but you lose a 
little flexibility.

> will happen is the widget dynamically generating the ballot display based
> on data and rules stored in an XML file. Down the road I'll produce a GUI
> ballot designer that then generates the XML but still lets the widget do
> all the heavy lifting.

Yup, sounds like the right way to go.

>
> This is all very exciting and I'm learning a lot. Thanks for all the help!
>

No prob :)


Greg Fortune
Fortune Solutions




More information about the PyQt mailing list