diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-01 11:27:38 +0200 |
---|---|---|
committer | cherrypickbot <cherrypickbot@codereview.qt-project.org> | 2020-04-01 19:47:07 +0000 |
commit | 7c0562d06e84febceac0d8f1d36cf4d6e0758398 (patch) | |
tree | 30fd368374e9448224aaff5c270c667102c1c029 /src/designer/src/components | |
parent | 8685a264d6961a759257bb3c8ece0beffca2bd14 (diff) | |
download | qttools-7c0562d06e84febceac0d8f1d36cf4d6e0758398.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.
Cherry-picked from branch: dev
Change-Id: Ib66ab86a085e47829cc5c8c0c6da78c9a7321748
Task-number: QTBUG-82924
Reviewed-by: cherrypickbot
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 70668c362..a7dcc28e7 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -772,9 +772,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; |