Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. resource
    Log in to post

    • UNSOLVED using resources system with qml
      QML and Qt Quick • qml qt5 image resource interface • • newbiSoso  

      8
      0
      Votes
      8
      Posts
      229
      Views

      Hi @newbisoso , See this, it may help you
    • SOLVED Access resources using qrc file
      General and Desktop • c++ qrc resource • • Maluna34  

      5
      0
      Votes
      5
      Posts
      2077
      Views

      @Maluna34 maybe the qrc file mechanism is not the best approach for what you intend to use; however you only know your actual requirements. From documentation about Qt resource system: The Qt resource system is a platform-independent mechanism for storing binary files in the application's executable. This is useful if your application always needs a certain set of files (icons, translation files, etc.) and you don't want to run the risk of losing the files. so a music file for a whole opera concert is not a suitable candidate for being stored in the qrc file as it ends up into your executable. Given that said, you could get the file from the resource and save it somewhere to disk so the external tool can access it. QFile::copy(":/sounds/ocean.mp3", "/tmp/ocean.mp3"); you can even use QTemporaryFile to avoid worrying about file naming and deletion.
    • UNSOLVED get original file name of resource in qrc file
      General and Desktop • qt 5.7 qfile resource qresource • • CybeX  

      3
      0
      Votes
      3
      Posts
      1334
      Views

      @Chris-Kawa It would actually just make things easier. I would like to generalize this procedure to e.g. QFile::copy(":/my/file", r.OriginalFileName); Here Qresource::OriginalFileName() returns the original file name e.g. somefile.txt Now, I am required to (for each file): QString newLocation = QString(tempdir + tempdir.seperator() + QString("myNewFileName.txt")); QFile::copy(":/my/file", newLocation); It just seems tedious and not very efficient. But thanks for clearing it up though, *grabs coffee
    • UNSOLVED copy file from resource to disk keeping folder structure (platform independant)
      General and Desktop • qfile qrc resource copy • • CybeX  

      7
      0
      Votes
      7
      Posts
      3002
      Views

      //copy whole <from> directory to the folder <to> void copyDirectoryNested(QString from,QString to) { QDirIterator it(from, QDirIterator::Subdirectories); while (it.hasNext()) { QString file_in = it.next(); QFileInfo file_info = QFileInfo(file_in); QString file_out = file_in; file_out.replace(from,to); if(file_info.isFile()) { //is file copy qDebug() << QFile::copy(file_in, file_out); qDebug() << file_in << "<----" << file_out; } if(file_info.isDir()) { //dir mkdir QDir dir(file_out); if (!dir.exists()) qDebug() << "mkpath"<< dir.mkpath("."); } } } then use above function : copyDirectoryNested(":/<qrc_folder_location>",<writing_location>); copyDirectoryNested(":/DefaultAppData",app_data_location);
    • UNSOLVED QT doesn't want to load resource
      General and Desktop • qrc resource load loading loading images • • xLlama  

      2
      0
      Votes
      2
      Posts
      1715
      Views

      @xLlama You did not open your file for reading as indicated by the error messag "device not open". http://doc.qt.io/qt-5/qiodevice.html#open
    • UNSOLVED FLAC file as resource causes compilation to fail
      General and Desktop • resource flac out-of-memory • • trollkatt  

      5
      0
      Votes
      5
      Posts
      842
      Views

      @trollkatt You shouldn't compile a resource this big into the binary to begin with! Load it at runtime instead. For example look at this thread.
    • UNSOLVED Overriding external binary resource (rcc) doesn't update its content
      General and Desktop • resource • • Gregoire Borel  

      3
      0
      Votes
      3
      Posts
      1008
      Views

      @mrjj said: it means you compile a new version with rcc and copy it over? Yes, it's generated from my CMakeLists.txt. No problem whatsoever with the generation. If yes, have you try to flipflop I did. It doesn't work. When going back to redTheme.rcc, the content is still the same as it was in first hand. Note that I shared my problem on stackoverflow, and according to one of the replies, it's a bug. Therefore, I reported it to the Qt bug tracker.
    • SOLVED Dynamically change QML theme at runtime
      General and Desktop • resource qml + js theme • • Gregoire Borel  

      2
      0
      Votes
      2
      Posts
      2467
      Views

      Solution can be found here: http://stackoverflow.com/questions/36335481/dynamically-change-qml-theme-at-runtime/36399339#36399339
    • SOLVED cross plugin linking
      General and Desktop • plugin designer resource linker • • bob123  

      5
      0
      Votes
      5
      Posts
      1214
      Views

      Yes, it works if I build a normal shared library an a designer plugin containing the widgets used by other plugins. The normal shared library is used to be linked to the other ones and the plugin is loaded into the designer to have the widgets available there.
    • Virtual/Hidden File System
      General and Desktop • resource files virtual • • Scribe  

      3
      0
      Votes
      3
      Posts
      852
      Views

      Thank you Anant, I will be deploying both to Linux and Windows and so require a solution for both, however they don't necessarily have to be the same solution. Many thanks
    • How to add a module with a plugin to resource file
      QML and Qt Quick • qml android plugin module resource plugin windows • • Lcmzt  

      1
      0
      Votes
      1
      Posts
      962
      Views

      No one has replied

    • [SOLVED] QSystemTrayIcon icon from resource file isn't showing
      General and Desktop • icon resource qsystemtrayicon • • nitzan  

      26
      0
      Votes
      26
      Posts
      10471
      Views

      Good, glad ya got it sorted out. Sorry I've been super busy lately and haven't lurked the forums here. :)
    • [SOLVED] Video files in external Qt resource file can not play
      General and Desktop • qml video resource mp4 • • Phataas  

      6
      0
      Votes
      6
      Posts
      2164
      Views

      Yes, it is fixed since Qt 5.6.2, as the linked bug report suggests.
    • How to create Android expansion files to be use with Qt on Android
      Mobile and Embedded • qml android deployment resource • • Phataas  

      1
      0
      Votes
      1
      Posts
      646
      Views

      No one has replied

    • QThreads and Image loading from Ezust book
      General and Desktop • qthread image resource filevisitor • • RDiGuida  

      1
      0
      Votes
      1
      Posts
      509
      Views

      No one has replied