Unsolved QQuickView crash,is it a bug?
-
I create a test project and write a few code with quickview or quickwidget on windows, but program will crashed which is complied by vs toolchain,but mingw ok?
#include <QGuiApplication> #include <QApplication> #include <QQmlApplicationEngine> #include <QtQuick/QQuickView> #include <QtQuickWidgets/QQuickWidget> int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); QQuickWidget view(QUrl("qrc:\\main.qml")); view.show(); return app.exec(); }
qml
import QtQuick 2.9 import QtQuick.Window 2.2 Rectangle { visible: true width: 640 height: 480 color: "red" }
i use vs 2017 and qt 5.11.0
-
Both vs 2017 and MinGW compilations are done through Qt creator?
If yes, try to rerun qmake and rebuild.
-
This post is deleted! -
@koahnig i use Qt Creator to create project and complie
-
@koahnig rebuild can not reslove this problem!
-
Then you would need to debug and check where it crashes.
You need to give more details as the actual error message. Especially if it is already during start-up or later on is important.
-
Hi
Also, i wondering if that qml can work ?
I mean its just rectangle. not a window.Using
import QtQuick 2.9 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") Rectangle { visible: true width: 640 height: 480 color: "red" } }
Both works in mingw and visual studio for me.
-
@mrjj look at my c++ code
i use quickview not xxxengine -
@koahnig Vesion of my Qt is 5.9.5
HEAP[untitled1.exe]: Invalid allocation size - 646f72700000001f (exceeded 7ffffffdefff)
0x00007FFD471DA388 ( untitled1.exe ) Microsoft C++ exception: std::bad_alloc,0x000000DBD48FD2C0 。
0x00007FFD031DBB6B (ig9icd64.dll) (untitled1.exe ): 0xC0000005: read 0xFFFFFFFFFFFFFFFF 。
0x00007FFD031DBB6B (ig9icd64.dll) (untitled1.exe ): 0xC0000005: 0xFFFFFFFFFFFFFFFF 。stack:
ig9icd64.dll!00007ffd031dbb6b()
ig9icd64.dll!00007ffd031dc670()
ig9icd64.dll!00007ffd031dde9a()
ig9icd64.dll!00007ffd031d888f()
ig9icd64.dll!00007ffd02d74bb0()
ig9icd64.dll!00007ffd02ec87d2()
ig9icd64.dll!00007ffd02e6edf0()
untitled1.exe!QOpenGLExtraFunctions::glProgramBinary(unsigned int program, unsigned int binaryFormat, const void * binary, int length) 1177 C++ -
@JohnDaYe
Ah, yes. tried your sample.
It work fine here.
I dont have vs 2017 so cant test if that makes a difference.
here is complete test sample if anyone can see if reproducible with 2017
https://www.dropbox.com/s/1mul34tc2ed8qij/qmltest.zip?dl=0 -
@mrjj thanks!
maybe it is caused by opengl driver! god knows。 -
@JohnDaYe
Well it looks a bit like that
ig9icd64 is as far as i know intel graphics driver.What spooks me is that mingw should use same driver but it could be some
incompatibilities with vs run time and the driver.
it gives bad_alloc.You could go see if newer driver is available from their site.
(if you indeed has Intel gfx:)Also it sort of sounds like this bug
https://bugreports.qt.io/browse/QTBUG-66915 -
@mrjj yes,I update my intel driver(old driver is from microsoft with Win10),everything is be ok! but i can not let my customer to do this!
Is there a way that let QQuickview use Direct3D? -
@mrjj mingw is ok in the same environment!emm
-
Direct3D
Well there is https://doc-snapshots.qt.io/qt5-5.9/qtquick-visualcanvas-adaptations-d3d12.html
but dont know how well it works.Im not sure there is other fix than new drivers.
seems to be certain version of intel gfx
https://bugreports.qt.io/browse/QTBUG-64697 -
@JohnDaYe Maybe you can explicitly set the scenegraph backend to Direct3D, just add
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Direct3D12);
before any QQuickWindow is created