Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QML module not found in Designer using QML_ELEMENT

QML module not found in Designer using QML_ELEMENT

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 257 Views 1 Watching
  • 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.
  • O Offline
    O Offline
    Oleg R.
    wrote on last edited by
    #1

    Hello,

    I integrated C++ class into QML using QML_ELEMENT. While it compiles and works find, in Qt Designer, in QML file the import line with module name is highlighted and error appears: QML module not found (Backend).

    In .pro file I have the following:

    CONFIG += qmltypes
    
    QML_IMPORT_NAME = Backend
    QML_IMPORT_MAJOR_VERSION = 1
    

    In apimanager.h file I have the following:

    class ApiManager : public QObject
    {
        Q_OBJECT
    
        QML_ELEMENT
    
        const QString apiUrl = "https://127.0.0.1:8000/api/";
    
    public:
        explicit ApiManager(QObject *parent = nullptr);
    
        Q_INVOKABLE void login(QString username, QString password);
    

    I'm running Qt 5.15.1 on MacOS. While having the same version on my Laptop does not show this error, on my Desktop PC it does. I have tried to fully reinstall Qt (manually deleted all config and cache folders).

    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