diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2020-10-27 10:11:31 +0100 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2020-11-19 11:28:44 +0000 |
commit | 98666c8afc80cccb80ca4426b97ec52916c6e610 (patch) | |
tree | 003ed8422f2c8a7a6c8a2a52a0565208ffdeda1b /src/tools | |
parent | 0732c5917d5441f901c6789056066b25cd263103 (diff) |
Change QString formatting of negative numbers in non-base-10
For bases other than 10, negative numbers have been converted
to QString by casting them to an unsigned number and
converting that. Thus QString::number(-17, 16) returned
"0xffffffffffffffef", for example.
This patch changes the behavior so that
negative numbers are converted like positive numbers.
Additinally, this patch adds unit tests for QString::number.
[ChangeLog][Important Behavior Changes]
Changed QString::number(integer, base) for negative numbers
and bases other than 10 to return the string corresponding
to the absolute value, prefixed by "-".
Fixes: QTBUG-53706
Change-Id: I0ad3ca3f035d553860b262f5bec17dc81714d8ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools')
0 files changed, 0 insertions, 0 deletions