Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

Reported by @gmaxwell
The sort order for the amount column is lexicographical resulting in a order like "1 10 2 20 200 3 ...".

The attempts of this PR is to fix this.

// amount
itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->vout[out.i].nValue));
itemOutput->setText(COLUMN_AMOUNT_INT64, strPad(QString::number(out.tx->vout[out.i].nValue), 15, " ")); // padding so that sorting works correctly
itemOutput->setData(COLUMN_AMOUNT_INT64, Qt::DisplayRole, QVariant((qlonglong)out.tx->vout[out.i].nValue)); // padding so that sorting works correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get rid of the hidden _INT64 columns completely, they should no longer be necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: function strPad can go after this.

@laanwj
Copy link
Member

laanwj commented Nov 18, 2016

Working on a patch

@laanwj
Copy link
Member

laanwj commented Nov 18, 2016

Please cherry-pick the top commit from: https://github.com/laanwj/bitcoin/tree/2016_11_trol_cleanup into this. I've done some further cleanups and fixes:

  • Do sorting for date, amount and confirmations column as longlong, not unsigned longlong.
  • Use UserRole to store our own data for sorting. This makes it treated as ancillary data prevents it from being displayed.
  • Get rid of getMappedColumn strPad - these are no longer necessary.
  • Get rid of hidden _INT64 columns.
  • Start column enumeration from 0 (otherwise values are undefined).

- Do sorting for date, amount and confirmations column as longlong, not
  unsigned longlong.
- Use `UserRole` to store our own data. This makes it treated as
  ancillary data prevents it from being displayed.
- Get rid of `getMappedColumn` `strPad` - these are no longer necessary.
- Get rid of hidden `_INT64` columns.
- Start enumeration from 0 (otherwise values are undefined).
@jonasschnelli
Copy link
Contributor Author

Thanks @laanwj!
Cherry picked your 4231032

@laanwj
Copy link
Member

laanwj commented Nov 21, 2016

@gmaxwell Can you please test this in your environment and confirm whether the problem is fixed?

@jonasschnelli
Copy link
Contributor Author

Tested ACK (Ubuntu) after @laanwj commit.
Binaries: https://bitcoin.jonasschnelli.ch/pulls/9185/

Waiting for @gmaxwell's re-test

bildschirmfoto 2016-11-21 um 13 55 27

@gmaxwell
Copy link
Contributor

tested ACK!

@jonasschnelli jonasschnelli merged commit 4231032 into bitcoin:master Nov 22, 2016
jonasschnelli added a commit that referenced this pull request Nov 22, 2016
4231032 [Qt] Clean up and fix coincontrol tree widget handling (Wladimir J. van der Laan)
76af4eb [Qt] fix coincontrol sort issue (Jonas Schnelli)
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 2, 2016
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 2, 2016
- Do sorting for date, amount and confirmations column as longlong, not
  unsigned longlong.
- Use `UserRole` to store our own data. This makes it treated as
  ancillary data prevents it from being displayed.
- Get rid of `getMappedColumn` `strPad` - these are no longer necessary.
- Get rid of hidden `_INT64` columns.
- Start enumeration from 0 (otherwise values are undefined).

Github-Pull: bitcoin#9185
Rebased-From: 4231032
codablock pushed a commit to codablock/dash that referenced this pull request Jan 15, 2018
4231032 [Qt] Clean up and fix coincontrol tree widget handling (Wladimir J. van der Laan)
76af4eb [Qt] fix coincontrol sort issue (Jonas Schnelli)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
4231032 [Qt] Clean up and fix coincontrol tree widget handling (Wladimir J. van der Laan)
76af4eb [Qt] fix coincontrol sort issue (Jonas Schnelli)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 24, 2019
4231032 [Qt] Clean up and fix coincontrol tree widget handling (Wladimir J. van der Laan)
76af4eb [Qt] fix coincontrol sort issue (Jonas Schnelli)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants