argc change value when calling Qcoreapplication::arguments()
-
Hi,
I have a class App deriving from QApplication and
with contructor App::App( int& argc, char *argv[] )
In one of the member of the class App, I am doing
QStringList Args = QCoreApplication::arguments();
When I run my application I know that app is created with
argc at 0 anf argv at "" .
I have a crash when I call QCoreApplication::arguments().
I traced the problem until const int ac = self->d_func()->argc;
where ac will contain a value greater than 0 ( never the same).
I don't change argc at the application levelI see that argc and self->d_func()->argc have the same adress but I cannot see where argc value changed.
Any idea?Thierry
-
@Flotisable Yes, at the first position in argv there should be the name of the executable.
@tmas how do you use your App class? -
From http://doc.qt.io/qt-5/qcoreapplication.html#QCoreApplication
Warning: [...] argc must be greater than zero and argv must contain at least one valid character string.
-
This post is deleted!