Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use QPluginLoader to view methods inside library
Forum Updated to NodeBB v4.3 + New Features

How to use QPluginLoader to view methods inside library

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kamatchi
    wrote on last edited by
    #1

    Hi All,
    I have created the library file libtest.so.
    I need to view the classes and methods present inside library.
    Is there any way to get those method names through QPluginLoader / QLibrary

    Thanks,
    Kamatchi

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      Hi,

      I moved your topic to the general subforum. More people will see it there.

      The beta testing is for testing this forum website.

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        There are ways to see, what a library exports.
        If there is a way to reconstuct the object structure, I don't know.
        Doping this via QPluginLoader / QLibrary is not possible.
        Both are used to load libraries. QPluginLoader for plugins, QLibary in gerenal (QPluginLoader uses QLiabry internally).
        With QLibarary, you can find methods in a lib, but not list them.

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kamatchi
          wrote on last edited by
          #4

          Ok thanks for ur reply.

          But the instance() method in QPluginLoader returns QObject pointer
          Can i get class names from the QOBjectPointer( returned by QPluginLoader)

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #5

            If you look at the source code of QPluginLoader, it shows:

            it loads a library with QLibrary

            it resolves a specific function with QLibrary::resolve

            it calls that function, which be definition returns a QObject pointer

            If all this is compiled with RTTI, you can use RTTI functions to get the real class names
            If the returned classes have correct Qt meta info, you can usethe QMetaInfo API to retreive class names.

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kamatchi
              wrote on last edited by
              #6

              Thanks for ur reply

              Through MetaInfo i can get the class Name.
              But i want to get all the classes and method names used inside the library.
              Is it possible?

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lgeyer
                wrote on last edited by
                #7

                Not using pure Qt. Take a look at tools like nm (part of "binutils":http://www.gnu.org/software/binutils/).

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved