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. External QML module debugging

External QML module debugging

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 174 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    Hello everyone!

    I have a generic question about external QML module debugging. I wanted to debug an external qml module in C++ application if possible.

    // main.cpp
    int main(int argc, char *argv[]) {
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/qml/main.qml"));
        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 6.3
    import QtQuick.Controls 6.3
    import QtQuick.VirtualKeyboard 6.0
    import QtQuick.Layouts 6.3
    import QtQml 6.0
    import MyModule.Utils 1.1
    
    ApplicationWindow {
        id: applicationWindow
    
        width: 1024
        height: 600
        visible: true
        title: qsTr("xxx")
    

    I'm able to debug the application and put the brakepoint in main.qml as well as in main.cpp. But I wanted to debug MyModule.Utils module. I have compiled it like an external module and set the QML_IMPORT_PATH. Than opened the file in QtCreator and put the breakepoint there. But nothing happened... .

    So is it possible to step into external module or only the one way is to use Console.log()?

    Thank you,
    Andy

    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