====== Qt ====== ===== Other Qt Pages ===== * [[QtEnums]] * For undocumented features of qmake, including SUBDIR projects with proper dependency hierarchies: http://wiki.qtcentre.org/index.php?title=Undocumented_qmake#SUBDIRS_projects ===== Compiling Qt under (k)ubuntu ===== * Download and extract Qt * Use sudo apt-get install to install the following packages: * openssl * libssl-dev * xorg-dev * build-essential * Configure with the following line ./configure -no-phonon -no-webkit -no-opengl -openssl * Build and install with the commands (g)make install sudo (g)make install ===== Building a minimal set of libraries only ===== If you only want the Qt libraries, and none of the tools or examples, you can save time by using the following command lines ./configure -no-phonon -no-webkit -no-opengl -openssl -nomake examples -nomake demos (g)make sudo (g)make install ===== Compiling Qt under Windows/Visual Studio ===== * Download and extract Qt to C:\build\ * Download and extract OpenSSL to C:\build\openssl-0.9.8g. Build it. * Download and install the Windows SDK (formerly Platform SDK, at the time of writing v6.1) * For Phonon support, download and install the full DirectX SDK (at time of writing, November 2007 release) * Set the following environment variables OPENSSL_PATH = C:\build\openssl-0.9.8g PATH += C:\build\qt-win-opensource-src-4.4.0\bin QMAKESPEC = win32-msvc2005 * Run a platform sdk command prompt (The yellow one) * For Phonon support, execute the DirectX environment script C:\Program Files\Microsoft DirectX SDK (November 2007)\Utilities\Bin\dx_setenv.cmd * Configure with the following command lines cd c:\build\qt-win-opensource-src-4.4.0\ configure.exe -debug-and-release -phonon -webkit -direct3d -openssl -I C:\build\Include -L C:\build\Lib Check the beginning of the output of configure, and ensure all selected options have been correctly enabled) * Compile with the following command line nmake ===== Improved Debugging output ===== * Find the autoexp.dat file within the visual studio installation directory and add the following lines just before the [[Visualiser]] section ; Qt Integration QObject =classname= superclassname=d.stringdata,s> QList<*>=size=end,i> QLinkedList<*>=size=end,i> QString=data,su> size=size,u> QByteArray=data,s> size=size,u> QUrl =encodedOriginal.d->data,s> QUrlInfo =name.d->data,su> QPoint =x= y= QPointF =x= y= QRect =x1= y1= x2= y2= QRectF =x= y= w= h= QSize =width= height= QSizeF =width= height= QMap<*> =size=size> QVector<*> =size=size> QHash<*> =size=size> QVarLengthArray<*> =size= data= QFont =family=request.family.d->data,su> size=request.pointSize, f> QDomNode =name=name.d->data,su> value=value.d->data,su> ===== Making a project with qmake ===== * Create a new project file with the following commandline qmake -project -t app -o projectname.pro (In the current version of qmake, the template does not always get correctly applied, it can be fixed with the template below). - Visual Studio 2005 template TEMPLATE = app - Output binary name TARGET = myproject DEPENDPATH += . - Which Qt modules to include QT += network - Additional condiguration CONFIG += warn_on thread CONFIG -= embed_manifest_exe - Show a console with stderr output in debug mode win32:CONFIG += console - Input HEADERS += main.h SOURCES += main.cpp ===== Creating the Visual Studio project files ===== Once the .pro file is made, and indeed every time it is changed, use the following commandline to generate the Visual Studio project files qmake -tp vc The project can then be opened in visual studio and compiled as ususal