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. Can you set border to QVBoxLayout
Forum Updated to NodeBB v4.3 + New Features

Can you set border to QVBoxLayout

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 2.2k 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.
  • L Offline
    L Offline
    lukutis222
    wrote on last edited by
    #1

    Most of my widgets on the application are placed on the Grid:
    4b6819e0-6786-42a3-a943-a6daf9f1abb6-image.png

    On one of the grid slots, I have placed vertical layout verticalLayout_7 and within this layout I have multiple other horizontal layouts.

    Currently, my application looks like this:
    9f2245da-233e-41c5-a227-3140587bcafc-image.png

    My goal is to make a border around verticalLayout_7. This is just an example how I want this to look:
    8e52a57b-0c87-4b8c-a674-c1b72f81212e-image.png

    I would appreciate if someone could suggest a way to do this. Thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • L lukutis222

      Most of my widgets on the application are placed on the Grid:
      4b6819e0-6786-42a3-a943-a6daf9f1abb6-image.png

      On one of the grid slots, I have placed vertical layout verticalLayout_7 and within this layout I have multiple other horizontal layouts.

      Currently, my application looks like this:
      9f2245da-233e-41c5-a227-3140587bcafc-image.png

      My goal is to make a border around verticalLayout_7. This is just an example how I want this to look:
      8e52a57b-0c87-4b8c-a674-c1b72f81212e-image.png

      I would appreciate if someone could suggest a way to do this. Thanks in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @lukutis222 Layouts are not widgets, so have no visual representation. But you can use for example QFrame if you need a border/frame around something.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      L 1 Reply Last reply
      1
      • jsulmJ jsulm

        @lukutis222 Layouts are not widgets, so have no visual representation. But you can use for example QFrame if you need a border/frame around something.

        L Offline
        L Offline
        lukutis222
        wrote on last edited by
        #3

        @jsulm
        Would you be able to clarify how do I use the QFrame exactly? I assume you dont just drag and drop it on top of the vertical layout:
        c517ccf9-ea52-403a-b289-663656699513-image.png

        jsulmJ 1 Reply Last reply
        0
        • L lukutis222

          @jsulm
          Would you be able to clarify how do I use the QFrame exactly? I assume you dont just drag and drop it on top of the vertical layout:
          c517ccf9-ea52-403a-b289-663656699513-image.png

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @lukutis222 said in Can you set border to QVBoxLayout:

          how do I use the QFrame exactly?

          Like any other widget. Put it in the layout where you currently have those widgets you want to have a border around them. Then and a layout to this frame and add those widgets to this layout.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          L 1 Reply Last reply
          0
          • jsulmJ jsulm

            @lukutis222 said in Can you set border to QVBoxLayout:

            how do I use the QFrame exactly?

            Like any other widget. Put it in the layout where you currently have those widgets you want to have a border around them. Then and a layout to this frame and add those widgets to this layout.

            L Offline
            L Offline
            lukutis222
            wrote on last edited by
            #5

            @jsulm I dont believe that works for me.

            I have placed the frame on my layout:
            6989ef7e-d6f0-43c3-8545-223e0ea426c6-image.png

            but I cannot put anything inside a frame. It seems like it is disabled. Any clues why that might be the case ?

            jsulmJ 1 Reply Last reply
            0
            • L lukutis222

              @jsulm I dont believe that works for me.

              I have placed the frame on my layout:
              6989ef7e-d6f0-43c3-8545-223e0ea426c6-image.png

              but I cannot put anything inside a frame. It seems like it is disabled. Any clues why that might be the case ?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @lukutis222 said in Can you set border to QVBoxLayout:

              It seems like it is disabled

              Where? It works just fine for me.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              L 1 Reply Last reply
              0
              • jsulmJ jsulm

                @lukutis222 said in Can you set border to QVBoxLayout:

                It seems like it is disabled

                Where? It works just fine for me.

                L Offline
                L Offline
                lukutis222
                wrote on last edited by
                #7

                @jsulm

                You are right. I can place the widgets in the QFrame. I also had to ensure the widget is set to Vertical layout:

                05e65873-1edc-4d54-9ab4-6d6d7fa0021f-image.png

                Result:
                175992de-5dcc-43fd-98d6-395823add137-image.png

                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