Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can I add extra meta information to a property?

Can I add extra meta information to a property?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 543 Views
  • 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.
  • K Offline
    K Offline
    kitfox
    wrote on last edited by kitfox
    #1

    I'm trying to create a UI that relies on examining a QObject to find its properties. I need to supply a bit more information that what the basic Q_PROPERTY definition gives you. Is there any way to add extra information to my properties?

    jsulmJ 1 Reply Last reply
    0
    • K kitfox

      I'm trying to create a UI that relies on examining a QObject to find its properties. I need to supply a bit more information that what the basic Q_PROPERTY definition gives you. Is there any way to add extra information to my properties?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @kitfox What extra information do you want to add?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • K Offline
        K Offline
        kitfox
        wrote on last edited by kitfox
        #3

        A simple map of string to values. For example, I'd like to attach a map like this to a property (even just a map of strings to strings would do):

        "displayColor": QColor(100, 0, 0),
        "type": "vector",
        "userIndex": 5
        
        jsulmJ 1 Reply Last reply
        0
        • K kitfox

          A simple map of string to values. For example, I'd like to attach a map like this to a property (even just a map of strings to strings would do):

          "displayColor": QColor(100, 0, 0),
          "type": "vector",
          "userIndex": 5
          
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @kitfox I would rather create a class/struct and put all this information there and use this class/struct as property type.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved