Results 1 to 14 of 14

Thread: EXtend functionality of QListWidget by making a plugin and use it in designer?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    I changed the dateListView.cpp to the following...BUT i am still not able to edit all the propertys of a QListWidget in Designer.



    Qt Code:
    1. dateViewList :: dateViewList( QWidget* parent )
    2. : QListWidget(parent)
    3. {
    4. }
    To copy to clipboard, switch view to plain text mode 

    So i am wondering is this part right in the customwidgetplugin.cpp
    Qt Code:
    1. QListWidget *createWidget(QWidget*parent){returnnewdateListWidget()
    2. };
    To copy to clipboard, switch view to plain text mode 
    Or should it be
    Qt Code:
    1. QWidget* createWidget(QWidget *parent){return new dateListWidget()}
    To copy to clipboard, switch view to plain text mode 
    Or even
    Qt Code:
    1. dateListView* createWidget(QWidget *parent){return new dateListWidget() }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Dec 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    or is this all to do with the propertyEditor?
    QDesignerFormEditorInterface :: propertyEditor ()

    Is this what i somehow have to incorporate in my plugin?

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

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    Quote Originally Posted by Sisyfos View Post
    So i am wondering is this part right in the customwidgetplugin.cpp
    It should be
    Qt Code:
    1. QWidget* createWidget(QWidget *parent){return new dateListWidget(parent);}
    To copy to clipboard, switch view to plain text mode 

    I suggest you take a look at an example of making a Qt Designer plugin that comes with Qt docs.

  4. #4
    Join Date
    Dec 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    Oh! i have read them time and time again!
    The plugin is showing in designer so in that way i have done exactly as far as the example in the documentation takes me. But i have read numerous post, (on this FORUM and others. Here is onehttp://www.qtforum.org/thread.php?th...ght=Q+PROPERTY), that is asking exactly what i am asking. The problem is that none of the posts have any replies in them.
    So i am starting to think it is not possible.
    I think that it is only possible to edit the properties of the base class QWidget even though the documentation vaguely suggests that it is supposed to be possible to make the properties editable in designer by declaring Q_PROPERTY() in the class declaration.
    SO if someone can prove me wrong i will jump with joy.
    Last edited by Sisyfos; 13th December 2006 at 21:40.

  5. #5
    Join Date
    Dec 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?


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

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    Quote Originally Posted by Sisyfos View Post
    Here is onehttp://www.qtforum.org/thread.php?th...ght=Q+PROPERTY), that is asking exactly what i am asking.
    It's not exactly what you are asking. The poster there can't add any properties, and you can't see the ones which are already there.

    So i am starting to think it is not possible.
    I assure you it's possible.

    I think that it is only possible to edit the properties of the base class QWidget even though the documentation vaguely suggests that it is supposed to be possible to make the properties editable in designer by declaring Q_PROPERTY() in the class declaration.
    SO if someone can prove me wrong i will jump with joy.
    Of course it's possible to add new properties and to see existing ones.

    Here you go, you may base your widget on the code attached.
    Attached Files Attached Files
    Last edited by wysota; 13th December 2006 at 22:18. Reason: Added the example code

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

    Sisyfos (13th December 2006)

  8. #7
    Join Date
    Dec 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    I have not yet had the time to analyse exactly what i did wrong. I will have to look at that in the morning when my brain has regained capacity enough to grasp what u have done. BUT i just wanted to thank u so VERY much for taking the time to look at my sad example and point me in the right direction. I have tried for two days now to figure out what u did in a couple of minutes. So it is really a load of my shoulders. Again THX!

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

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    That's not my first Qt Designer plugin, I also learned on my mistakes while making my first plugins.

  10. #9
    Join Date
    Dec 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    Quote Originally Posted by wysota View Post
    That's not my first Qt Designer plugin, I also learned on my mistakes while making my first plugins.
    I sort of figured it was not your first plugin
    There were a number of problems with my code but most of all i had not understod the part where u call the base class constructor which seems to have caused some problems. But on thing i am wondering about is it really necessary to include the QCoreApplication. Cause it seems as if it was needed in my program but it is not clear from the documentation that it is needed in cases like this.
    BUT then again i dont find the documentation to be very good it leaves a lot of guessing to be done.

    Anyway i changed my code according to your example that u attached and now everything works just fine and i am happy as a clam.
    I recommend all ppl that are having any problems with their plugins to take a look at the code that Wysota has attached. It is a good base to stand on.

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

    Default Re: EXtend functionality of QListWidget by making a plugin and use it in designer?

    Quote Originally Posted by Sisyfos View Post
    But on thing i am wondering about is it really necessary to include the QCoreApplication. Cause it seems as if it was needed in my program but it is not clear from the documentation that it is needed in cases like this.
    QCoreApplication is responsible for initialising plugins.

    BUT then again i dont find the documentation to be very good it leaves a lot of guessing to be done.
    That's your opinion According to me it just doesn't try to be smarter than the reader as some docs do.

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.