diff --git a/src/plugins/scxmleditor/common/navigator.cpp b/src/plugins/scxmleditor/common/navigator.cpp index c6fa76169b1..f9dc6095c3c 100644 --- a/src/plugins/scxmleditor/common/navigator.cpp +++ b/src/plugins/scxmleditor/common/navigator.cpp @@ -53,13 +53,13 @@ void Navigator::setCurrentView(GraphicsView *view) m_currentView = view; if (m_currentView) { - connect(m_currentView, &GraphicsView::viewChanged, m_ui.m_navigatorView, &NavigatorGraphicsView::setMainViewPolygon); - connect(m_currentView, &GraphicsView::zoomPercentChanged, m_ui.m_navigatorSlider, &NavigatorSlider::setSliderValue); + connect(m_currentView.data(), &GraphicsView::viewChanged, m_ui.m_navigatorView, &NavigatorGraphicsView::setMainViewPolygon); + connect(m_currentView.data(), &GraphicsView::zoomPercentChanged, m_ui.m_navigatorSlider, &NavigatorSlider::setSliderValue); - connect(m_ui.m_navigatorSlider, &NavigatorSlider::valueChanged, m_currentView, &GraphicsView::zoomTo); - connect(m_ui.m_navigatorView, &NavigatorGraphicsView::moveMainViewTo, m_currentView, &GraphicsView::moveToPoint); - connect(m_ui.m_navigatorView, &NavigatorGraphicsView::zoomIn, m_currentView, &GraphicsView::zoomIn); - connect(m_ui.m_navigatorView, &NavigatorGraphicsView::zoomOut, m_currentView, &GraphicsView::zoomOut); + connect(m_ui.m_navigatorSlider, &NavigatorSlider::valueChanged, m_currentView.data(), &GraphicsView::zoomTo); + connect(m_ui.m_navigatorView, &NavigatorGraphicsView::moveMainViewTo, m_currentView.data(), &GraphicsView::moveToPoint); + connect(m_ui.m_navigatorView, &NavigatorGraphicsView::zoomIn, m_currentView.data(), &GraphicsView::zoomIn); + connect(m_ui.m_navigatorView, &NavigatorGraphicsView::zoomOut, m_currentView.data(), &GraphicsView::zoomOut); } } diff --git a/src/plugins/scxmleditor/common/search.cpp b/src/plugins/scxmleditor/common/search.cpp index 37273a8ef9e..52178b1e960 100644 --- a/src/plugins/scxmleditor/common/search.cpp +++ b/src/plugins/scxmleditor/common/search.cpp @@ -75,7 +75,7 @@ void Search::setDocument(ScxmlDocument *document) void Search::setGraphicsScene(GraphicsScene *scene) { m_scene = scene; - connect(m_ui.m_searchView, &ScxmlEditor::OutputPane::TableView::mouseExited, m_scene, &GraphicsScene::unhighlightAll); + connect(m_ui.m_searchView, &ScxmlEditor::OutputPane::TableView::mouseExited, m_scene.data(), &GraphicsScene::unhighlightAll); } void Search::rowEntered(const QModelIndex &index) diff --git a/src/plugins/scxmleditor/common/shapestoolbox.cpp b/src/plugins/scxmleditor/common/shapestoolbox.cpp index a9489c44c15..632cdd7371e 100644 --- a/src/plugins/scxmleditor/common/shapestoolbox.cpp +++ b/src/plugins/scxmleditor/common/shapestoolbox.cpp @@ -49,7 +49,7 @@ void ShapesToolbox::setUIFactory(ScxmlEditor::PluginInterface::ScxmlUiFactory *f QTC_ASSERT(factory, return); m_shapeProvider = static_cast(factory->object("shapeProvider")); - connect(m_shapeProvider, &PluginInterface::ShapeProvider::changed, this, &ShapesToolbox::initView); + connect(m_shapeProvider.data(), &PluginInterface::ShapeProvider::changed, this, &ShapesToolbox::initView); initView(); } diff --git a/src/plugins/scxmleditor/common/structuremodel.cpp b/src/plugins/scxmleditor/common/structuremodel.cpp index f1fd35c945f..a0ee760547a 100644 --- a/src/plugins/scxmleditor/common/structuremodel.cpp +++ b/src/plugins/scxmleditor/common/structuremodel.cpp @@ -50,8 +50,8 @@ void StructureModel::setDocument(ScxmlDocument *document) m_document = document; if (m_document) { - connect(m_document, &ScxmlDocument::beginTagChange, this, &StructureModel::beginTagChange); - connect(m_document, &ScxmlDocument::endTagChange, this, &StructureModel::endTagChange); + connect(m_document.data(), &ScxmlDocument::beginTagChange, this, &StructureModel::beginTagChange); + connect(m_document.data(), &ScxmlDocument::endTagChange, this, &StructureModel::endTagChange); } endResetModel(); } diff --git a/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp b/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp index c3f95cd4ea9..4e531934587 100644 --- a/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp +++ b/src/plugins/scxmleditor/plugin_interface/graphicsscene.cpp @@ -313,8 +313,8 @@ void GraphicsScene::setDocument(ScxmlDocument *document) void GraphicsScene::connectDocument() { if (m_document) { - connect(m_document, &ScxmlDocument::beginTagChange, this, &GraphicsScene::beginTagChange); - connect(m_document, &ScxmlDocument::endTagChange, this, &GraphicsScene::endTagChange); + connect(m_document.data(), &ScxmlDocument::beginTagChange, this, &GraphicsScene::beginTagChange); + connect(m_document.data(), &ScxmlDocument::endTagChange, this, &GraphicsScene::endTagChange); } } diff --git a/src/plugins/scxmleditor/plugin_interface/warningitem.cpp b/src/plugins/scxmleditor/plugin_interface/warningitem.cpp index 8ac3dc03707..12c0bef5940 100644 --- a/src/plugins/scxmleditor/plugin_interface/warningitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/warningitem.cpp @@ -44,7 +44,7 @@ WarningItem::WarningItem(QGraphicsItem *parent) if (sc) { sc->addWarningItem(this); m_warningModel = sc->warningModel(); - connect(m_warningModel, &OutputPane::WarningModel::modelCleared, this, &WarningItem::check); + connect(m_warningModel.data(), &OutputPane::WarningModel::modelCleared, this, &WarningItem::check); } setWarningActive(false); } @@ -82,7 +82,7 @@ QVariant WarningItem::itemChange(GraphicsItemChange change, const QVariant &valu if (sc) { sc->addWarningItem(this); m_warningModel = sc->warningModel(); - connect(m_warningModel, &OutputPane::WarningModel::modelCleared, this, &WarningItem::check); + connect(m_warningModel.data(), &OutputPane::WarningModel::modelCleared, this, &WarningItem::check); } break; } @@ -141,7 +141,7 @@ void WarningItem::setWarningActive(bool active) { if (active && !m_warning && m_warningModel) { m_warning = m_warningModel->createWarning(m_severity, m_typeName, m_reason, m_description); - connect(m_warning, &OutputPane::Warning::dataChanged, this, &WarningItem::checkVisibility); + connect(m_warning.data(), &OutputPane::Warning::dataChanged, this, &WarningItem::checkVisibility); } else if (!active && m_warning) { m_warning->deleteLater(); m_warning = nullptr; diff --git a/src/plugins/scxmleditor/scxmleditordocument.cpp b/src/plugins/scxmleditor/scxmleditordocument.cpp index 7a496dc3339..d7c09b9e883 100644 --- a/src/plugins/scxmleditor/scxmleditordocument.cpp +++ b/src/plugins/scxmleditor/scxmleditordocument.cpp @@ -52,7 +52,7 @@ ScxmlEditorDocument::ScxmlEditorDocument(MainWidget *designWidget, QObject *pare // Designer needs UTF-8 regardless of settings. setCodec(QTextCodec::codecForName("UTF-8")); - connect(m_designWidget, &Common::MainWidget::dirtyChanged, this, [this]{ + connect(m_designWidget.data(), &Common::MainWidget::dirtyChanged, this, [this]{ emit changed(); }); }