QT : get the class name of an object

后端 未结 2 666
逝去的感伤
逝去的感伤 2020-12-29 03:48

I\'m writing a test app that simulates key presses of another application. For every key press I have to check if the right window/form is shown. So what I do is get the poi

相关标签:
2条回答
  • 2020-12-29 04:01

    Try using the metaobject.

    pWin->metaObject()->className();  
    
    0 讨论(0)
  • 2020-12-29 04:21

    You could also check the typeinfo header. Using the typeid operator on you object you get a type_info instance which describes the type of your object. Check out: http://www.cplusplus.com/reference/std/typeinfo/type_info/

    0 讨论(0)
提交回复
热议问题