Results 1 to 8 of 8

Thread: "propertyspecifications" for inheritted properties of custom widget plugin.

Hybrid View

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

    Default Re: "propertyspecifications" for inheritted properties of custom widget plugin.

    Lets break the problem down.
    my base custom widget doesn't have a plugin and therefore doesn't specify a domXml().
    Well that conflicts with
    This base custom widget (which inherits QWidget) has some properties which I want available in the designer,
    which you wrote originally.
    But I take it that your custom widget does inherit from some other custom widgets which does implement domXml(), otherwise the whole problem of copying it would be raised, right?

    So, the thing we have at hand is having a class inheriting implementation of a mother class, which should be solved with what I wrote before.
    Creating a plugin for the abstract class will not help, if the abstract class returns an empty string from domXml(). - and if it does, then you don't have anything to inherit from it...

    Ofcourse, you could use the old Q_PROPERTY in your subclass header file.
    ==========================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.

  2. #2
    Join Date
    Jan 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: "propertyspecifications" for inheritted properties of custom widget plugin.

    My base widget doesn't have a plugin (since its an abstract class, but even if it wasn't I don't want anyone to actually use this widget). It does however contain properties. And since the designer lists all the properties of all the ancestors of a widget, you can change properties derived from parent widgets event if the parent widget doesn't have a plugin (the classic example being the "objectName" property inherited from QObject).

    In any case I did create a plugin for my parent widget (just for the test), and it did have a domXml() retuning a valid XML with the "propertyspecifications" I wanted (not an empty xml). But it seems like the "propertyspecifications" were not inherited by the derived widget. So what you suggested didn't work for me.

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

    Default Re: "propertyspecifications" for inheritted properties of custom widget plugin.

    can you run your code in a debugger, explicitly call domXml(), set a break point and see what string is beying returned?
    If the string is not empty, it should be the string you set in the base class, which should hold propertyspecifications in it.
    At least then we know if the problem is before calling domXml() or after it.
    ==========================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.

Similar Threads

  1. Replies: 1
    Last Post: 5th January 2010, 14:34
  2. Replies: 2
    Last Post: 11th June 2009, 21:38
  3. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  4. Replies: 2
    Last Post: 25th August 2006, 12:35
  5. How to initialize properties to a custom plugin widget?
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 28th February 2006, 17:56

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