Results 1 to 5 of 5

Thread: QMetaProperty to identify custom property

  1. #1
    Join Date
    Feb 2014
    Posts
    60
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QMetaProperty to identify custom property

    hi,
    I am working on QMetaObject to read all property of a QObject.My Doubt is can we differentiate between a user Defined property(property added by myself) and default property (i.e) already available in qt .I gone through docs but cudn't find good method to do the task.
    thanks,

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMetaProperty to identify custom property

    If you look at QMetaObject it has a property offset that tells you which property is the first of the respective class in the inheritance hierachy.

    So if you work through the properties starting at QObject, you'll know when you've reached the first class of your own.

    Cheers,
    _

  3. #3
    Join Date
    Feb 2014
    Posts
    60
    Thanks
    4
    Thanked 5 Times in 5 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QMetaProperty to identify custom property

    tanks, but the problem is property offset return similliar for my custom class as well as its parent class for e.g the propertyOffset() of all properties of MyPushButton and QPushButton all gives the same index.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QMetaProperty to identify custom property

    Can you show the code you are using?

    Cheers,
    _

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QMetaProperty to identify custom property

    I have a feeling of déjà vu about this thread. Same poster, same problem as here

Similar Threads

  1. Custom Property On Custom Widget
    By Ashutosh2k1 in forum Qt Programming
    Replies: 29
    Last Post: 28th October 2014, 12:16
  2. Replies: 2
    Last Post: 3rd June 2013, 16:45
  3. FolderListModel custom property
    By WeX.tmpvar in forum Qt Quick
    Replies: 0
    Last Post: 18th February 2012, 06:57
  4. Custom property in designer
    By avgust in forum Newbie
    Replies: 1
    Last Post: 9th September 2010, 10:14
  5. Animatin a custom property
    By Luc4 in forum Qt Programming
    Replies: 2
    Last Post: 13th April 2010, 08:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.