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.5 qml module notfound

qt 6.5 qml module notfound

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 323 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
    jialuo
    wrote on last edited by
    #1

    I used the new module function of qt6.5, and I was prompted in main.qml that qml module not found, but the project could be built and run normally, and it found my button correctly.
    main.cpp

    int main(int argc, char *argv[])
    {
        QGuiApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
    
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
            &app, []() { QCoreApplication::exit(-1); },
            Qt::QueuedConnection);
        engine.loadFromModule("qt65_2", "Main");
        return app.exec();
    }
    
    
    

    main.qml

    import QtQuick
    import QtQuick.Window
    import example.mystyle 1.0
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
            MyButton{}
    
    }
    
    
    

    85cc197b-fba4-4877-b34e-a467e9541ab4-image.png

    JoeCFDJ 1 Reply Last reply
    0
    • J jialuo

      I used the new module function of qt6.5, and I was prompted in main.qml that qml module not found, but the project could be built and run normally, and it found my button correctly.
      main.cpp

      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
      
          QQmlApplicationEngine engine;
      
          QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
              &app, []() { QCoreApplication::exit(-1); },
              Qt::QueuedConnection);
          engine.loadFromModule("qt65_2", "Main");
          return app.exec();
      }
      
      
      

      main.qml

      import QtQuick
      import QtQuick.Window
      import example.mystyle 1.0
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
              MyButton{}
      
      }
      
      
      

      85cc197b-fba4-4877-b34e-a467e9541ab4-image.png

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      @jialuo your code works because example.mystyle is not used anywhere, right?

      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