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. How to create long line?
Forum Updated to NodeBB v4.3 + New Features

How to create long line?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 437 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.
  • Q Offline
    Q Offline
    qwe3
    wrote on last edited by
    #1

    Hi,

    I would like to create GUI with two parts. They are separate by one long line. Something like this:

    https://www.google.com/search?q=virtual+box+installation&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjP-aXfmq7qAhWHqqQKHc11D_cQ_AUoAnoECA0QBA&biw=1920&bih=926#imgrc=Ysx5ytvgG2_aiM

    The first part here is "Custom Setup", the second part is between the lines. Here we have for example "Browse" button and location.
    In the third part there are "Back", "Next", "Cancel", "Disk Usage" buttons.

    When I try something like:

        HLine = new QFrame;
        HLine->setFrameShape(QFrame::HLine);
    

    and add this line to qGridLayout I get the line, but which is shorter:

    example.png

    The black rectangles are my Desktop background, the vertical lines are QGroupBox border and the horizontal line is what I talking about. I would like that will be longer like in virtual box image example.

    J.HilkJ 1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by
      #2

      It's probably due to your layout margin.
      Call setContentsMargins(0,0,0,0) to your layout.

      1 Reply Last reply
      5
      • Q qwe3

        Hi,

        I would like to create GUI with two parts. They are separate by one long line. Something like this:

        https://www.google.com/search?q=virtual+box+installation&source=lnms&tbm=isch&sa=X&ved=2ahUKEwjP-aXfmq7qAhWHqqQKHc11D_cQ_AUoAnoECA0QBA&biw=1920&bih=926#imgrc=Ysx5ytvgG2_aiM

        The first part here is "Custom Setup", the second part is between the lines. Here we have for example "Browse" button and location.
        In the third part there are "Back", "Next", "Cancel", "Disk Usage" buttons.

        When I try something like:

            HLine = new QFrame;
            HLine->setFrameShape(QFrame::HLine);
        

        and add this line to qGridLayout I get the line, but which is shorter:

        example.png

        The black rectangles are my Desktop background, the vertical lines are QGroupBox border and the horizontal line is what I talking about. I would like that will be longer like in virtual box image example.

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @qwe3 to add to @Bonnie , default layouts come with spacing != 0 as well, that can cause spacing issues as well


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        3
        • Q Offline
          Q Offline
          qwe3
          wrote on last edited by
          #4

          @J-Hilk @Bonnie Perfect!

          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