[PyKDE] Ghosting out dialog sections

Danny Pansters danny at ricin.com
Mon Mar 20 23:51:23 GMT 2006

On Monday 20 March 2006 20:36, Maxwell Bottiger wrote:
> Hi,
> I'm fairly new to designing with Qt (esp w. python) and I was wondering
> what the easiest way was to ghost out sections of my dialog.  I have a pair
> of raido buttons which determine which network protocol to use and I want
> to make the inapplicapable options unavailable to my users.  I have my
> widgets grouped into different button boxes and was hoping there might be a
> simple slot I could add to do this.
> Thanks!

Disable it (the widget(s)). It will appear greyed out and be non interactive. 
Put the code into the handling of the changing of selected items if needed so 
it greys out the ones you want to when you want to. Put appropriate disabling 
in your __init__ (instantiator) routine if needed (say if you want to look 
for installed libraries to do some task and you want to disable the ones not 
installed right away). That's all there's to it I reckon.

yourwidgetchild.setEnable(False). Something like that. Check at api for 
QWidget. Any child of a qwidget is a qwidget itself also.


More information about the PyQt mailing list