drhex
28th June 2011, 22:49
I've put 3 QTextEdits above each other in a widget using a QVBoxLayout.
The one that has input focus is supposed to be bigger than the other two, and I fix that by giving it a stretch factor of 1, while the others have a stretch factor of 0 in the layout.
That works, but the two QTextEdits that do not have any stretch become too large.
I suppose they have the default/recommended/preferred/sizeHint-size (whichever is the correct term) of 192 vertical pixels.
How can I change this default size? There does not seem to be a QWidget::setSizeHint() method, and overriding sizeHint() in a subclass did not help either (it never gets called)
The one that has input focus is supposed to be bigger than the other two, and I fix that by giving it a stretch factor of 1, while the others have a stretch factor of 0 in the layout.
That works, but the two QTextEdits that do not have any stretch become too large.
I suppose they have the default/recommended/preferred/sizeHint-size (whichever is the correct term) of 192 vertical pixels.
How can I change this default size? There does not seem to be a QWidget::setSizeHint() method, and overriding sizeHint() in a subclass did not help either (it never gets called)