forked from qt-creator/qt-creator
JSON Wizards: Give labels more space even when word-wrapped
QLabel has a horizontal size policy of "Preferred", but if the label is word-wrapped, the sizeHint is a using a golden ratio for width & height, but we want the label to grab as much horizontal space as it gets anyhow. Change-Id: I6ed049f4f23158014dc04f2d5020b7c2dd4c1980 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -388,6 +388,7 @@ QWidget *LabelField::createWidget(const QString &displayName, JsonFieldPage *pag
|
||||
auto w = new QLabel;
|
||||
w->setWordWrap(m_wordWrap);
|
||||
w->setText(m_text);
|
||||
w->setSizePolicy(QSizePolicy::Expanding, w->sizePolicy().verticalPolicy());
|
||||
return w;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user