How to load .rcc file



  • I have converted a .qrc file to a .rcc file . However i wanted to load my .rcc file on the build directory and test it on the hardware (imx6)board , but when i try to allot a path to my .rcc file using QGuiApplication it is thowing an error as :
    /home/mvs6kor/WMApp/main.cpp:14: error: expected unqualified-id before ‘(’ token path.(QResource::registerResource("file:///"+applicationDirPath+"/images.rcc"));
    ^

    the code is here :

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include<QQmlContext>
    #include <QResource>
    #include <QDebug>
    
    int main(int argc, char *argv[])
    {
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine;
        QResource path;
        engine.rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath());
        path.(QResource::registerResource("file:///"+applicationDirPath+"/images.rcc"));
        engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
        return app.exec();
    }
    

  • Moderators

    path. is invalid syntax. I think you might have meant path.registerResource


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.