Skip to content
Snippets Groups Projects
Commit a98faf95 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

app: detect and abort/core dump on Qt runtime version mismatch

Catch Qt binary incompatibility.

Change-Id: I30e1de97bd658fc570ac89115d1aa8a37f53952a
parent 0140f72d
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,13 @@ ScreenInfo::setCurrentFocusWindow(QWindow* window)
MainApplication::MainApplication(int& argc, char** argv)
: QApplication(argc, argv)
{
const char* qtVersion = qVersion();
qInfo() << "Using Qt runtime version:" << qtVersion << " - "
<< strnlen(qtVersion, sizeof qtVersion);
if (strncmp(qtVersion, QT_VERSION_STR, strnlen(qtVersion, sizeof qtVersion)) != 0) {
qFatal(QString("Qt build version mismatch!(%1)").arg(QT_VERSION_STR).toLatin1());
}
parseArguments();
QObject::connect(this, &QApplication::aboutToQuit, [this] { cleanup(); });
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment