Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

qresource Custom attributes?



  • Hey!
    qresource provide awesome feature, as for example "lang", attribute.

    <qresource>
        <file>cut.jpg</file>
    </qresource>
    <qresource lang="fr">
        <file alias="cut.jpg">cut_fr.jpg</file>
    </qresource>
    //If the user's locale is French (i.e., QLocale::system().name() returns "fr_FR"), :/cut.jpg becomes a reference to the cut_fr.jpg image. 
    

    But I want add custom attribute, for example mode, and change images depend on current mode of application.

    <qresource>
        <file>cut.jpg</file>
    </qresource>
    <qresource mode="black">
        <file alias="cut.jpg">cut_black.jpg</file>
    </qresource>
    <qresource mode="green">
        <file alias="cut.jpg">cut_green.jpg</file>
    </qresource>
    

    Any possibilities?
    Thanks!



  • I don't have answer to that qresource question, but I already gave in the other tread a way to use graphical effects (ColorOverlay) to change the color of images.



  • Thanks, but I interested exactly in attributes.


  • Lifetime Qt Champion

    Hi,

    AFAIK no, however you could use QFileSelector and organise your files differently.

    Hope it helps


Log in to reply