Results 1 to 16 of 16

Thread: Deleting and disabling properties in designer for custom plugins...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Deleting and disabling properties in designer for custom plugins...

    You know, I wanted to say that right in the beginning - why do you want to hide a property in Designer? This won't stop anyone from using it in code anyway, so what's the point? If you want to disable all the properties (only in Designer!) then the proper way to go is to implement a QDesignerPropertySheetExtension for your widget - this will substitute the default property browser with yours. You can specify your own properties there and handle them the way you want. Of course it won't stop anyone from calling the property methods (or QObject::setProperty()) directly from code.

  2. #2
    Join Date
    Jan 2006
    Location
    Florida
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Quote Originally Posted by wysota View Post
    You know, I wanted to say that right in the beginning - why do you want to hide a property in Designer? This won't stop anyone from using it in code anyway, so what's the point? If you want to disable all the properties (only in Designer!) then the proper way to go is to implement a QDesignerPropertySheetExtension for your widget - this will substitute the default property browser with yours. You can specify your own properties there and handle them the way you want. Of course it won't stop anyone from calling the property methods (or QObject::setProperty()) directly from code.

    I'm generating a library of custom plugins that will be used by another group (non-programmers) to lay out GUI screens. I'm not real concerned about somebody doing what you said because the intended audience will be non-programming UI designers. I really wish there was a way to add more slots that can be seen in designer, but we can't have everything.

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

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Quote Originally Posted by thawkins View Post
    I really wish there was a way to add more slots that can be seen in designer, but we can't have everything.
    You mean without subclassing? What would it give a non-programmer? Anyway, you might want to take a look at this:
    QDesignerMemberSheetExtension

  4. #4
    Join Date
    Jan 2006
    Location
    Florida
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Quote Originally Posted by wysota View Post
    You mean without subclassing? What would it give a non-programmer? Anyway, you might want to take a look at this:
    QDesignerMemberSheetExtension
    I briefly took a look at that. I guess I got somewhat discouraged because I've searched this and a couple other forums and everyones says the same thing, that you can't have custom slots from within designer. I'm still working on getting the property sheet stuff working with QDesignerPropertySheetExtension. I'll play around with that next to see if some type of custom slots are possible by implementing my own QDesignerMemberSheetExtension.

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

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Why would you want to allow an ui designer (the person) to create custom slots if he/she can't implement them? The problem is people treat Qt Designer as an IDE, but it's not one - it's a layout editor, you shouldn't implement any logic there. To be honest I'm surprised why Trolltech implemented writing scripts in QtScript in Designer (since 4.3), as it clearly violates their own rule of removing the editor part from Designer.

  6. #6
    Join Date
    Jan 2006
    Location
    Florida
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Quote Originally Posted by wysota View Post
    Why would you want to allow an ui designer (the person) to create custom slots if he/she can't implement them? The problem is people treat Qt Designer as an IDE, but it's not one - it's a layout editor, you shouldn't implement any logic there. To be honest I'm surprised why Trolltech implemented writing scripts in QtScript in Designer (since 4.3), as it clearly violates their own rule of removing the editor part from Designer.
    I don't think you understand, or maybe I'm not saying it right. I don't want a user to be able to create and modify a slot from scratch in Qt, merely to have slots that were defined in code visible in the slot editor in designer. I think if they went through the trouble of exposing properties and such with Q_PROPERTY(), Q_ENUM, etc, why is there no equivalent for slots and signals? That wouldn't seem to violate their rules and in fact would make designer more useful as a layout tool. As it stands now, when you develop a plugin you still have to programmatically attach any of the slots that you wrote. This takes away from the usefulness of designer for anything accept the layout of built in widgets as anything else requires further coding to work.

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

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Quote Originally Posted by thawkins View Post
    I don't think you understand, or maybe I'm not saying it right. I don't want a user to be able to create and modify a slot from scratch in Qt, merely to have slots that were defined in code visible in the slot editor in designer. I think if they went through the trouble of exposing properties and such with Q_PROPERTY(), Q_ENUM, etc, why is there no equivalent for slots and signals?
    I think you had to make some mistake, as my custom slots are perfectly visible in Designer (screenshot attached).
    Attached Images Attached Images

  8. #8
    Join Date
    Jan 2006
    Location
    Florida
    Posts
    24
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6

    Default Re: Deleting and disabling properties in designer for custom plugins...

    Quote Originally Posted by wysota View Post
    I think you had to make some mistake, as my custom slots are perfectly visible in Designer (screenshot attached).
    And so it is. Mine appear to show up as well. I never looked before because I hadn't gotten a chance to play with that feature in my custom plugins and I've read so much about not having custom slots show up in designer. Oh well, just goes to show you can't take everything at face value.

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.