Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Widget hiding other widget
Forum Updated to NodeBB v4.3 + New Features

Widget hiding other widget

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.9k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    Misty River
    wrote on last edited by
    #1

    Hi,

    Is there a way to set priority to the visibility of widget... like for instance if I have a frame with a picture and I want to put a button on top of the frame but I don't want to put it in the frame so that it doesn't inherit the stylesheet properties... I tried but the frame is hiding my button.. I want it the other way around.. what's under the button is hidden in the frame but the rest of the frame is still visible...

    Thanks good day

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Could you please, show the code.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Misty River
        wrote on last edited by
        #3

        I don't do this manually.. it would be excruciating.. I use the designer

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          You are using widgets not QML, right?

          If I drop QPushPutton first and then QFrame above the button then right click on frame, "send to back" and the button always appear above the frame and accepts the mouse clicks.
          Check ui_*.h file and I see that my button belong to centralWidget
          @
          pushButton_2 = new QPushButton(centralWidget);
          frame_2 = new QFrame(centralWidget);
          @
          in the case when QFrame is first the button created like this
          @
          frame_3 = new QFrame(centralWidget);
          pushButton_3 = new QPushButton(frame_3);
          @

          Also you can redefine stylesheet properties for the button in a designer. See properties editor, QWidget, styleSheet.

          But maybe I did not get what is the problem is. :-)
          In this case could you please, show a picture of what you get and what you need.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Misty River
            wrote on last edited by
            #5

            Hi, I am not using QML you are right it is just regular widgets... I tried what you said and it is exactly what I was looking for thank you. I have another question if you don't mind... I have 2 qlabel that contains scalable pictures.. they are both in distinct horizontal layout.. now I want my app to be scalable so I have to put a mainlayout on the window.. problem is I want those 2 horizontal layout to overlap each other so that one image is on top of the other but I can't use a stackedlayout because both layouts must be visible at the same time... Is there a way to achieve this with regular layouts or I have to use QML and anchors.. if I put the smallest picture as a child of the background one the small one gets both background-image as a result of css inheriting... not sur if I made my problem clear..

            Anyways thanks for your time have a good day.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              Glad that it worked for you.
              Regarding second question. It is not clear for me what you need to achieve.
              Could you post a picture of your design.

              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