Is it possible to see definition of Q_SIGNALS, Q_SLOT, SLOT(), SIGNAL() macros? (Qt)

浪子不回头ぞ 提交于 2019-11-28 04:01:02

问题


Is it possible to see definition of Q_SIGNALS, Q_SLOT, SLOT(), SIGNAL() macros in Qt framework?

P.S. Google gave me nothing in this question.


回答1:


Form qobjectdefs.h, for a non-debug compilation:

#define Q_SLOTS
#define Q_SIGNALS   protected
#define SLOT(a)     "1"#a
#define SIGNAL(a)   "2"#a

The Q_SLOTS and Q_SIGNALS declarations are only treated specially by the moc run, in the final compilation they reduce to simple method declarations. SIGNAL() and SLOT() create names from the provided signatures.




回答2:


With visual studio - right click the identifier you're interested in and choose "Go To Definition" or press F12.
If you have Visual Assist, this can also be done with Alt+G when the VS mechanism doesn't work so well.



来源:https://stackoverflow.com/questions/1815172/is-it-possible-to-see-definition-of-q-signals-q-slot-slot-signal-macros

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!