Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QList as a property in Qt designer custom widget
Forum Updated to NodeBB v4.3 + New Features

QList as a property in Qt designer custom widget

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 2 Posters 1.5k 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.
  • L Offline
    L Offline
    lb40
    wrote on last edited by
    #1

    i have defined a custom widget, basically adding to QLabel. The simple (Qstring and enum ) properties are ok and appear in my Qt designer.

    I am now trying to add a property which is a list.

    So I declare my property as :
    @
    Q_PROPERTY(QList<int> points READ getpoints )
    @

    and I have my private variable QList<int> m_points;

    Still, I cannot see my points property in Q designer propriety editor. And, I don't know what went wrong.

    I've tried to add the DESIGNABLE flag but it does nothing.

    When I try to add the dynamic property points in designer, it tells me "this propriety already exists".

    Is there a way to add a "list" property easily ?

    thanks

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NicuPopescu
      wrote on last edited by
      #2

      Hi,

      I have tested QStringList type in the customwidgetplugin example and it works ... it provides a list editor for adding strings; conversions to other types is on you ...

      to be honest I have not found any list property of any type among qt's designable widgets and the doc regarding Q_PROPERTY and QList within QVariant is confusing

      hope this help :)

      Cheers!

      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