c++ - Qt empty space column in QGridLayout? -
I have the following code where I place a button and a text box in While I run it, I get something like this: 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 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); ......
Stretch = 1 for all the columns. This will give you the view you want.
Comments
Post a Comment