Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6653823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:18:59+00:00 2026-05-26T01:18:59+00:00

Is there a way to enumerate all QObject classes declared in an application or

  • 0

Is there a way to enumerate all QObject classes declared in an application or DLL? I am trying to create an application that loads DLLs and lists all QObject classes inside the DLLs.

Update: Actually I am trying to create a Unit Test GUI. It will load DLLs, instantiate the QObject inside, and call QTest::qExec against them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:19:00+00:00Added an answer on May 26, 2026 at 1:19 am

    If the program code is not stripped you can get some instrospection by reading the binary:
    objdump -demangle=C++ -t SomeQtLibrary.so |grep qt_static_metacall it shows roughly the QObject derived classes. I think they all implement this symbol. Of couse since you are on Windows you would have to use Windows tools such as nm (correct me if I am wrong). Naturally processing the symbols in-code is also possible, but this is a separate topic.

    The command I mentioned returns this for example:

    0000000000470c00 l     F .text  0000000000000014              QxtBoundFunction::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    00000000004392ea l     F .text  0000000000000158              MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    0000000000453b5c l     F .text  0000000000000091              QtLocalPeer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    0000000000438508 l     F .text  0000000000000014              MyApplication::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    0000000000442cd0 l     F .text  0000000000000080              MessagePoll::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    0000000000442ea2 l     F .text  0000000000000091              RFBClient::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    0000000000467c3c l     F .text  000000000000436a              QxtRPCService::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    0000000000439114 l     F .text  000000000000008f              MemoryPolling::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
    

    If you are interested in run-time introspection than you would have to play with the QMetaObject class on each object.

    For objects that were registered as QMetaType (and only those!) you can do some additional magic to bring them to life. Not very easy, and not out of the box – but it is still hell of a lot from such a static language. Here is a snippet from Qt docs (changed if(id == 0) to if(id)).

     int id = QMetaType::type("MyClass");
     if (id) {
         void *myClassPtr = QMetaType::construct(id);
         ...
         QMetaType::destroy(id, myClassPtr);
         myClassPtr = 0;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way for a consumer to enumerate all interfaces implemented by a
I'm writing a service application that needs to enumerate all current user sessions, and
Is there a way to enumerate all users on a local (NT-based) Windows box
Is there a straightforward way to enumerate all visible network printers in .NET? Currently,
On page load is there a way to enumerate all the nest user controls
Is there a way, in WPF, to enumerate through all files within a specific
Is there any way to enumerate all of a character's Unicode properties in Ruby?
Consider the following graph: I'm trying to find a way to enumerate all possible
I'm experimenting with Android's audio recording and playback. Is there a way to enumerate
I am wondering if there is a way to enumerate the collection of applications

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.