Results 1 to 5 of 5

Thread: Why and when to use Q_PROPERTY

  1. #1
    Join Date
    Nov 2007
    Posts
    12
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Why and when to use Q_PROPERTY

    Hello All,

    I am new to QT and am learning it for my present job so I apologize for any dum questions.

    I have read the information on the Qt Assistant regarding the macro Q_PROPERTY. Although Assistant gives the 'syntax' it does not give the why and when to insert such properties into a class derived from QObject.

    What criteria should I use to decide to create / insert properties in my class designs derived from QObject?

    Does the Qt framework make use of them?

    The same questions are asked of the use of dynamic properties.

    Thanks,

    Vanir

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Why and when to use Q_PROPERTY

    Quote Originally Posted by Vanir View Post
    I have read the information on the Qt Assistant regarding the macro Q_PROPERTY. Although Assistant gives the 'syntax' it does not give the why and when to insert such properties into a class derived from QObject.
    In Q_PROPERTY docs, there's a link to more verbose article: Qt's Property System
    J-P Nurmi

  3. #3
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Why and when to use Q_PROPERTY

    Hi,
    there's no dum questions
    rather not asking is dummy

    Q_PROPERTY is required whne developing QtDesigner plugins(that extends designer by new custom widgets).
    Q_PROPERTY macro adds informations that allow designer to add a property t property editor (and change its value at design time).

    It can be omitted in other cases, so u may ignore it until first QtDesigner plugin writing.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why and when to use Q_PROPERTY

    Properties are also useful in scriptable objects.

  5. #5
    Join Date
    Nov 2007
    Posts
    12
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Why and when to use Q_PROPERTY

    Hi Everyone,

    Thank you for your hard-earnt knowledge.

    I am sure to post again.

    Vanir

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.