[PyQt] Position widgets over widgets

Mads Ipsen madsipsen at gmail.com
Thu Apr 7 14:36:47 BST 2011


I tried that, but is does not seem to work. The 'XXX' is still hidden by 
the widget in the layout.

What I eventually would like to achieve is to add a QPushButton in, say, 
the upper left corner of the parent widget.

I have attached a similar example, this time with a QPushButton. This 
QPushButton is rendered useless (i.e.) you cannot press it.

I thought solving this problem would be a walk in the park. Any clues?

Best regards,


On 2011-04-07 15:19, Hans-Peter Jansen wrote:
> On Thursday 07 April 2011, 14:58:30 Mads Ipsen wrote:
>> Hi,
>> I have attached a simple example where a widget sets up two labels.
>> One which is added to the layout of the widget, and one which is not.
>> In the paintEvent() of the parent widget I instead position the
>> non-layout label using setGeometry to make it appear in the center of
>> the parent widget.
>> However, the label positioned by this approach is always obscured by
>> the widget which was added to the layout. I want it to appear as
>> visible, i.e. visible on top of the parent widget.
> Create _label2 after _label1, but this is a questionable approach.
> Why can't you use something like QStackedLayout?
> Pete
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

| Mads Ipsen                                          |
| Florsgade 7, 4. th   |                              |
| DK-2200 København N  | phone:          +45-29716388 |
| Denmark              | email:  mads.ipsen at gmail.com |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: front_push.py
Type: text/x-python
Size: 719 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110407/61e06ece/attachment.py>

More information about the PyQt mailing list