×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    28

    how to load multiple plugins in QT

    Hi,

    Does any one knows, how to load multiple plugins in QT?
    Do you have any code examples or links, please share.

    Thanks!!!

    Regards
    Rajini

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to load multiple plugins in QT

    Could you please elaborate your question?

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    28

    Re: how to load multiple plugins in QT

    I have 3 plugins and that need to be available to the application all the time. I wanted to load all of them at the same time. when i use the following code to load them, its failing after first plugin is loaded.
    I kept all the plugins shared libraries (.so files) in the one directory. Does the QT plugin loader will load only one .so at a time? If so, when i want to load multiple plugins at time, what would be the approach.

    QDir pluginDirectory(qApp->applicationDirPath());
    pluginDirectory.cdUp();
    pluginDirectory.cd("plugin");
    QStringList filePaths = pluginDirectory.entryList();

    Q_FOREACH(QString file, filePaths) {
    if( QLibrary::isLibrary( file ) ) {
    qDebug()<<"the path is"<<pluginDirectory.absoluteFilePath(file);
    QPluginLoader pluginLoader(pluginDirectory.absoluteFilePath(file));
    QObject *plugin = pluginLoader.instance();
    qDebug()<<"plugin : "<<plugin;
    }
    }

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to load multiple plugins in QT

    Quote Originally Posted by g.rkreddy View Post
    when i use the following code to load them, its failing after first plugin is loaded.
    Does it give an error message or what are the symptoms of failure?

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    28

    Re: how to load multiple plugins in QT

    It's not giving any error... the .so is not loading. I don't know internally how the QPluginLoader has been implemented.

    qDebug()<<"the path is"<<pluginDirectory.absoluteFilePath(file);

    the above statement in the below code is giving correct path. But plugin is not being loaded.

    Do you know i which cases plugin would fail to load? And any corresponding links would help me out.


    Regards
    Rajini

  6. #6
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to load multiple plugins in QT

    If there is no indication of error, why do you believe there is a problem? What is content of QPluginLoader::errorString()?
    http://doc.trolltech.com/4.7/qplugin...ml#errorString

  7. #7
    Registered User
    Join Date
    Sep 2010
    Posts
    28

    Re: how to load multiple plugins in QT

    Error : "Cannot load library /home/rajini/Project/facebookplugin/libfacebookplugin.so: (/home/rajini/Project/facebookplugin/libfacebookplugin.so: undefined symbol: _ZTI15PluginInterface)"

    The above error is throwing.... what does that mean

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to load multiple plugins in QT

    What is an output of this command?
    Code:
    nm -D /home/rajini/Project/facebookplugin/libfacebookplugin.so

  9. #9
    Registered User
    Join Date
    Sep 2010
    Posts
    28

    Re: how to load multiple plugins in QT

    w _Jv_RegisterClasses
    U _Unwind_Resume
    00003058 V _ZGVZ13qvariant_castI8QVariantET_RKS0_E3vid
    U _ZN11QMetaObject11changeGuardEPP7QObjectS1_
    U _ZN11QMetaObject11removeGuardEPP7QObject
    000015b0 T _ZN14FacebookPlugin10getFriendsEv
    00001630 T _ZN14FacebookPlugin11getPlayListEv
    00001650 T _ZN14FacebookPlugin11openSessionEv
    000017f0 T _ZN14FacebookPlugin11qt_metacallEN11QMetaObject4CallEiPPv
    00001830 T _ZN14FacebookPlugin11qt_metacastEPKc
    00001670 T _ZN14FacebookPlugin12closeSessionEv
    000015d0 T _ZN14FacebookPlugin13getArtistInfoEv
    000015f0 T _ZN14FacebookPlugin15getFriendsLikesEv
    00002e04 D _ZN14FacebookPlugin16staticMetaObjectE
    00001610 T _ZN14FacebookPlugin7getKeysEv
    00001930 W _ZN14FacebookPluginD0Ev
    000018e0 W _ZN14FacebookPluginD1Ev
    U _ZN7QObject10childEventEP11QChildEvent
    U _ZN7QObject10timerEventEP11QTimerEvent
    U _ZN7QObject11customEventEP6QEvent
    U _ZN7QObject11eventFilterEPS_P6QEvent
    U _ZN7QObject11qt_metacallEN11QMetaObject4CallEiPPv
    U _ZN7QObject11qt_metacastEPKc
    U _ZN7QObject13connectNotifyEPKc
    U _ZN7QObject16disconnectNotifyEPKc
    U _ZN7QObject16staticMetaObjectE
    U _ZN7QObject5eventEP6QEvent
    U _ZN7QObjectC2EPS_
    U _ZN7QObjectD2Ev
    00001790 W _ZN8QPointerI7QObjectED1Ev
    000017c0 T _ZNK14FacebookPlugin10metaObjectEv
    00002ea0 V _ZTI14FacebookPlugin
    U _ZTI15PluginInterface
    U _ZTI7QObject
    00001a6f V _ZTS14FacebookPlugin
    00002e20 V _ZTV14FacebookPlugin
    U _ZTV15PluginInterface
    U _ZTVN10__cxxabiv121__vmi_class_type_infoE
    000015a0 T _ZThn8_N14FacebookPlugin10getFriendsEv
    00001620 T _ZThn8_N14FacebookPlugin11getPlayListEv
    00001640 T _ZThn8_N14FacebookPlugin11openSessionEv
    00001660 T _ZThn8_N14FacebookPlugin12closeSessionEv
    000015c0 T _ZThn8_N14FacebookPlugin13getArtistInfoEv
    000015e0 T _ZThn8_N14FacebookPlugin15getFriendsLikesEv
    00001600 T _ZThn8_N14FacebookPlugin7getKeysEv
    00001920 W _ZThn8_N14FacebookPluginD0Ev
    000018d0 W _ZThn8_N14FacebookPluginD1Ev
    U _ZdlPv
    U _Znwj
    00003040 A __bss_start
    U __cxa_atexit
    w __cxa_finalize
    U __cxa_guard_acquire
    U __cxa_guard_release
    w __gmon_start__
    U __gxx_personality_v0
    00003040 A _edata
    00003060 A _end
    000019b8 T _fini
    000013c0 T _init
    000016a0 T qt_plugin_instance
    00001680 T qt_plugin_query_verification_data

  10. #10
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to load multiple plugins in QT

    It looks like libfacebookplugin.so is using another library, which has PluginInterface symbols defined and is missing.
    What this command gives to you?
    Code:
    ldd /home/rajini/Project/facebookplugin/libfacebookplugin.so

  11. #11
    Registered User
    Join Date
    Sep 2010
    Posts
    28

    Re: how to load multiple plugins in QT

    Hi,

    here is the ldd out put.

    linux-gate.so.1 => (0x00661000)
    libQtGui.so.4 => /home/rajini/qtsdk-2010.04/qt/lib/libQtGui.so.4 (0x007ed000)
    libQtCore.so.4 => /home/rajini/qtsdk-2010.04/qt/lib/libQtCore.so.4 (0x00110000)
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x003b7000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0045a000)
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x003d0000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x003f6000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x00662000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0x00415000)
    librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0x0041b000)
    libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0x00550000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x099f6000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x0061a000)
    libSM.so.6 => /usr/lib/libSM.so.6 (0x00424000)
    libICE.so.6 => /usr/lib/libICE.so.6 (0x007c6000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x0042d000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x0cf6d000)
    libz.so.1 => /lib/libz.so.1 (0x1e58f000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x1f94e000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x1fb60000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x00437000)
    /lib/ld-linux.so.2 (0x0043d000)
    libpcre.so.3 => /lib/libpcre.so.3 (0x1441b000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x00659000)
    libexpat.so.1 => /lib/libexpat.so.1 (0x09ac8000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x06fd5000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x007bc000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x007c0000)


    Regards
    Rajini

Similar Threads

  1. how to load from .mbm file when it has multiple .bmp icons
    By tlr in forum Symbian User Interface
    Replies: 16
    Last Post: 2009-11-17, 07:40
  2. Replies: 0
    Last Post: 2006-11-07, 11:45
  3. Replies: 0
    Last Post: 2005-10-21, 11:50
  4. How to load multiple bitmaps ?
    By pNinja in forum Symbian
    Replies: 0
    Last Post: 2005-01-30, 12:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×