Results 1 to 6 of 6

Thread: Static vs Plugin

  1. #1
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Static vs Plugin

    All,

    I'm trying to get Qt to work with PostgreSQL. What is the difference between static and plugin. Also, which is the best to implement.

    Trey

  2. #2
    Join Date
    Sep 2009
    Location
    Tashkent, Uzbekistan
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Static vs Plugin

    I'm trying to get Qt to work with PostgreSQL. What is the difference between static and plugin. Also, which is the best to implement.
    As far as I know you have 2 options:
    - Use QPSQL plugin as a part of Qt or libpq.* as alternative. Qt module is not threadsafe but it is bundled so you can use it if you don't have a lot to do with Postgres.
    -Use libpq (Postgres Client C library) or libpg+ (CXX wrapper over libpq). It is better choice for performance issues and multithreading. See pgadmin source code for details.

    About static vs dynamic. It is not about plugin's - it is about binding of your code. It depends on what you want to do. Shared version is smaller but won't necessary work on all distro's while static is bigger but safe.

  3. The following user says thank you to Tanuki-no Torigava for this useful post:

    treyhaslem (4th December 2009)

  4. #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: Static vs Plugin

    Quote Originally Posted by treyhaslem View Post
    What is the difference between static and plugin.
    "Static" means support for PostgreSQL will be built into Qt library and every Qt program using the SQL module regardless if it communicates with PostgreSQL databases or not will need psql library. This is not the case with plugins. Therefore if you want to develop different kinds of applications with Qt, it's better to use the plugin approach. Just remember that if you build Qt statically, plugins will also be built statically (although not as part of Qt library) and you will have to tell your program to link against specific plugins (see docs entry for "static plugins").
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    treyhaslem (4th December 2009)

  6. #4
    Join Date
    Sep 2009
    Location
    Tashkent, Uzbekistan
    Posts
    107
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Static vs Plugin

    And my 5 cents. The best thing about plugins is that plugin basically represents some shared library you can load and unload. If you are working with multiple DB's and implement database interaction as a plugins - your app won't crash if some of the libraries required for you plugin not exists. But, again, default Qt plugins more a placeholders. If you need complete control and thread-safety (which is good for Postgres async transactions) - use libpq or it's C++ brother.

  7. The following user says thank you to Tanuki-no Torigava for this useful post:

    treyhaslem (4th December 2009)

  8. #5
    Join Date
    Nov 2009
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Static vs Plugin

    After issuing a configure -plugin-sql-psql, do I have to do a make (mingw32-make)

  9. #6
    Join Date
    Oct 2007
    Location
    Grenoble, France
    Posts
    80
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Static vs Plugin

    After issuing a configure -plugin-sql-psql, do I have to do a make (mingw32-make)
    Everytime you reconfigure the source you have to recompile. Isn't that obvious?
    You have to run a level 3 diagnostic.

    Ashes to ashes, Qt to Qt ( wysota )

Similar Threads

  1. Extending a plugin in a static library
    By ultim8 in forum Qt Programming
    Replies: 5
    Last Post: 25th March 2010, 15:10
  2. Replies: 11
    Last Post: 13th July 2009, 16:05
  3. How to use static mysql plugin
    By khikho in forum Qt Programming
    Replies: 7
    Last Post: 19th January 2009, 21:44
  4. Replies: 16
    Last Post: 23rd May 2008, 10:12
  5. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13

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.