Emit dataChanged signal to dynamically re-sort Peers table#375
Merged
hebasto merged 1 commit intobitcoin-core:masterfrom Jul 5, 2021
Merged
Emit dataChanged signal to dynamically re-sort Peers table#375hebasto merged 1 commit intobitcoin-core:masterfrom
hebasto merged 1 commit intobitcoin-core:masterfrom
Conversation
Closed
Member
Author
|
@rebroad Do you mind testing this PR? |
jarolrod
reviewed
Jun 29, 2021
Contributor
jarolrod
left a comment
There was a problem hiding this comment.
ACK 986bf78
Tested on Arch Linux, Ubuntu, macOS 11.3, and Windows 10. The usage of dataChanged here is correct and solves the mentioned issue.
The following screenshots will compare the behavior of master and this PR. Note that the screenshots will sort by Received.
On the master screenshots you will see the ordering get out of whack because it is not dynamically sorting the peers as the data changes.
On the PR screenshots, you will see that the ordering is correct because we now allow to dynamically sort the peers as the data changes.
Ubuntu
| Master | PR |
|---|---|
![]() |
![]() |
macOS
| Master | PR |
|---|---|
![]() |
![]() |
Windows 10
| Master | PR |
|---|---|
![]() |
![]() |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Jul 5, 2021
…-sort Peers table 986bf78 qt: Emit dataChanged signal to dynamically re-sort Peers table (Hennadii Stepanov) Pull request description: [By default](https://doc.qt.io/qt-5/qsortfilterproxymodel.html#details), the `PeerTableSortProxy` > dynamically re-sorts ... data whenever the original model changes. That is not the case on master (8cdf917) as in ecbd911 (#164) no signals are emitted to notify about model changes. This PR uses a dedicated [`dataChanged`](https://doc.qt.io/qt-5/qabstractitemmodel.html#dataChanged) signal. Fixes #367. An alternative to #374. ACKs for top commit: jarolrod: ACK 986bf78 Tree-SHA512: dcb92c2f9a2c632880429e9528007db426d2ad938c64dfa1f1538c03e4b62620df52ad7daf33b582976c67b472ff76bc0dae707049f4bbbd4941232cee9ce3d4
gwillen
pushed a commit
to ElementsProject/elements
that referenced
this pull request
Jun 1, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






By default, the
PeerTableSortProxyThat is not the case on master (8cdf917) as in ecbd911 (#164) no signals are emitted to notify about model changes.
This PR uses a dedicated
dataChangedsignal.Fixes #367.
An alternative to #374.