Results 1 to 3 of 3

Thread: Not working custom deginer widget + container based on QWidget!

  1. #1
    Join Date
    Mar 2010
    Location
    Heredia, Costa Rica
    Posts
    257
    Thanks
    24
    Thanked 17 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Not working custom deginer widget + container based on QWidget!

    Hi,

    I created a custom Designer widget that I want to use as container.

    I indicated that it is a container with:

    Qt Code:
    1. bool myWidget::isContainer() const
    2. {
    3. return true;
    4. }
    To copy to clipboard, switch view to plain text mode 

    However, even when Designer loads the custom widget and I can it to a ui... The widget is not a container! What else I need to do?

    Thanks,
    Carlos.

  2. #2
    Join Date
    Nov 2010
    Posts
    315
    Thanked 53 Times in 51 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Not working custom deginer widget + container based on QWidget!

    it should be MyWidgetDesignerFactory::isContainer not myWidget::isContainer. See http://techbase.kde.org/Development/...signer_Plugins.

  3. #3
    Join Date
    Mar 2010
    Location
    Heredia, Costa Rica
    Posts
    257
    Thanks
    24
    Thanked 17 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Not working custom deginer widget + container based on QWidget!

    Hi,
    myWidget is the plugin declared like
    Qt Code:
    1. class myWidget : public QObject, public QDesignerCustomWidgetInterface
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. myWidget(QObject *parent = 0);
    7.  
    8. bool isContainer() const;
    9. bool isInitialized() const;
    10. QIcon icon() const;
    11. QString domXml() const;
    12. QString group() const;
    13. QString includeFile() const;
    14. QString name() const;
    15. QString toolTip() const;
    16. QString whatsThis() const;
    17. QWidget *createWidget(QWidget *parent);
    18. void initialize(QDesignerFormEditorInterface *core);
    19.  
    20. private:
    21. bool m_initialized;
    22. };
    To copy to clipboard, switch view to plain text mode 

    Thus I have:
    Qt Code:
    1. bool myWidget::isContainer() const
    2. {
    3. return true;
    4. }
    To copy to clipboard, switch view to plain text mode 

    Carlos.

Similar Threads

  1. Replies: 1
    Last Post: 23rd June 2011, 23:09
  2. Replies: 4
    Last Post: 27th October 2010, 16:43
  3. Custom Container widget plugin help needed
    By JohnKustrin in forum Newbie
    Replies: 1
    Last Post: 14th May 2010, 10:01
  4. Replies: 2
    Last Post: 30th July 2009, 04:58
  5. Problem with custom container widget
    By MrGarbage in forum Qt Tools
    Replies: 4
    Last Post: 25th August 2007, 03:37

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.