Results 1 to 5 of 5

Thread: Can Custom Data types in Own Widget Plugin be shown Designer Property Window?

  1. #1
    Join Date
    Jan 2010
    Location
    Ankara - TURKEY
    Posts
    30
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Can Custom Data types in Own Widget Plugin be shown Designer Property Window?

    Hi All,

    I want to create my own data type and want to use in my own custom widget plugin and show in Designer's Property window by using in Q_PROPERTY() declaration in my plugin.

    For example if I have custom data types like below;
    typedef QMap<int,QVariant> MyType;
    Could I create Q_PROPERTY in my widget plugin and can see from Designer's property windows.

    Is this possible or not?
    If possible how can I achieve?

    Regards.
    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can Custom Data types in Own Widget Plugin be shown Designer Property Window?

    It's quite a complex situation. It is easier to have a context menu entry in Designer to edit such entries. You can take a look at the "Task Menu Extension Example" in the docs on how to do that. As for seeing the property in Designer - it should be possible but I'm not able to tell you how without investigating in Designer source code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    umituzun84 (5th March 2010)

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

    Default Re: Can Custom Data types in Own Widget Plugin be shown Designer Property Window?

    I don't know for sure, but it might work if you register the type with Qt:
    http://doc.trolltech.com/4.6/custom-types.html
    ==========================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.

  5. #4
    Join Date
    Jan 2010
    Location
    Ankara - TURKEY
    Posts
    30
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can Custom Data types in Own Widget Plugin be shown Designer Property Window?

    Quote Originally Posted by wysota View Post
    It's quite a complex situation. It is easier to have a context menu entry in Designer to edit such entries. You can take a look at the "Task Menu Extension Example" in the docs on how to do that. As for seeing the property in Designer - it should be possible but I'm not able to tell you how without investigating in Designer source code.
    Thanks so much for your explanation wysota. I have thought same Task Menu Extension method, but thought if there is much easier way or not. So I will use task menu instead of investigation of Designer source code.

    Regards.

  6. #5
    Join Date
    Jan 2010
    Location
    Ankara - TURKEY
    Posts
    30
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Can Custom Data types in Own Widget Plugin be shown Designer Property Window?

    Quote Originally Posted by high_flyer View Post
    I don't know for sure, but it might work if you register the type with Qt:
    http://doc.trolltech.com/4.6/custom-types.html
    Thanks high_flyer. But after I looked documents I see that, Q_DECLARE_METATYPE() macro help us while using own type in QVariant type for signal&slot and QObject:roperty, setProperty and etc usefull situation but not support designable extension for designer's property windows.
    If you think opposite thought please let me now it support for designer window too or not?

    Regards.

Similar Threads

  1. Add custom Widget into window (not using Designer)
    By invisible_uli in forum Newbie
    Replies: 3
    Last Post: 12th January 2010, 08:31
  2. Designer plugin widget property not recognized
    By janus in forum Qt Programming
    Replies: 7
    Last Post: 14th April 2009, 21:26
  3. Replies: 6
    Last Post: 14th April 2007, 07:59
  4. QVariant::toString and custom data types
    By Vladimir in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2007, 15:36
  5. custom plugin designer property with out a variable?
    By high_flyer in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2006, 19:11

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.