PDA

View Full Version : Unable to use an 'autosize' QlineEdit widget and layout.



tonnot
14th February 2012, 12:07
I have created a custom widget extending QLineEdit. I want this is 'autosize'. Ok I get it using connect(this,SIGNAL(textChanged(QString)), this, SLOT(resizeLineEditToContents()));
I have 2 of this widgets. The idea is that a resize of widget 1 is used by the horizontal layout where I have placed the two widgets to place rightly the widget 2.
But it is impossible, I have played with all the policy possible value, without success.
The layout tries always to adjust the size of my 'QLineEdit' widget .... (It happens also with a standard QlineEdit).
Any help ? Thanks


Solved . It is neccesary to use setfixedwidth().