c++ - Qt empty space column in QGridLayout? -


I have the following code where I place a button and a text box in QGridLayout . Issue notices that I use columns 3 and 4 for them.

  QGridLayout * insAddPanel = New QGridLayout (); {QLineEdit * ledInstrumentName = New QLineEdit (); InsAddPanel- & gt; AddWidget (name of leadership, 0, 3); QPushButton * btnAddInstrument = New QPushButton (); BtnAddInstrument- & gt; SetText ("add"); InsAddPanel-> addWidget (btnAddInstrument, 0, 4); } Main Layout- & gt; Adlayout (In AdPaneel); ......   

While I run it, I get something like this:

 Enter the image details here

I wanted to capture the text editing and the button only available 2/5 of the horizontal space, this is why I And put it in 4 columns. Since it does not work, how can I do it? Is there something like Spaces widget in QT? I searched but could not find it.

You Stretch = 1 for all the columns. This will give you the view you want.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -