Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.14.0, 5.14.2, 5.15.0, 6.2.4, 6.3.0
-
None
-
Fedora 32 Linux, CMake, QtCreator 4.12.2
-
-
5
-
e48b4d2b7c1d99ba8962a9c10a1508d16dc33fbf
-
Team B Foundation Sprint 55, Team B Foundation Sprint 56
Description
Not certain whether this is a bug or intended but I noticed that when converting Hex/Octal/Binary strings to their int values I can convert hex using as either "0x64" or "64", Octal using either "0144" or "144", but Binary only using "1100100". If I use "0b1100100" I get a failure.
QString t = "0b1100100";
bool ok = false;
int i;
// t = t.mid(2);
i = t.toInt(&ok, 2);
gives i == 0 and ok == false. With the t=t.mid(2) to strip the Ob off if gives the correct value of 100 (decimal) and ok == true.