Hello!

I've got problem with passing arguments from command line to application:

Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "mainwindow.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8.  
  9. w.show();
  10.  
  11. w.myVariable = QString(argv[1]).toInt();
  12.  
  13. return a.exec();
  14. }
To copy to clipboard, switch view to plain text mode 

myVariable is public. And it has very weird values. When I pass that argument to function which is printing that value on console at startup everything is ok. How can I do it?

thanks in advance
best regards
Tomasz