forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user