Qt Weekly #22: How to help Qt Support help you more efficiently

If you have used Qt Support before then you may have had to deal with a bit of back and forth with Support trying to get to the heart of the problem that you are having. Therefore in order to try and speed up that process along in the future we have the following tips for you to help you ensure we get all the information that might be useful to us right away.

Installation issues:
- First check that you have all the dependencies for building Qt as indicated here:

http://qt-project.org/doc/qt-4.8/requirements.html

http://qt-project.org/doc/qt-5/build-sources.html
- If the problem occurs when building Qt from source, then send the entire output from configure as well as the output from the make command so we can see everything that has happeend in the run up to the build issue
- If installing from one of the binary installers then re-run the installer with the --verbose option and send the log file it generates

General qmake issues:
- If the makefile/vcxproj/xcodeproj file is not being created correctly then re-run qmake with the extra options "-d -d -d -d 2>debug.txt" and send the debug.txt file it generates. This contains all the debug information from qmake which may be useful.

License not found or is incorrectly invalid issues:
- Delete the .qt-license file from:

*nix/Mac: $(HOME)/.qt-license
Windows: %USERPROFILE%/.qt-license

and delete the following extra file/registry entry:

*nix: $HOME/.config/Digia/LicenseManager.conf
Mac: $HOME/Library/Preferences/com.digia.LicenseManager.plist
Windows: HKEY_CURRENT_USER\Software\Digia\LicenseManager in the registry

Problems with the application starting up:
- If the application itself fails to start then check that the dependencies are found:

*nix: ldd ./executable
Mac: otool -L ./executable.app/Contents/MacOS/executable
Windows: depends executable.exe

On Windows if you do not have depends already you can get this from www.dependencywalker.com. Send the output to us if problems still occur (in the case of Windows you can save it as a dwi file and send that).

If it is a plugin that is failing to start then run the tool from the same location as the executable on the plugin directly instead. For example "ldd ./platforms/libxcb.so". In addition run the application with the environment variable:

QT_DEBUG_PLUGINS=1

set and send the output that you get from running the application. On Windows you might need to use DebugView in order to see the output if you don't have a console window or are not running through a debugger.

If the application is crashing:
- Send the stack trace you get when it crashes (in debug mode) and give us the details surrounding what was happening at the time of the crash. Additionally if an example can be produced to reproduce the problem then this certainly goes a long way.

If you have found a bug:
- Sometimes we need to pass on the example that is created to reproduce the bug by a customer into a public bug report system. Please indicate in that case if it is ok to use the example in a public bug report or not so we can save time having to ask first.

Problems related to the network module:
- If at all possible apply the patches from here:
Qt 4:

--- a/src/network/kernel/qhostinfo_win.cpp
+++ b/src/network/kernel/qhostinfo_win.cpp
@@ -134,8 +134,8 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
     QHostInfo results;

#if defined(QHOSTINFO_DEBUG) - qDebug("QHostInfoAgent::fromName(%p): looking up \"%s\" (IPv6 support is %s)", - this, hostName.toLatin1().constData(), + qDebug("QHostInfoAgent::fromName(): looking up \"%s\" (IPv6 support is %s)", + hostName.toLatin1().constData(), (local_getaddrinfo && local_freeaddrinfo) ? "enabled" : "disabled"); #endif

@@ -248,8 +248,8 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)

#if defined(QHOSTINFO_DEBUG) if (results.error() != QHostInfo::NoError) { - qDebug("QHostInfoAgent::run(%p): error (%s)", - this, results.errorString().toLatin1().constData()); + qDebug("QHostInfoAgent::run(): error (%s)", + results.errorString().toLatin1().constData()); } else { QString tmp; QList addresses = results.addresses(); @@ -257,8 +257,8 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName) if (i != 0) tmp += ", "; tmp += addresses.at(i).toString(); } - qDebug("QHostInfoAgent::run(%p): found %i entries: {%s}", - this, addresses.count(), tmp.toLatin1().constData()); + qDebug("QHostInfoAgent::run(): found %i entries: {%s}", + addresses.count(), tmp.toLatin1().constData()); } #endif return results;

--- a/src/network/network.pro +++ b/src/network/network.pro @@ -3,13 +3,13 @@ TARGET = QtNetwork QPRO_PWD = $$PWD DEFINES += QT_BUILD_NETWORK_LIB QT_NO_USING_NAMESPACE -#DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG -#DEFINES += QNETWORKDISKCACHE_DEBUG -#DEFINES += QSSLSOCKET_DEBUG -#DEFINES += QHOSTINFO_DEBUG -#DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG -#DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG -#DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG +DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG +DEFINES += QNETWORKDISKCACHE_DEBUG +DEFINES += QSSLSOCKET_DEBUG +DEFINES += QHOSTINFO_DEBUG +DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG +DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG +DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG QT = core win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000

Qt 5:

--- a/src/network/network.pro
+++ b/src/network/network.pro
@@ -2,13 +2,13 @@ TARGET = QtNetwork
QT = core-private

DEFINES += QT_NO_USING_NAMESPACE -#DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG -#DEFINES += QNETWORKDISKCACHE_DEBUG -#DEFINES += QSSLSOCKET_DEBUG -#DEFINES += QHOSTINFO_DEBUG -#DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG -#DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG -#DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG +DEFINES += QLOCALSERVER_DEBUG QLOCALSOCKET_DEBUG +DEFINES += QNETWORKDISKCACHE_DEBUG +DEFINES += QSSLSOCKET_DEBUG +DEFINES += QHOSTINFO_DEBUG +DEFINES += QABSTRACTSOCKET_DEBUG QNATIVESOCKETENGINE_DEBUG +DEFINES += QTCPSOCKETENGINE_DEBUG QTCPSOCKET_DEBUG QTCPSERVER_DEBUG QSSLSOCKET_DEBUG +DEFINES += QUDPSOCKET_DEBUG QUDPSERVER_DEBUG win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x64000000

MODULE_PLUGIN_TYPES = \

and then build the network module again and rerun the application. Send us the output that it generates as this will give us a lot of network debug information to look at in case it is useful.

Problems with debugging inside Qt Creator:
- Please include with your support request the contents of the Windows | Views | Debugger Log as this shows all the debugger commands and information.

General tips:
- If you experience a strange crash in your application and you have subclassed Q[Core|Gui]Application then just double check that the constructor's signature is correct, it should be taking an "int &" and not just an "int" as this can cause problems further down the line although it will compile fine without a warning.


Blog Topics:

Comments