Results 1 to 8 of 8

Thread: How to Use Q_PROPERTY

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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: How to Use Q_PROPERTY

    In this case you just have to use the proper method:
    Qt Code:
    1. void assignProp()
    2. {
    3. der_no = number();
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jun 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Use Q_PROPERTY

    Hi jacek,

    Thanks for quick reply,

    Thats right i can use method but then what is use of Q_PROPERTY? means i am missing some knowledge regarding Q_PROPERTY. I think that because of Q_PROPERTY macro one sholud not get the knowledge of class members and do get set of property defined in a class.

    Can you briefly give what is the exact use of Q_PROPERTY.

    Thanks,
    Mitesh..

  3. #3
    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: How to Use Q_PROPERTY

    Quote Originally Posted by mitesh_modi
    Can you briefly give what is the exact use of Q_PROPERTY.
    You can use QObject::property() and QObject::setProperty() to change the value of given property without knowing anything about the object.

    http://www.qtcentre.org/forum/f-newb...erty-1596.html

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
  •  
Qt is a trademark of The Qt Company.