Hi,

i have Qt 4.7.1 and VS2010 Express

the following code crashes with no reason:
Qt Code:
  1. #include "QApplication"
  2. #include <QtCore>
  3.  
  4. void test( )
  5. {
  6. QVariant v, v2;
  7. QList<QVariant> list;
  8. v.setValue(1); // init variant with integer = 1
  9. list.append(v); // add variant to list
  10. v2.setValue(list); // add list to variant
  11. qDebug() << v;
  12. qDebug() << list;
  13. qDebug() << v2;
  14. // leaving this function will crash with a corrupted heap
  15. // output see below
  16. }
  17.  
  18. int main( int argc , char *argv[] )
  19. {
  20. test();
  21. QApplication app(argc, argv);
  22. return app.exec();
  23. }
To copy to clipboard, switch view to plain text mode 

my output:
Qt Code:
  1. QVariant(int, 1)
  2. (QVariant(int, 1) )
  3. QVariant(QVariantList, (QVariant(int, 1) ) )
To copy to clipboard, switch view to plain text mode 

after the crash it points me to "qguivariant.cpp" line 280:
Qt Code:
  1. qcoreVariantHandler()->clear(d);
To copy to clipboard, switch view to plain text mode 

any help ?
thanks