R
R
rust212014-09-30 01:45:22
Qt
rust21, 2014-09-30 01:45:22

How can I hide a top-level widget in Qt, but still show a nested (lower-level) widget?

As a training example (according to the tutorial), I made up the widget shown in the picture:
64f0906419e341bebd1e89d7112a1425.PNG
How to make it so that when this widget is displayed, only the data entry form with rounded edges is shown?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xseven, 2014-09-30
@xseven

From the looks of it, it wouldn't hurt to add a layout to stretch your child widget inside the parent widget.
In the constructor of the parent widget, you can add:
setAttribute(Qt::WA_TranslucentBackground);
Should help.

R
rust21, 2014-09-30
@rust21

xseven, thanks for the advice =) The widget is already stretched with the layout inside the parent one, just a large margin is set. In order for everything to work perfectly, you need to add the following in addition to your line:

setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(Qt::FramelessWindowHint);

And after that everything works great.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question