diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-01 11:27:38 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-01 12:11:58 +0200 |
commit | 07b9ccd98b4d6598ba705800588feb63d9fb22cc (patch) | |
tree | 9c24838fe533027809bcb5f927af8cd925a31c4b /src/designer/src/components | |
parent | d9db7d6aaa9ada14a933043362998f31e26395d0 (diff) | |
download | qttools-07b9ccd98b4d6598ba705800588feb63d9fb22cc.tar.gz |
Qt Designer/signal slot editor: Improve adding new connections
Ensure new connections are visible and selected.
The order of statements in Add/DeleteConnectionCommand
needs to be changed for the model indexes to be valid.
Change-Id: Ib66ab86a085e47829cc5c8c0c6da78c9a7321748
Pick-to: 5.15
Task-number: QTBUG-82924
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer/src/components')
-rw-r--r-- | src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index ef70f0cc4..f9de8f5a1 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -774,9 +774,10 @@ void SignalSlotEditorWindow::updateDialogSelection(Connection *con) return; QModelIndex index = m_proxy_model->mapFromSource(m_model->connectionToIndex(con)); - if (index == m_view->currentIndex()) + if (!index.isValid() || index == m_view->currentIndex()) return; m_handling_selection_change = true; + m_view->scrollTo(index, QTreeView::EnsureVisible); m_view->setCurrentIndex(index); m_handling_selection_change = false; |