| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 4 | |
Hi all, I know this is probobly a silly question, but where does the output of qDebug go to in Qt/Windows. Cheers, Jono
This works only in the debugger. I tink you have to set a hook to cach these and process the yourself. Ries Jonathan Bacon wrote: > > Hi all, > > I know this is probobly a silly question, but where does the output of > qDebug go to in Qt/Windows. > > Cheers, > > Jono > > -- > List archive and information: http://qt-interest.trolltech.com
If your application is a console app, the output will go in the console. > This works only in the debugger. > I tink you have to set a hook to cach these and process the yourself. > > Ries > Jonathan Bacon wrote: > > > > Hi all, > > > > I know this is probobly a silly question, but where does the output of > > qDebug go to in Qt/Windows. > > > > Cheers, > > > > Jono > > > > -- > > List archive and information: http://qt-interest.trolltech.com > > -- > List archive and information: http://qt-interest.trolltech.com >
They go to the Debug window in MSVC. They use the Win32 OutputDebugString() API call There is a utility from www.sysinternals.com which can catch these messages and display them for you. Paul ----- Original Message ----- From: Jonathan Bacon <j.bacon@delta.wlv.ac.uk> To: <qt-interest@trolltech.com> Sent: Thursday, October 11, 2001 4:13 PM Subject: qDebug in windows Hi all, I know this is probobly a silly question, but where does the output of qDebug go to in Qt/Windows. Cheers, Jono -- [ signature omitted ]
Am Donnerstag, 11. Oktober 2001 17:13 schrieb Jonathan Bacon:
> I know this is probobly a silly question, but where does the output of
> qDebug go to in Qt/Windows.
It goes straight to NoWhere ;). There seems to be a significant difference
between console apps and gui apps on Windows concerning STDOUT and
STDERR (why?).
You can do something like this in your main C++ file:
stream someStream; // File or whatever you like
void MyOutputHandler(QtMsgType type, const char *msg) {
switch (type) {
case QtDebugMsg:
someStream << msg << "\n";
break;
case QtWarningMsg:
someStream << "Warnung: " << msg << "\n";
break;
case QtFatalMsg:
someStream << "Fatal: " << msg << "\n";
abort(); // dump core on purpose
}
}
int main( int argc, char ** argv ) {
// Application
QApplication a( argc, argv );
[ init someStream ]
qInstallMsgHandler(wbAusgabeHandler);
// .... Blah blah ....
}
klaus
--
[ signature omitted ]
> This works only in the debugger. > I tink you have to set a hook to cach these and process the yourself. I know the response is probobly RTFM, but any idea how to do this in Visual C++? I am completely new to Windows development. Cheers, Jono
> > This works only in the debugger. > > I tink you have to set a hook to cach these and process the yourself. > > I know the response is probobly RTFM, but any idea how to do this in > Visual C++? I am completely new to Windows development. You don't need to catch anything. If you use Visual Studio and your application is built as debug then you will see the output in the output window which is commonly at the bottom of Visual Studio (the one with all the libraries in when they are loaded). If you are running on the command line, then make your application a console application that is built as debug (add console to the CONFIG line in your .pro file if you use qmake or use /SUBSYSTEM:console in your makefile). And run your application. Then you will see the debug messages without a problem. Andy
Hi Folks, Is there a way to put a QScrollView on a dialog in Qt Designer? I might be missing the obvious, but I can't see it - the nearest thing is a QFrame. - Keith
> This works only in the debugger. > I tink you have to set a hook to cach these and process the yourself. I know the response is probobly RTFM, but any idea how to do this in Visual C++? I am completely new to Windows development. qdebugs get expanded to outputdebugstrings() in windows to see outputdebugstrings just start it under a debugger ig create a debug build and start it via F5 in msvc. hope it helps
Does anybody know of a 'debugger' program which does no debugging per se - all it does is echo these messages to the console? Cheers, M On Thu, Oct 11, 2001 at 06:59:57PM +0200, Nikolaus Gerstmayr wrote: > > This works only in the debugger. > > I tink you have to set a hook to cach these and process the yourself. > > I know the response is probobly RTFM, but any idea how to do this in > Visual C++? I am completely new to Windows development. > > qdebugs get expanded to outputdebugstrings() in windows > to see outputdebugstrings just start it under a debugger > ig create a debug build and start it via F5 in msvc. > > hope it helps > > -- > List archive and information: http://qt-interest.trolltech.com
Does anybody know of a 'debugger' program which does no debugging per se - all it does is echo these messages to the console? Cheers, M well, outputdebugstrings can only be read by a debugger. but I happen to work on a debugger for windows - with Qt for GUI stuff and threading. So it was easy to make a stripped down debugger that does only read outputdebugstring and uses console you can grab it here: http://stud4.tuwien.ac.at/~e9425109/it.zip hope you like it ;)
Well stg easy to do is to use qInstallMsgHandler (available under windows and linux) (it is described in 'QApplication', they give an example : just copy it :) ) Note : if you do a 'console app' under VC++, the default qDebug will be displayed in the console (even in release mode)... > -----Message d'origine----- > De : Jonathan Bacon [mailto:j.bacon@delta.wlv.ac.uk] > Envoyé : jeudi 11 octobre 2001 17:30 > A : qt-interest@trolltech.com > Objet : RE: qDebug in windows > > > > This works only in the debugger. > > I tink you have to set a hook to cach these and process the > yourself. > > I know the response is probobly RTFM, but any idea how to do this in > Visual C++? I am completely new to Windows development. > > Cheers, > > Jono > > -- > List archive and information: http://qt-interest.trolltech.com >
<<< text/html: EXCLUDED >>>