Hello.

I have compiled Qt for 64-bit architecture under windows and all works fine except QtScript. The following simple code, working perfectly with 32-bit Qt for windows installed from qtsoftware.com, crashes if compiled with 64-bit Qt . Maybe it's an error in my code? Or Qt is not compatible with 64-bit? Or it is a bug and i need to submit it somehow?

Qt console project.
main.h

Qt Code:
  1. #pragma once
  2.  
  3. #include <QObject>
  4. #include <QScriptEngine>
  5.  
  6. class Script : public QObject
  7. {
  8. Q_OBJECT;
  9. public slots: void Test();
  10. private: QScriptEngine m_oEngine;
  11. };
  12.  
  13. class App : public QObject
  14. {
  15. Q_OBJECT;
  16. signals: void ScriptTest();
  17. protected: void timerEvent( QTimerEvent* );
  18. };
To copy to clipboard, switch view to plain text mode 

main.cpp

Qt Code:
  1. #include <QtCore/QCoreApplication>
  2. #include <QThread>
  3. #include "main.h"
  4.  
  5. void Script::Test()
  6. {
  7. QString sScript = "function OnStart() { var a = [ [ 0 ] ]; "
  8. "for( var i = 0; i < 3; i ++ ) { for( var j = 0; j < 100; j ++ ) "
  9. "{ \"a\" + a[ 0 ][ 0 ]; } } }";
  10. m_oEngine.evaluate( sScript );
  11. QScriptValue oFnStart = m_oEngine.evaluate( "OnStart" );
  12. oFnStart.call();
  13. }
  14.  
  15. void App::timerEvent( QTimerEvent* ) { ScriptTest(); }
  16.  
  17. int main(int argc, char *argv[])
  18. {
  19. QCoreApplication a(argc, argv);
  20. QThread scriptThread;
  21. scriptThread.start();
  22. Script script;
  23. script.moveToThread( & scriptThread );
  24. App app;
  25. script.connect( & app, SIGNAL( ScriptTest() ), SLOT( Test() ) );
  26. app.startTimer( 50 );
  27. return a.exec();
  28. }
To copy to clipboard, switch view to plain text mode