[PyQt] Designer issues, WYS-is not-WYG
hpj at urpla.net
Tue Jun 28 07:06:44 BST 2011
On Tuesday 28 June 2011, 01:08:38 James Polk wrote:
> I like Designer and have been using it more and more...
> but I've been noticing that many times what you see in the Designer
> window ends up not matching when you run your program later.
> For example, small offsets in X and Y...look good in Designer, but
> don't end up in the same place in the program. Many times, it's not
> that consequential, but in a more complex UI, with very precise
> positioning, this can be very frustrating.
> One example,...create a MainWindow, drop a horizontal slider into it,
> and make it's height 60, so you get a kinda' tall "main marker".
> Save it as a .ui file,...load it into your program, and the tall
> marker is now short. ( I dynamically load my UI's with
> uic.loadUiType(), but the same phenomena happens either way.) Using
> Designer's "preview" is consistent with what's in Designer, but
> something is lost in translation later when it goes into the program.
> I often get positon offset weirdness using QFrames,
> QGroupBoxes,etc... They look good in Designer, then "off" in main
> program, so I have to make them look "off" in Designer, so they'll
> end up in the right place when they're used.
This all sounds like you're using fixed geometries and no layouts.
I cannot recommend doing this in any sane project.
The ability of combining different layouts in a top level container
constitutes one of Qt's strength, resulting in resolution independent
Please provide an example UI, that demonstrates your issues.
More information about the PyQt