$ 0 0 did you add QT += widgets in your pro file in the first place ? You also need to use a QApplication rather than a QGuiApplication