Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Question Regarding one Qlabel over another or any other wdgets over another

Question Regarding one Qlabel over another or any other wdgets over another

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 3 Posters 322 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VIDYUL SHAH
    wrote on last edited by
    #1

    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: sample.png 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?

    JonBJ 1 Reply Last reply
    0
    • V VIDYUL SHAH

      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: sample.png 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?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @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.

      V 1 Reply Last reply
      2
      • F Offline
        F Offline
        friedemannkleint
        wrote on last edited by
        #3

        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.

        JonBJ 1 Reply Last reply
        1
        • F friedemannkleint

          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.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @friedemannkleint
          I did not know about that QStackedLayout::StackAll possibility. It's really not great that the first line in https://doc.qt.io/qt-6/qstackedlayout.html states

          The QStackedLayout class provides a stack of widgets where only one widget is visible at a time.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            friedemannkleint
            wrote on last edited by
            #5

            That is the main purpose, right ;-)

            JonBJ 1 Reply Last reply
            0
            • F friedemannkleint

              That is the main purpose, right ;-)

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @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.

              1 Reply Last reply
              0
              • JonBJ JonB

                @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.

                V Offline
                V Offline
                VIDYUL SHAH
                wrote on last edited by
                #7

                @JonB @friedemannkleint sample.png 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.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved