Hello!
I've got problem with passing arguments from command line to application:
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
MainWindow w;
w.show();
w.
myVariable = QString(argv
[1]).
toInt();
return a.exec();
}
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
w.myVariable = QString(argv[1]).toInt();
return a.exec();
}
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
Bookmarks