Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.9.0, 6.9.1
Description
QString::arg() converts float wrapper type using type conversion operator to integer, the same goes for double. This issue is not present in Qt 6.8
#include <QCoreApplication> #include <QDebug> class MyFloat { float value; public: MyFloat(float f0) : value(f0) {} // Type conversion operator operator float() { return value; } }; int main(int argc, char** argv) { QCoreApplication app(argc, argv); MyFloat mf = 5.1; auto var = QString("%1").arg(mf); qInfo() << ((var == "5.1") ? "Equal, var value is: " : "Not Equal, var value is: ") << var; return 0; }