Fix segmentation fault in Qt

Fixes segmentation fault due to uninitialized variables (#3344). The code is a copy paste from NativeApp.cpp