Results 1 to 3 of 3

Thread: Q_property

  1. #1
    Join Date
    Apr 2012
    Qt products

    Default Q_property


    I'm writing a Custom Widget for QtCreator/-Designer. Things work fine, BUT I have difficulties to create properties for the Property-
    Editor. Simple properties like INTs, BOOLs, ... work fine (with Q_PROPERTY), but I would like to bundle some properties that belong together into a subproperty
    like in QWidget:
    | |-X
    | |-Y
    | |-Width
    | |-Height
    I've also tried to find a solution with Q_FLAGS but a so declared enum wouldn't even show up in the Property-Editor

    The other point is that when I create a QString property such subproperties are created automatically (translation, ...). Does somebody know how I can get rid if them?

    Any suggestions, example code, ... ?

    Thanx in advance


  2. #2
    Join Date
    Jan 2006
    Munich, Germany
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows

    Default Re: Q_property

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    d_stranz (12th April 2012)

  4. #3
    Join Date
    Apr 2012
    Qt products

    Default Re: Q_property


    thanks for your reply. I tried to use the domXML-function to create new properties and it works for strings. When using 'cstring' as datatyp-element I even get rid of the sub-properties translation, etc.
    But I cannot create a 'set'-property. As described in it should be possible to create a set-property with


    But if I specify this in my domXML() method this property is silently ignored by QTDesigner

    Can anybody tell me where the problem is?

Similar Threads

  1. Q_PROPERTY Code Generation
    By lexfridman in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2014, 10:37
  2. Why and when to use Q_PROPERTY
    By Vanir in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2007, 10:25
  3. How to Use Q_PROPERTY
    By mitesh_modi in forum Qt Programming
    Replies: 7
    Last Post: 20th June 2006, 15:49
  4. enlighten me on the use of Q_PROPERTY!!
    By nupul in forum Newbie
    Replies: 4
    Last Post: 3rd April 2006, 11:02
  5. Pointers and Q_PROPERTY
    By andersin in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2006, 15:05

Tags for this Thread


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.