Qt World Summit: Register Today!

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 <QResource>
    #include <QDebug>
    int main(int argc, char *argv[])
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine;
        QResource path;
        engine.rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath());
        return app.exec();

  • Moderators

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

Log in to reply