sonysan
27th May 2015, 10:46
Hello @all,
guess, what I get as output if I try to run this simple code?!
QString test_str = QString("20%1").arg(5, 2, 10, '0');
qDebug("%s", qPrintable(test_str));
if I use MingW4.8.3 and Qt5.3 on win7 64bit, then I got compiler warnings:
Warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default]
QString test_str = QString("20%1").arg(5, 2, 10, '0');
^
But if I modify it to:
QString test_str = QString("20%1").arg(5, 2, 10, QChar('0');
then it works fine.
I am trying to understand, and your help is welcome!
Best Regards!
guess, what I get as output if I try to run this simple code?!
QString test_str = QString("20%1").arg(5, 2, 10, '0');
qDebug("%s", qPrintable(test_str));
if I use MingW4.8.3 and Qt5.3 on win7 64bit, then I got compiler warnings:
Warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default]
QString test_str = QString("20%1").arg(5, 2, 10, '0');
^
But if I modify it to:
QString test_str = QString("20%1").arg(5, 2, 10, QChar('0');
then it works fine.
I am trying to understand, and your help is welcome!
Best Regards!