question:
QVariant test("10.23"); //define a QVariant object
test.canConvert(QVariant:ateTime)==true ? //the convert is success why?
why ? the test object can convert to datetime ? i do't understand
hope somebody help me ,thank
question:
QVariant test("10.23"); //define a QVariant object
test.canConvert(QVariant:ateTime)==true ? //the convert is success why?
why ? the test object can convert to datetime ? i do't understand
hope somebody help me ,thank
Why shouldnt it be success ??
QVariant supports QDateTime,,, and also QDateTime can form a datetime from string (QDateTime::fromString) . So probably canConvert checks if it can form a valid QDateTime object from string, if valid, it returns success
code is :
QString str="kkk";
QDateTime qdt=QDateTime::fromQString(str);
qdt.canConvert(QVariant:ateTime)==true ?//it's puzzle
why?
Bookmarks