PyGUI as a standard GUI API for Python?

David Boddie david at
Sat Oct 11 17:31:58 CEST 2008

On Saturday 11 October 2008 11:19, lkcl wrote:

> pyqt4 has the concept of layouts.  a layout can be a horizontal
> layout, vertical, grid, and you can even specify the percentage or
> ratio of the width (or height) that individual cells can use. you
> attach a layout to a widget; you can attach layouts to layouts.  you
> can remove layouts from widgets.  what you _can't_ do is _remove_
> layouts from layouts.

You can remove layouts from layouts with the QLayout.removeItem() method.

> disappointingly, this was the killer, for me.  it was just getting...
> too complicated.  i had already encountered advice that, in order to
> implement the means to move widgets around, i should remove
> *everything* and redo the layout.  it just... wasn't happening.

You'll need to delete the contents of those layouts yourself - maybe that's
the real problem. You shouldn't need to redo the whole layout structure,

> plus, i  think also that there are problems, again, with the HTML
> layout: you can't _entirely_ stop text-squashing.  so, although pyqt4
> was _better_, it still wasn't _enough_.

These days, you'd probably use PyQt4's WebKit integration for HTML
rendering, anyway, though I imagine that it doesn't help you much if
you're already using WebKit directly.


> QT4 lacks crucial layout management (layouts not being deletable from
> layouts), flow-layout, and variable-sized rich text.  they _do_ have
> proportional subdivision of layouts (allowing you to specify a fixed
> width on one cell and a percentage width on others) but it is very
> clumsy.

You can write your own layouts as well, but maybe that's more work than
you're prepared to do, especially now that you seem to have settled on
WebKit as your toolkit.


More information about the Python-list mailing list