diff --git a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp index 3a9a6d9ca..2d0744953 100644 --- a/src/libs/vpropertyexplorer/vpropertyformwidget.cpp +++ b/src/libs/vpropertyexplorer/vpropertyformwidget.cpp @@ -78,8 +78,8 @@ void VPE::VPropertyFormWidget::build() d_ptr->EditorWidgets.clear(); if (layout()) { - QLayoutItem *child = layout()->takeAt(0); - while (layout()->count() > 0 && child != nullptr) + QLayoutItem *child; + while (layout()->count() > 0 && (child = layout()->takeAt(0)) != nullptr) { if (child->widget()) {