Question Regarding one Qlabel over another or any other wdgets over another
-
Hi, I have actually two questions and I would like to know how the can I achive those things as no relevant videos are available for the same. Please do share if you have come across something regarding my doubts.
Question 1. Continuing to my last question about central widgets here. When I maximize the screen it does not stretch full length in width wise (both the sides) as shared in the picture:What setting I need to do?
Current Settings: Size Policy(Horizontal and Vertical): Expanding
Maxsize: 1920x1080 (For mian window as well as central widgets)Question 2. I want to put one label over another and also a test box on the black screen where my video will be displayed. How can I do this?
-
@VIDYUL-SHAH said in Question Regarding one Qlabel over another or any other wdgets over another:
Question 2. I want to put one label over another
You cannot do this if you are using layouts, you would have to use absolute positioning. Why would you want to do this? Unless you mean show something in place of something else, as opposed to "over it", but that is different.
-
Maybe QStackedLayout helps ( https://doc.qt.io/qt-6/qstackedlayout.html ); it has a StackingMode enum https://doc.qt.io/qt-6/qstackedlayout.html#stackingMode-prop which allows for overlays.
-
@friedemannkleint
I did not know about thatQStackedLayout::StackAll
possibility. It's really not great that the first line in https://doc.qt.io/qt-6/qstackedlayout.html statesThe QStackedLayout class provides a stack of widgets where only one widget is visible at a time.
-
That is the main purpose, right ;-)
-
@friedemannkleint
It never occurred to me to look to see whether a class describing itself in its headline/summary as "where only one widget is visible at a time" had an option to display multiple widgets at a time.... If it had said maybe "usually" "one widget at a time" I would not have been surprised. -
@JonB @friedemannkleint
There are three labels in the photo with background white, black and tan. I wish to add few buttons over the tan colored label while a few buttons at the label with white background and something like floating button in the black area which can be adjusting using the mouse according to the video coming at that place.
Also, I haven't received the answer for my question 1
@VIDYUL-SHAH said in Question Regarding one Qlabel over another or any other wdgets over another:
When I maximize the screen it does not stretch full length in width wise (both the sides) as shared in the picture
Here in this photo I shared it has stretched to one side but didn't stretch to other side.