I used __FILE__ and __LINE__ with gcc on Linux, but I thought it's rather common and should work on VS for example.
And there is also Qt Meta Object system whick can give you some info. Every class which has a moc part (so inherits QObject and has a Q_OBJECT macro) has a metaObject() which returns QMetaObject, which has methods like classInfo(), className() - can be also useful :]
Bookmarks