-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 'Move selected to top' breaks attribute table sorting #58901
Fix 'Move selected to top' breaks attribute table sorting #58901
Conversation
…ttribute table dialog breaks the current sort column and sort order due to the column and order being hard-coded to 0 and Qt::AscendingOrder respectively.
Good catch! Looking through the git history, it seemed a bunch of cleanups have happened to this function over time which resulted in the current bug. Would you be able to extend the tests in TestQgsAttributeTable::testSelectedOnTop() to cover this fix too? |
No worries @nyalldawson, can do. I will have a look after work. |
Tests added. I think this is enough to adequately test the bug fix, but it's been a long day so hopefully I haven't made any blunders in checking the feature orders! |
Great work, thanks @benwirf ! |
Thanks @nyalldawson! :-) |
Description
Recently I noticed that toggling the 'Move selected to top' action in the attribute table dialog, breaks any existing sort column and sort order; the sorting is always reset to ascending on the first column.
Looking at the code, it seems that the sort column and order was hard-coded to 0 and
Qt::AscendingOrder
respectively. The existing sort column and order is retrieved but not used:Unless I'm missing something, shouldn't we be passing the
column
andorder
values to thesort()
call?Screencast before:
Screencast after proposed fix: