Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. resource
    Log in to post
    • All categories
    • 0

      Solved Forced lib linkage for its resources
      General and Desktop • librabries linking resource • • 0...-5

      3
      0
      Votes
      3
      Posts
      123
      Views

      0

      @Christian-Ehrlicher many thanks for fast response

    • N

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

      8
      0
      Votes
      8
      Posts
      550
      Views

      S

      Hi @newbisoso ,

      See this, it may help you

    • M

      Solved Access resources using qrc file
      General and Desktop • c++ qrc resource • • Maluna34

      5
      0
      Votes
      5
      Posts
      2665
      Views

      Pablo J. Rogina

      @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.

    • CybeX

      Unsolved get original file name of resource in qrc file
      General and Desktop • resource qt 5.7 qfile qresource • • CybeX

      3
      0
      Votes
      3
      Posts
      1625
      Views

      CybeX

      @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

    • CybeX

      Unsolved copy file from resource to disk keeping folder structure (platform independant)
      General and Desktop • qrc qfile resource copy • • CybeX

      7
      0
      Votes
      7
      Posts
      4358
      Views

      S

      //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);
    • X

      Unsolved QT doesn't want to load resource
      General and Desktop • resource loading images load loading qrc • • xLlama

      2
      0
      Votes
      2
      Posts
      2065
      Views

      T

      @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

    • trollkatt

      Unsolved FLAC file as resource causes compilation to fail
      General and Desktop • flac resource out-of-memory • • trollkatt

      5
      0
      Votes
      5
      Posts
      944
      Views

      kshegunov

      @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.

    • Gregoire Borel

      Unsolved Overriding external binary resource (rcc) doesn't update its content
      General and Desktop • resource • • Gregoire Borel

      3
      0
      Votes
      3
      Posts
      1138
      Views

      Gregoire Borel

      @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.

    • Gregoire Borel

      Solved Dynamically change QML theme at runtime
      General and Desktop • resource qml + js theme • • Gregoire Borel

      2
      0
      Votes
      2
      Posts
      3206
      Views

      Gregoire Borel

      Solution can be found here: http://stackoverflow.com/questions/36335481/dynamically-change-qml-theme-at-runtime/36399339#36399339

    • B

      Solved cross plugin linking
      General and Desktop • plugin resource linker designer • • bob123

      5
      0
      Votes
      5
      Posts
      1350
      Views

      B

      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.

    • S

      Virtual/Hidden File System
      General and Desktop • files virtual resource • • Scribe

      3
      0
      Votes
      3
      Posts
      1011
      Views

      S

      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

    • Lcmzt

      How to add a module with a plugin to resource file
      QML and Qt Quick • module plugin plugin windows qml resource android • • Lcmzt

      1
      0
      Votes
      1
      Posts
      1133
      Views

      No one has replied

    • N

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

      26
      0
      Votes
      26
      Posts
      11712
      Views

      A

      Good, glad ya got it sorted out. Sorry I've been super busy lately and haven't lurked the forums here. :)

    • P

      [SOLVED] Video files in external Qt resource file can not play
      General and Desktop • qml video mp4 resource • • Phataas

      6
      0
      Votes
      6
      Posts
      2498
      Views

      sierdzio

      Yes, it is fixed since Qt 5.6.2, as the linked bug report suggests.

    • P

      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
      731
      Views

      No one has replied

    • R

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

      1
      0
      Votes
      1
      Posts
      573
      Views

      No one has replied