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 320 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 28 Jun 2024, 12:20 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?

    J 1 Reply Last reply 28 Jun 2024, 12:44
    0
    • V VIDYUL SHAH
      28 Jun 2024, 12:20

      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?

      J Offline
      J Offline
      JonB
      wrote on 28 Jun 2024, 12:44 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 29 Jun 2024, 04:12
      2
      • F Offline
        F Offline
        friedemannkleint
        wrote on 28 Jun 2024, 13:16 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.

        J 1 Reply Last reply 28 Jun 2024, 13:32
        1
        • F friedemannkleint
          28 Jun 2024, 13:16

          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.

          J Offline
          J Offline
          JonB
          wrote on 28 Jun 2024, 13:32 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 28 Jun 2024, 13:58 last edited by
            #5

            That is the main purpose, right ;-)

            J 1 Reply Last reply 28 Jun 2024, 14:00
            0
            • F friedemannkleint
              28 Jun 2024, 13:58

              That is the main purpose, right ;-)

              J Offline
              J Offline
              JonB
              wrote on 28 Jun 2024, 14:00 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
              • J JonB
                28 Jun 2024, 12:44

                @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 29 Jun 2024, 04:12 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

                1/7

                28 Jun 2024, 12:20

                • Login

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