How to add a label on a layout that covers the entire window.
-
Hello,
I am trying to create a sliding window for my main login page i.e i have created a simple login page with a layout and i want to add a label on top of the login page which will cover the login page . It is more like a welcome page . The welcome page will slide up and the login page will be seen.So i have placed all the widgets on the central widget for the login page using a layout.
Now the problem is when i try to add a label that covers the entire window, the layout wont let me do that , also if i set the size policy to fix and change the size , it changes the size of the entire window. Is there a way i can add the label on the layout but without affecting the present layout . I tried MainWindow :: setCentralWidget() , but that stops me from doing the sliding animation.Also if anybody know any other easy way by which i can achieve what i'm trying to do , please tell me.
I Just want a simple welcome page that slides up on clicking a button.
Thank youqrt -
Hi,
One way could be to position/resize your label by hand over the central widget.
-
@jsulm How to add to a widget. Sorry im a beginner. The addwidget() function can be only used with a layout so if you are telling me to add without a layout i cannot use that function. If i drag the label on the ui it moves all the widgets. I cant find a way to add the entire label on top of the layout.
-
Reimplement the resizeEvent of your main widget and resize your label in there.