Home > database >  Qt Quick emulation layer crashed when QtQuick.Controls is imported in QML
Qt Quick emulation layer crashed when QtQuick.Controls is imported in QML

Time:08-04

My ssd died and I had to reinstall Qt, Im using the same version as before (5.15.2, Qt Creator 6.0.2 and MSVC2019). Described problems appears only while using Static build.

  • This type (ApplicationWindow) is not supported as a root (Im not 100% sure if it was fine before reinstall)

  • Invalid property name "title, maximumHeight, maximumWidth, minimumHeight, minimumWidth".

  • And finally after resolving (Changed from ApplicationWindow to Window, and commented Invalid Properties) these two errors I got: Line 1: Qt Quick emulation layer crashed. I attached a debugger to Qt Creator and it's 0xC0000005 on Editor, Preview and Render.

I tested it in both ways, with latest Qt Creator (installed before making Static kit because it will wipe my Qt directory) and with Qt Creator 6.0.2 (installed after making Static kit). To compile Static Kit I used this script, but after some problems (jom and jom install did not create any files in QtInstallDir) I just run configure.bat by myself, and then jom and jom install and files were in their place.

The solution can be:

  • Designing using diffrent kit with Window and then on release change Kit to static, change Window to ApplicationWindow (Im using onClosing from ApplicationWindow).

but it's dirty and I personally do not like it. Is there any other solution?

EDIT: non-static versions are fine (self-compiled and one from MaintenanceTool).

Static configure.bat:

configure.bat -prefix %QTINSTALLDIR% -platform %PLATFORM% -opensource -debug-and-release -confirm-license -opengl dynamic -mp -static -static-runtime -no-shared -qt-libpng -qt-libjpeg -qt-zlib -qt-pcre -no-compile-examples -nomake examples -no-icu -optimize-size -qt-sqlite -openssl-linked OPENSSL_PREFIX=%SSLINSTALLDIR%

Non-static configure.bat:

configure.bat -prefix %QTINSTALLDIR% -platform %PLATFORM% -opensource -debug-and-release -confirm-license -opengl dynamic -mp -no-compile-examples -nomake examples -optimize-size -qt-sqlite

Diffrence:

-static -static-runtime -no-shared -qt-libpng -qt-libjpeg -qt-zlib -qt-pcre -openssl-linked OPENSSL_PREFIX=<location>

CodePudding user response:

Okay, I fixed the Invalid property name .., I dont know what really fixed it but:

  • I had wrong versions of requirements. I was on latest of Ruby, Python etc.
  • I installed Submodules one more time using script linked in main post and then installed them one by one by my own hands using qmake then jom clean all then jom install.

Also I found that the Line 1: Qt Quick emulation layer crashed. error appear only when I have QtQuick.Controls <any_version> in imports. Im still trying to fix this.

Fixed. I did this by doing those steps:

  • In maintenance tool I downloaded Mingw64 and Mingw64 for 5.15.2 and for "Tools".
  • I did an static mingw build using this powershell script: https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
  • I saw that the script is changing qmake.conf files in mkspecs folder. I ran this MSVC script to make MSVC Static build and after unzipping QtBase I modified qmake.conf in mkspecs/winrt-x64-msvc2019 and in mkspecs/win32-msvc.
QMAKE_LFLAGS  = -static
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE  = -Os
DEFINES  = QT_STATIC_BUILD
  • Then the qt setup and qt build command, when build is finished I modified the (THIS TIME IN PREFIX LOCATION / LOCATION WHERE QT STATIC IS INSTALLED) qmake.conf in mkspecs/winrt-x64-msvc2019 and in mkspecs/win32-msvc
CONFIG  = static
  • Run Qt Creator and the Designer is fine.
  • Related