forked from qt-creator/qt-creator
QmlDesigner: Fix crashes on mode change
Fixes: QDS-8129 Change-Id: Iea76157c58f663244e8fd8de8ea26392d2b49b43 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -310,6 +310,9 @@ void MaterialBrowserView::modelAttached(Model *model)
|
|||||||
|
|
||||||
void MaterialBrowserView::refreshModel(bool updateImages)
|
void MaterialBrowserView::refreshModel(bool updateImages)
|
||||||
{
|
{
|
||||||
|
if (!model())
|
||||||
|
return;
|
||||||
|
|
||||||
ModelNode matLib = modelNodeForId(Constants::MATERIAL_LIB_ID);
|
ModelNode matLib = modelNodeForId(Constants::MATERIAL_LIB_ID);
|
||||||
QList <ModelNode> materials;
|
QList <ModelNode> materials;
|
||||||
|
|
||||||
@@ -461,7 +464,7 @@ void MaterialBrowserView::nodeRemoved(const ModelNode &removedNode,
|
|||||||
|
|
||||||
void QmlDesigner::MaterialBrowserView::loadPropertyGroups()
|
void QmlDesigner::MaterialBrowserView::loadPropertyGroups()
|
||||||
{
|
{
|
||||||
if (!m_hasQuick3DImport || m_propertyGroupsLoaded)
|
if (!m_hasQuick3DImport || m_propertyGroupsLoaded || !model())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString matPropsPath = model()->metaInfo("QtQuick3D.Material").importDirectoryPath()
|
QString matPropsPath = model()->metaInfo("QtQuick3D.Material").importDirectoryPath()
|
||||||
|
Reference in New Issue
Block a user