Results 1 to 3 of 3

Thread: Q_property

  1. #1
    Join Date
    Apr 2012
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Q_property

    Hi,

    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:
    v-geometry
    | |-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

    Michael

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

    Default Re: Q_property

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    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
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Q_property

    Hi,

    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 http://www.kde.gr.jp/~ichi/qt/designer-manual-15.html it should be possible to create a set-property with

    <set>AlignLeft|AlignTop</set>

    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, 09:37
  2. Why and when to use Q_PROPERTY
    By Vanir in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2007, 09:25
  3. How to Use Q_PROPERTY
    By mitesh_modi in forum Qt Programming
    Replies: 7
    Last Post: 20th June 2006, 14:49
  4. enlighten me on the use of Q_PROPERTY!!
    By nupul in forum Newbie
    Replies: 4
    Last Post: 3rd April 2006, 10:02
  5. Pointers and Q_PROPERTY
    By andersin in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2006, 14:05

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.