Unsolved Crash when using QKeySequence as global constant
-
Following program crashes:
#include <QtGui/qkeysequence.h> inline const QKeySequence my_key_sequence = Qt::CTRL + Qt::Key_E; inline const QKeySequence my_other_key_sequence = QKeySequence::Copy; int main() {}
Why does it crash and how do I get around this?
-
@Kerndog73 said in Crash when using QKeySequence as global constant:
Why does it crash and how do I get around this?
It crashes because QKeySequence (like most other gui classes) need a QGuiApplication instance to work properly.
Simply don't create any global static at all.