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. QFormLayout formatting
Forum Updated to NodeBB v4.3 + New Features

QFormLayout formatting

Scheduled Pinned Locked Moved Unsolved General and Desktop
qformlayoutforma
2 Posts 2 Posters 948 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.
  • G Offline
    G Offline
    gabor53
    wrote on last edited by
    #1

    Hi,
    I have the following QFormLayout:

    QScrollArea *scrollarea = new QScrollArea(this);
            scrollarea->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOn);
            scrollarea->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOn);
    
            scrollarea->setMinimumWidth (900);
    
            QWidget *viewport  = new QWidget(this);
            scrollarea->setWidget (viewport);
            scrollarea->setWidgetResizable (true);
    
    
            QFormLayout *layout = new QFormLayout(this);
            viewport->setLayout (layout);
    		layout->setSpacing (20);
    
            //Title Row setup
            QHBoxLayout *titleRow = new QHBoxLayout();
            titleRow->addWidget (Title);
    
    
    		//Displaying the rows
    
    		layout->addRow (titleRow);
            layout->addRow (Label_ID,ID_Display);
    

    How can I increase the distance between the rows? Is it possible to do different distances for different rows? (For example bigger space between the title and the ID row and set the distance between the other rows of the form.)

    Thank you for your help.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      @gabor53 said:
      Hi
      there is
      layoutVerticalSpacing property.
      You can set minimum sizes on widgets so they take more space but
      the interspace for rows is the same.

      Also, u can always insert a Widget as place holder and use other settings for its layout so the overall effect will be what u need.

      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