Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QQuickView crash,is it a bug?
Forum Update on Monday, May 27th 2025

QQuickView crash,is it a bug?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
16 Posts 4 Posters 3.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JohnDaYe
    wrote on last edited by
    #1

    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

    K 1 Reply Last reply
    0
    • J JohnDaYe

      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

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @JohnDaYe

      Both vs 2017 and MinGW compilations are done through Qt creator?

      If yes, try to rerun qmake and rebuild.

      Vote the answer(s) that helped you to solve your issue(s)

      J 2 Replies Last reply
      1
      • J Offline
        J Offline
        JohnDaYe
        wrote on last edited by JohnDaYe
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • K koahnig

          @JohnDaYe

          Both vs 2017 and MinGW compilations are done through Qt creator?

          If yes, try to rerun qmake and rebuild.

          J Offline
          J Offline
          JohnDaYe
          wrote on last edited by
          #4

          @koahnig i use Qt Creator to create project and complie

          1 Reply Last reply
          0
          • K koahnig

            @JohnDaYe

            Both vs 2017 and MinGW compilations are done through Qt creator?

            If yes, try to rerun qmake and rebuild.

            J Offline
            J Offline
            JohnDaYe
            wrote on last edited by
            #5

            @koahnig rebuild can not reslove this problem!

            K 1 Reply Last reply
            0
            • J JohnDaYe

              @koahnig rebuild can not reslove this problem!

              K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              @JohnDaYe

              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.

              Vote the answer(s) that helped you to solve your issue(s)

              J 1 Reply Last reply
              0
              • mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #7

                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.

                J 1 Reply Last reply
                0
                • mrjjM mrjj

                  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.

                  J Offline
                  J Offline
                  JohnDaYe
                  wrote on last edited by
                  #8

                  @mrjj look at my c++ code
                  i use quickview not xxxengine

                  mrjjM 1 Reply Last reply
                  0
                  • K koahnig

                    @JohnDaYe

                    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.

                    J Offline
                    J Offline
                    JohnDaYe
                    wrote on last edited by JohnDaYe
                    #9

                    @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++

                    1 Reply Last reply
                    0
                    • J JohnDaYe

                      @mrjj look at my c++ code
                      i use quickview not xxxengine

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by mrjj
                      #10

                      @JohnDaYe
                      Ah, yes. tried your sample.
                      It work fine here.
                      alt text

                      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

                      J 1 Reply Last reply
                      0
                      • mrjjM mrjj

                        @JohnDaYe
                        Ah, yes. tried your sample.
                        It work fine here.
                        alt text

                        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

                        J Offline
                        J Offline
                        JohnDaYe
                        wrote on last edited by JohnDaYe
                        #11

                        @mrjj thanks!
                        maybe it is caused by opengl driver! god knows。

                        mrjjM 1 Reply Last reply
                        0
                        • J JohnDaYe

                          @mrjj thanks!
                          maybe it is caused by opengl driver! god knows。

                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by mrjj
                          #12

                          @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

                          J 2 Replies Last reply
                          0
                          • mrjjM mrjj

                            @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

                            J Offline
                            J Offline
                            JohnDaYe
                            wrote on last edited by JohnDaYe
                            #13

                            @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?

                            S 1 Reply Last reply
                            0
                            • mrjjM mrjj

                              @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

                              J Offline
                              J Offline
                              JohnDaYe
                              wrote on last edited by
                              #14

                              @mrjj mingw is ok in the same environment!emm

                              1 Reply Last reply
                              0
                              • mrjjM Offline
                                mrjjM Offline
                                mrjj
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                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

                                1 Reply Last reply
                                1
                                • J JohnDaYe

                                  @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?

                                  S Offline
                                  S Offline
                                  Shadow Won
                                  wrote on last edited by
                                  #16

                                  @JohnDaYe Maybe you can explicitly set the scenegraph backend to Direct3D, just add

                                  QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Direct3D12);
                                  

                                  before any QQuickWindow is created

                                  1 Reply Last reply
                                  0

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved