7

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.

Sergey
  • 47,222
  • 25
  • 87
  • 129

2 Answers2

14

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.

sth
  • 222,467
  • 53
  • 283
  • 367
  • 1
    Also, you can look at the output files of moc (in your build directory) to see what it did with the macros. – Adam W Jan 07 '10 at 22:27
3

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.

shoosh
  • 76,898
  • 55
  • 205
  • 325