[qt3-win32] additional porting debug support for the native qt3 port available

Ralf Habacker ralf.habacker at freenet.de
Sun Apr 25 13:02:35 CEST 2004


Hi all, 

while preparing the recent qt port changes I implemented a method to reduce 
the overhead for adding and printing porting debug messages. 

A. How to add debug messages 
Add a printf style like function call to qPortDebug() anywhere like seen in 
the following example. 

void func a()
{
	....
	qPortDebug("xaz %s",a_var); 
	... 
}

this will print a debug line on stderr containing AUTOMATICALLY the filename, 
the line, the functionname and the printf like formatted string as seen 
above. see an example:  
...
kernel/qfontdatabase_win.cpp [00150]:void newWinFont(void) - xaz a string
....

To disable this debug code add the following macro at the beginning of the 
file. 

#define NO_QPORTDEBUG

By default the qPortDebug() calls are activated. 


B. How to print debug messages 
By default the printing of debug messages is disabled. You can activate this 
messages by using the following command line 

1. activate all debug messages 
	export QDEBUG=*
	<qtapp_name>

or 

	QDEBUG=* <qtapp_name>

2. activate specific debug message 
	export QDEBUG=<term>
	<qtapp_name>

or 

	QDEBUG=<term>  <qtapp_name>

where <term> is a string refering to a part of the printed messages in case of 
using QDEBUG=*. 

This setting belongs to all qDebug and qPortDebug messages. If you like to see 
only the message from qPortDebug you can use QPORTDEBUG instead of QDEBUG. 

QPORTDEBUG=* <atapp_name>

If you are using this stuff and are recognizing that only a few message are 
printed, see the related _win.cpp files if the debug printing is disabled. 

BTW: The implementation of qPortDebug could be found in src/tools/qglobal.cpp 
and src/tools/qglobal.h, where qPortDebug is a macro, which calls a function 
qPortMessage(). 


Ralf 





More information about the kde-cygwin mailing list