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. qresource Custom attributes?
Forum Updated to NodeBB v4.3 + New Features

qresource Custom attributes?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 3 Posters 758 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.
  • W Offline
    W Offline
    Warezovvv
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • E Offline
      E Offline
      Eeli K
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • W Offline
        W Offline
        Warezovvv
        wrote on last edited by
        #3

        Thanks, but I interested exactly in attributes.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

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

          Hope it helps

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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