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. Qt 6.4 application crash in debug with QML Dialog component

Qt 6.4 application crash in debug with QML Dialog component

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 502 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.
  • V Offline
    V Offline
    Volodymyr Mudryk
    wrote on last edited by
    #1

    Hi

    Application crash if add Dialog component and start debugging with QML debug. If just run (not debug, of off QML debugging) it works fine.
    Does anybody can reproduce it too?
    Is there any workaround or fix?

    Project to reproduce:
    Ubuntu 20.04.4
    Qt Creator 8.0.0
    Qt 6.4

    pro file:

    QT += quick
    
    SOURCES += \
            main.cpp
    
    resources.files = main.qml 
    resources.prefix = /$${TARGET}
    RESOURCES += resources
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    

    main.cpp:

    #include <QQmlApplicationEngine>
    
    
    int main(int argc, char *argv[])
    {
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        const QUrl url(u"qrc:/untitled11/main.qml"_qs);
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl)
                QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
    
        return app.exec();
    }
    

    main.qml:

    import QtQuick
    import QtQuick.Controls
    
    Window {
        id: window
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        Dialog {}
    }
    
    V 1 Reply Last reply
    0
    • V Volodymyr Mudryk

      Hi

      Application crash if add Dialog component and start debugging with QML debug. If just run (not debug, of off QML debugging) it works fine.
      Does anybody can reproduce it too?
      Is there any workaround or fix?

      Project to reproduce:
      Ubuntu 20.04.4
      Qt Creator 8.0.0
      Qt 6.4

      pro file:

      QT += quick
      
      SOURCES += \
              main.cpp
      
      resources.files = main.qml 
      resources.prefix = /$${TARGET}
      RESOURCES += resources
      
      # Additional import path used to resolve QML modules in Qt Creator's code model
      QML_IMPORT_PATH =
      
      # Additional import path used to resolve QML modules just for Qt Quick Designer
      QML_DESIGNER_IMPORT_PATH =
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      

      main.cpp:

      #include <QQmlApplicationEngine>
      
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
          const QUrl url(u"qrc:/untitled11/main.qml"_qs);
          QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                           &app, [url](QObject *obj, const QUrl &objUrl) {
              if (!obj && url == objUrl)
                  QCoreApplication::exit(-1);
          }, Qt::QueuedConnection);
          engine.load(url);
      
          return app.exec();
      }
      

      main.qml:

      import QtQuick
      import QtQuick.Controls
      
      Window {
          id: window
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Dialog {}
      }
      
      V Offline
      V Offline
      Volodymyr Mudryk
      wrote on last edited by
      #2

      Workaround: to off "Show QML object tree" in Preferences -> Debuger -> General
      Now I can run and debug.

      1 Reply Last reply
      2

      • Login

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