[Qt-interest] QVariant odd behaviour?

Linos info at linos.es
Sat Oct 8 19:45:44 CEST 2011


Hi,
	should not be a return a null QVariant(QVariant::Int) .toString() method
QString("") instead of QString("0"), it seems a bit odd for me, example main.cpp:

#include <iostream>
#include <QtCore>

int main(int argc, char *argv[])
{
    QVariant test(QVariant::Int);
    std::cout << "isNull: " << test.isNull() << " toString: " <<
qPrintable(test.toString()) << std::endl;
}

When executed prints:

isNull: 1 toString: 0

Regards,
Miguel Angel.



More information about the Qt-interest-old mailing list