QmlDesigner: avoid extra widgetInfo() call

widgetInfo() should be cheap but people make expensive stuff inside the
call. So we should try to avoid to many calls.

Change-Id: I66b0a5431471732dca934fc03efb307e2617fd65
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2024-03-13 13:38:00 +01:00
parent f8d74b5a05
commit 0cd74fe22e

View File

@@ -567,8 +567,10 @@ void AbstractView::disableWidget()
void AbstractView::enableWidget()
{
if (hasWidget() && widgetInfo().widgetFlags == DesignerWidgetFlags::DisableOnError)
widgetInfo().widget->setEnabled(true);
if (hasWidget()) {
if (auto info = widgetInfo(); info.widgetFlags == DesignerWidgetFlags::DisableOnError)
info.widget->setEnabled(true);
}
}
QString AbstractView::contextHelpId() const