Skip to content

Commit 90c365e

Browse files
committed
Fixed a warning from QObject::disconnect
Make sure the active tool is deactivated before switching its MapDocument, rather than after.
1 parent d025687 commit 90c365e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tiled/mapeditor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ void MapEditor::setCurrentDocument(Document *document)
367367
mWidgetStack->setCurrentWidget(mapView);
368368

369369
mLayerDock->setMapDocument(mapDocument);
370-
mToolManager->setMapDocument(mapDocument);
371370

372371
if (mZoomable) {
373372
mZoomable->setComboBox(nullptr);
@@ -408,6 +407,9 @@ void MapEditor::setCurrentDocument(Document *document)
408407
mapScene->disableSelectedTool();
409408
mViewWithTool = nullptr;
410409
}
410+
411+
mToolManager->setMapDocument(mapDocument);
412+
411413
if (mapView) {
412414
MapScene *mapScene = mapView->mapScene();
413415
mapScene->setSelectedTool(mSelectedTool);

0 commit comments

Comments
 (0)