Results 1 to 2 of 2

Thread: What is the Use of QPluginLoader

  1. #1
    Join Date
    Oct 2011
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default What is the Use of QPluginLoader

    Hi All,
    I want to know why QPluginLoader is used.
    For what purpose we use QPluginLoader.
    QLibrary is mainly used to resolve symbols. But i dono y QPluginLoader mainly used for.
    instance() method in QPluginLoader returns QObject Pointer.
    Can we get the methods present inside library file using this QObject pointer.

    I need some idea.

    Thanks in Advance
    Kamatchi

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is the Use of QPluginLoader

    They say madness is doing the same thing and expecting different result...

    QPluginLoader is a small wrapper around QLibrary that simplifies the process of loading a plugin. It will only work with dynamic libraries that follow a set of conventions (explained in Qt docs) to export some QObject subclasses.

    When you load a plugin the usual assumption is that your application knows the type of object provided by the plugin (i.e when compiling your application, you had access to a header files describing the class and methods you expect to load from the plugins).

    If this assumption does not hold but the dynamic library follows the conventions that make it loadable by QPluginLoader you can still retrieve some information via the metaobject system.

    If the dynamic library does not follow said conventions, Qt will not help you. Your only recourse will be to use platform-specific libraries (such as libelf) to inspect the library. You will also have to demangle C++ symbol names. Based on your insistence on asking the same question 3 times and ignoring the answers, you probably have no clue what this means so you should not even think about going down that road before seriously reading up on dynamic linking and C++ ABI...
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. QPluginLoader not load plugin
    By Thyago.celler in forum Qt Programming
    Replies: 9
    Last Post: 20th May 2011, 19:01
  2. QPluginLoader instance
    By Jeff100 in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 06:47
  3. QPluginLoader question
    By QPlace in forum Qt Programming
    Replies: 1
    Last Post: 29th July 2007, 11:16
  4. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  5. QPluginLoader Qt 4
    By rianquinn in forum Qt Programming
    Replies: 9
    Last Post: 2nd October 2006, 07:04

Tags for this Thread

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.