Main | LegacyQtInstallationAndSetup

Qt 5.1.1 with Visual Studio 2012

These directions will allow Qt 5.1.1 to be installed and used by Visual Studio 2012. (:toc:)

Prerequisites

  1. Install Visual Studio 2012 and apply <A HREF="http://support.microsoft.com/kb/2835600?ppud=4&wa=wsignin1.0">Update 3</A> if it has not already been done.
  2. Install <A HREF="http://www.activestate.com/activeperl">ActivePerl</A> (currently version 5.16.3 Build 1603), checking add path to the PATH environment variable during installation.
  3. Install <A HREF="http://www.activestate.com/activepython">ActivePython</A> (currently version 3.2.2.3).
    1. Create an environment variable named PYTHON_DIR and set its value to the path to the Python installation (for example "C:\Program Files (x86)\Python32)
  4. Install <A HREF="http://site.icu-project.org">ICU</A>
    1. Download the ICU Windows binary archive (currently version 51.2)
    2. Extract the archive and place the resultant files in a permanent location (for example, C:\Program Files (x86)\ICU).
    3. Create an environment variable named ICU_DIR and set its value to the location of ICU.
    4. Prepend \bin; to the PATH environment variable.
  5. Install <A HREF="http://rubyinstaller.org/">Ruby</A> (currently version 2.0.0.0 p195). During installation, check update the PATH environment variable.
  6. (For Windows XP support) Install the Windows SDK 7.1
  7. (For Windows XP support) Install the DirectX SDK from June 2010
  8. (Optional) Install <A HREF="http://www.openssl.org">OpenSSL</A> (currently version 1.0.1e)

Setup

  1. (Optional, for commercial licenses) Instal the license file.
    1. Download the license file.
    2. Rename the file to .qt-license.
    3. Move the license file to the root of your user directory.
  2. Download the latest version of QT's source code from here.
  3. Extract the source into C:\Qt\5.1.1-x86 or a similar path. This path will be referred to as QTDIR for the remainder of this document. Qt compilation will fail if there are spaces in the path or if the path is changed after the compilation process has completed.
  4. Create the environment variables:
    1. Go to "Control Panel" → "System" → "Advanced" → "Environment Variables"
    2. Within the system variables section, click New to bring up the New Variable dialog.
    3. Fill in the dialog. Fill in the name field with "QTDIR" and the value field with the path to the Qt source code.
    4. Click ok.
    5. Prepend %QTDIR%\bin; to the system PATH environment variable.
    6. Click ok twice.

Edit the Qt sources

  1. Update %QTDIR%/qtbase/mkspecs/win32-msvc2012/qmake.conf
    1. Change (:code:)QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t to (:code:)QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t -D_USING_V110_SDK71_
    2. Change(:code:)QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE to(:code:)QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,\"5.01\"
    3. Change(:code:)QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS to(:code:)QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,\"5.01\"
  2. Update /qtwebkit/Source/WebCore/WebCore.pri(:source:)
  3. Remove whole program optimizations due to miscompilations

win32-msvc2005|win32-msvc2008|win32-msvc2010|wince*:{ (:sourceend:)

  with (:source:)
  1. Remove whole program optimizations due to miscompilations

win32-msvc2005|win32-msvc2008|win32-msvc2010|win32-msvc2012|wince*:{ (:sourceend:)

Setup the Qt build environment

  1. Copy and paste the following batch code into a file named setup.bat.<div style="height:10em;overflow:scroll">(:source lang=dos:) @ECHO off REM Program Files Paths =================================== IF "%ProgramFiles(x86)%" == "" GOTO 32BIT_HOST SET programFiles32=%ProgramFiles(x86)% SET programFiles64=%ProgramFiles% GOTO QUERY_MODE :32BIT_HOST SET programFiles32=%ProgramFiles% SET programFiles64= GOTO QUERY_MODE REM Query Mode =================================== :QUERY_MODE SET /p mode= "Target 32-bit (1) or 64-bit(2)? " IF "%mode%" == "1" GOTO 32BIT_MODE IF "%mode%" == "2" GOTO 64BIT_MODE echo "The selected mode is invalid, quiting." GOTO END :32BIT_MODE SET mode=x86 GOTO QUERY_VS_VERSION :64BIT_MODE SET mode=x86_amd64 GOTO QUERY_VS_VERSION REM Query the version of Visual Studio =================================== :QUERY_VS_VERSION SET /p version= "Which version of Visual Studio (2010 or 2012)? " IF "%version%" == "2010" GOTO VERSION_2010 IF "%version%" == "2012" GOTO VERSION_2012 ECHO "The selected version of Visual Studio is not supported, quiting." GOTO END :VERSION_2010 set QMAKESPEC=win32-msvc2010 SET xpSupport=no GOTO RUN :VERSION_2012 set QMAKESPEC=win32-msvc2012 GOTO QUERY_XP_SUPPORT REM XP Support ============================================================ :QUERY_XP_SUPPORT SET /p xpSupport= "Enable XP Support (yes, no)? " IF "%xpSupport%" == "yes" GOTO RUN IF "%xpSupport%" == "no" GOTO RUN ECHO "The XP support choice is not supported, quiting." GOTO END :RUN echo on call "%programFiles32%\Microsoft DirectX SDK (June 2010)\Utilities\Bin\dx_setenv.cmd" echo on IF "%version%" == "2012" GOTO VS_2012 call "%programFiles32%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %mode% echo on GOTO XP_SUPPORT :VS_2012 call "%programFiles32%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" %mode% echo on :XP_SUPPORT IF "%xpSupport%" == "no" GOTO OPENSSL set INCLUDE=%programFiles32%\Microsoft SDKs\Windows\7.1A\Include;%INCLUDE% set PATH=%programFiles32%\Microsoft SDKs\Windows\7.1A\Bin;%PATH% set CL=/D_USING_V110_SDK71_;%CL% set LIB=%programFiles32%\Microsoft SDKs\Windows\7.1A\Lib;%LIB% set LINK=/SUBSYSTEM:CONSOLE,5.01 %LINK% :OPENSSL IF "%mode%" == "x86_amd64" GOTO OPENSSL64 IF "%OPENSSL32DIR%" == "" GOTO COMMON set INCLUDE=%OPENSSL32DIR%\include;%INCLUDE% set LIB=%OPENSSL32DIR%\lib\VC\static;%LIB% GOTO COMMON :OPENSSL64 IF "%OPENSSL64DIR%" == "" GOTO COMMON set INCLUDE=%OPENSSL64DIR%\include;%INCLUDE% set LIB=%OPENSSL64DIR%\lib\VC\static;%LIB% :COMMON set PATH=%QTDIR%\qtbase\bin;%QTDIR%\qtrepotools\bin;%QTDIR%\gnuwin32\bin;%PATH% set PATH=%PYTHON_DIR%;%PATH% set INCLUDE=%ICU_DIR%\include;%INCLUDE% set LIB=%ICU_DIR%\lib;%LIB% set PATH=%ICU_DIR%\bin;%PATH% cd %QTDIR% :END </div>
  2. Open a command prompt
  3. Run the setup.bat file

Build Qt

  1. Configure Qt: configure -debug-and-release -mp -ltcg -opengl desktop
    • -help - Print a list of configuration options.
    • -debug-and-release - Enable generation of both debug and release mode executables.
    • -mp - Use multiple processors for compiling with MSVC (-MP).
    • -ltcg - Use Link Time Code Generation. (Release builds only). This can increase performance by 10%-15%. However, the size of the library will be larger.
    • -opengl desktop - Use native OpenGL drivers instead of the ANGLE library.
    A full list of parameters can be found at Configuration Options for Qt
  2. Choose which license you would like to use and enter y when prompted. The configuration process will take a few minutes.
  3. Build Qt. This will take a long time.(:source:)

nmake (:sourceend:)

  1. Delete all intermediate files produced in the build process. These file are no longer needed.(:source:)

move \qtactiveqt\src\activeqt\vc110.pdb \qtactiveqt\src\activeqt\vc110.pdb.hold move \qtactiveqt\src\activeqt\container\vc110.pdb \qtactiveqt\src\activeqt\container\vc110.pdb.hold move \qtactiveqt\src\activeqt\control\vc110.pdb \qtactiveqt\src\activeqt\control\vc110.pdb.hold nmake clean move \qtactiveqt\src\activeqt\vc110.pdb.hold \qtactiveqt\src\activeqt\vc110.pdb move \qtactiveqt\src\activeqt\container\vc110.pdb.hold \qtactiveqt\src\activeqt\container\vc110.pdb move \qtactiveqt\src\activeqt\control\vc110.pdb.hold \qtactiveqt\src\activeqt\control\vc110.pdb (:sourceend:)

Installing Addon Modules

QtFtp

The QFtp class has been depreciated in Qt5, but the class is still available in the form of an addon.

  1. Create the directory %QTDIR%/addons if it doesn't already exist.
    • Using Git - clone git://gitorious.org/qt/qtftp.git.
    • Download as a tarball
      1. Download the tarball
      2. Extract the tarball
      3. Create an empty .git folder in %QTDIR%/addons/qtftp
  2. In the command window, navigate to %QTDIR%/addons/qtftp.
  3. Configure, build, and install the module.(:source:)

qmake CONFIG+="debug_and_release build_all" nmake nmake install (:sourceend:)

  1. Remove unneeded files.(:source:)

move /addons/qtftp/src/qftp/vc110.pdb /addons/qtftp/src/qftp/vc110.pdb.hold nmake clean move /addons/qtftp/src/qftp/vc110.pdb.hold /addons/qtftp/src/qftp/vc110.pdb (:sourceend:)

QtHttp

The QHttp class has been depreciated in Qt5, but the class is still available in the form of an addon.

  1. Create the directory %QTDIR%/addons if it doesn't already exist.
    • Using Git - clone git://gitorious.org/qt/qtftp.git.
    • Download as a tarball
      1. Download the tarball
      2. Extract the tarball
      3. Create an empty .git folder in %QTDIR%/addons/qthttp
  2. In the command window, navigate to %QTDIR%/addons/qthttp.
  3. Configure, build, and install the module.(:source:)

qmake CONFIG+="debug_and_release build_all" nmake nmake install (:sourceend:)

  1. Remove unneeded files.(:source:)

move /addons/qthttp/src/qhttp/vc110.pdb /addons/qthttp/src/qhttp/vc110.pdb.hold nmake clean move /addons/qthttp/src/qhttp/vc110.pdb.hold /addons/qthttp/src/qhttp/vc110.pdb (:sourceend:)

QtCharts

The commercial only QtCharts addon provides a charting library which is capable of creating a number of different chart types.

  1. Download the QtCharts archive from the Qt Customer Portal.
  2. Extract the archive to %QTDIR%/addons/qtcharts-1.3.0.
  3. Navigate to %QTDIR%/addons/qtcharts-1.3.0 in the command prompt.
  4. Configure, build, and install the module.(:source:)

qmake CONFIG+="debug_and_release build_all" nmake nmake install nmake clean (:sourceend:)

Optional Visual Studio Improvements

Debugging support for Qt can be added to Visual Studio 2012. The required changed can be performed manually (as described below) or they can be made automatically with the Qt Visual Studio Add-in. There are different versions of the Add-in for Qt 4.8.5 and 5.1. Using the Add-in is the preferred approach since it adds some debugging features not described below. In addition to debugging support, the Add-in optionally also provides help integration and a Visual Studio wizard to simplify the generation of Qt projects. Not installing the wizard portion of the Add-in is recommended since there is another wizard (titled QtWizard) which is described below that provides alternate functionality.

Improve Debugger support for Qt datatypes.

Add the following lines to the file <Visual Studio Directory>/Common7/Packages/Debugger/autoexp.dat just before the line "[Visualizer]". Note: If you are on the Windows Vista or Windows 7 platform, you must open the text editor in "Run as Administrator" mode. (:source:) ;QT_DEBUG_START (Qt5 Visual Studio Add-in v1.2.2)

QByteArray=<d->data,s> size=<d->size,u> QPoint =x=<xp> y=<yp> QPointF =x=<xp> y=<yp> QRect =x1=<x1> y1=<y1> x2=<x2> y2=<y2> QRectF =x=<xp> y=<yp> w=<w> h=<h> QSize =width=<wd> height=<ht> QSizeF =width=<wd> height=<ht> QHash<*> =size=<d->size> QVarLengthArray<*> =size=<s> data=<ptr>

;QT_DEBUG_END (:sourcend:)

Add the following just after the [Visualizer] tag. This has been taken directly from the Qt Visual Studio Add-in (when installed for Visual Studio 2012 and Qt 5.1), which is not required. <div style="height:40em;overflow:scroll">(:code:) ;QT_DEBUG_START (Qt5 Visual Studio Add-in v1.2.2) ; Digia Qt 5.x visualizers -----------------------------------------[ start ]-- ;------------------------------------------------------------------------------ ; Feel free to modify these visualizers to suit yours needs! But please let us ; know about the changes you make, so we continuously improve the visualizers. ; Qt4 ;QString{ ; preview ([$e.d->data,su]) ; stringview ([$e.d->data,sub]) ; children ; ( ; #( ; d: $c.d, ; [size]: $c.d->size, ; [referenced]: $c.d->ref._q_value ; ) ; ) ;} ; Qt4 ;QByteArray{ ; preview ([$e.d->data,s]) ; stringview ([$e.d->data,sb]) ; children ; ( ; #( ; d: $c.d, ; [size]: $c.d->size, ; [referenced]: $c.d->ref._q_value ; ) ; ) ;} ; Qt5 QString|*::QString{ preview ([(unsigned short*)$e.d + $e.d->offset/2,su]) stringview ([(unsigned short*)$e.d + $e.d->offset/2,sub]) children ( #( d: $c.d, [size]: $c.d->size, [referenced]: $c.d->ref.atomic._q_value ) ) } ; Qt5 QByteArray|*::QByteArray{ preview ([(char*)$e.d + $e.d->offset,s]) stringview ([(char*)$e.d + $e.d->offset,sb]) children ( #( d: $c.d, [size]: $c.d->size, [referenced]: $c.d->ref._q_value ) ) } QFileInfo|*::QFileInfo{ preview ( #( "private=", $c.d_ptr ) ) } QUrl|*::QUrl{ preview ( #if ($e.d.stateFlags == 0) ( $e.d ) #else ( #( $e.d->scheme, $e.d->host, $e.d->path ) ) ) children ( #( scheme: $c.d->scheme, host: $c.d->host, path: $c.d->path, username: $c.d->userName, password: $c.d->password, encodedOriginal: $c.d->encodedOriginal, query: $c.d->query, fragment: $c.d->fragment ) ) } QTime|*::QTime{ preview ( #( "hour=", [$e.mds / 3600000, d], ", minute=", [($e.mds % 3600000) / 60000, d], ", second=", [($e.mds / 1000) % 60, d], ", millisecond=", [$e.mds % 1000, d] ) ) children ( #( [hour]: [$e.mds / 3600000, d], [minute]: [($e.mds % 3600000) / 60000, d], [second]: [($e.mds / 1000) % 60, d], [millisecond]: [$e.mds % 1000, d] ) ) } QVariant{ preview ( #if ($e.d.type == 1) ( #("bool = ", [$e.d.data.b]) ) #elif ($e.d.type == 2) ( #("int = ", [$e.d.data.i]) ) #elif ($e.d.type == 3) ( #("usigned int = ", [$e.d.data.u]) ) #elif ($e.d.type == 4) ( #("long long = ", [$e.d.data.ll]) ) #elif ($e.d.type == 5) ( #("unsigned long long = ", [$e.d.data.ull]) ) #elif ($e.d.type == 6) ( #("double = ", [$e.d.data.d]) ) #elif ($e.d.type == 7) ( #("char = ", [$e.d.data.c]) ) #elif ($e.d.type == 8) ( #("QMap = ", [(QMap) $e.d.data.ptr]) ) #elif ($e.d.type == 10) ( #("QString = ", [(QString) $e.d.data.ptr]) ) #elif ($e.d.type == 11) ( #("QStringList = ", [(QStringList) $e.d.data.ptr]) ) #elif ($e.d.type == 17) ( #("QUrl = ", [(QUrl) $e.d.data.ptr]) ) #else ( #("type = ", [$e.d.type]) ) ) children ( #if ($e.d.type == 1) ( $c.d.data.b ) #elif ($e.d.type == 2) ( $c.d.data.i ) #elif ($e.d.type == 3) ( $c.d.data.u ) #elif ($e.d.type == 4) ( $c.d.data.ll ) #elif ($e.d.type == 5) ( $c.d.data.ull ) #elif ($e.d.type == 6) ( $c.d.data.d ) #elif ($e.d.type == 7) ( $c.d.data.c ) #elif ($e.d.type == 8) ( ) #elif ($e.d.type == 10) ( #( [size]: ((QString) $c.d.data.ptr).d->size ) ) #elif ($e.d.type == 11) ( #if ((((QStringList) $e.d.data.ptr).d->end - ((QStringList) $e.d.data.ptr).d->begin) <= 10) ( #array ( expr: (QString)((((QStringList) $e.d.data.ptr).d->array + ((QStringList) $e.d.data.ptr).d->begin)[$i]), size: ((QStringList) $e.d.data.ptr).d->end-((QStringList) $e.d.data.ptr).d->begin ) ) #else ( #array ( expr: (QString)((((QStringList) $e.d.data.ptr).d->array + ((QStringList) $e.d.data.ptr).d->begin)[$i]), size: 10 ) ) ) #elif ($e.d.type == 17) ( #( scheme: ((QUrl) $e.d.data.ptr).d->scheme, host: ((QUrl) $e.d.data.ptr).d->host, path: ((QUrl) $e.d.data.ptr).d->path, username: ((QUrl) $e.d.data.ptr).d->userName, password: ((QUrl) $e.d.data.ptr).d->password, encodedOriginal: ((QUrl) $e.d.data.ptr).d->encodedOriginal, query: ((QUrl) $e.d.data.ptr).d->query, fragment: ((QUrl) $e.d.data.ptr).d->fragment ) ) #else ( #("type = ", [$e.d.type]) ) ) } *::QVariant{ preview ( #if ($e.d.type == 1) ( #("bool = ", [$e.d.data.b]) ) #elif ($e.d.type == 2) ( #("int = ", [$e.d.data.i]) ) #elif ($e.d.type == 3) ( #("usigned int = ", [$e.d.data.u]) ) #elif ($e.d.type == 4) ( #("long long = ", [$e.d.data.ll]) ) #elif ($e.d.type == 5) ( #("unsigned long long = ", [$e.d.data.ull]) ) #elif ($e.d.type == 6) ( #("double = ", [$e.d.data.d]) ) #elif ($e.d.type == 7) ( #("char = ", [$e.d.data.c]) ) #elif ($e.d.type == 8) ( #("QMap = ", [($T1::QMap) $e.d.data.ptr]) ) #elif ($e.d.type == 10) ( #("QString = ", [($T1::QString) $e.d.data.ptr]) ) #elif ($e.d.type == 11) ( #("QStringList = ", [($T1::QStringList) $e.d.data.ptr]) ) #elif ($e.d.type == 17) ( #("QUrl = ", [($T1::QUrl) $e.d.data.ptr]) ) #else ( #("type = ", [$e.d.type]) ) ) children ( #if ($e.d.type == 1) ( $c.d.data.b ) #elif ($e.d.type == 2) ( $c.d.data.i ) #elif ($e.d.type == 3) ( $c.d.data.u ) #elif ($e.d.type == 4) ( $c.d.data.ll ) #elif ($e.d.type == 5) ( $c.d.data.ull ) #elif ($e.d.type == 6) ( $c.d.data.d ) #elif ($e.d.type == 7) ( $c.d.data.c ) #elif ($e.d.type == 8) ( ) #elif ($e.d.type == 10) ( #( [size]: (($T1::QString) $c.d.data.ptr).d->size ) ) #elif ($e.d.type == 11) ( #if (((($T1::QStringList) $e.d.data.ptr).d->end - (($T1::QStringList) $e.d.data.ptr).d->begin) <= 10) ( #array ( expr: ($T1::QString)(((($T1::QStringList) $e.d.data.ptr).d->array + (($T1::QStringList) $e.d.data.ptr).d->begin)[$i]), size: (($T1::QStringList) $e.d.data.ptr).d->end-(($T1::QStringList) $e.d.data.ptr).d->begin ) ) #else ( #array ( expr: ($T1::QString)(((($T1::QStringList) $e.d.data.ptr).d->array + (($T1::QStringList) $e.d.data.ptr).d->begin)[$i]), size: 10 ) ) ) #elif ($e.d.type == 17) ( #( scheme: (($T1::QUrl) $e.d.data.ptr).d->scheme, host: (($T1::QUrl) $e.d.data.ptr).d->host, path: (($T1::QUrl) $e.d.data.ptr).d->path, username: (($T1::QUrl) $e.d.data.ptr).d->userName, password: (($T1::QUrl) $e.d.data.ptr).d->password, encodedOriginal: (($T1::QUrl) $e.d.data.ptr).d->encodedOriginal, query: (($T1::QUrl) $e.d.data.ptr).d->query, fragment: (($T1::QUrl) $e.d.data.ptr).d->fragment ) ) #else ( #("type = ", [$e.d.type]) ) ) } ;------------------------------------------------------------------------------ ; QStringList ;------------------------------------------------------------------------------ QStringList{ preview ( #if (($c.d->end - $c.d->begin) <= 10) ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: (QString)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end-$c.d->begin ), ")" ) ) #else ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: (QString)(($c.d->array + $c.d->begin)[$i]), size: 10 ), ", ...)" ) ) ) } *::QStringList{ preview ( #if (($c.d->end - $c.d->begin) <= 10) ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: ($T1::QString)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end-$c.d->begin ), ")" ) ) #else ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: ($T1::QString)(($c.d->array + $c.d->begin)[$i]), size: 10 ), ", ...)" ) ) ) } ;------------------------------------------------------------------------------ ; QList, QQueue ;------------------------------------------------------------------------------ QList<*>|QQueue<*>{ preview ( #if (int(sizeof($T1)) <= int(sizeof(void*))) ( #if (($c.d->end - $c.d->begin) <= 10) ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: ($T1)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end-$c.d->begin ), ")" ) ) #else ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: ($T1)(($c.d->array + $c.d->begin)[$i]), size: 10 ), ", ...)" ) ) ) #else ( #if (($c.d->end - $c.d->begin) <= 10) ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: *($T1*)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end-$c.d->begin ), ")" ) ) #else ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: *($T1*)(($c.d->array + $c.d->begin)[$i]), size: 10 ), ", ...)" ) ) ) ) children ( #if (int(sizeof($T1)) <= int(sizeof(void*))) ( #array ( expr: ($T1)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end - $c.d->begin ) ) #else ( #array ( expr: *($T1*)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end - $c.d->begin ) ) ) } *::QList<*>|*::QQueue<*>{ preview ( #if (int(sizeof($T2)) <= int(sizeof(void*))) ( #if (($c.d->end - $c.d->begin) <= 10) ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: ($T2)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end-$c.d->begin ), ")" ) ) #else ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: ($T2)(($c.d->array + $c.d->begin)[$i]), size: 10 ), ", ...)" ) ) ) #else ( #if (($c.d->end - $c.d->begin) <= 10) ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: *($T2*)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end-$c.d->begin ), ")" ) ) #else ( #( "[", $c.d->end - $c.d->begin, "](", #array ( expr: *($T2*)(($c.d->array + $c.d->begin)[$i]), size: 10 ), ", ...)" ) ) ) ) children ( #if (int(sizeof($T2)) <= int(sizeof(void*))) ( #array ( expr: ($T2)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end - $c.d->begin ) ) #else ( #array ( expr: *($T2*)(($c.d->array + $c.d->begin)[$i]), size: $c.d->end - $c.d->begin ) ) ) } ;------------------------------------------------------------------------------ ; QList::iterator, QQueue::iterator ;------------------------------------------------------------------------------ QList<*>::iterator|QList<*>::const_iterator|QQueue<*>::iterator|QQueue<*>::const_iterator{ preview ( #( ($T1*)$c.ptr ) ) children ( #( ptr: ($T1)$c.ptr ) ) } *::QList<*>::iterator|*::QList<*>::const_iterator|*::QQueue<*>::iterator|*::QQueue<*>::const_iterator{ preview ( #( ($T2)$c.i->v ) ) children ( #( ptr: ($T2)$c.i->v ) ) } ;------------------------------------------------------------------------------ ; QListIterator ;------------------------------------------------------------------------------ QListIterator<*>|QMutableListIterator<*>{ preview ( #( *($T1*)($c.i.i->v) ) ) children ( #( Value: *($T1*)($c.i.i->v) ) ) } *::QListIterator<*>|*::QMutableListIterator<*>{ preview ( #( *($T2*)($c.i.i->v) ) ) children ( #( Value: *($T2*)($c.i.i->v) ) ) } ;------------------------------------------------------------------------------ ; QLinkedList ;------------------------------------------------------------------------------ QLinkedList<*>{ preview ( #if ($e.d->size >= 10) ( #( "[", $e.d->size, "](", #list ( head: $c.d->n, size: 10, next: n ) : ( (*(QLinkedListNode<$T1>*)&$e).t ), ", ...)" ) ) #else ( #( "[", $e.d->size, "](", #list ( head: $c.d->n, size: $c.d->size, next: n ) : ( (*(QLinkedListNode<$T1>*)&$e).t ), ")" ) ) ) children ( #( #list ( head: $c.d->n, size: $c.d->size, next: n ) : (*(QLinkedListNode<$T1>*)&$e).t ) ) } *::QLinkedList<*>{ preview ( #if ($e.d->size >= 10) ( #( "[", $e.d->size, "](", #list ( head: $c.d->n, size: 10, next: n ) : ( (*($T1::QLinkedListNode<$T2>*)&$e).t ), ", ...)" ) ) #else ( #( "[", $e.d->size, "](", #list ( head: $c.d->n, size: $c.d->size, next: n ) : ( (*($T1::QLinkedListNode<$T2>*)&$e).t ), ")" ) ) ) children ( #( #list ( head: $c.d->n, size: $c.d->size, next: n ) : (*($T1::QLinkedListNode<$T2>*)&$e).t ) ) } ;------------------------------------------------------------------------------ ; QLinkedList::iterator ;------------------------------------------------------------------------------ QLinkedList<*>::iterator|*::QLinkedList<*>::iterator|QLinkedList<*>::const_iterator|*::QLinkedList<*>::const_iterator{ preview ( #( $e.i->t ) ) children ( #( ptr: $e.i->t ) ) } QLinkedListIterator<*>|*::QLinkedListIterator<*>{ preview ( #( $c.i ) ) children ( #( value: $c.i ) ) } ;------------------------------------------------------------------------------ ; QVector, QStack ; ; By default, this visualizer supports only Qt 4.6.x. If you're going to use ; Qt 4.5.x code, then you may want to replace all expr lines with this: ; expr: (((size_t)($c.d) + (size_t)(sizeof(QVectorData)) ))[$i], ; ; This will allow this visualizer to display Qt 4.5.x and Qt 4.6.x QVector ; objects. But be aware of some limitations. For example enum types can't be ; displayed properly this way. ; ; Qt 4.5.x: ; QVector::d is QVectorTypedData<T> ; QVector::p is QVectorData ; expr: $c.d->array[$i] ; ; Qt 4.6.x: ; QVector::d is QVectorData ; QVector::p is QVectorTypedData<T> ; expr: $c.p->array[$i] ; ;------------------------------------------------------------------------------ QVector<*>|*::QVector<*>|QStack<*>|*::QStack<*>{ preview ( #if ($c.d->size <= 10) ( #( "[", $c.d->size, "](", #array ( expr: $c.p->array[$i], size: $c.d->size ), ")" ) ) #else ( #( "[", $c.d->size, "](", #array ( expr: $c.p->array[$i], size: 10 ), ", ...)" ) ) ) children ( #array ( expr: $c.p->array[$i], size: $c.d->size ) ) } ;------------------------------------------------------------------------------ ; QMap ;------------------------------------------------------------------------------ QMapNode<*,*>{ preview ( #( "(", $e.key, "; ", $e.value, ")" ) ) children ( #( key: $e.key, value: $e.value ) ) } QMap<*>{ children ( #( raw data: [$c,!], #tree ( head : $c.d->forward[0], skip : $c.d, size : $c.d->size, left : backward, right : forward ) : ( (QMapNode<$T1>*)((char*)&$e - (sizeof(QMapPayloadNode<$T1>) - sizeof(QMapData::Node*))) ) ) ) preview ( #( "[", $e.d->size, "](", #tree ( head : $c.d->forward[0], size : $c.d->size, left : backward, right : forward ) : $e, ")" ) ) } ;------------------------------------------------------------------------------ ; QHash ;------------------------------------------------------------------------------ QHash<*>{ preview ( #( "[", $e.d->size, "] (...)" ) ) children ( #if ($e.d->size <= 255) ( #( #array ( expr: (QHashNode<$T1>*)$c.d->buckets[$i], size: $c.d->numBuckets ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e ) ) ) #else ( #( #array ( expr: (QHashNode<$T1>*)$c.d->buckets[$i], size: 255 ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e ) ) ) ) } *::QHash<*>{ preview ( #( "[", $e.d->size, "] (...)" ) ) children ( #if ($e.d->size <= 255) ( #( #array ( expr: ($T1::QHashNode<$T2> *)$c.d->buckets[$i], size: $c.d->numBuckets ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e ) ) ) #else ( #( #array ( expr: ($T1::QHashNode<$T2> *)$c.d->buckets[$i], size: 255 ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e ) ) ) ) } ;------------------------------------------------------------------------------ ; QMultiHash ;------------------------------------------------------------------------------ QMultiHash<*>{ preview ( (*(QHash<$T1>*)(&$c)) ) } *::QMultiHash<*>{ preview ( (*($T1::QHash<$T2>*)(&$c)) ) } ;------------------------------------------------------------------------------ ; QHash::iterator ;------------------------------------------------------------------------------ QHash<*>::iterator{ preview ( #( "(", ((QHashNode<$T1>*)($c.i))->key, ", ", ((QHashNode<$T1>*)($c.i))->value, ")" ) ) children ( #( key: ((QHashNode<$T1>*)($c.i))->key, value: ((QHashNode<$T1>*)($c.i))->value ) ) } *::QHash<*>::iterator{ preview ( #( "(", (($T1::QHashNode<$T2>*)($c.i))->key, ", ", (($T1::QHashNode<$T2>*)($c.i))->key, ")" ) ) children ( #( key: (($T1::QHashNode<$T2>*)($c.i))->key, value: (($T1::QHashNode<$T2>*)($c.i))->value ) ) } ;------------------------------------------------------------------------------ ; QHashIterator ;------------------------------------------------------------------------------ QHashIterator<*>{ preview ( #( "(", ((QHashNode<$T1>*)((($c).i).i))->key, ", ", ((QHashNode<$T1>*)((($c).i).i))->key, ")" ) ) children ( #( key: ((QHashNode<$T1>*)((($c).i).i))->key, value: ((QHashNode<$T1>*)((($c).i).i))->value ) ) } *::QHashIterator<*>{ preview ( #( "(", (($T1::QHashNode<$T2>*)((($c).i).i))->key, ", ", (($T1::QHashNode<$T2>*)((($c).i).i))->key, ")" ) ) children ( #( key: (($T1::QHashNode<$T2>*)((($c).i).i))->key, value: (($T1::QHashNode<$T2>*)((($c).i).i))->value ) ) } ;------------------------------------------------------------------------------ ; QHashNode ;------------------------------------------------------------------------------ QHashNode<*>|*::QHashNode<*>{ preview ( #( "(key = ", $c.key,"; value = ", $c.value, ")" ) ) children ( #( key: $c.key, value: $c.value ) ) } ;------------------------------------------------------------------------------ ; QSet ;------------------------------------------------------------------------------ QSet<*>{ preview ( #( "[", $e.q_hash.d->size, "] (...)" ) ) children ( #if ($e.q_hash.d->size <= 255) ( #( #array ( expr: (QHashNode<$T1,QHashDummyValue> *)$c.q_hash.d->buckets[$i], size: $c.q_hash.d->numBuckets ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e.key ) ) ) #else ( #( #array ( expr: (QHashNode<$T1,QHashDummyValue> *)$c.q_hash.d->buckets[$i], size: 255 ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e.key ) ) ) ) } *::QSet<*>{ preview ( #( "[", $e.q_hash.d->size, "] (...)" ) ) children ( #if ($e.q_hash.d->size <= 255) ( #( #array ( expr: ($T1::QHashNode<$T2,QHashDummyValue> *)$c.q_hash.d->buckets[$i], size: $c.q_hash.d->numBuckets ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e.key ) ) ) #else ( #( #array ( expr: ($T1::QHashNode<$T2,QHashDummyValue> *)$c.q_hash.d->buckets[$i], size: 255 ) : #list ( head: $e, next: next ) : #switch ($e.next != 0) #case 1 ( $e.key ) ) ) ) } ;------------------------------------------------------------------------------ ; QPalette ;------------------------------------------------------------------------------ QPalette{ children ( #( WindowText_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 0)->d, Button_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 1)->d, Light_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 2)->d, Midlight_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 3)->d, Dark_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 4)->d, Mid_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 5)->d, Text_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 6)->d, BrightText_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 7)->d, ButtonText_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 8)->d, Base_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 9)->d, Window_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+10)->d, Shadow_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+11)->d, Highlight_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+12)->d, HighlightedText_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+13)->d, Link_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+14)->d, LinkVisited_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+15)->d, AlternateBase_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+16)->d, NoRole_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+17)->d, ToolTipBase_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+18)->d, ToolTipText_active: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+19)->d, WindowText_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 0)->d, Button_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 1)->d, Light_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 2)->d, Midlight_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 3)->d, Dark_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 4)->d, Mid_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 5)->d, Text_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 6)->d, BrightText_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 7)->d, ButtonText_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 8)->d, Base_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 9)->d, Window_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+10)->d, Shadow_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+11)->d, Highlight_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+12)->d, HighlightedText_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+13)->d, Link_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+14)->d, LinkVisited_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+15)->d, AlternateBase_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+16)->d, NoRole_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+17)->d, ToolTipBase_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+18)->d, ToolTipText_disabled: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+19)->d, WindowText_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 0)->d, Button_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 1)->d, Light_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 2)->d, Midlight_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 3)->d, Dark_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 4)->d, Mid_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 5)->d, Text_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 6)->d, BrightText_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 7)->d, ButtonText_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 8)->d, Base_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 9)->d, Window_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+10)->d, Shadow_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+11)->d, Highlight_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+12)->d, HighlightedText_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+13)->d, Link_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+14)->d, LinkVisited_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+15)->d, AlternateBase_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+16)->d, NoRole_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+17)->d, ToolTipBase_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+18)->d, ToolTipText_inactive: ((QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+19)->d ) ) } *::QPalette{ children ( #( WindowText_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 0)->d, Button_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 1)->d, Light_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 2)->d, Midlight_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 3)->d, Dark_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 4)->d, Mid_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 5)->d, Text_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 6)->d, BrightText_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 7)->d, ButtonText_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 8)->d, Base_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+ 9)->d, Window_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+10)->d, Shadow_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+11)->d, Highlight_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+12)->d, HighlightedText_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+13)->d, Link_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+14)->d, LinkVisited_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+15)->d, AlternateBase_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+16)->d, NoRole_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+17)->d, ToolTipBase_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+18)->d, ToolTipText_active: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+19)->d, WindowText_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 0)->d, Button_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 1)->d, Light_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 2)->d, Midlight_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 3)->d, Dark_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 4)->d, Mid_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 5)->d, Text_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 6)->d, BrightText_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 7)->d, ButtonText_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 8)->d, Base_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+ 9)->d, Window_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+10)->d, Shadow_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+11)->d, Highlight_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+12)->d, HighlightedText_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+13)->d, Link_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+14)->d, LinkVisited_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+15)->d, AlternateBase_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+16)->d, NoRole_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+17)->d, ToolTipBase_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+18)->d, ToolTipText_disabled: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+20+19)->d, WindowText_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 0)->d, Button_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 1)->d, Light_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 2)->d, Midlight_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 3)->d, Dark_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 4)->d, Mid_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 5)->d, Text_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 6)->d, BrightText_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 7)->d, ButtonText_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 8)->d, Base_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+ 9)->d, Window_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+10)->d, Shadow_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+11)->d, Highlight_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+12)->d, HighlightedText_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+13)->d, Link_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+14)->d, LinkVisited_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+15)->d, AlternateBase_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+16)->d, NoRole_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+17)->d, ToolTipBase_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+18)->d, ToolTipText_inactive: (($T1::QBrush*)((char*)$c.d+sizeof(QAtomicInt))+40+19)->d ) ) } ;------------------------------------------------------------------------------ ; QBrush ;------------------------------------------------------------------------------ QBrush|*::QBrush{ preview ( #( "[", $c.d->style, "] (...)" ) ) children ( #( style: $c.d->style, color: $c.d->color, transform: $c.d->transform ) ) } QBrushData|*::QBrushData{ preview ( #( "[", $c.style, "] (...)" ) ) children ( #( style: $c.style, color: $c.color, transform: $c.transform ) ) } ;------------------------------------------------------------------------------ ; QColor ;------------------------------------------------------------------------------ QColor|*::QColor{ preview ( #( #if ($c.cspec == 1) ( #( "[", $c.cspec, "] [", "r = ", [$c.ct.argb.red,x], ", g = ", [$c.ct.argb.green,x], ", b = ", [$c.ct.argb.blue,x], "] (...)" ) ) #elif ($c.cspec == 2) ( #( "[", $c.cspec, "] [", "h = ", [$c.ct.ahsv.hue,x], ", s = ", [$c.ct.ahsv.saturation,x], ", v = ", [$c.ct.ahsv.value,x], "] (...)" ) ) #elif ($c.cspec == 3) ( #( "[", $c.cspec, "] [", "c = ", [$c.ct.acmyk.cyan,x], ", m = ", [$c.ct.acmyk.magenta,x], ", y = ", [$c.ct.acmyk.yellow,x], ", k = ", [$c.ct.acmyk.black,x], "] (...)" ) ) #else ( #( "[Invalid]" ) ) ) ) children ( #( #if ($c.cspec == 1) ( #( red: [$c.ct.argb.red,x], green: [$c.ct.argb.green,x], blue: [$c.ct.argb.blue,x], alpha: [$c.ct.argb.alpha,x], pad: [$c.ct.argb.pad,x] ) ) #elif ($c.cspec == 2) ( #( hue: [$c.ct.ahsv.hue,x], saturation: [$c.ct.ahsv.saturation,x], value: [$c.ct.ahsv.value,x], alpha: [$c.ct.ahsv.alpha,x], pad: [$c.ct.ahsv.pad,x] ) ) #elif ($c.cspec == 3) ( #( cyan: [$c.ct.acmyk.cyan,x], magenta: [$c.ct.acmyk.magenta,x], yellow: [$c.ct.acmyk.yellow,x], black: [$c.ct.acmyk.black,x], alpha: [$c.ct.acmyk.alpha,x] ) ) ) ) } ;------------------------------------------------------------------------------ ; QTransform ;------------------------------------------------------------------------------ QTransform|*::QTransform{ preview ( #( "[",[$c.affine._m11,g]," ",[$c.affine._m12,g]," ",[$c.m_13,g],"]", "[",[$c.affine._m21,g]," ",[$c.affine._m22,g]," ",[$c.m_23,g],"]", "[",[$c.affine._dx,g]," ",[$c.affine._dy,g]," ",[$c.m_33,g],"]" ) ) children ( #( translation_horizontal_m31_dx: [$c.affine._dx,g], translation_vertical_m32_dy: [$c.affine._dy,g], scaling_horizontal_m11: [$c.affine._m11,g], scaling_vertical_m22: [$c.affine._m22,g], projection_factor_m33: [$c.m_33,g], projection_horizontal_m13: [$c.m_13,g], projection_vertical_m23: [$c.m_23,g], shearing_horizontal_m21: [$c.affine._m21,g], shearing_vertical_m12: [$c.affine._m12,g], type: $c.m_type, dirty: (bool)$c.m_dirty ) ) } ;------------------------------------------------------------------------------ ; QMatrix ;------------------------------------------------------------------------------ QMatrix|*::QMatrix{ preview ( #( "[",[$c._m11,g]," ",[$c._m12,g],"]", "[",[$c._m21,g]," ",[$c._m22,g],"]", "[",[$c._dx,g]," ",[$c._dy,g],"]" ) ) children ( #( translation_horizontal_dx: [$c._dx,g], translation_vertical_dy: [$c._dy,g], scaling_horizontal_m11: [$c._m11,g], scaling_vertical_m22: [$c._m22,g], shearing_horizontal_m21: [$c._m21,g], shearing_vertical_m12: [$c._m12,g] ) ) } ;------------------------------------------------------------------------------ ; QPolygon ;------------------------------------------------------------------------------ QPolygon{ preview ( #( "[", ((QVector<QPoint>*)(&$c))->d->size, "] (...)" ) ) children ( #( #array ( expr: ((QPoint*)(((void*)$c.d) + sizeof(QVectorData)))[$i], size: ((QVector<QPoint>*)(&$c))->d->size ) ) ) } *::QPolygon{ preview ( #( "[", (($T1::QVector<$T1::QPoint>*)(&$c))->d->size, "] (...)" ) ) children ( #( #array ( expr: (($T1::QPoint*)(((void*)$c.d) + sizeof(QVectorData)))[$i], size: (($T1::QVector<$T1::QPoint>*)(&$c))->d->size ) ) ) } ;------------------------------------------------------------------------------ ; QPolygonF ;------------------------------------------------------------------------------ QPolygonF{ preview ( #( "[", ((QVector<QPointF>*)(&$c))->d->size, "] (...)" ) ) children ( #( #array ( expr: ((QVector<QPointF>*)(&$c))->p->array[$i], size: ((QVector<QPointF>*)(&$c))->d->size ) ) ) } *::QPolygonF{ preview ( #( "[", (($T1::QVector<$T1::QPointF>*)(&$c))->d->size, "] (...)" ) ) children ( #( #array ( expr: (($T1::QVector<$T1::QPointF>*)(&$c))->p->array[$i], size: (($T1::QVector<$T1::QPointF>*)(&$c))->d->size ) ) ) } ;------------------------------------------------------------------------------ ; Digia Qt 5.x visualizers -------------------------------------------[ end ]-- ;QT_DEBUG_END </div>

Create the file <Visual Studio Directory>/Common7/Packages/Debugger/Visualizers/qt5.natvis. Note: If you are on the Windows Vista or Windows 7 platform, you must open the text editor in "Run as Administrator" mode. This has been taken directly from the Qt Visual Studio Add-in (when installed for Visual Studio 2012 and Qt 5.1), which is not required. <div style="height:40em;overflow:scroll">(:source lang=xml:) <?xml version="1.0" encoding="utf-8"?> <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> <Type Name="QPoint"> <AlternativeType Name="QPointF"/> <DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString> <Expand> <Item Name="[x]">xp</Item> <Item Name="[y]">yp</Item> </Expand> </Type> <Type Name="QRect"> <DisplayString>{{ x = {x1}, y = {y1}, width = {x2 - x1 + 1}, height = {y2 - y1 + 1} }}</DisplayString> <Expand> <Item Name="[x]">x1</Item> <Item Name="[y]">y1</Item> <Item Name="[width]">x2 - x1 + 1</Item> <Item Name="[height]">y2 - y1 + 1</Item> </Expand> </Type> <Type Name="QRectF"> <DisplayString>{{ x = {xp}, y = {yp}, width = {w}, height = {h} }}</DisplayString> <Expand> <Item Name="[x]">xp</Item> <Item Name="[y]">yp</Item> <Item Name="[width]">w</Item> <Item Name="[height]">h</Item> </Expand> </Type> <Type Name="QSize"> <AlternativeType Name="QSizeF"/> <DisplayString>{{ width = {wd}, height = {ht} }}</DisplayString> <Expand> <Item Name="[width]">wd</Item> <Item Name="[height]">ht</Item> </Expand> </Type> <Type Name="QLine"> <AlternativeType Name="QLineF"/> <DisplayString>{{ start point = {pt1}, end point = {pt2} }}</DisplayString> <Expand> <Synthetic Name="[start point]"> <DisplayString>{pt1}</DisplayString> <Expand> <ExpandedItem>pt1</ExpandedItem> </Expand> </Synthetic> <Synthetic Name="[end point]"> <DisplayString>{pt2}</DisplayString> <Expand> <ExpandedItem>pt2</ExpandedItem> </Expand> </Synthetic> </Expand> </Type> <Type Name="QPolygon"> <DisplayString>{{ size = {d-&gt;size} }}</DisplayString> <Expand> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <ArrayItems> <Size>d-&gt;size</Size> <ValuePointer>(QPoint*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="QPolygonF"> <DisplayString>{{ size = {d-&gt;size} }}</DisplayString> <Expand> <Item Name="[closed]"> d-&gt;size &gt; 0 &amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).xp == (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).xp) &amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).yp == (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).yp) </Item> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <ArrayItems> <Size>d-&gt;size</Size> <ValuePointer>(QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name ="QVector2D"> <DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString> <Expand> <Item Name="[x]">xp</Item> <Item Name="[y]">yp</Item> </Expand> </Type> <Type Name ="QVector3D"> <DisplayString>{{ x = {xp}, y = {yp}, z = {zp} }}</DisplayString> <Expand> <Item Name="[x]">xp</Item> <Item Name="[y]">yp</Item> <Item Name="[z]">zp</Item> </Expand> </Type> <Type Name ="QVector4D"> <DisplayString>{{ x = {xp}, y = {yp}, z = {zp}, w = {wp} }}</DisplayString> <Expand> <Item Name="[x]">xp</Item> <Item Name="[y]">yp</Item> <Item Name="[z]">zp</Item> <Item Name="[w]">wp</Item> </Expand> </Type> <Type Name ="QMatrix"> <DisplayString> {{ m11 = {_m11}, m12 = {_m12}, m21 = {_m21}, m22 = {_m22}, ... }} </DisplayString> <Expand> <Item Name="[m11]">_m11</Item> <Item Name="[m12]">_m12</Item> <Item Name="[m21]">_m21</Item> <Item Name="[m22]">_m22</Item> <Item Name="[dx]">_dx</Item> <Item Name="[dy]">_dy</Item> </Expand> </Type> <Type Name ="QMatrix4x4"> <DisplayString> {{ m11 = {m[0][0]}, m12 = {m[1][0]}, m13 = {m[2][0]}, m14 = {m[3][0]}, ... }} </DisplayString> <Expand> <Item Name="[m11]">m[0][0]</Item> <Item Name="[m12]">m[1][0]</Item> <Item Name="[m13]">m[2][0]</Item> <Item Name="[m14]">m[3][0]</Item> <Item Name="[m21]">m[0][1]</Item> <Item Name="[m22]">m[1][1]</Item> <Item Name="[m23]">m[2][1]</Item> <Item Name="[m24]">m[3][1]</Item> <Item Name="[m31]">m[0][2]</Item> <Item Name="[m32]">m[1][2]</Item> <Item Name="[m33]">m[2][2]</Item> <Item Name="[m34]">m[3][2]</Item> <Item Name="[m41]">m[0][3]</Item> <Item Name="[m42]">m[1][3]</Item> <Item Name="[m43]">m[2][3]</Item> <Item Name="[m44]">m[3][3]</Item> </Expand> </Type> <Type Name="QSizePolicy"> <DisplayString> {{ horizontal = {static_cast&lt;Policy&gt;(bits.horPolicy)}, vertical = {static_cast&lt;Policy&gt;(bits.verPolicy)}, type = {ControlType(1 &lt;&lt; bits.ctype)} }} </DisplayString> <Expand> <Synthetic Name="[vertical policy]"> <DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.verPolicy)}</DisplayString> </Synthetic> <Synthetic Name="[horizontal policy]"> <DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.horPolicy)}</DisplayString> </Synthetic> <Synthetic Name="[control type]"> <DisplayString>QSizePolicy::ControlType::{ControlType(1 &lt;&lt; bits.ctype)}</DisplayString> </Synthetic> <Synthetic Name="[expanding directions]"> <DisplayString Condition="(static_cast&lt;Policy&gt;(bits.verPolicy) &amp; ExpandFlag)"> Qt::Vertical (2) </DisplayString> <DisplayString Condition="(static_cast&lt;Policy&gt;(bits.horPolicy) &amp; ExpandFlag)"> Qt::Horizontal (1) </DisplayString> </Synthetic> <Item Name="[vertical stretch]">static_cast&lt;int&gt;(bits.verStretch)</Item> <Item Name="[horizontal stretch]">static_cast&lt;int&gt;(bits.horStretch)</Item> <Item Name="[has height for width]">bits.hfw == 1</Item> <Item Name="[has width for height]">bits.wfh == 1</Item> </Expand> </Type> <Type Name="QChar"> <DisplayString>{ucs,c}</DisplayString> <StringView>ucs,c</StringView> <Expand> <Item Name="[latin 1]">ucs > 0xff ? '\0' : char(ucs),c</Item> <Item Name="[unicode]">ucs,c</Item> </Expand> </Type> <Type Name="QString"> <DisplayString>{((reinterpret_cast&lt;unsigned short*&gt;(d)) + d->offset / 2),sub}</DisplayString> <StringView>((reinterpret_cast&lt;unsigned short*&gt;(d)) + d->offset / 2),sub</StringView> <Expand> <Item Name="[size]">d-&gt;size</Item> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <ArrayItems> <Size>d-&gt;size</Size> <ValuePointer>((reinterpret_cast&lt;unsigned short*&gt;(d)) + d->offset / 2),c</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="QByteArray"> <DisplayString>{((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset),sb}</DisplayString> <StringView>((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset),sb</StringView> <Expand> <Item Name="[size]">d-&gt;size</Item> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <ArrayItems> <Size>d-&gt;size</Size> <ValuePointer>((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset),c</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="QBitArray"> <DisplayString>{{ size = {(d.d-&gt;size &lt;&lt; 3) - *((reinterpret_cast&lt;char*&gt;(d.d)) + d.d-&gt;offset)} }}</DisplayString> <Expand> <Item Name="[referenced]">d.d-&gt;ref.atomic._q_value</Item> <IndexListItems> <Size>(d.d-&gt;size &lt;&lt; 3) - *((reinterpret_cast&lt;char*&gt;(d.d)) + d.d-&gt;offset)</Size> <ValueNode> (*(reinterpret_cast&lt;const unsigned char*&gt;((reinterpret_cast&lt;char*&gt;(d.d)) + d.d-&gt;offset) + 1 + ($i &gt;&gt; 3)) &amp; (1 &lt;&lt; ($i &amp; 7))) != 0 </ValueNode> </IndexListItems> </Expand> </Type> <Type Name="QVarLengthArray&lt;*&gt;"> <AlternativeType Name="QVarLengthArray&lt;*, int&gt;"/> <DisplayString>{{ size = {s} }}</DisplayString> <Expand> <Item Name="[capacity]">a</Item> <ArrayItems> <Size>s</Size> <ValuePointer>ptr</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="QDate"> <DisplayString>{{ julian day = {jd} }}</DisplayString> <Expand></Expand> </Type> <Type Name="QTime"> <DisplayString Condition="mds == 1">{{ millisecond = {mds} }}</DisplayString> <DisplayString Condition="mds != 1">{{ milliseconds = {mds} }}</DisplayString> <Expand> <Item Name="[hour]" Condition="(mds / 3600000) == 1">mds / 3600000, d</Item> <Item Name="[hours]" Condition="(mds / 3600000) != 1">mds / 3600000, d</Item> <Item Name="[minute]" Condition="((mds % 3600000) / 60000) == 1">(mds % 3600000) / 60000, d</Item> <Item Name="[minutes]" Condition="((mds % 3600000) / 60000) != 1">(mds % 3600000) / 60000, d</Item> <Item Name="[second]" Condition="((mds / 1000) % 60) == 1">(mds / 1000) % 60, d</Item> <Item Name="[seconds]" Condition="((mds / 1000) % 60) != 1">(mds / 1000) % 60, d</Item> <Item Name="[millisecond]" Condition="(mds % 1000) == 1">mds % 1000, d</Item> <Item Name="[milliseconds]" Condition="(mds % 1000) != 1">mds % 1000, d</Item> </Expand> </Type> <Type Name="QRegularExpression"> <DisplayString>{d.pattern}</DisplayString> </Type> <Type Name="QSharedData"> <Expand> <Item Name="[referenced]">ref._q_value</Item> </Expand> </Type> <Type Name="QSharedPointer&lt;*&gt;"> <DisplayString>strong reference to shared pointer of type {"$T1"}</DisplayString> <Expand> <Item Name="[is null]">value == 0</Item> <Item Name="[weak referenced]">d-&gt;weakref._q_value</Item> <Item Name="[strong referenced]">d-&gt;strongref._q_value</Item> </Expand> </Type> <Type Name="QSharedDataPointer&lt;*&gt;"> <DisplayString>pointer to implicit shared object of type {"$T1"}</DisplayString> <Expand> <ExpandedItem>d</ExpandedItem> </Expand> </Type> <Type Name="QExplicitlySharedDataPointer&lt;*&gt;"> <DisplayString>pointer to explicit shared object of type {"$T1"}</DisplayString> <Expand> <ExpandedItem>d</ExpandedItem> </Expand> </Type> <Type Name="QPointer&lt;*&gt;"> <DisplayString>guarded pointer to subclass of QObject of type {"$T1"}</DisplayString> <Expand> <Item Name="[is null]">wp.d == 0 || wp.d-&gt;strongref._q_value == 0 || wp.value == 0</Item> </Expand> </Type> <Type Name="QWeakPointer&lt;*&gt;"> <DisplayString>weak reference to shared pointer of type {"$T1"}</DisplayString> <Expand> <Item Name="[is null]">d == 0 || d-&gt;strongref._q_value == 0 || value == 0</Item> <Item Name="[weak referenced]">d-&gt;weakref._q_value</Item> <Item Name="[strong referenced]">d-&gt;strongref._q_value</Item> </Expand> </Type> <Type Name="QScopedPointer&lt;*&gt;"> <DisplayString>scoped pointer to a dynamically allocated object of type {"$T1"}</DisplayString> <Expand> <Item Name="[is null]">!d</Item> </Expand> </Type> <Type Name="QScopedArrayPointer&lt;*&gt;"> <DisplayString>scoped pointer to dynamically allocated array of objects of type {"$T1"}</DisplayString> <Expand> <Item Name="[is null]">!d</Item> </Expand> </Type> <Type Name="QPair&lt;*,*&gt;"> <DisplayString>({first}, {second})</DisplayString> <Expand> <Item Name="[first]">first</Item> <Item Name="[second]">second</Item> </Expand> </Type> <Type Name="QVector&lt;*&gt;"> <AlternativeType Name="QStack&lt;*&gt;"></AlternativeType> <DisplayString>{{ size = {d-&gt;size} }}</DisplayString> <Expand> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <ArrayItems> <Size>d-&gt;size</Size> <ValuePointer>($T1*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer> </ArrayItems> </Expand> </Type> <Type Name="QList&lt;*&gt;"> <AlternativeType Name="QStringList"></AlternativeType> <AlternativeType Name="QQueue&lt;*&gt;"></AlternativeType> <DisplayString>{{ size = {d-&gt;end - d-&gt;begin} }}</DisplayString> <Expand> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <IndexListItems> <Size>d-&gt;end - d-&gt;begin</Size> <ValueNode>*reinterpret_cast&lt;$T1*&gt;((sizeof($T1) &gt; sizeof(void*)) ? reinterpret_cast&lt;Node*&gt;(d->array + d->begin + $i)->v : reinterpret_cast&lt;$T1*&gt;(d->array + d->begin + $i)) </ValueNode> </IndexListItems> </Expand> </Type> <Type Name="QLinkedList&lt;*&gt;"> <DisplayString>{{ size = {d-&gt;size} }}</DisplayString> <Expand> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <LinkedListItems> <Size>d-&gt;size</Size> <HeadPointer>d-&gt;n</HeadPointer> <NextPointer>n</NextPointer> <ValueNode>(*(QLinkedListNode&lt;$T1&gt;*)this).t</ValueNode> </LinkedListItems> </Expand> </Type> <Type Name="QMapNode&lt;*,*&gt;"> <DisplayString>({key}, {value})</DisplayString> <Expand> <Item Name="[key]">key</Item> <Item Name="[value]">value</Item> </Expand> </Type> <Type Name="QMap&lt;*,*&gt;"> <AlternativeType Name="QMultiMap&lt;*,*&gt;"/> <DisplayString>{{ size = {d-&gt;size} }}</DisplayString> <Expand> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <TreeItems> <Size>d-&gt;size</Size> <HeadPointer>d-&gt;header.left</HeadPointer> <LeftPointer>left</LeftPointer> <RightPointer>right</RightPointer> <ValueNode>*((QMapNode&lt;$T1,$T2&gt;*)this)</ValueNode> </TreeItems> </Expand> </Type> <Type Name="QHashNode&lt;*,*&gt;"> <DisplayString Condition="next == 0">(empty)</DisplayString> <DisplayString Condition="next != 0">({key}, {value})</DisplayString> <Expand> <Item Name="[key]" Condition="next != 0">key</Item> <Item Name="[value]" Condition="next != 0">value</Item> </Expand> </Type> <Type Name="QHash&lt;*,*&gt;"> <AlternativeType Name="QMultiHash&lt;*,*&gt;"/> <DisplayString>{{ size = {d-&gt;size} }}</DisplayString> <Expand> <Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item> <IndexListItems> <Size>d-&gt;numBuckets</Size> <ValueNode>*((QHashNode&lt;$T1,$T2&gt;*)d-&gt;buckets[$i])</ValueNode> </IndexListItems> </Expand> </Type> <Type Name="QHashNode&lt;*,QHashDummyValue&gt;"> <DisplayString Condition="next == 0">(empty)</DisplayString> <DisplayString Condition="next != 0">({key})</DisplayString> <Expand> <Item Name="[key]" Condition="next != 0">key</Item> </Expand> </Type> <Type Name="QSet&lt;*&gt;"> <DisplayString>{{ size = {q_hash.d-&gt;size} }}</DisplayString> <Expand> <ExpandedItem>q_hash</ExpandedItem> </Expand> </Type> <Type Name="QCache&lt;*,*&gt;::Node"> <DisplayString>({*keyPtr}, {*t})</DisplayString> <Expand> <Item Name="[key]">*keyPtr</Item> <Item Name="[value]">*t</Item> </Expand> </Type> <Type Name="QCache&lt;*,*&gt;"> <DisplayString>{{ size = {hash.d-&gt;size} }}</DisplayString> <Expand> <Item Name="[max coast]">mx</Item> <Item Name="[total coast]">total</Item> <Item Name="[referenced]">hash.d-&gt;ref.atomic._q_value</Item> <LinkedListItems> <Size>hash.d-&gt;size</Size> <HeadPointer>f</HeadPointer> <NextPointer>n</NextPointer> <ValueNode>*((Node*)this)</ValueNode> </LinkedListItems> </Expand> </Type> <Type Name="QVariant"> <!--Region DisplayString QVariant--> <DisplayString Condition="d.type == QMetaType::UnknownType">Invalid</DisplayString> <DisplayString Condition="d.type == QMetaType::Bool">{d.data.b}</DisplayString> <DisplayString Condition="d.type == QMetaType::Int">{d.data.i}</DisplayString> <DisplayString Condition="d.type == QMetaType::UInt">{d.data.u}</DisplayString> <DisplayString Condition="d.type == QMetaType::LongLong">{d.data.ll}</DisplayString> <DisplayString Condition="d.type == QMetaType::ULongLong">{d.data.ull}</DisplayString> <DisplayString Condition="d.type == QMetaType::Double">{d.data.d}</DisplayString> <DisplayString Condition="d.type == QMetaType::QChar">{d.data.c}</DisplayString> <DisplayString Condition="d.type == QMetaType::QVariantMap"> {*((QMap&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QVariantList"> {*((QList&lt;QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QString"> {*((QString*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QStringList"> {*((QStringList*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QByteArray"> {*((QByteArray*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QBitArray"> {*((QBitArray*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QDate"> {*((QDate*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QTime"> {*((QTime*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QDateTime">DateTime</DisplayString> <DisplayString Condition="d.type == QMetaType::QUrl">Url</DisplayString> <DisplayString Condition="d.type == QMetaType::QLocale">Locale</DisplayString> <DisplayString Condition="d.type == QMetaType::QRect"> {*((QRect*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QRectF"> {*((QRectF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QSize"> {*((QSize*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QSizeF"> {*((QSizeF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QLine"> {*((QLine*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QLineF"> {*((QLineF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QPoint"> {*((QPoint*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QPointF"> {*((QPointF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QRegExp">RegExp</DisplayString> <DisplayString Condition="d.type == QMetaType::QRegularExpression">RegularExpression</DisplayString> <DisplayString Condition="d.type == QMetaType::QVariantHash"> {*((QHash&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))} </DisplayString> <DisplayString Condition="d.type == QMetaType::QEasingCurve">EasingCurve</DisplayString> <DisplayString Condition="d.type == QMetaType::QUuid">Uuid</DisplayString> <DisplayString Condition="d.type == QMetaType::QModelIndex">ModelIndex</DisplayString> <DisplayString Condition="d.type == QMetaType::LastCoreType">LastCoreType</DisplayString> <DisplayString Condition="d.type == QMetaType::QFont">Font</DisplayString> <DisplayString Condition="d.type == QMetaType::QPixmap">Pixmap</DisplayString> <DisplayString Condition="d.type == QMetaType::QBrush">Brush</DisplayString> <DisplayString Condition="d.type == QMetaType::QColor">Color</DisplayString> <DisplayString Condition="d.type == QMetaType::QPalette">Palette</DisplayString> <DisplayString Condition="d.type == QMetaType::QImage">Image</DisplayString> <DisplayString Condition="d.type == QMetaType::QPolygon">Polygon</DisplayString> <DisplayString Condition="d.type == QMetaType::QRegion">Region</DisplayString> <DisplayString Condition="d.type == QMetaType::QBitmap">Bitmap</DisplayString> <DisplayString Condition="d.type == QMetaType::QCursor">Cursor</DisplayString> <DisplayString Condition="d.type == QMetaType::QKeySequence">KeySequence</DisplayString> <DisplayString Condition="d.type == QMetaType::QPen">Pen</DisplayString> <DisplayString Condition="d.type == QMetaType::QTextLength">TextLength</DisplayString> <DisplayString Condition="d.type == QMetaType::QTextFormat">TextFormat</DisplayString> <DisplayString Condition="d.type == QMetaType::QMatrix">Matrix</DisplayString> <DisplayString Condition="d.type == QMetaType::QTransform">Transform</DisplayString> <DisplayString Condition="d.type == QMetaType::QMatrix4x4">Matrix4x4</DisplayString> <DisplayString Condition="d.type == QMetaType::QVector2D">Vector2D</DisplayString> <DisplayString Condition="d.type == QMetaType::QVector3D">Vector3D</DisplayString> <DisplayString Condition="d.type == QMetaType::QVector4D">Vector4D</DisplayString> <DisplayString Condition="d.type == QMetaType::QQuaternion">Quaternion</DisplayString> <DisplayString Condition="d.type == QMetaType::QPolygonF">PolygonF</DisplayString> <DisplayString Condition="d.type == QMetaType::QIcon">Icon</DisplayString> <DisplayString Condition="d.type == QMetaType::LastGuiType">LastGuiType</DisplayString> <DisplayString Condition="d.type == QMetaType::QSizePolicy">SizePolicy</DisplayString> <DisplayString Condition="d.type == QMetaType::User">UserType</DisplayString> <DisplayString Condition="d.type == 0xffffffff">LastType</DisplayString> <!--End region DisplayString QVariant--> <!--Region DisplayView QVariant--> <StringView Condition="d.type == QMetaType::QChar">d.data.c</StringView> <StringView Condition="d.type == QMetaType::QString"> *((QString*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </StringView> <StringView Condition="d.type == QMetaType::QByteArray"> *((QByteArray*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </StringView> <!--End region DisplayView QVariant--> <!--Region Expand QVariant--> <Expand> <ExpandedItem Condition="d.type == QMetaType::QVariantMap"> *((QMap&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QVariantList"> *((QList&lt;QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QString"> *((QString*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QStringList"> *((QStringList*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QByteArray"> *((QByteArray*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QBitArray"> *((QBitArray*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QDate"> *((QDate*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QTime"> *((QTime*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QRect"> *((QRect*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QRectF"> *((QRectF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QSize"> *((QSize*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QSizeF"> *((QSizeF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QLine"> *((QLine*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QLineF"> *((QLineF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QPoint"> *((QPoint*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QPointF"> *((QPointF*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> <ExpandedItem Condition="d.type == QMetaType::QVariantHash"> *((QHash&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr : reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr))) </ExpandedItem> </Expand> <!--End region Expand QVariant--> </Type> </AutoVisualizer> </div>

IntelliSense

IntelliSense settings for Qt can be added to Visual Studio's options for all projects or set at the project level. Setting the options at the project level allows the settings to be maintained across multiple Visual Studio installs. However, the settings will have to be set after each new project is created.

To setup IntelliSense for all projects on your Visual Studio install, add the following lines to the Visual Studio include file paths dialog.

Visual Studio 2012 (per project):

  1. Right click on the project and click on properties
  2. Click on NMake
  3. Add the paths listed below to the "Include Search Path" field
  4. Click Apply
  5. Repeat for each configuration (i.e. debug and release)

<div style="height:10em;overflow:scroll">(:source:) $(QTDIR)\qtbase\include $(QTDIR)\qtbase\include\QtANGLE $(QTDIR)\qtbase\include\QtCommercialChart $(QTDIR)\qtbase\include\QtConcurrent $(QTDIR)\qtbase\include\QtCore $(QTDIR)\qtbase\include\QtFtp $(QTDIR)\qtbase\include\QtGui $(QTDIR)\qtbase\include\QtHttp $(QTDIR)\qtbase\include\QtNetwork $(QTDIR)\qtbase\include\QtOpenGL $(QTDIR)\qtbase\include\QtOpenGLExtensions $(QTDIR)\qtbase\include\QtPlatformSupport $(QTDIR)\qtbase\include\QtPrintSupport $(QTDIR)\qtbase\include\QtSql $(QTDIR)\qtbase\include\QtTest $(QTDIR)\qtbase\include\QtWidgets $(QTDIR)\qtbase\include\QtXml $(QTDIR)\qtbase\include\QtZlib $(QTDIR)\qtbase\mkspecs\win32-msvc2005 $(QTDIR)\qtbase\mkspecs\win32-msvc2008 $(QTDIR)\qtbase\mkspecs\win32-msvc2010 $(QTDIR)\qtbase\mkspecs\win32-msvc2012 $(QTDIR)\qtbase\include\ActiveQt $(QTDIR)\qtactiveqt\include $(QTDIR)\qtactiveqt\include\ActiveQt $(QTDIR)\qtbase\include\QtDeclarative $(QTDIR)\qtbase\include\QtQml $(QTDIR)\qtbase\include\QtQuick $(QTDIR)\qtbase\include\QtQuickParticles $(QTDIR)\qtbase\include\QtQuickTest $(QTDIR)\qtdeclarative\include $(QTDIR)\qtdeclarative\include\QtQml $(QTDIR)\qtdeclarative\include\QtQmlDevTools $(QTDIR)\qtdeclarative\include\QtQuick $(QTDIR)\qtdeclarative\include\QtQuickParticles $(QTDIR)\qtdeclarative\include\QtQuickTest $(QTDIR)\qtquick1\include $(QTDIR)\qtquick1\include\QtDeclarative $(QTDIR)\qtbase\include\QtCLucene $(QTDIR)\qtbase\include\QtDesigner $(QTDIR)\qtbase\include\QtDesignerComponents $(QTDIR)\qtbase\include\QtHelp $(QTDIR)\qtbase\include\QtUiTools $(QTDIR)\qttools\include $(QTDIR)\qttools\include\QtCLucene $(QTDIR)\qttools\include\QtDesigner $(QTDIR)\qttools\include\QtDesignerComponents $(QTDIR)\qttools\include\QtHelp $(QTDIR)\qttools\include\QtUiTools $(QTDIR)\qtbase\include\QtMultimedia $(QTDIR)\qtbase\include\QtMultimediaQuick_p $(QTDIR)\qtbase\include\QtMultimediaWidgets $(QTDIR)\qtmultimedia\include $(QTDIR)\qtmultimedia\include\QtMultimedia $(QTDIR)\qtmultimedia\include\QtMultimediaQuick_p $(QTDIR)\qtmultimedia\include\QtMultimediaWidgets $(QTDIR)\qtbase\include\QtScript $(QTDIR)\qtbase\include\QtScriptTools $(QTDIR)\qtscript\include $(QTDIR)\qtscript\include\QtScript $(QTDIR)\qtscript\include\QtScriptTools $(QTDIR)\qtbase\include\QtSensors $(QTDIR)\qtsensors\include $(QTDIR)\qtsensors\include\QtSensors $(QTDIR)\qtbase\include\QtSerialPort $(QTDIR)\qtserialport\include $(QTDIR)\qtserialport\include\QtSerialPort $(QTDIR)\qtbase\include\QtSvg $(QTDIR)\qtsvg\include $(QTDIR)\qtsvg\include\QtSvg $(QTDIR)\qtbase\include\QtWebKit $(QTDIR)\qtbase\include\QtWebKitWidgets $(QTDIR)\qtwebkit\include $(QTDIR)\qtwebkit\include\QtWebKit $(QTDIR)\qtwebkit\include\QtWebKitWidgets $(QTDIR)\qtbase\include\QtXmlPatterns $(QTDIR)\qtxmlpatterns\include $(QTDIR)\qtxmlpatterns\include\QtXmlPatterns $(QTDIR)\qtbase\include\QtV8 $(QTDIR)\qtjsbackend\include $(QTDIR)\qtjsbackend\include\QtV8 (:sourceend:)</div>

  • When working with Qt (and qmake), running the rebuild command is often required. This primarily becomes an issue when changes are made to the .pro file or when Q_OBJECT is added or removed from files.
  • In order to not pollute the global namespace, the above .pro file examples use the no_keywords configuration option. This option disables Qt specific macros. Instead of using the standard Qt macros, use the Q_X equivalents (replacing X with the name of the macro, i.e. Q_SLOTS).
  • In order to use V-Tune with release builds of QT applications, the following needs to be added to the .pro file.(:source:)

QMAKE_CXXFLAGS += /Zi QMAKE_LFLAGS += /fixed:no QMAKE_LFLAGS += /DEBUG (:sourceend:)

Deploying Qt Projects

The library dependencies of Qt 5 differ from those of Qt 4. The official documentation describes which dlls are requred when the various Qt modules are employed. The minimum set of libraries required to be shipped with a dynamically-linked Qt project are listed below.

  • Minimal set of Qt libraries
    • Qt5Core.dll
    • icudt49.dll [if ICU was compiled into Qt]
    • icuin49.dll [if ICU was compiled into Qt]
    • icuuc49.dll [if ICU was compiled into Qt]
    • The DirectX runtime (D3DCompiler_XX.dll) [if using ANGLE]
    • libEGL.dll [if using ANGLE]
    • libGLESv2.dll [if usign ANGLE]
    • platforms/qwindows.dll

The platforms/qwindws.dll is normally placed in the same folder (and at the same level) as the Qt application. However, this can be changed and is documented in the official documentation. The recommended approach is to create a qt.conf2] file to inform Qt where to locate the platforms folder. This file should be placed alongside the Qt application. An example [@qt.conf file is show below.(:code:) [Paths] Plugins=../Libs Support for Qt's widgets has been removed from the QtGUI module and placed in a new QtWidgets. In order to use desktop widgets in your application, both the Qt5Gui.dll and Qt5Widgets.dll dll files are required.

Qt Project Creation with Visual Studio

Using QtWizard

Because generating Qt makefile projects within Visual Studio can be tedious, especially when developing large numbers of smaller applications, a Visual Studio wizard has been produced that automates parts of the process. The installer for the wizard can be located at http://www.sanfordfreedman.com/utilities/. The QtWizard integrates into Visual Studio and lets the user generate a Qt makefile project in the same manner as a standard Win32 or other inherently supported project type.

Manual Project Creation

  • Ensure the environment variable %QTDIR% points to your installation of QT.
  • Open Visual Studio and select File -> New ->Project.
  • Select General and then Makefile Project.
  • After providing a name and location for the new Makefile project, click Ok.
  • Configure nmake. Makefiles require that nmake be properly configured for the new project. This can be accomplished in two locations, within the Makefile Project Wizard or within the project properties dialog after the project has been fully created. (TODO: Complete Intellisense section)
  • Windows XP support requires the platform toolset to be changed to 110_xp
    • Open the .vcxproj file in a text editor
    • Change each occurrence of <PlatformToolset>v110</PlatformToolset> to <PlatformToolset>v110_xp</PlatformToolset> (there is one instance for each configuration in the project.
    • Save the file and reload the project if it was open in Visual Studio.

Configuring nmake with the Makefile Project Wizard.

  1. Select Debug Configuration Settings.
  2. Fill in the following fields:<BR> Build Command Line:(:source:)

\qtbase\bin\qmake nmake debug (:sourceend:)

 Rebuild All Command Line:(:source:)

\qtbase\bin\qmake nmake debug-clean nmake debug (:sourceend:)

 Clean Command Line:(:source:)

\qtbase\bin\qmake nmake debug-clean (:sourceend:)

 Output:(:code:)debug\[ApplicationName].exe
  1. Select Release Configuration Settings.
  2. Uncheck the Same as debug configuration box.
  3. Fill in the follwing fields:<BR> Build Command Line:(:source:)

\qtbase\bin\qmake nmake release (:sourceend:)

 Rebuild All Command Line:(:source:)

\qtbase\bin\qmake nmake release-clean nmake release (:sourceend:)

 Clean Command Line:(:source:)

\qtbase\bin\qmake nmake release-clean (:sourceend:)

 Output:(:code:)release\[ApplicationName].exe
  1. Click Finish to complete the creation of the new Makefile project.

Configuring nmake with Properties Pages dialog

  1. With the project open, right click on the name of the project within the Solution Explorer toolbar (generally on the left side of the IDE).
  2. Select Properties in the popup menu.
  3. Select NMake to access the nmake configuration section.
  4. Under Configuration, select Debug to edit the Debug Configuration properties.
  5. Fill in the four properties listed under General.<BR> Build Command Line:(:source:)

\qtbase\bin\qmake nmake debug (:sourceend:)

 Rebuild All Command Line:(:source:)

\qtbase\bin\qmake nmake debug-clean nmake debug (:sourceend:)

 Clean Command Line:(:source:)

\qtbase\bin\qmake nmake debug-clean (:sourceend:)

 Output:(:source:)

debug\[ApplicationName].exe (:sourceend:)

  1. Under configuration, select Release to edit the Release Configuration properties. If asked to save settings, select Yes.
  2. Fill in the four properties listed under General.<BR> Build Command Line:(:source:)

\qtbase\bin\qmake nmake release (:sourceend:)

 Rebuild All Command Line:(:source:)

\qtbase\bin\qmake nmake release-clean nmake release (:sourceend:)

 Clean Command Line:(:source:)

\qtbase\bin\qmake nmake release-clean (:sourceend:)

 Output:(:source:)

release\[ApplicationName].exe (:sourceend:)

  1. Click Ok to finish configuring nmake.
  2. Create a file with an extension of .pro
  3. Depending on the desired type of project, copy the corresponding example into the .pro file (replacing ApplicationName with the application's name):<BR> GUI Application:(:code:) TEMPLATE = app CONFIG += qt warn_on no_keywords embed_manifest_exe resources QT += widgets TARGET = ApplicationName SOURCES = HEADERS = LIBS += RESOURCES += # Treat warnings as errors win32:QMAKE_CXXFLAGS += /WX unix:QMAKE_CXXFLAGS += -Werror # Required for compiling with Visual Studio 2012 Update 3 and the v110_xp toolchain DEFINES += _USING_V110_SDK71_ CONFIG(debug, debug|release){ # Debug build options # Enable a read-only console window (i.e. for printf etc.) # CONFIG += console } else{ # Release build options # Enable a read-only console window (i.e. for printf etc.) # CONFIG += console } Console Application:(:code:) TEMPLATE = app CONFIG += qt warn_on no_keywords console embed_manifest_exe resources QT += widgets TARGET = ApplicationName SOURCES = HEADERS = LIBS += RESOURCES += # Treat warnings as errors win32:QMAKE_CXXFLAGS += /WX unix:QMAKE_CXXFLAGS += -Werror # Required for compiling with Visual Studio 2012 Update 3 and the v110_xp toolchain DEFINES += _USING_V110_SDK71_ CONFIG(debug, debug|release){ # Debug build options } else{ # Release build options } DLL:(:code:) TEMPLATE = lib CONFIG += qt warn_on no_keywords dll embed_manifest_dll resources QT += widgets TARGET = ApplicationName SOURCES = HEADERS = LIBS += RESOURCES += DEF_FILE = $${TARGET}.def # Treat warnings as errors win32:QMAKE_CXXFLAGS += /WX unix:QMAKE_CXXFLAGS += -Werror # Required for compiling with Visual Studio 2012 Update 3 and the v110_xp toolchain DEFINES += _USING_V110_SDK71_ CONFIG(debug, debug|release){ # Debug build options } else{ # Release build options } Static Library:(:code:) TEMPLATE = lib CONFIG += qt warn_on no_keywords staticlib resources QT += widgets TARGET = ApplicationName SOURCES = HEADERS = LIBS += RESOURCES += # Treat warnings as errors win32:QMAKE_CXXFLAGS += /WX unix:QMAKE_CXXFLAGS += -Werror # Required for compiling with Visual Studio 2012 Update 3 and the v110_xp toolchain DEFINES += _USING_V110_SDK71_ CONFIG(debug, debug|release){ # Debug build options } else{ # Release build options } Qt Plugin:(:code:) TEMPLATE = lib CONFIG += qt warn_on no_keywords plugin resources QT += widgets TARGET = ApplicationName SOURCES = HEADERS = LIBS += RESOURCES += # Treat warnings as errors win32:QMAKE_CXXFLAGS += /WX unix:QMAKE_CXXFLAGS += -Werror # Required for compiling with Visual Studio 2012 Update 3 and the v110_xp toolchain DEFINES += _USING_V110_SDK71_ CONFIG(debug, debug|release){ # Debug build options } else{ # Release build options } Subdirs:(:code:) TEMPLATE = subdirs CONFIG += ordered SUBDIRS +=

If the Qt project will be linked against static libraries that will undergo development at the same time as the application, add the following to the .pro file:(:code:) CONFIG(debug, debug|release){ # Debug build options LIBS += path/to/debug/library/library.lib POST_TARGETDEPS += $$LIBS } else{ # Release build options LIBS += path/to/release/library/library.lib POST_TARGETDEPS += $$LIBS }

  1. Create and fill in the application's source files. Each source and header file needs to be listed in the appropriate sections of the applications .pro file (HEADERS and SOURCES).

Make sure to always updates this file when new header files and source files are added to the project. Additionally, this approach requires frequently rebuilding of the entire project to ensure that everything is up to date.

External References

Official Qt Website
Official Qt Information Website
Official Qt 5.1 Documentation
Qt Centre - A Qt Community Wiki and forum
QtNode - A Qt Community Wiki