6

Suppose I have a gridlayout of three columns. I want each column to have custom width. Seems to me that the width of the columns are fixed automatically.

How can I do this in the qt designer?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Yousuf Azad
  • 414
  • 1
  • 7
  • 17
  • 1
    To set size column You can use `setColumnMinimumWidth()`, but You also must manipulate `setSizePolicy` for each element in column as QLabel, QGroupBox etc, because policy determines how behavior must be particular object in column. Look Here http://doc.qt.io/qt-4.8/qsizepolicy.html also probably find some here http://stackoverflow.com/questions/4553304/understanding-form-layout-mechanisms-in-qt – Mbded Oct 19 '15 at 10:29
  • So without the manual tweaking, with the help of GUI(in qtDesigner) the individual column widths cannot be changed? :/ – Yousuf Azad Oct 21 '15 at 03:32

1 Answers1

2

You can do it in the QT Designer (GUI)

  1. First, use the Grid Layout widget (say, you want 3 column)
  2. Second, in the Property Editor, choose the layoutColumnStretch and enter value (such as 200,100,100)

Result: 1st column 200px, 2nd column 100px, 3rd column 100px,