> -----Original Message----- > From: [email protected] [mailto:qt- > [email protected]] On Behalf Of ext > andy fillebrown > Sent: Sunday, July 24, 2011 2:09 AM > To: [email protected] > Subject: [Qt-creator] Howto link a file in debugger output? > > Hi all, > > I'm trying to print debug output such that a file:line link is included, > similar to > how QObject::connect does it when it reports a bad connection attempt ... > > like this debug output ... > Object::connect: No such slot Child::childChanged() in > debug\/../../../../../master/src/plugins/mi_coreplugin/dataobjects/mi_objec > t.h:145 > > When I get this message in the debugger the file is underlined and I can click > on it to jump directly to the file:line. How do I print my own file:line so > it can > be jumped to from the debugger? I've tried just printing it like > QObject::connect does, but it doesn't seem to work. Looking through the > source code doesn't reveal how to do it either; it just looks like a regular > string passed to qWarning().
Hi, the heuristics to detect file names & lines are in QtOutputFormatter ($CREATORDIR/src/plugins/qtsupport/qtoutputformatter.cpp). E.g. the connect statement is catched by a regular expression 'Object::.*in (.*:\\d+)', and if you keep to exactly this regular expression your file/line columns should also be clickable. Note though that this is an implementation detail, and might break without further warning in future versions. Regards Kai > Any ideas? > > Cheers, > ~ andy.f > _______________________________________________ > Qt-creator mailing list > [email protected] > http://lists.qt.nokia.com/mailman/listinfo/qt-creator _______________________________________________ Qt-creator mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-creator
