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. How to load .rcc file
Qt 6.11 is out! See what's new in the release blog

How to load .rcc file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.6k 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.
  • V Offline
    V Offline
    vishu_fcb
    wrote on last edited by p3c0
    #1

    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();
    }
    
    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      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