Results 1 to 3 of 3

Thread: Plugin Architecture

  1. #1
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Plugin Architecture

    Hi all,

    I've managed to get Qt plugins working successfully, but I'm having a problem with the overall architecture.

    I have a main app that uses (includes/depends on) our engine code and a series of Qt plugins loaded by the app that also use the engine code.

    The problem is that this seems to result in the app and the plugins each having their own instance of the engine, whereas there should only be one instance of the engine (otherwise engine objects created by the plugins won't be recognized by the app's engine).

    Is there any way to achieve an engine system common to the app and the plugins it loads?

    TIA,

    jt

  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: Plugin Architecture

    You can export the engine to a separate library and link each plugin against the library. Or you can place the engine in the main application and have a pointer to it somewhere so that plugins can take it and use it. It depends whether you want each plugin to have a separate engine or if they can all share a single instance of it.

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

    jtaylor108 (8th April 2008)

  4. #3
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Plugin Architecture

    Many thanks for such a prompt reply

    Using VS2005, I'm building the engine as a library (a '.lib' static library file) and the app and plugins are both linking against this. I would like the app and plugins to share a single instance of the engine, but this doesn't seem to be happening. However, the plan now is to rewrite the engine as a dll so I'll see how that works once it's been done.

    Again, many thanks for the help - it's much appreciated.

    Cheers,

    jt

Similar Threads

  1. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  2. Need help making plugin
    By vieraci in forum Qt Programming
    Replies: 10
    Last Post: 24th September 2007, 13:20
  3. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  4. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  5. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 09:01

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.