useful for debugging, dumps the object and all it's parents also usable from GDB!
| 142 | // useful for debugging, dumps the object and all it's parents |
| 143 | // also usable from GDB! |
| 144 | void dumpObject(QObject *obj) |
| 145 | { |
| 146 | if (!obj) { |
| 147 | cout << "QObject(0x0)" << endl; |
| 148 | return; |
| 149 | } |
| 150 | |
| 151 | const std::ios::fmtflags oldFlags(cout.flags()); |
| 152 | do { |
| 153 | cout << obj->metaObject()->className() << "(" << hex << obj << ")"; |
| 154 | obj = obj->parent(); |
| 155 | if (obj) |
| 156 | cout << " <- "; |
| 157 | } while (obj); |
| 158 | cout << endl; |
| 159 | cout.flags(oldFlags); |
| 160 | } |
| 161 | |
| 162 | struct Listener |
| 163 | { |
nothing calls this directly
no test coverage detected