forked from qt-creator/qt-creator
JsonWizard: Fix warning
On macOS, pixelMetric(QStyle::PM_LayoutHorizontalSpacing) will always return -1. ``` QWidget::setMinimumSize: (/QWidget) Negative sizes (-1,-1) are not possible QWidget::setMaximumSize: (/QWidget) Negative sizes (-1,-1) are not possible QWidget::setMinimumSize: (/QWidget) Negative sizes (-1,-1) are not possible QWidget::setMaximumSize: (/QWidget) Negative sizes (-1,-1) are not possible ``` Change-Id: I87d83af9f739dec6cdb898880ad8e9e9eaa411f9 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -474,8 +474,8 @@ QWidget *SpacerField::createWidget(const QString &displayName, JsonFieldPage *pa
|
||||
Q_UNUSED(page)
|
||||
int hspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing);
|
||||
int vspace = QApplication::style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
|
||||
int hsize = hspace * m_factor;
|
||||
int vsize = vspace * m_factor;
|
||||
int hsize = qMax(0, hspace * m_factor);
|
||||
int vsize = qMax(0, vspace * m_factor);
|
||||
|
||||
auto w = new QWidget();
|
||||
w->setMinimumSize(hsize, vsize);
|
||||
|
Reference in New Issue
Block a user