Results 1 to 3 of 3

Thread: How to reload widget plugins?

  1. #1
    Join Date
    Mar 2006
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default How to reload widget plugins?

    I've been developing a plugin-based application that has the main executable and several widget plugins (QWidgetPlugin) for additional functionality. Everything works fine. The problem is that during the development of plugins, I would like to simply unload the old version of the widget plugin and reload the new .so (in linux) or .dll (in windows). I do this by making the createWidget call in QWidgetFactory which uses the plugin files to create the widget.

    Unfortunately, if I re-compile a new version of a plugin and make a new call to createWidget from QWidgetFactory, I still get a pointer to the older version of the widget and not the new one. Is there anyway to do this in Qt. This would save lots of development time for us because we would not need to constantly restart our main application (which is tedious and time-consuming in our case).

    Regards,
    Victor

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: How to reload widget plugins?

    You have two choices. One is to make a kind of stub of your application, which will just handle testing plugins. Second is to make sure you unload the plugin before loading it again. I don't know if it works in all environments, but there is a chance that after unloading and loading the plugin again, you'll get the new plugin instead of the old one. Simply reloading the plugin won't do, as it'll see that it's already loaded and will just give you the old pointer.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: How to reload widget plugins?

    Could you explain the situation a bit more? Are we talking about Designer plugins here or your own (custom ones)? Do you link with them at compilation time?

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 08:06
  2. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 23:29
  3. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 21:39
  4. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 11:35
  5. about custom widget plugins
    By hesummar in forum Qt Tools
    Replies: 16
    Last Post: 1st December 2006, 02:59

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.