user's arguments are empty with QCoreApplication in mysterious cases user's arguments are empty with QCoreApplication in mysterious cases linux linux

user's arguments are empty with QCoreApplication in mysterious cases


Q(Core)Application wants argc and argv by reference, so your constructor should read

Diagramm(int& argc, char **argv[])

If you don't to this, it may work in some cases and lead to segfaults or strange behavior in others, as you encountered. Seems to be a common error and isn't easy to spot when reading the documentation.


arguments() is a static function so the line should be:

QStringList arguments = QCoreApplication::arguments();