diff options
author | Topi Reinio <topi.reinio@digia.com> | 2013-06-11 15:43:04 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-12 10:58:06 +0200 |
commit | fb8839690418d3af30536b297b58db94517f2b17 (patch) | |
tree | 02034f45e73efbce4472f3f17a84362ffdfee81d | |
parent | cd4b41575da72b2f55ba51e79b7b4d08c2bf9269 (diff) |
Doc: Do not parse snippets as documentation sourcev5.1.0-rc1
The .qdocconf file was using the root of the repository as a source
directory, leading to also the snippets being parsed as source for
docs.
This change modifies .qdocconf to remove the unnecessary paths and
excludes src/snippets. It also fixes the \snippet links to be
relative to src/ instead of the root folder.
Change-Id: Ifd03d7f5f28360bbe89b250fc4567a81ab3a008d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
29 files changed, 352 insertions, 351 deletions
diff --git a/doc/config/qtdoc-project.qdocconf b/doc/config/qtdoc-project.qdocconf index 70a79fbc9..0387ac764 100644 --- a/doc/config/qtdoc-project.qdocconf +++ b/doc/config/qtdoc-project.qdocconf @@ -57,10 +57,12 @@ imagedirs += ../src/images \ ../images sourcedirs += \ - ../.. \ ../src exampledirs += \ - ../.. \ ../src \ ../snippets + +# Don't parse files in snippets directory +excludedirs += \ + ../src/snippets diff --git a/doc/src/classes/exportedfunctions.qdoc b/doc/src/classes/exportedfunctions.qdoc index 5cc8efe7e..cf66f865c 100644 --- a/doc/src/classes/exportedfunctions.qdoc +++ b/doc/src/classes/exportedfunctions.qdoc @@ -43,7 +43,7 @@ application, you must declare them before calling them. For example: - \snippet doc/src/snippets/code/doc_src_exportedfunctions.qdoc 0 + \snippet snippets/code/doc_src_exportedfunctions.qdoc 0 These functions will remain as part of Qt for the lifetime of Qt 4. diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index f4fa01330..3419bdf95 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -214,7 +214,7 @@ To use this approach, you must start by installing a static version of the Qt library: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 0 + \snippet snippets/code/doc_src_deployment.qdoc 0 We specify the prefix so that we do not overwrite the existing Qt installation. The example above only builds the Qt libraries, @@ -233,12 +233,12 @@ makefile and rebuild the application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 1 + \snippet snippets/code/doc_src_deployment.qdoc 1 Now run qmake to create a new makefile for the application, and do a clean build to create the statically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 2 + \snippet snippets/code/doc_src_deployment.qdoc 2 You probably want to link against the release libraries, and you can specify this when invoking \c qmake. Note that we must set the @@ -247,7 +247,7 @@ To check that the application really links statically with Qt, run the \c ldd tool (available on most Unices): - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 3 + \snippet snippets/code/doc_src_deployment.qdoc 3 Verify that the Qt libraries are not mentioned in the output. @@ -295,17 +295,17 @@ the \l {tools/plugandpaint}{Plug & Paint} application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 4 + \snippet snippets/code/doc_src_deployment.qdoc 4 Now run qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 5 + \snippet snippets/code/doc_src_deployment.qdoc 5 This builds the core application, the following will build the plugins: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 6 + \snippet snippets/code/doc_src_deployment.qdoc 6 If everything compiled and linked without any errors, we will get a \c plugandpaint executable and the \c libpnp_basictools.so and @@ -358,7 +358,7 @@ third approach since it is the most flexible. For example, a \c plugandpaint.sh script will look like this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 7 + \snippet snippets/code/doc_src_deployment.qdoc 7 By running this script instead of the executable, you are sure that the Qt libraries will be found by the dynamic linker. Note @@ -371,7 +371,7 @@ \c plugins directory, or you can set the \c DESTDIR in the plugins' project files: - \snippet doc/src/snippets/code/doc_src_deployment.pro 8 + \snippet snippets/code/doc_src_deployment.pro 8 An archive distributing all the Qt libraries, and all the plugins, required to run the \l {tools/plugandpaint}{Plug & Paint} @@ -424,7 +424,7 @@ application using QApplication::addLibraryPath() or QApplication::setLibraryPaths(). - \snippet doc/src/snippets/code/doc_src_deployment.cpp 9 + \snippet snippets/code/doc_src_deployment.cpp 9 \section1 Application Dependencies @@ -433,7 +433,7 @@ To find out which libraries your application depends on, run the \c ldd tool (available on most Unices): - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 10 + \snippet snippets/code/doc_src_deployment.qdoc 10 This will list all the shared library dependencies for your application. Depending on configuration, these libraries must be @@ -534,13 +534,13 @@ built statically. To do this, go to a command prompt and type the following: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 11 + \snippet snippets/code/doc_src_deployment.qdoc 11 Remember to specify any other options you need, such as data base drivers, as arguments to \c configure. Once \c configure has finished, type the following: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 12 + \snippet snippets/code/doc_src_deployment.qdoc 12 This will build Qt statically. Note that we have used \c nmake in all the examples, but \c mingw32-make should be used for MinGW. @@ -556,13 +556,13 @@ {tools/plugandpaint}{Plug & Paint} application. First we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 13 + \snippet snippets/code/doc_src_deployment.qdoc 13 We must then run \c qmake to create a new makefile for the application, and do a clean build to create the statically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 14 + \snippet snippets/code/doc_src_deployment.qdoc 14 You probably want to link against the release libraries, and you can specify this when invoking \c qmake. Now, provided that @@ -611,17 +611,17 @@ the \l {tools/plugandpaint}{Plug & Paint} application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 15 + \snippet snippets/code/doc_src_deployment.qdoc 15 Now run \c qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 16 + \snippet snippets/code/doc_src_deployment.qdoc 16 This builds the core application, the following will build the plugins: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 17 + \snippet snippets/code/doc_src_deployment.qdoc 17 If everything compiled and linked without any errors, we will get a \c plugandpaint.exe executable and the \c pnp_basictools.dll and @@ -680,7 +680,7 @@ So to make the plugins available to our application, we have to create the \c plugins subdirectory and copy over the relevant DLLs: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 18 + \snippet snippets/code/doc_src_deployment.qdoc 18 An archive distributing all the Qt DLLs and application specific plugins required to run the \l {tools/plugandpaint}{Plug @@ -762,7 +762,7 @@ using QApplication::addLibraryPath() or QApplication::setLibraryPaths(). - \snippet doc/src/snippets/code/doc_src_deployment.cpp 19 + \snippet snippets/code/doc_src_deployment.cpp 19 One benefit of using plugins is that they can easily be made available to a whole family of applications. @@ -793,11 +793,11 @@ binary. Since Qt 4.1.3, the follwoing \c CONFIG options are available for embedding manifests: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 20 + \snippet snippets/code/doc_src_deployment.qdoc 20 To use the options, add - \snippet doc/src/snippets/code/doc_src_deployment.pro 21 + \snippet snippets/code/doc_src_deployment.pro 21 to your .pro file. The \c embed_manifest_dll option is enabled by default. The \c embed_manifest_exe option is NOT enabled by default. @@ -866,7 +866,7 @@ \l{Dependency Walker} tool. All you need to do is to run it like this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 24 + \snippet snippets/code/doc_src_deployment.qdoc 24 This will provide a list of the libraries that your application depends on and other information. @@ -949,7 +949,7 @@ If you add a custom path using QApplication::addLibraryPath it could look like this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 54 + \snippet snippets/code/doc_src_deployment.qdoc 54 Then qApp->libraryPaths() would return something like this: @@ -1016,7 +1016,7 @@ Add the following statement to your application's project file (\c{.pro}): - \snippet doc/src/snippets/code/doc_src_deployment.pro 26 + \snippet snippets/code/doc_src_deployment.pro 26 This tells \c qmake not to put the executable inside a bundle. @@ -1031,7 +1031,7 @@ cannot use plugins and that you must build the dependent libraries such as image formats, SQL drivers, and so on with static linking. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 27 + \snippet snippets/code/doc_src_deployment.qdoc 27 You can check the various options that are available by running \c configure -help. @@ -1042,12 +1042,12 @@ makefile and rebuild the application. First, we must go into the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 28 + \snippet snippets/code/doc_src_deployment.qdoc 28 Now run \c qmake to create a new makefile for the application, and do a clean build to create the statically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 29 + \snippet snippets/code/doc_src_deployment.qdoc 29 You probably want to link against the release libraries, and you can specify this when invoking \c qmake. If you have Xcode Tools @@ -1064,12 +1064,12 @@ You can check what other libraries your application links to using the \c otool: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 30 + \snippet snippets/code/doc_src_deployment.qdoc 30 Here is what the output looks like for the statically linked \l {tools/plugandpaint}{Plug & Paint}: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 31 + \snippet snippets/code/doc_src_deployment.qdoc 31 If you see \e Qt libraries in the output, it probably means that you have both dynamic and static Qt libraries installed @@ -1084,11 +1084,11 @@ For example, replace the following: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 32 + \snippet snippets/code/doc_src_deployment.qdoc 32 with this: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 33 + \snippet snippets/code/doc_src_deployment.qdoc 33 The \l {tools/plugandpaint}{Plug & Paint} example consists of several components: The core application (\l @@ -1139,24 +1139,24 @@ {tools/plugandpaint}{Plug & Paint} application. First, we must go to the directory that contains the application: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 34 + \snippet snippets/code/doc_src_deployment.qdoc 34 Run \c qmake to create a new makefile for the application, and do a clean build to create the dynamically linked executable: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 35 + \snippet snippets/code/doc_src_deployment.qdoc 35 This builds the core application. Use the following to build the plugins: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 36 + \snippet snippets/code/doc_src_deployment.qdoc 36 Now run the \c otool for the Qt frameworks, for example Qt Gui: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 37 + \snippet snippets/code/doc_src_deployment.qdoc 37 You would get the following output: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 38 + \snippet snippets/code/doc_src_deployment.qdoc 38 For the Qt frameworks, the first line (i.e. \c {path/to/Qt/lib/QtGui.framework/Versions/4/QtGui (compatibility @@ -1184,14 +1184,14 @@ the bundle. We will assume that we are in the directory where we built the bundle. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 39 + \snippet snippets/code/doc_src_deployment.qdoc 39 First we create a \c Frameworks directory inside the bundle. This follows the Mac OS X application convention. We then copy the frameworks into the new directory. As frameworks contain symbolic links, we use the \c -R option. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 40 + \snippet snippets/code/doc_src_deployment.qdoc 40 Then we run \c install_name_tool to set the identification names for the frameworks. The first argument after \c -id is the new @@ -1201,7 +1201,7 @@ names specifies that these frameworks are located in the directory directly under the \c Frameworks directory. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 41 + \snippet snippets/code/doc_src_deployment.qdoc 41 Now, the dynamic linker knows where to look for QtCore and QtGui. We must ensure that the application also knows where to find the @@ -1212,7 +1212,7 @@ Finally, the QtGui framework depends on QtCore, so we must remember to change the reference for QtGui: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 42 + \snippet snippets/code/doc_src_deployment.qdoc 42 After this, we run \c otool again and see that the application can find the libraries. @@ -1234,20 +1234,20 @@ file, the plugins' \c .dylib files are in the \c plugins subdirectory under the \c plugandpaint directory. We just have to move this director. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 43 + \snippet snippets/code/doc_src_deployment.qdoc 43 For example, If we run \c otool on the \l {tools/plugandpaintplugins/basictools}{Basic Tools} plugin's \c .dylib file, we get the following information. - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 44 + \snippet snippets/code/doc_src_deployment.qdoc 44 Then we can see that the plugin links to the Qt frameworks it was built against. As we want the plugins to use the framework in the application bundle, we change them the same way as we did for the application. For example for the Basic Tools plugin: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 45 + \snippet snippets/code/doc_src_deployment.qdoc 45 We must also modify the code in \c @@ -1255,7 +1255,7 @@ that the application finds the plugins. Add the following code to the \c mainwindow.cpp file: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 46 + \snippet snippets/code/doc_src_deployment.qdoc 46 \table \row @@ -1272,18 +1272,18 @@ Copy Qt's image format plugins into the bundle: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 47 + \snippet snippets/code/doc_src_deployment.qdoc 47 Use \c install_name_tool to link the plugins to the frameworks in the bundle: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 48 + \snippet snippets/code/doc_src_deployment.qdoc 48 Update the source code in \c tools/plugandpaint/main.cpp to look for the new plugins. After constructing the QApplication, we add the following code: - \snippet doc/src/snippets/code/doc_src_deployment.cpp 49 + \snippet snippets/code/doc_src_deployment.cpp 49 First, we tell the application to only look for plugins in this directory. In our case, we want the application to look for only those @@ -1364,7 +1364,7 @@ You can check which libraries your application is linking against by using \c otool. Run this with the application path as an argument: - \snippet doc/src/snippets/code/doc_src_deployment.qdoc 50 + \snippet snippets/code/doc_src_deployment.qdoc 50 Unlike the deployment processes on \l {Deploying an Application on X11 Platforms}{X11} and \l {Deploying an Application on @@ -1393,7 +1393,7 @@ variable to get \e{weak linking} to work for your application. You can add the following: - \snippet doc/src/snippets/code/doc_src_deployment.pro 51 + \snippet snippets/code/doc_src_deployment.pro 51 to your .pro file, and qmake will take care of this for you. diff --git a/doc/src/deployment/qt-conf.qdoc b/doc/src/deployment/qt-conf.qdoc index 0a8159edf..c72e8dc8d 100644 --- a/doc/src/deployment/qt-conf.qdoc +++ b/doc/src/deployment/qt-conf.qdoc @@ -95,6 +95,6 @@ For example, a \c qt.conf file could contain the following: - \snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 0 + \snippet snippets/code/doc_src_qt-conf.qdoc 0 */ diff --git a/doc/src/development/cmake-manual.qdoc b/doc/src/development/cmake-manual.qdoc index 4624b4f21..d7cb800c4 100644 --- a/doc/src/development/cmake-manual.qdoc +++ b/doc/src/development/cmake-manual.qdoc @@ -53,7 +53,7 @@ To build a helloworld GUI executable, typical usage would be: - \snippet doc/src/snippets/cmake/CMakeLists.pro 0 + \snippet snippets/cmake/CMakeLists.pro 0 Note that setting the minimum required CMake version to 2.8.11 is required for automatic linking to the qtmain.lib library on Windows. @@ -72,7 +72,7 @@ using a variable like Qt5<Module>_LIBRARIES in CMake commands such as \c{target_link_libraries}. The actual path to the library can be obtained using the \l{CMake LOCATION Documentation}{LOCATION property}: - \snippet doc/src/snippets/cmake/CMakeLists.pro 1 + \snippet snippets/cmake/CMakeLists.pro 1 Note however that it is rare to require the full location to the library in \c{CMake} code. Most \c{CMake} APIs are aware of imported targets and can automatically use them instead of the full path. @@ -104,7 +104,7 @@ The \c{qt5_use_modules} macro encapsulates all of the variable usage required to use a Qt module. It automatically finds the modules given to it on the command line if they have not already been found. - \snippet doc/src/snippets/cmake/CMakeLists.pro 3 + \snippet snippets/cmake/CMakeLists.pro 3 \section2 Using Qt 5 with \c{CMake} older than 2.8.9 @@ -115,7 +115,7 @@ \c{target_link_libraries}, \c{include_directories}, and \c{add_definitions} commands, and to manually specify moc requirements with either \c{qt5_generate_moc} or \c{qt5_wrap_cpp}: - \snippet doc/src/snippets/cmake/CMakeLists.pro 4 + \snippet snippets/cmake/CMakeLists.pro 4 It is also necessary when using an older \c{CMake} to add Qt5<Module>_EXECUTABLE_COMPILE_FLAGS to the CMAKE_CXX_FLAGS so that the -fPIE flags are added to the compile flags if necessary (as @@ -126,14 +126,14 @@ targets using Qt instead, or it can be set globally for all targets. Note that this is not necessary with CMake 2.8.11: - \snippet doc/src/snippets/cmake/CMakeLists.pro 5 + \snippet snippets/cmake/CMakeLists.pro 5 Note that it may be necessary to enable POSITION_INDEPENDENT_CODE globally in order to use try_compile with Qt code, or any wrapper macros around it such as check_cxx_source_compiles etc. As position independent code is a platform-specific and Qt-configuration-specific concept, the Qt5_POSITION_INDEPENDENT_CODE property can be used to check whether it is required. - \snippet doc/src/snippets/cmake/CMakeLists.pro 6 + \snippet snippets/cmake/CMakeLists.pro 6 \section1 Variable Reference diff --git a/doc/src/development/debug.qdoc b/doc/src/development/debug.qdoc index 653e8629a..a94af25b0 100644 --- a/doc/src/development/debug.qdoc +++ b/doc/src/development/debug.qdoc @@ -138,7 +138,7 @@ If you include the <QtDebug> header file, the \c qDebug() function can also be used as an output stream. For example: - \snippet doc/src/snippets/code/doc_src_debug.cpp 0 + \snippet snippets/code/doc_src_debug.cpp 0 The Qt implementation of these functions prints to the \c stderr output under Unix/X11 and Mac OS X. With Windows, if it @@ -189,7 +189,7 @@ between each item. Here is an example for a class that represents a 2D coordinate. - \snippet doc/src/snippets/qdebug/qdebugsnippet.cpp 0 + \snippet snippets/qdebug/qdebugsnippet.cpp 0 Integration of custom types with Qt's meta-object system is covered in more depth in the \l{Creating Custom Qt Types} document. @@ -215,14 +215,14 @@ These macros are useful for detecting program errors, e.g. like this: - \snippet doc/src/snippets/code/doc_src_debug.cpp 1 + \snippet snippets/code/doc_src_debug.cpp 1 Q_ASSERT(), Q_ASSERT_X(), and Q_CHECK_PTR() expand to nothing if \c QT_NO_DEBUG is defined during compilation. For this reason, the arguments to these macro should not have any side-effects. Here is an incorrect usage of Q_CHECK_PTR(): - \snippet doc/src/snippets/code/doc_src_debug.cpp 2 + \snippet snippets/code/doc_src_debug.cpp 2 If this code is compiled with \c QT_NO_DEBUG defined, the code in the Q_CHECK_PTR() expression is not executed and \e alloc returns diff --git a/doc/src/development/moc.qdoc b/doc/src/development/moc.qdoc index 3a05f22e0..c59e5352a 100644 --- a/doc/src/development/moc.qdoc +++ b/doc/src/development/moc.qdoc @@ -54,7 +54,7 @@ \c moc is typically used with an input file containing class declarations like this: - \snippet doc/src/snippets/moc/myclass1.h 0 + \snippet snippets/moc/myclass1.h 0 In addition to the signals and slots shown above, \c moc also implements object properties as in the next example. The @@ -68,14 +68,14 @@ has a get function \c priority() and a set function \c setPriority(). - \snippet doc/src/snippets/moc/myclass2.h 0 + \snippet snippets/moc/myclass2.h 0 The Q_FLAGS() macro declares enums that are to be used as flags, i.e. OR'd together. Another macro, Q_CLASSINFO(), allows you to attach additional name/value pairs to the class's meta-object: - \snippet doc/src/snippets/moc/myclass3.h 0 + \snippet snippets/moc/myclass3.h 0 The output produced by \c moc must be compiled and linked, just like the other C++ code in your program; otherwise, the build @@ -108,12 +108,12 @@ For Q_OBJECT class declarations in header files, here is a useful makefile rule if you only use GNU make: - \snippet doc/src/snippets/code/doc_src_moc.qdoc 0 + \snippet snippets/code/doc_src_moc.qdoc 0 If you want to write portably, you can use individual rules of the following form: - \snippet doc/src/snippets/code/doc_src_moc.qdoc 1 + \snippet snippets/code/doc_src_moc.qdoc 1 You must also remember to add \c moc_foo.cpp to your \c SOURCES (substitute your favorite name) variable and \c moc_foo.o or \c @@ -131,12 +131,12 @@ For Q_OBJECT class declarations in implementation (\c .cpp) files, we suggest a makefile rule like this: - \snippet doc/src/snippets/code/doc_src_moc.qdoc 2 + \snippet snippets/code/doc_src_moc.qdoc 2 This guarantees that make will run the moc before it compiles \c foo.cpp. You can then put - \snippet doc/src/snippets/code/doc_src_moc.cpp 3 + \snippet snippets/code/doc_src_moc.cpp 3 at the end of \c foo.cpp, where all the classes declared in that file are fully known. @@ -223,7 +223,7 @@ file. \c moc defines the preprocessor symbol \c Q_MOC_RUN. Any code surrounded by - \snippet doc/src/snippets/code/doc_src_moc.cpp 4 + \snippet snippets/code/doc_src_moc.cpp 4 is skipped by the \c moc. @@ -245,7 +245,7 @@ \c moc does not handle all of C++. The main problem is that class templates cannot have signals or slots. Here is an example: - \snippet doc/src/snippets/code/doc_src_moc.cpp 5 + \snippet snippets/code/doc_src_moc.cpp 5 Less importantly, the following constructs are illegal. All of them have alternatives which we think are usually better, so @@ -257,7 +257,7 @@ first inherited class is a subclass of QObject. Also, be sure that only the first inherited class is a QObject. - \snippet doc/src/snippets/code/doc_src_moc.cpp 6 + \snippet snippets/code/doc_src_moc.cpp 6 Virtual inheritance with QObject is \e not supported. @@ -267,11 +267,11 @@ signal or slot parameters, we think inheritance is a better alternative. Here is an example of illegal syntax: - \snippet doc/src/snippets/code/doc_src_moc.cpp 7 + \snippet snippets/code/doc_src_moc.cpp 7 You can work around this restriction like this: - \snippet doc/src/snippets/code/doc_src_moc.cpp 8 + \snippet snippets/code/doc_src_moc.cpp 8 It may sometimes be even better to replace the function pointer with inheritance and virtual functions. @@ -285,13 +285,13 @@ fully qualify the data types when declaring signals and slots, and when establishing connections. For example: - \snippet doc/src/snippets/code/doc_src_moc.cpp 9 + \snippet snippets/code/doc_src_moc.cpp 9 \section2 Nested Classes Cannot Have Signals or Slots Here's an example of the offending construct: - \snippet doc/src/snippets/code/doc_src_moc.cpp 11 + \snippet snippets/code/doc_src_moc.cpp 11 \section2 Signal/Slot return types cannot be references diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index b17738615..d7483d1d9 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -201,11 +201,11 @@ The following snippet illustrates how lists of values are assigned to variables: - \snippet doc/src/snippets/qmake/variables.pro 0 + \snippet snippets/qmake/variables.pro 0 The list of values in a variable is extended in the following way: - \snippet doc/src/snippets/qmake/variables.pro 1 + \snippet snippets/qmake/variables.pro 1 \note The first assignment only includes values that are specified on the same line as the \c HEADERS variable. The second assignment splits @@ -244,7 +244,7 @@ The contents of a variable can be read by prepending the variable name with \c $$. This can be used to assign the contents of one variable to another: - \snippet doc/src/snippets/qmake/dereferencing.pro 0 + \snippet snippets/qmake/dereferencing.pro 0 The \c $$ operator is used extensively with built-in functions that operate on strings and lists of values. For more information, see @@ -255,21 +255,21 @@ Usually, whitespace separates values in variable assignments. To specify values that contain spaces, you must enclose the values in double quotes: - \snippet doc/src/snippets/qmake/quoting.pro 0 + \snippet snippets/qmake/quoting.pro 0 The quoted text is treated as a single item in the list of values held by the variable. A similar approach is used to deal with paths that contain spaces, particularly when defining the \l{INCLUDEPATH} and \l{LIBS} variables for the Windows platform: - \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces + \snippet snippets/qmake/spaces.pro quoting include paths with spaces \section2 Comments You can add comments to project files. Comments begin with the \c # character and continue to the end of the same line. For example: - \snippet doc/src/snippets/qmake/comments.pro 0 + \snippet snippets/qmake/comments.pro 0 To include the \c # character in variable assignments, it is necessary to use the contents of the built-in \l{LITERAL_HASH} variable. @@ -285,12 +285,12 @@ The \c include function is most commonly used to include other project files: - \snippet doc/src/snippets/qmake/include.pro 0 + \snippet snippets/qmake/include.pro 0 Support for conditional structures is made available via \l{Scopes}{scopes} that behave like \c if statements in programming languages: - \snippet doc/src/snippets/qmake/scopes.pro 0 + \snippet snippets/qmake/scopes.pro 0 The assignments inside the braces are only made if the condition is true. In this case, the \c win32 \l{CONFIG} option must be set. This @@ -353,7 +353,7 @@ versions of a project, the Makefile that qmake generates includes a rule that builds both versions. This can be invoked in the following way: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 0 + \snippet snippets/code/doc_src_qmake-manual.pro 0 Adding the \c build_all option to the \c CONFIG variable makes this rule the default when building the project. @@ -365,8 +365,8 @@ For example, the following lines show the function as the condition in a scope to test whether only the \c opengl option is in use: - \snippet doc/src/snippets/qmake/configscopes.pro 4 - \snippet doc/src/snippets/qmake/configscopes.pro 5 + \snippet snippets/qmake/configscopes.pro 4 + \snippet snippets/qmake/configscopes.pro 5 This enables different configurations to be defined for \c release and \c debug builds. For more information, see \l{Scopes}{Using Scopes}. @@ -394,7 +394,7 @@ For example, if your application uses the Qt library and you want to build it in \c debug mode, your project file will contain the following line: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 1 + \snippet snippets/code/doc_src_qmake-manual.pro 1 \note You must use "+=", not "=", or qmake will not be able to use Qt's configuration to determine the settings @@ -409,21 +409,21 @@ extension modules. For example, we can enable the XML and network modules in the following way: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 2 + \snippet snippets/code/doc_src_qmake-manual.pro 2 \note \c QT includes the \c core and \c gui modules by default, so the above declaration \e adds the network and XML modules to this default list. The following assignment \e omits the default modules, and will lead to errors when the application's source code is being compiled: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 3 + \snippet snippets/code/doc_src_qmake-manual.pro 3 If you want to build a project \e without the \c gui module, you need to exclude it with the "-=" operator. By default, \c QT contains both \c core and \c gui, so the following line will result in a minimal Qt project being built: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 4 + \snippet snippets/code/doc_src_qmake-manual.pro 4 For a list of Qt modules that you can add to the \c QT variable, see \l{Variables#QT}{QT}. @@ -441,7 +441,7 @@ \l{http://www.freedesktop.org/wiki/Software/pkg-config}{pkg-config}, such as the D-Bus and ogg libraries, with the following lines: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 5 + \snippet snippets/code/doc_src_qmake-manual.pro 5 For more information about adding features, see \l{Adding New Configuration Features}. @@ -458,14 +458,14 @@ For example, the following lines show how a library can be specified: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 6 + \snippet snippets/code/doc_src_qmake-manual.pro 6 The paths containing header files can also be specified in a similar way using the \l{INCLUDEPATH} variable. For example, to add several paths to be searched for header files: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 7 + \snippet snippets/code/doc_src_qmake-manual.pro 7 */ /*! @@ -485,7 +485,7 @@ The syntax used to run qmake takes the following simple form: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 8 + \snippet snippets/code/doc_src_qmake-manual.pro 8 \section1 Operating Modes @@ -572,7 +572,7 @@ \target MakefileMode \section1 Makefile Mode Options - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 9 + \snippet snippets/code/doc_src_qmake-manual.pro 9 In Makefile mode, qmake will generate a Makefile that is used to build the project. Additionally, the following options may @@ -599,12 +599,12 @@ before all of the files specified. For example, the following command generates a Makefile from test.pro: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 10 + \snippet snippets/code/doc_src_qmake-manual.pro 10 However, some of the specified options can be omitted as they are default values: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 11 + \snippet snippets/code/doc_src_qmake-manual.pro 11 If you are certain you want your variables processed after the files specified, then you may pass the \c -after option. When this @@ -614,7 +614,7 @@ \target ProjectMode \section1 Project Mode Options - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 12 + \snippet snippets/code/doc_src_qmake-manual.pro 12 In project mode, qmake will generate a project file. Additionally, you may supply the following options in this mode: @@ -669,7 +669,7 @@ For example, to use qmake from a binary package to create a Makefile in a project directory, invoke the following command: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 13 + \snippet snippets/code/doc_src_qmake-manual.pro 13 \section2 Using Frameworks @@ -681,12 +681,12 @@ to the build system, and this is achieved by appending linker options to the \l{QMAKE_LFLAGS} variable, as shown in the following example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 14 + \snippet snippets/code/doc_src_qmake-manual.pro 14 The framework itself is linked in by appending the \c{-framework} options and the name of the framework to the \l{LIBS} variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 15 + \snippet snippets/code/doc_src_qmake-manual.pro 15 \section2 Creating Frameworks @@ -697,7 +697,7 @@ \l{TEMPLATE}{\c lib template} and add the \c lib_bundle option to the \l{CONFIG} variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 16 + \snippet snippets/code/doc_src_qmake-manual.pro 16 The data associated with the library is specified using the \l{QMAKE_BUNDLE_DATA} @@ -705,7 +705,7 @@ bundle, and is often used to specify a collection of header files, as in the following example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 17 + \snippet snippets/code/doc_src_qmake-manual.pro 17 You use the \c FRAMEWORK_HEADERS variable to specify the headers required by a particular framework. @@ -727,7 +727,7 @@ by running qmake to generate an Xcode project from an existing qmake project file. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 19 + \snippet snippets/code/doc_src_qmake-manual.pro 19 \note If a project is later moved on the disk, qmake must be run again to process the project file and create a new Xcode project file. @@ -778,12 +778,12 @@ This can also be set using a command line option, for example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 20 + \snippet snippets/code/doc_src_qmake-manual.pro 20 It is possible to recursively generate \c{.vcproj} files in subdirectories and a \c{.sln} file in the main directory, by typing: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 21 + \snippet snippets/code/doc_src_qmake-manual.pro 21 Each time you update the project file, you need to run qmake to generate an updated Visual Studio @@ -802,12 +802,12 @@ Removing manifest embedding for application executables can be done with the following assignment to the \l{CONFIG} variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 22 + \snippet snippets/code/doc_src_qmake-manual.pro 22 Also, the manifest embedding for DLLs can be removed with the following assignment to the \c CONFIG variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 23 + \snippet snippets/code/doc_src_qmake-manual.pro 23 This is discussed in more detail in the \l{Deploying an Application on Windows#Manifest files} @@ -916,7 +916,7 @@ qmake generates includes a rule that builds both versions, and this can be invoked in the following way: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 24 + \snippet snippets/code/doc_src_qmake-manual.pro 24 When linking a library, qmake relies on the underlying platform to know what other libraries this library links @@ -953,7 +953,7 @@ will be set for each of these modes, and you can test for this to perform build-specific tasks. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 25 + \snippet snippets/code/doc_src_qmake-manual.pro 25 As a result, it may be useful to define mode-specific variables, such as \l{#QMAKE_LFLAGS_RELEASE}{QMAKE_LFLAGS_RELEASE}, instead of general @@ -1049,7 +1049,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 26 + \snippet snippets/code/doc_src_qmake-manual.pro 26 \target DEFINES \section1 DEFINES @@ -1059,7 +1059,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 27 + \snippet snippets/code/doc_src_qmake-manual.pro 27 \target DEF_FILE \section1 DEF_FILE @@ -1089,7 +1089,7 @@ For example, the following definition uploads all PNG images in \c path to the directory where the build target is deployed: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 28 + \snippet snippets/code/doc_src_qmake-manual.pro 28 The default deployment target path for Windows CE is \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to @@ -1101,7 +1101,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 29 + \snippet snippets/code/doc_src_qmake-manual.pro 29 \note In Windows CE all linked Qt libraries will be deployed to the path specified by \c{myFiles.path}. @@ -1122,7 +1122,7 @@ For example, the following definition uploads the jpeg imageformat plugin to the plugins directory on the Windows CE device: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 142 + \snippet snippets/code/doc_src_qmake-manual.pro 142 \target DESTDIR \section1 DESTDIR @@ -1131,7 +1131,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 30 + \snippet snippets/code/doc_src_qmake-manual.pro 30 \target DISTFILES \section1 DISTFILES @@ -1141,7 +1141,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 31 + \snippet snippets/code/doc_src_qmake-manual.pro 31 \target DLLDESTDIR \section1 DLLDESTDIR @@ -1159,7 +1159,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 32 + \snippet snippets/code/doc_src_qmake-manual.pro 32 \target GUID \section1 GUID @@ -1182,7 +1182,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 34 + \snippet snippets/code/doc_src_qmake-manual.pro 34 See also \l{#SOURCES}{SOURCES}. @@ -1201,12 +1201,12 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 35 + \snippet snippets/code/doc_src_qmake-manual.pro 35 To specify a path containing spaces, quote the path using the technique described in \l{Whitespace}. - \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces + \snippet snippets/qmake/spaces.pro quoting include paths with spaces \target INSTALLS \section1 INSTALLS @@ -1220,7 +1220,7 @@ build target will be installed, and the \c INSTALLS assignment adds the build target to the list of existing resources to be installed: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 36 + \snippet snippets/code/doc_src_qmake-manual.pro 36 For more information, see \l{Installing Files}. @@ -1247,7 +1247,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 37 + \snippet snippets/code/doc_src_qmake-manual.pro 37 \target LIBS \section1 LIBS @@ -1260,18 +1260,18 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 38 + \snippet snippets/code/doc_src_qmake-manual.pro 38 To specify a path containing spaces, quote the path using the technique described in \l{Whitespace}. - \snippet doc/src/snippets/qmake/spaces.pro quoting library paths with spaces + \snippet snippets/qmake/spaces.pro quoting library paths with spaces By default, the list of libraries stored in \c LIBS is reduced to a list of unique names before it is used. To change this behavior, add the \c no_lflags_merge option to the \l{CONFIG} variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 39 + \snippet snippets/code/doc_src_qmake-manual.pro 39 \target LITERAL_HASH \section1 LITERAL_HASH @@ -1282,7 +1282,7 @@ For example: - \snippet doc/src/snippets/qmake/comments.pro 1 + \snippet snippets/qmake/comments.pro 1 By using \c LITERAL_HASH in this way, the \c # character can be used to construct a URL for the \c message() function to print to the console. @@ -1310,7 +1310,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 40 + \snippet snippets/code/doc_src_qmake-manual.pro 40 \target OBJECTS \section1 OBJECTS @@ -1327,7 +1327,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 41 + \snippet snippets/code/doc_src_qmake-manual.pro 41 \target POST_TARGETDEPS \section1 POST_TARGETDEPS @@ -1416,7 +1416,7 @@ and \c path/to/header_two.h to a group containing information about the headers supplied with the framework: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 43 + \snippet snippets/code/doc_src_qmake-manual.pro 43 The last line adds the information about the headers to the collection of resources that will be installed with the library bundle. @@ -1438,7 +1438,7 @@ For example, the following definition will result in a framework with the \c{.myframework} extension: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 44 + \snippet snippets/code/doc_src_qmake-manual.pro 44 \section1 QMAKE_CC @@ -2026,7 +2026,7 @@ \c{-compress} options are used with particular values each time that \c rcc is invoked: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 45 + \snippet snippets/code/doc_src_qmake-manual.pro 45 \section1 QMAKE_RPATHDIR @@ -2130,7 +2130,7 @@ exclude the \c gui value with the "-=" operator. The following line will result in a minimal Qt project being built: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 47 + \snippet snippets/code/doc_src_qmake-manual.pro 47 \section1 QTPLUGIN @@ -2176,7 +2176,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 48 + \snippet snippets/code/doc_src_qmake-manual.pro 48 \target REQUIRES \section1 REQUIRES @@ -2218,7 +2218,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 49 + \snippet snippets/code/doc_src_qmake-manual.pro 49 See also \l{#HEADERS}{HEADERS}. @@ -2232,7 +2232,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 50 + \snippet snippets/code/doc_src_qmake-manual.pro 50 It is essential that the project file in each subdirectory has the same name as the subdirectory itself, so that qmake @@ -2243,7 +2243,7 @@ which they are specified, update the \l{#CONFIG}{CONFIG} variable to include the \c ordered option: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 51 + \snippet snippets/code/doc_src_qmake-manual.pro 51 It is possible to modify this default behavior of \c SUBDIRS by giving additional modifiers to \c SUBDIRS elements. Supported modifiers are: @@ -2265,7 +2265,7 @@ For example, define two subdirectories, both of which reside in a different directory than the \c SUBDIRS value, and one of the subdirectories must be built before the other: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 149 + \snippet snippets/code/doc_src_qmake-manual.pro 149 \target TARGET \section1 TARGET @@ -2275,7 +2275,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 52 + \snippet snippets/code/doc_src_qmake-manual.pro 52 The project file above would produce an executable named \c myapp on unix and \c{myapp.exe} on Windows. @@ -2323,7 +2323,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 53 + \snippet snippets/code/doc_src_qmake-manual.pro 53 The template can be overridden by specifying a new template type with the \c -t command line option. This overrides the template type \e after the .pro @@ -2347,7 +2347,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 54 + \snippet snippets/code/doc_src_qmake-manual.pro 54 \target VERSION \section1 VERSION @@ -2357,7 +2357,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 57 + \snippet snippets/code/doc_src_qmake-manual.pro 57 \section1 VER_MAJ @@ -2391,7 +2391,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 58 + \snippet snippets/code/doc_src_qmake-manual.pro 58 \section1 _PRO_FILE_ @@ -2400,7 +2400,7 @@ For example, the following line causes the location of the project file to be written to the console: - \snippet doc/src/snippets/qmake/project_location.pro project file + \snippet snippets/qmake/project_location.pro project file \note Do not attempt to overwrite the value of this variable. @@ -2411,7 +2411,7 @@ For example, the following line causes the location of the directory containing the project file to be written to the console: - \snippet doc/src/snippets/qmake/project_location.pro project file directory + \snippet snippets/qmake/project_location.pro project file directory \note Do not attempt to overwrite the value of this variable. */ @@ -2446,7 +2446,7 @@ For example, the following call returns the string \c {"/home/johndoe/myproject/readme.txt"}: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 159 + \snippet snippets/code/doc_src_qmake-manual.pro 159 See also \l{clean_path(path)}{clean_path()}, \l{relative_path(filePath[, base])}{relative_path()}. @@ -2457,7 +2457,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 59 + \snippet snippets/code/doc_src_qmake-manual.pro 59 \section2 cat(filename[, mode]) @@ -2489,7 +2489,7 @@ Returns the directory name part of the specified file. For example: - \snippet doc/src/snippets/qmake/dirname.pro 0 + \snippet snippets/qmake/dirname.pro 0 \section2 enumerate_vars @@ -2504,7 +2504,7 @@ \note If you specify the string to expand literally, you need to escape the backslashes, as illustrated by the following code snippet: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 173 + \snippet snippets/code/doc_src_qmake-manual.pro 173 \target findfunction \section2 find(variablename, substr) @@ -2512,7 +2512,7 @@ Returns all the values in \c variablename that match the regular expression \c substr. - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 64 + \snippet snippets/code/doc_src_qmake-manual.pro 64 MY_VAR2 will contain '-Lone -Ltwo -Lthree -Lfour -Lfive', and MY_VAR3 will contain 'three two three'. @@ -2523,7 +2523,7 @@ For example, the following call returns \c firstname: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 161 + \snippet snippets/code/doc_src_qmake-manual.pro 161 See also \l{last(variablename)}{last()}. @@ -2549,7 +2549,7 @@ For example, the following call converts the hexadecimal number \c BAD to \c 002989: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 163 + \snippet snippets/code/doc_src_qmake-manual.pro 163 \section2 fromfile(filename, variablename) @@ -2572,7 +2572,7 @@ For example, the following call returns \c phone: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 162 + \snippet snippets/code/doc_src_qmake-manual.pro 162 See also \l{first(variablename)}{first()}. @@ -2583,11 +2583,11 @@ of that variable. You can use the variable to write a loop as illustrated by the following code snippet - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 170 + \snippet snippets/code/doc_src_qmake-manual.pro 170 instead of: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 171 + \snippet snippets/code/doc_src_qmake-manual.pro 171 \section2 lower(arg1 [, arg2 ..., argn]) @@ -2633,11 +2633,11 @@ contents of the variable supplied as \c string. For example, the code - \snippet doc/src/snippets/qmake/replace.pro 0 + \snippet snippets/qmake/replace.pro 0 prints the message: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 70 + \snippet snippets/code/doc_src_qmake-manual.pro 70 \section2 sprintf(string, arguments...) @@ -2659,7 +2659,7 @@ For example, the following call outputs \c surname: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 167 + \snippet snippets/code/doc_src_qmake-manual.pro 167 \section2 shadowed(path) @@ -2697,7 +2697,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 168 + \snippet snippets/code/doc_src_qmake-manual.pro 168 \section2 system(command[, mode]) @@ -2706,7 +2706,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 72 + \snippet snippets/code/doc_src_qmake-manual.pro 72 See also the test variant of \l{system(command)}{system()}. @@ -2732,7 +2732,7 @@ Returns the list of values in \c variablename with duplicate entries removed. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 73 + \snippet snippets/code/doc_src_qmake-manual.pro 73 \section2 upper(arg1 [, arg2 ..., argn]) @@ -2776,7 +2776,7 @@ mutually exclusive values) a second parameter can be used to specify a set of values to consider. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 60 + \snippet snippets/code/doc_src_qmake-manual.pro 60 Because release is considered the active setting (for feature parsing) it will be the CONFIG used to generate the build file. In the common @@ -2791,7 +2791,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 61 + \snippet snippets/code/doc_src_qmake-manual.pro 61 The contents of the scope are only processed if the \c drivers variable contains the value \c network. If this is the case, the @@ -2808,7 +2808,7 @@ only processed if the variable contains the correct number of values. For example: - \snippet doc/src/snippets/qmake/functions.pro 2 + \snippet snippets/qmake/functions.pro 2 \section2 debug(level, message) @@ -2833,7 +2833,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 160 + \snippet snippets/code/doc_src_qmake-manual.pro 160 \section2 error(string) @@ -2843,7 +2843,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 62 + \snippet snippets/code/doc_src_qmake-manual.pro 62 \section2 eval(string) @@ -2853,7 +2853,7 @@ values of existing variables or create new definitions. For example: - \snippet doc/src/snippets/qmake/functions.pro 4 + \snippet snippets/qmake/functions.pro 4 \note Quotation marks can be used to delimit the string, and the return value can be discarded if it is not needed. @@ -2866,7 +2866,7 @@ succeeds if any file matches the regular expression specified. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 63 + \snippet snippets/code/doc_src_qmake-manual.pro 63 \note "/" should be used as a directory separator, regardless of the platform in use. @@ -2890,7 +2890,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 65 + \snippet snippets/code/doc_src_qmake-manual.pro 65 \section2 greaterThan(variablename, value) @@ -2900,7 +2900,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 164 + \snippet snippets/code/doc_src_qmake-manual.pro 164 It is impossible to compare two numbers as strings directly. As a workaround, construct temporary values with a non-numeric prefix and compare @@ -2908,7 +2908,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 172 + \snippet snippets/code/doc_src_qmake-manual.pro 172 See also \l{lessThan(variablename, value)}{lessThan()}. @@ -2918,7 +2918,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 166 + \snippet snippets/code/doc_src_qmake-manual.pro 166 \section2 include(filename) @@ -2930,7 +2930,7 @@ You can check whether the file was included by using this function as the condition for a scope. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 66 + \snippet snippets/code/doc_src_qmake-manual.pro 66 \section2 infile(filename, var, val) @@ -2950,7 +2950,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 67 + \snippet snippets/code/doc_src_qmake-manual.pro 67 \section2 isEqual @@ -2963,7 +2963,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 165 + \snippet snippets/code/doc_src_qmake-manual.pro 165 \section2 load(feature) @@ -2982,7 +2982,7 @@ Always succeeds, and displays \c string as a general message to the user. Unlike the \c error() function, this function allows processing to continue. - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 68 + \snippet snippets/code/doc_src_qmake-manual.pro 68 The above line causes "This is a message" to be written to the console. The use of quotation marks is optional, but recommended. @@ -2993,7 +2993,7 @@ \l{Scopes}{in conjunction with a scope} to filter out messages during builds. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 69 + \snippet snippets/code/doc_src_qmake-manual.pro 69 \section2 mkpath(dirPath) @@ -3016,7 +3016,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 71 + \snippet snippets/code/doc_src_qmake-manual.pro 71 See also the replace variant of \l{system(command[, mode])}{system()}. @@ -3032,7 +3032,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 169 + \snippet snippets/code/doc_src_qmake-manual.pro 169 \section2 warning(string) @@ -3056,11 +3056,11 @@ This can be useful to optionally enable or disable features. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 157 + \snippet snippets/code/doc_src_qmake-manual.pro 157 And then, in the code: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 158 + \snippet snippets/code/doc_src_qmake-manual.pro 158 */ /*! @@ -3077,14 +3077,14 @@ property in qmake once, and query it each time qmake is invoked. You can set a property in qmake as follows: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 74 + \snippet snippets/code/doc_src_qmake-manual.pro 74 The appropriate property and value should be substituted for \c PROPERTY and \c VALUE. You can retrieve this information back from qmake as follows: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 75 + \snippet snippets/code/doc_src_qmake-manual.pro 75 \note \c{qmake -query} lists built-in properties in addition to the properties that you set with \c{qmake -set PROPERTY VALUE}. @@ -3130,11 +3130,11 @@ For example, you can query the installation of Qt for this version of qmake with the \c QT_INSTALL_PREFIX property: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 77 + \snippet snippets/code/doc_src_qmake-manual.pro 77 You can query the values of properties in a project file as follows: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 78 + \snippet snippets/code/doc_src_qmake-manual.pro 78 \target QMAKESPEC \section1 QMAKESPEC @@ -3184,7 +3184,7 @@ example, the extension used for \l moc files can be redefined with the following assignment in a project file: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 85 + \snippet snippets/code/doc_src_qmake-manual.pro 85 The following variables can be used to redefine common file extensions recognized by qmake: @@ -3244,7 +3244,7 @@ The \c = operator assigns a value to a variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 89 + \snippet snippets/code/doc_src_qmake-manual.pro 89 The above line sets the \l{TARGET} variable to \c myapp. This will overwrite any values previously set for \c TARGET with \c myapp. @@ -3253,7 +3253,7 @@ The \c += operator appends a new value to the list of values in a variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 90 + \snippet snippets/code/doc_src_qmake-manual.pro 90 The above line appends \c USE_MY_STUFF to the list of pre-processor defines to be put in the generated Makefile. @@ -3262,7 +3262,7 @@ The \c -= operator removes a value from the list of values in a variable: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 91 + \snippet snippets/code/doc_src_qmake-manual.pro 91 The above line removes \c USE_MY_STUFF from the list of pre-processor defines to be put in the generated Makefile. @@ -3273,7 +3273,7 @@ if it is not already present. This prevents values from being included many times in a variable. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 92 + \snippet snippets/code/doc_src_qmake-manual.pro 92 In the above line, \c USE_MY_STUFF will only be added to the list of pre-processor defines if it is not already defined. Note that the \l{unique}{unique()} @@ -3285,7 +3285,7 @@ The \c ~= operator replaces any values that match a regular expression with the specified value: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 93 + \snippet snippets/code/doc_src_qmake-manual.pro 93 In the above line, any values in the list that start with \c QT_D or \c QT_T are replaced with \c QT. @@ -3295,7 +3295,7 @@ The \c $$ operator is used to extract the contents of a variable, and can be used to pass values between variables or supply them to functions: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 94 + \snippet snippets/code/doc_src_qmake-manual.pro 94 Variables can be used to store the contents of environment variables. These can be evaluated at the time when qmake @@ -3347,7 +3347,7 @@ Scopes consist of a condition followed by an opening brace on the same line, a sequence of commands and definitions, and a closing brace on a new line: - \snippet doc/src/snippets/qmake/scopes.pro syntax + \snippet snippets/qmake/scopes.pro syntax The opening brace \e{must be written on the same line as the condition}. Scopes may be concatenated to include more than one condition, as described @@ -3358,7 +3358,7 @@ A scope is written as a condition followed by a series of declarations contained within a pair of braces. For example: - \snippet doc/src/snippets/qmake/scopes.pro 0 + \snippet snippets/qmake/scopes.pro 0 The above code will add the \c paintwidget_win.cpp file to the sources listed in the generated Makefile when building for a Windows platform. When @@ -3369,24 +3369,24 @@ original condition is false. For example, to process something when building for all platforms \e except Windows, negate the scope like this: - \snippet doc/src/snippets/qmake/scopes.pro 1 + \snippet snippets/qmake/scopes.pro 1 Scopes can be nested to combine more than one condition. For instance, to include a particular file for a certain platform only if debugging is enabled, write the following: - \snippet doc/src/snippets/qmake/scopes.pro 2 + \snippet snippets/qmake/scopes.pro 2 To save writing many nested scopes, you can nest scopes using the \c : operator. The nested scopes in the above example can be rewritten in the following way: - \snippet doc/src/snippets/qmake/scopes.pro 3 + \snippet snippets/qmake/scopes.pro 3 You may also use the \c : operator to perform single line conditional assignments. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 95 + \snippet snippets/code/doc_src_qmake-manual.pro 95 The above line adds \c USE_MY_STUFF to the \l{DEFINES} variable only when building for the Windows platform. @@ -3396,7 +3396,7 @@ There is also the \c | operator to act like a logical OR operator, joining together a number of conditions, and requiring only one of them to be true. - \snippet doc/src/snippets/qmake/scopes.pro 4 + \snippet snippets/qmake/scopes.pro 4 You can also provide alternative declarations to those within a scope by using an \c else scope. Each \c else scope is processed if the conditions @@ -3404,7 +3404,7 @@ This allows you to write complex tests when combined with other scopes (separated by the \c : operator as above). For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 96 + \snippet snippets/code/doc_src_qmake-manual.pro 96 \section2 Configuration and Scopes @@ -3413,15 +3413,15 @@ values can be used as the condition for a scope. For example, the list of values held by \c CONFIG can be extended with the \c opengl value: - \snippet doc/src/snippets/qmake/configscopes.pro 0 + \snippet snippets/qmake/configscopes.pro 0 As a result of this operation, any scopes that test for \c opengl will be processed. We can use this feature to give the final executable an appropriate name: - \snippet doc/src/snippets/qmake/configscopes.pro 1 - \snippet doc/src/snippets/qmake/configscopes.pro 2 - \snippet doc/src/snippets/qmake/configscopes.pro 3 + \snippet snippets/qmake/configscopes.pro 1 + \snippet snippets/qmake/configscopes.pro 2 + \snippet snippets/qmake/configscopes.pro 3 This feature makes it easy to change the configuration for a project without losing all the custom settings that might be needed for a specific @@ -3444,7 +3444,7 @@ following lines from a project file show the current specification in use and test for the \c linux-g++ specification: - \snippet doc/src/snippets/qmake/specifications.pro 0 + \snippet snippets/qmake/specifications.pro 0 You can test for any other platform-compiler combination as long as a specification exists for it in the \c mkspecs directory. @@ -3459,7 +3459,7 @@ variables with a given name when it encounters an assignment to that name. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 97 + \snippet snippets/code/doc_src_qmake-manual.pro 97 There are no restricitions on what you do to your own variables, as qmake will ignore them unless it needs to evaluate them when processing @@ -3468,19 +3468,19 @@ You can also assign the value of a current variable to another variable by prefixing $$ to the variable name. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 98 + \snippet snippets/code/doc_src_qmake-manual.pro 98 Now the MY_DEFINES variable contains what is in the DEFINES variable at this point in the project file. This is also equivalent to: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 99 + \snippet snippets/code/doc_src_qmake-manual.pro 99 The second notation allows you to append the contents of the variable to another value without separating the two with a space. For example, the following will ensure that the final executable will be given a name that includes the project template being used: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 100 + \snippet snippets/code/doc_src_qmake-manual.pro 100 \target UsingReplaceFunctions \section1 Replace Functions @@ -3492,7 +3492,7 @@ operator with this type of function as you would to assign contents of one variable to another: - \snippet doc/src/snippets/qmake/functions.pro 1 + \snippet snippets/qmake/functions.pro 1 This type of function should be used on the right-hand side of assignments (that is, as an operand). @@ -3500,13 +3500,13 @@ You can define your own functions for processing the contents of variables as follows: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 102 + \snippet snippets/code/doc_src_qmake-manual.pro 102 The following example function takes a variable name as its only argument, extracts a list of values from the variable with the \l{eval(string)}{eval()} built-in function, and compiles a list of files: - \snippet doc/src/snippets/qmake/replacefunction.pro 0 + \snippet snippets/qmake/replacefunction.pro 0 \target UsingTestFunctions \section1 Test Functions @@ -3515,7 +3515,7 @@ used as conditions when writing scopes. These functions do not return a value, but instead indicate \e success or \e failure: - \snippet doc/src/snippets/qmake/functions.pro 3 + \snippet snippets/qmake/functions.pro 3 This type of function should be used in conditional expressions only. @@ -3524,7 +3524,7 @@ for scopes. The following example tests whether each file in a list exists and returns true if they all exist, or false if not: - \snippet doc/src/snippets/qmake/testfunction.pro 0 + \snippet snippets/qmake/testfunction.pro 0 */ /*! @@ -3581,7 +3581,7 @@ For example, consider the following assignment in a project file: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 103 + \snippet snippets/code/doc_src_qmake-manual.pro 103 With this addition to the \c CONFIG variable, qmake will search the locations listed above for @@ -3903,7 +3903,7 @@ and \e static throughout your project. A typical precompiled header might look like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.cpp 104 + \snippet snippets/code/doc_src_qmake-manual.cpp 104 \note A precompiled header file needs to separate C includes from C++ includes, since the precompiled header file for C files may not @@ -3915,7 +3915,7 @@ To make your project use precompiled headers, you only need to define the \l{PRECOMPILED_HEADER} variable in your project file: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 105 + \snippet snippets/code/doc_src_qmake-manual.pro 105 qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to @@ -3928,7 +3928,7 @@ precompiled headers. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 106 + \snippet snippets/code/doc_src_qmake-manual.pro 106 \section1 Notes on Possible Issues @@ -3937,7 +3937,7 @@ declarations may cause two different object files with the same name to be generated: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 107 + \snippet snippets/code/doc_src_qmake-manual.pro 107 To avoid potential conflicts like these, give distinctive names to header files that will be precompiled. @@ -4105,17 +4105,17 @@ Just start a new line with \c {SOURCES +=} and put hello.cpp after it. You should have something like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 108 + \snippet snippets/code/doc_src_qmake-manual.pro 108 We repeat this for each source file in the project, until we end up with the following: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 109 + \snippet snippets/code/doc_src_qmake-manual.pro 109 If you prefer to use a Make-like syntax, with all the files listed in one go you can use the newline escaping like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 110 + \snippet snippets/code/doc_src_qmake-manual.pro 110 Now that the source files are listed in the project file, the header files must be added. These are added in exactly the same way as source @@ -4124,7 +4124,7 @@ Once you have done this, your project file should look something like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 111 + \snippet snippets/code/doc_src_qmake-manual.pro 111 The target name is set automatically. It is the same as the project filename, but with the suffix appropriate for the platform. For example, if @@ -4132,24 +4132,24 @@ on Windows and \c hello on Unix. If you want to use a different name you can set it in the project file: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 112 + \snippet snippets/code/doc_src_qmake-manual.pro 112 The finished project file should look like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 113 + \snippet snippets/code/doc_src_qmake-manual.pro 113 You can now use qmake to generate a Makefile for your application. On the command line, in your project directory, type the following: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 114 + \snippet snippets/code/doc_src_qmake-manual.pro 114 Then type \c make or \c nmake depending on the compiler you use. For Visual Studio users, qmake can also generate Visual Studio project files. For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 115 + \snippet snippets/code/doc_src_qmake-manual.pro 115 \section1 Making an Application Debuggable @@ -4161,7 +4161,7 @@ For example: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 116 + \snippet snippets/code/doc_src_qmake-manual.pro 116 Use qmake as before to generate a Makefile. You will now obtain useful information about your application when running it in a debugging @@ -4181,7 +4181,7 @@ A simple scope that adds the platform-dependent file for Windows looks like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 117 + \snippet snippets/code/doc_src_qmake-manual.pro 117 When building for Windows, qmake adds \c hellowin.cpp to the list of source files. When building for any other platform, qmake simply ignores it. Now @@ -4190,7 +4190,7 @@ When you have done that, your project file should look something like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 118 + \snippet snippets/code/doc_src_qmake-manual.pro 118 Use qmake as before to generate a Makefile. @@ -4203,13 +4203,13 @@ the scope condition with the function. A check for a file called main.cpp looks like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 119 + \snippet snippets/code/doc_src_qmake-manual.pro 119 The \c{!} symbol is used to negate the test. That is, \c{exists( main.cpp )} is true if the file exists, and \c{!exists( main.cpp )} is true if the file does not exist. - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 120 + \snippet snippets/code/doc_src_qmake-manual.pro 120 Use qmake as before to generate a makefile. If you rename \c main.cpp temporarily, you will see the message and @@ -4228,12 +4228,12 @@ the other inside it. Put the settings to be processed inside the second scope, like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 121 + \snippet snippets/code/doc_src_qmake-manual.pro 121 Nested scopes can be joined together using colons, so the final project file looks like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 122 + \snippet snippets/code/doc_src_qmake-manual.pro 122 That's it! You have now completed the tutorial for qmake, and are ready to write project files for @@ -4306,7 +4306,7 @@ to specify any. qmake will add the necessary default values. An example project file might look like this: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 123 + \snippet snippets/code/doc_src_qmake-manual.pro 123 For items that are single valued, such as the template or the destination directory, we use "="; but for multi-valued items we use "+=" to \e @@ -4444,8 +4444,8 @@ To enable a project to be built in both modes, you must add the \c debug_and_release option to the \c CONFIG variable: - \snippet doc/src/snippets/qmake/debug_and_release.pro 0 - \snippet doc/src/snippets/qmake/debug_and_release.pro 1 + \snippet snippets/qmake/debug_and_release.pro 0 + \snippet snippets/qmake/debug_and_release.pro 1 The scope in the above snippet modifies the build target in each mode to ensure that the resulting targets have different names. Providing different @@ -4455,23 +4455,23 @@ generate a Makefile rule to allow the project to be built in both modes. This can be invoked in the following way: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 124 + \snippet snippets/code/doc_src_qmake-manual.pro 124 The \c build_all option can be added to the \c CONFIG variable in the project file to ensure that the project is built in both modes by default: - \snippet doc/src/snippets/qmake/debug_and_release.pro 2 + \snippet snippets/qmake/debug_and_release.pro 2 This allows the Makefile to be processed using the default rule: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 125 + \snippet snippets/code/doc_src_qmake-manual.pro 125 \section2 Installing in Both Modes The \c build_all option also ensures that both versions of the target will be installed when the installation rule is invoked: - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 126 + \snippet snippets/code/doc_src_qmake-manual.pro 126 It is possible to customize the names of the build targets depending on the target platform. For example, a library or plugin may be named using a @@ -4481,7 +4481,7 @@ Note: This was originally used in the customwidgetplugin.pro file, but is no longer needed there. \endomit - \snippet doc/src/snippets/code/doc_src_qmake-manual.pro 127 + \snippet snippets/code/doc_src_qmake-manual.pro 127 The default behavior in the above snippet is to modify the name used for the build target when building in debug mode. An \c else clause could be diff --git a/doc/src/development/rcc.qdoc b/doc/src/development/rcc.qdoc index 497591406..dd3a95aee 100644 --- a/doc/src/development/rcc.qdoc +++ b/doc/src/development/rcc.qdoc @@ -36,7 +36,7 @@ data specified in a Qt resource (.qrc) file. Usage: - \snippet doc/src/snippets/code/doc_src_rcc.qdoc 0 + \snippet snippets/code/doc_src_rcc.qdoc 0 RCC accepts the following command line options: diff --git a/doc/src/development/uic.qdoc b/doc/src/development/uic.qdoc index 1030c11d6..121baf5a4 100644 --- a/doc/src/development/uic.qdoc +++ b/doc/src/development/uic.qdoc @@ -39,7 +39,7 @@ Designer} and creates a corresponding C++ header file. Usage: - \snippet doc/src/snippets/code/doc_src_uic.qdoc 0 + \snippet snippets/code/doc_src_uic.qdoc 0 \section1 Options @@ -62,12 +62,12 @@ Here are useful makefile rules if you only use GNU make: - \snippet doc/src/snippets/code/doc_src_uic.qdoc 1 + \snippet snippets/code/doc_src_uic.qdoc 1 If you want to write portably, you can use individual rules of the following form: - \snippet doc/src/snippets/code/doc_src_uic.qdoc 2 + \snippet snippets/code/doc_src_uic.qdoc 2 You must also remember to add \c{ui_foo.h} to your \c HEADERS (substitute your favorite name). diff --git a/doc/src/frameworks-technologies/accessible.qdoc b/doc/src/frameworks-technologies/accessible.qdoc index db8d436a7..890509ee3 100644 --- a/doc/src/frameworks-technologies/accessible.qdoc +++ b/doc/src/frameworks-technologies/accessible.qdoc @@ -382,7 +382,7 @@ found in src/plugins/accessible/widgets. Here is the QAccessibleSlider's constructor: - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 0 + \snippet snippets/accessibilityslidersnippet.cpp 0 The slider is a complex control that functions as a \l{QAccessible::}{Controller} for its accessible children. @@ -403,11 +403,11 @@ \l{QAccessibleInterface::}{updateAccessibility()} to indicate that its value has changed: - \snippet doc/src/snippets/qabstractsliderisnippet.cpp 0 + \snippet snippets/qabstractsliderisnippet.cpp 0 \dots - \snippet doc/src/snippets/qabstractsliderisnippet.cpp 1 + \snippet snippets/qabstractsliderisnippet.cpp 1 \dots - \snippet doc/src/snippets/qabstractsliderisnippet.cpp 2 + \snippet snippets/qabstractsliderisnippet.cpp 2 Note that the call is made after the value of the slider has changed because clients may query the new value immediately after @@ -422,9 +422,9 @@ handle), and \c Position (the slider handle). Here is the implementation of \l{QAccessibleInterface::}{rect()}: - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 1 + \snippet snippets/accessibilityslidersnippet.cpp 1 \dots - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 2 + \snippet snippets/accessibilityslidersnippet.cpp 2 \dots The first part of the function, which we have omitted, uses the @@ -435,7 +435,7 @@ from the superclass, which is effectively the value obtained from QAccessibleWidget::rect(). - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 3 + \snippet snippets/accessibilityslidersnippet.cpp 3 Before the rectangle is returned it must be mapped to screen coordinates. @@ -447,7 +447,7 @@ The \l{QAccessibleInterface::}{text()} function returns the QAccessible::Text strings for the slider: - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 4 + \snippet snippets/accessibilityslidersnippet.cpp 4 The \c slider() function returns a pointer to the interface's QSlider. Some values are left for the superclass's implementation. @@ -459,7 +459,7 @@ The implementation of the \l{QAccessibleInterface::}{role()} function is straightforward: - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 5 + \snippet snippets/accessibilityslidersnippet.cpp 5 The role function should be reimplemented by all objects and describes the role of themselves and the children that do not @@ -470,9 +470,9 @@ at parts of the \c state() implementation to show how just a few of the states are handled: - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 6 + \snippet snippets/accessibilityslidersnippet.cpp 6 \dots - \snippet doc/src/snippets/accessibilityslidersnippet.cpp 7 + \snippet snippets/accessibilityslidersnippet.cpp 7 The superclass implementation of \l{QAccessibleInterface::}{state()}, uses the @@ -543,14 +543,14 @@ from the \l{QAccessibleWidget Example}. We start with the \c key() function: - \snippet doc/src/snippets/accessibilitypluginsnippet.cpp 0 + \snippet snippets/accessibilitypluginsnippet.cpp 0 We simply need to return the class name of the single interface our plugin can create an accessible interface for. A plugin can support any number of classes; just add more class names to the string list. We move on to the \c create() function: - \snippet doc/src/snippets/accessibilitypluginsnippet.cpp 1 + \snippet snippets/accessibilitypluginsnippet.cpp 1 We check whether the interface requested is for QSlider; if it is, we create and return an interface for it. Note that \c object will @@ -561,7 +561,7 @@ Finally, you need to include macros in the cpp file: - \snippet doc/src/snippets/accessibilitypluginsnippet.cpp 2 + \snippet snippets/accessibilitypluginsnippet.cpp 2 The Q_PLUGIN_METADATA macro exports the plugin in the \c SliderPlugin class into the \c acc_sliderplugin library. The first @@ -587,9 +587,9 @@ \l{QAccessible::}{installFactory()} function. We give an example of how to create a factory for the \c QAccessibleSlider interface: - \snippet doc/src/snippets/accessibilityfactorysnippet.cpp 0 + \snippet snippets/accessibilityfactorysnippet.cpp 0 \dots - \snippet doc/src/snippets/accessibilityfactorysnippet.cpp 1 + \snippet snippets/accessibilityfactorysnippet.cpp 1 \omit diff --git a/doc/src/frameworks-technologies/unicode.qdoc b/doc/src/frameworks-technologies/unicode.qdoc index a5ffd836a..e5a3ba5c6 100644 --- a/doc/src/frameworks-technologies/unicode.qdoc +++ b/doc/src/frameworks-technologies/unicode.qdoc @@ -106,12 +106,12 @@ QString provides implicit casting from \c{const char *} so that things like - \snippet doc/src/snippets/code/doc_src_unicode.cpp 0 + \snippet snippets/code/doc_src_unicode.cpp 0 will work. There is also a function, QObject::tr(), that provides translation support, like this: - \snippet doc/src/snippets/code/doc_src_unicode.cpp 1 + \snippet snippets/code/doc_src_unicode.cpp 1 QObject::tr() maps from \c{const char *} to a Unicode string, and uses installable QTranslator objects to do the mapping. @@ -130,11 +130,11 @@ fast functions for mapping to and from them. For example, to open an application's icon one might do this: - \snippet doc/src/snippets/code/doc_src_unicode.cpp 2 + \snippet snippets/code/doc_src_unicode.cpp 2 or - \snippet doc/src/snippets/code/doc_src_unicode.cpp 3 + \snippet snippets/code/doc_src_unicode.cpp 3 Qt supports rendering text in most languages written in the world. The detailed list of supported writing systems depends a bit on operating system support and diff --git a/doc/src/getting-started/gettingstartedqt.qdoc b/doc/src/getting-started/gettingstartedqt.qdoc index 639114a9f..7d9cdb9c3 100644 --- a/doc/src/getting-started/gettingstartedqt.qdoc +++ b/doc/src/getting-started/gettingstartedqt.qdoc @@ -49,7 +49,7 @@ \image gs1.png "Notepad application" You can find the final Notepad source files in the qtdoc repository in the - doc/src/snippets/widgets-tutorial/notepad directory. You can either fetch + snippets/widgets-tutorial/notepad directory. You can either fetch the Qt 5 sources from Qt Project or install them as part of Qt 5. \section1 Creating the Notepad Project diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 5ee59a49f..22c95d573 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -61,7 +61,7 @@ for your platform from the following list. if you have the \c{qt-everywhere-opensource-src-%VERSION%.tar.gz} package, type the following commands at a command line prompt: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 0 +\snippet snippets/code/doc_src_installation.qdoc 0 This creates the directory \c{/tmp/qt-everywhere-opensource-src-%VERSION%} containing the files from the archive. We only support the GNU version of @@ -76,20 +76,20 @@ for your platform from the following list. \c{/usr/local/Qt-%VERSION%} directory, but this can be changed by using the \c{-prefix} option. -\snippet doc/src/snippets/code/doc_src_installation.qdoc 1 +\snippet snippets/code/doc_src_installation.qdoc 1 Type \c{./configure -help} to get a list of all available options. To create the library and compile all the examples, tools, and tutorials, type: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 2 +\snippet snippets/code/doc_src_installation.qdoc 2 If \c{-prefix} is outside the build directory, you need to install the library, examples, tools, and tutorials in the appropriate place. To do this (as root if necessary), type: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 3 +\snippet snippets/code/doc_src_installation.qdoc 3 Note that on some systems the make utility is named differently, e.g. gmake. The configure script tells you which make utility to @@ -105,18 +105,18 @@ for your platform from the following list. In order to use Qt, some environment variables needs to be extended. -\snippet doc/src/snippets/code/doc_src_installation.qdoc 4 +\snippet snippets/code/doc_src_installation.qdoc 4 This is done like this: In \c{.profile} (if your shell is bash, ksh, zsh or sh), add the following lines: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 5 +\snippet snippets/code/doc_src_installation.qdoc 5 In \c{.login} (in case your shell is csh or tcsh), add the following line: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 6 +\snippet snippets/code/doc_src_installation.qdoc 6 If you use a different shell, please modify your environment variables accordingly. @@ -308,7 +308,7 @@ must be run as root. if you have the \c{qt-everywhere-opensource-src-%VERSION%.tar.gz} package, type the following commands at a command line prompt: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 11 +\snippet snippets/code/doc_src_installation.qdoc 11 This creates the directory \c{/tmp/qt-everywhere-opensource-src-%VERSION%} containing the files from the archive. @@ -322,7 +322,7 @@ must be run as root. \c{/usr/local/Qt-%VERSION%} directory, but this can be changed by using the \c{-prefix} option. -\snippet doc/src/snippets/code/doc_src_installation.qdoc 12 +\snippet snippets/code/doc_src_installation.qdoc 12 Type \c{./configure -help} to get a list of all available options. @@ -340,13 +340,13 @@ must be run as root. To create the library and compile all the examples, tools, and tutorials, type: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 13 +\snippet snippets/code/doc_src_installation.qdoc 13 If \c{-prefix} is outside the build directory, you need to install the library, examples, tools, and tutorials in the appropriate place. To do this, type: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 14 +\snippet snippets/code/doc_src_installation.qdoc 14 This command requires that you have administrator access on your machine. @@ -364,17 +364,17 @@ must be run as root. In order to use Qt, some environment variables need to be extended. -\snippet doc/src/snippets/code/doc_src_installation.qdoc 15 +\snippet snippets/code/doc_src_installation.qdoc 15 This is done like this: In \c{.profile} (if your shell is bash), add the following lines: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 16 +\snippet snippets/code/doc_src_installation.qdoc 16 In \c{.login} (in case your shell is csh or tcsh), add the following line: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 17 +\snippet snippets/code/doc_src_installation.qdoc 17 If you use a different shell, please modify your environment variables accordingly. @@ -421,7 +421,7 @@ in the \l{Qt for Windows CE Requirements} document. In order to build and use Qt, the \c PATH environment variable needs to be extended: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 18 +\snippet snippets/code/doc_src_installation.qdoc 18 This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable. For newer versions of Windows, \c PATH can be extended through @@ -437,7 +437,7 @@ in the \l{Qt for Windows CE Requirements} document. To configure Qt for Windows Mobile 5.0 for Pocket PC, type the following: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 19 +\snippet snippets/code/doc_src_installation.qdoc 19 If you want to configure Qt for another platform or with other options, type \c{configure -help} to get a list of all available @@ -451,16 +451,16 @@ in the \l{Qt for Windows CE Requirements} document. platforms. For a default installation of the Windows Mobile 5.0 Pocket PC SDK, this is done with the following commands: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 20 +\snippet snippets/code/doc_src_installation.qdoc 20 We provide a convenience script for this purpose, called \c{setcepaths}. Simply type: -\snippet doc/src/snippets/code/doc_src_installation.qdoc 21 +\snippet snippets/code/doc_src_installation.qdoc 21 Then to build Qt type: - \snippet doc/src/snippets/code/doc_src_installation.qdoc 22 + \snippet snippets/code/doc_src_installation.qdoc 22 \b{That's all. Qt is now installed.} diff --git a/doc/src/howtos/appicon.qdoc b/doc/src/howtos/appicon.qdoc index 540ee5cdf..1d0be0dc2 100644 --- a/doc/src/howtos/appicon.qdoc +++ b/doc/src/howtos/appicon.qdoc @@ -58,7 +58,7 @@ Then, assuming you are using qmake to generate your makefiles, you only need to add a single line to your \c .pro project file: - \snippet doc/src/snippets/code/doc_src_appicon.pro 0 + \snippet snippets/code/doc_src_appicon.pro 0 Finally, regenerate your makefile and your application. The \c .exe file will now be represented by your icon in Explorer. @@ -67,11 +67,11 @@ \c myapp.rc, which you want to reuse, the following two steps will be required. First, put a single line of text to the \c myapp.rc file: - \snippet doc/src/snippets/code/doc_src_appicon.qdoc 0 + \snippet snippets/code/doc_src_appicon.qdoc 0 Then, add this line to your \c myapp.pro file: - \snippet doc/src/snippets/code/doc_src_appicon.pro 1 + \snippet snippets/code/doc_src_appicon.pro 1 If you do not use \c qmake, the necessary steps are: first, create an \c .rc file and run the \c rc or \c windres program on the \c .rc file, @@ -102,7 +102,7 @@ if the name of your icon file is \c{myapp.icns}, and your project file is \c{myapp.pro}, add this line to \c{myapp.pro}: - \snippet doc/src/snippets/code/doc_src_appicon.pro 2 + \snippet snippets/code/doc_src_appicon.pro 2 This will ensure that \c qmake puts your icons in the proper place and creates an \c{Info.plist} entry for the icon. @@ -165,7 +165,7 @@ by using \l{http://developer.kde.org/documentation/other/kde-config.html}{kde-config}, for example, by typing the following in a terminal window: - \snippet doc/src/snippets/code/doc_src_appicon.qdoc 3 + \snippet snippets/code/doc_src_appicon.qdoc 3 Typically, the list of colon-separated paths printed to stdout includes the user-specific icon path and the system-wide path. Beneath these @@ -188,7 +188,7 @@ location can be determined by using \c gnome-config, for example by typing the following in a terminal window: - \snippet doc/src/snippets/code/doc_src_appicon.qdoc 4 + \snippet snippets/code/doc_src_appicon.qdoc 4 The path printed on stdout refers to a location that should contain a directory called \c{pixmaps}; the directory structure within the \c pixmaps diff --git a/doc/src/howtos/restoring-geometry.qdoc b/doc/src/howtos/restoring-geometry.qdoc index 49f94c881..56c306ccd 100644 --- a/doc/src/howtos/restoring-geometry.qdoc +++ b/doc/src/howtos/restoring-geometry.qdoc @@ -51,8 +51,8 @@ checks if the restored geometry is outside the available screen geometry, and modifies it as appropriate if it is: - \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 0 - \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 1 + \snippet snippets/code/src_gui_widgets_qmainwindow.cpp 0 + \snippet snippets/code/src_gui_widgets_qmainwindow.cpp 1 Another solution is to store both \l{QWidget::pos()}{pos()} and \l{QWidget::size()}{size()} and to restore the geometry using diff --git a/doc/src/howtos/session.qdoc b/doc/src/howtos/session.qdoc index 1e7d45a5d..afe0a2311 100644 --- a/doc/src/howtos/session.qdoc +++ b/doc/src/howtos/session.qdoc @@ -134,7 +134,7 @@ \li Run X11R6. \li Create a dot file \c .xsmstartup in your home directory which contains the single line - \snippet doc/src/snippets/code/doc_src_session.qdoc 0 + \snippet snippets/code/doc_src_session.qdoc 0 This tells \c xsm that the default/failsafe session is just an xterm and nothing else. Otherwise \c xsm would try to invoke lots of clients including the windowmanager \c twm, which isn't very helpful. diff --git a/doc/src/howtos/unix-signal-handlers.qdoc b/doc/src/howtos/unix-signal-handlers.qdoc index 16714d25c..c04d38dfc 100644 --- a/doc/src/howtos/unix-signal-handlers.qdoc +++ b/doc/src/howtos/unix-signal-handlers.qdoc @@ -58,7 +58,7 @@ sigaction(2) man pages before plowing through the following code snippets. - \snippet doc/src/snippets/code/doc_src_unix-signal-handlers.cpp 0 + \snippet snippets/code/doc_src_unix-signal-handlers.cpp 0 In the MyDaemon constructor, use the socketpair(2) function to initialize each file descriptor pair, and then create the @@ -67,24 +67,24 @@ appropriate slot function, which effectively converts the Unix signal to the QSocketNotifier::activated() signal. - \snippet doc/src/snippets/code/doc_src_unix-signal-handlers.cpp 1 + \snippet snippets/code/doc_src_unix-signal-handlers.cpp 1 Somewhere else in your startup code, you install your Unix signal handlers with sigaction(2). - \snippet doc/src/snippets/code/doc_src_unix-signal-handlers.cpp 2 + \snippet snippets/code/doc_src_unix-signal-handlers.cpp 2 In your Unix signal handlers, you write a byte to the \e write end of a socket pair and return. This will cause the corresponding QSocketNotifier to emit its activated() signal, which will in turn cause the appropriate Qt slot function to run. - \snippet doc/src/snippets/code/doc_src_unix-signal-handlers.cpp 3 + \snippet snippets/code/doc_src_unix-signal-handlers.cpp 3 In the slot functions connected to the QSocketNotifier::activated() signals, you \e read the byte. Now you are safely back in Qt with your signal, and you can do all the Qt stuff you weren'tr allowed to do in the Unix signal handler. - \snippet doc/src/snippets/code/doc_src_unix-signal-handlers.cpp 4 + \snippet snippets/code/doc_src_unix-signal-handlers.cpp 4 */ diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index b22d87e28..18eeab698 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -201,7 +201,7 @@ Typically, your application's \c main() function will look like this: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 8 + \snippet snippets/code/doc_src_i18n.cpp 8 For a translation-aware application, a QTranslator object is created, then a translation is loaded according to the current locale at runtime, and @@ -227,7 +227,7 @@ need to output Cyrillic in the ISO 8859-5 encoding. Code for this would be: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 9 + \snippet snippets/code/doc_src_i18n.cpp 9 For converting Unicode to local 8-bit encodings, a shortcut is available: the QString::toLocal8Bit() function returns such 8-bit @@ -242,7 +242,7 @@ demonstrated by this conversion from ISO 8859-5 Cyrillic to Unicode conversion: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 10 + \snippet snippets/code/doc_src_i18n.cpp 10 Unicode I/O should be used as this maximizes the portability of documents between users around the world. In many cases it is @@ -288,7 +288,7 @@ the text displayed by widgets using the \l{QObject::tr()}{tr()} function in the usual way. For example: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 12 + \snippet snippets/code/doc_src_i18n.cpp 12 All other change events should be passed on by calling the default implementation of the function. @@ -412,7 +412,7 @@ For example, assuming the \c LoginWidget is a subclass of QWidget: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 0 + \snippet snippets/code/doc_src_i18n.cpp 0 This accounts for 99% of the user-visible strings you're likely to write. @@ -422,7 +422,7 @@ appropriate class, or the QCoreApplication::translate() function directly: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 1 + \snippet snippets/code/doc_src_i18n.cpp 1 Qt indexes each translatable string by the \e{translation context} it is associated with; this is generally the name of the QObject subclass it is @@ -491,7 +491,7 @@ In some situations, it is useful to give a translation context explicitly by fully qualifying the call to tr(); for example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp explicit tr context + \snippet snippets/code/src_corelib_kernel_qobject.cpp explicit tr context This call obtains the translated text for "Page up" from the \c QScrollBar context. Developers can also use the QCoreApplication::translate() function @@ -501,7 +501,7 @@ You can localize numbers by using appropriate tr() strings: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 11 + \snippet snippets/code/doc_src_i18n.cpp 11 In the example, for the US we would leave the translation of "AMPM" as it is and thereby use the 12-hour clock branch; but in @@ -520,9 +520,9 @@ One way to do this is to add translation support to a non-Qt class using the Q_DECLARE_TR_FUNCTIONS() macro; for example: - \snippet doc/src/snippets/i18n-non-qt-class/myclass.h 0 + \snippet snippets/i18n-non-qt-class/myclass.h 0 \dots - \snippet doc/src/snippets/i18n-non-qt-class/myclass.h 1 + \snippet snippets/i18n-non-qt-class/myclass.h 1 This provides the class with \l{QObject::}{tr()} functions that can be used to translate strings associated with the class, and makes it @@ -549,7 +549,7 @@ Examples: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 40 + \snippet snippets/code/src_corelib_kernel_qobject.cpp 40 In these examples, the comments will be associated with the strings passed to tr() in the context of each call. @@ -581,7 +581,7 @@ Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp meta data + \snippet snippets/code/src_corelib_kernel_qobject.cpp meta data You can use the keyword \e TRANSLATOR for translator comments. Meta-data appearing right in front of the TRANSLATOR keyword applies to @@ -596,7 +596,7 @@ Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \snippet snippets/code/src_corelib_kernel_qobject.cpp 17 \dots In Qt 4.4 and earlier, this disambiguation parameter was the preferred @@ -618,7 +618,7 @@ Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 18 + \snippet snippets/code/src_corelib_kernel_qobject.cpp 18 The table below shows what string is returned depending on the active translation: @@ -634,7 +634,7 @@ This idiom is more flexible than the traditional approach; e.g., - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 19 + \snippet snippets/code/src_corelib_kernel_qobject.cpp 19 because it also works with target languages that have several plural forms (e.g., Irish has a special "dual" form that should @@ -666,7 +666,7 @@ use either the tr() function of an appropriate class, or the QCoreApplication::translate() function directly: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 13 + \snippet snippets/code/doc_src_i18n.cpp 13 \section2 Using QT_TR_NOOP() and QT_TRANSLATE_NOOP() in C++ @@ -677,11 +677,11 @@ Example of QT_TR_NOOP(): - \snippet doc/src/snippets/code/doc_src_i18n.cpp 2 + \snippet snippets/code/doc_src_i18n.cpp 2 Example of QT_TRANSLATE_NOOP(): - \snippet doc/src/snippets/code/doc_src_i18n.cpp 3 + \snippet snippets/code/doc_src_i18n.cpp 3 If you disable the \c{const char *} to QString automatic conversion by compiling your software with the macro \c @@ -705,16 +705,16 @@ The QString::arg() functions offer a simple means for substituting arguments: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 4 + \snippet snippets/code/doc_src_i18n.cpp 4 In some languages the order of arguments may need to change, and this can easily be achieved by changing the order of the % arguments. For example: - \snippet doc/src/snippets/code/doc_src_i18n.cpp 5 + \snippet snippets/code/doc_src_i18n.cpp 5 produces the correct output in English and Norwegian: - \snippet doc/src/snippets/code/doc_src_i18n.qdoc 6 + \snippet snippets/code/doc_src_i18n.qdoc 6 \section1 Further Reading diff --git a/doc/src/legal/3rdparty.qdoc b/doc/src/legal/3rdparty.qdoc index 85e8ddb2c..5173ea7f7 100644 --- a/doc/src/legal/3rdparty.qdoc +++ b/doc/src/legal/3rdparty.qdoc @@ -130,7 +130,7 @@ Note that this license is compatible with the FreeType license. - \quotefile doc/src/snippets/legal/CatharonLicense.txt + \quotefile snippets/legal/CatharonLicense.txt \section1 HarfBuzz (\c harfbuzz) diff --git a/doc/src/legal/gpl.qdoc b/doc/src/legal/gpl.qdoc index cb38b4325..bca9514ac 100644 --- a/doc/src/legal/gpl.qdoc +++ b/doc/src/legal/gpl.qdoc @@ -36,7 +36,7 @@ Reference: \l{GNU General Public License} - \snippet doc/src/snippets/code/doc_src_gpl.qdoc GPL v3 + \snippet snippets/code/doc_src_gpl.qdoc GPL v3 */ /*! \page lgpl.html @@ -50,7 +50,7 @@ Reference: \l{GNU Lesser General Public License, version 2.1} - \snippet doc/src/snippets/code/doc_src_lgpl.qdoc LGPL v2.1 + \snippet snippets/code/doc_src_lgpl.qdoc LGPL v2.1 \section1 Digia Qt LGPL Exception version 1.1 diff --git a/doc/src/legal/licenses-fonts.qdoc b/doc/src/legal/licenses-fonts.qdoc index 8e62471d2..4aa57a614 100644 --- a/doc/src/legal/licenses-fonts.qdoc +++ b/doc/src/legal/licenses-fonts.qdoc @@ -81,7 +81,7 @@ \section1 Babelfish - \snippet doc/src/snippets/code/doc_src_licenses.qdoc 1 + \snippet snippets/code/doc_src_licenses.qdoc 1 \section1 Bigelow & Holmes Luxi @@ -212,7 +212,7 @@ Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) - \snippet doc/src/snippets/code/doc_src_licenses.qdoc 2 + \snippet snippets/code/doc_src_licenses.qdoc 2 \section1 Fixed Fonts diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 6ac10c107..5f3f821dd 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -32,7 +32,6 @@ This page lists the C++ APIs in Qt. The \l{All Modules} page contains a list of all Qt modules. - */ /*! diff --git a/doc/src/platforms/mac-differences.qdoc b/doc/src/platforms/mac-differences.qdoc index 31aa892e1..8cfdabcda 100644 --- a/doc/src/platforms/mac-differences.qdoc +++ b/doc/src/platforms/mac-differences.qdoc @@ -98,7 +98,7 @@ If you use \c qmake and Makefiles, use the \c QMAKE_LFLAGS_SONAME setting: - \snippet doc/src/snippets/code/doc_src_mac-differences.pro 0 + \snippet snippets/code/doc_src_mac-differences.pro 0 Alternatively, you can modify the install name using the install_name_tool(1) on the command line. See its manpage for more @@ -160,7 +160,7 @@ the bundle resides on the disk. The following code returns the path of the application bundle: - \snippet doc/src/snippets/code/doc_src_mac-differences.cpp 1 + \snippet snippets/code/doc_src_mac-differences.cpp 1 Note: When OS X is set to use Japanese, a bug causes this sequence to fail and return an empty string. Therefore, always test the @@ -183,7 +183,7 @@ The main thing you need to do is create a file called locversion.plist. Here is an example for Norwegian: - \snippet doc/src/snippets/code/doc_src_mac-differences.qdoc 2 + \snippet snippets/code/doc_src_mac-differences.qdoc 2 Now when you run the application with your preferred language set to Norwegian, you should see menu items like "Avslutt" instead of diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index 850c90283..b1808590c 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -100,7 +100,7 @@ archive, be aware that you will probably end up with two different versions of the Qt library installed on your system, which will probably lead to link errors, like this: - \snippet doc/src/snippets/code/doc_src_platform-notes.qdoc 0 + \snippet snippets/code/doc_src_platform-notes.qdoc 0 Fix this by removing the old version of the library. If you have problems installing open source versions of Qt @@ -160,7 +160,7 @@ Installing Qt into a directory with spaces, e.g. C:\\Program Files, may cause linker errors like the following: - \snippet doc/src/snippets/code/doc_src_platform-notes.qdoc 2 + \snippet snippets/code/doc_src_platform-notes.qdoc 2 Install Qt into a subdirectory without spaces to avoid this problem. @@ -208,7 +208,7 @@ \c{C:\Program files\Qt\}) so you will have to move it to another place, or explicitly set the path yourself; for example: - \snippet doc/src/snippets/code/doc_src_compiler-notes.qdoc 0 + \snippet snippets/code/doc_src_compiler-notes.qdoc 0 If you are experiencing strange problems with using special flags that modify the alignment of structure and union members (such as \c{/Zp2}) @@ -264,7 +264,7 @@ defined when linking static C libraries into dynamic library. If you get the following error message when linking Qt: - \snippet doc/src/snippets/code/doc_src_platform-notes.qdoc 6 + \snippet snippets/code/doc_src_platform-notes.qdoc 6 re-link Qt using -single_module. This is only a problem when building the MySQL driver into Qt. It does not affect plugins or static builds. diff --git a/doc/src/platforms/qtmac-as-native.qdoc b/doc/src/platforms/qtmac-as-native.qdoc index ee79be3aa..482e13c3b 100644 --- a/doc/src/platforms/qtmac-as-native.qdoc +++ b/doc/src/platforms/qtmac-as-native.qdoc @@ -129,7 +129,7 @@ style Makefiles. Generating Xcode project files by using the \l qmake tool is also possible. For example: - \snippet doc/src/snippets/code/doc_src_qtmac-as-native.qdoc 0 + \snippet snippets/code/doc_src_qtmac-as-native.qdoc 0 will generate an Xcode project file from project.pro. With \l qmake you do not have to worry about rules for Qt's preprocessors (\l moc diff --git a/doc/src/platforms/wince-customization.qdoc b/doc/src/platforms/wince-customization.qdoc index d9552c5f0..f456764e7 100644 --- a/doc/src/platforms/wince-customization.qdoc +++ b/doc/src/platforms/wince-customization.qdoc @@ -43,7 +43,7 @@ Create a subdirectory in the \c mkspecs folder of the Qt directory. New specifications for Qt for Windows CE following this naming convention: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 0 + \snippet snippets/code/doc_src_wince-customization.qdoc 0 Using this convention makes it possible for \l{qmake} to identify that you are building Qt for Windows CE, and will customize the compilation @@ -68,7 +68,7 @@ Following is an example configuration for the Windows Mobile 5 for Pocket PC SDK: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 1 + \snippet snippets/code/doc_src_wince-customization.qdoc 1 \note \l{qmake} uses this information to build a valid Visual Studio project file. You need to ensure that they are identical to the @@ -81,7 +81,7 @@ For example, with Windows Mobile 5 for Pocket PC, the \c DEFINES variable is expanded in the following way: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 2 + \snippet snippets/code/doc_src_wince-customization.qdoc 2 The mkspec may require additional configuration to be used inside of Visual Studio, depending on the Windows CE SDK. The above example defines @@ -90,7 +90,7 @@ warnings can be disabled by adding a \c default_post.prf file containing the following lines, within the subdirectory. - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 8 + \snippet snippets/code/doc_src_wince-customization.qdoc 8 \section1 Cross-compilation Environment for a Custom SDK @@ -146,7 +146,7 @@ application that attempts to dynamically load the Qt for Windows CE libraries using \c LoadLibrary. The following code can be used for this: - \snippet doc/src/snippets/code/doc_src_wince-customization.cpp 9 + \snippet snippets/code/doc_src_wince-customization.cpp 9 Once you have compiled and deployed the application as well as the Qt libraries, start a remote debugger. The debugger will then print the @@ -216,7 +216,7 @@ \list \li First add \c{C:\Qt\mobile5-shadow\bin} to the \c PATH variable. - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 3 + \snippet snippets/code/doc_src_wince-customization.qdoc 3 \li Make sure the enviroment variables for your compiler are set. @@ -225,7 +225,7 @@ \li Now navigate to your shadow build directory and run configure: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 4 + \snippet snippets/code/doc_src_wince-customization.qdoc 4 \li To build Qt, you have to update your \c{PATH, INCLUDE} and \c LIB paths to point to your target platforms. @@ -233,16 +233,16 @@ For a default installation of the Windows Mobile 5.0 Pocket PC SDK, you can do the following: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 5 + \snippet snippets/code/doc_src_wince-customization.qdoc 5 We have provided a convenience script for this called \c{setcepaths}. Simply type: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 6 + \snippet snippets/code/doc_src_wince-customization.qdoc 6 \li Finally, to build the shadow build type: - \snippet doc/src/snippets/code/doc_src_wince-customization.qdoc 7 + \snippet snippets/code/doc_src_wince-customization.qdoc 7 \li That's all. You have successfully created a shadow build of Qt in \c{C:\Qt\mobile5-shadow}. diff --git a/doc/src/platforms/wince-introduction.qdoc b/doc/src/platforms/wince-introduction.qdoc index cbf308ac3..5f76e2d28 100644 --- a/doc/src/platforms/wince-introduction.qdoc +++ b/doc/src/platforms/wince-introduction.qdoc @@ -94,11 +94,11 @@ application. You can either do it on the command line or inside of Visual Studio. To do it on the command line, simply write: - \snippet doc/src/snippets/code/doc_src_wince-introduction.qdoc 0 + \snippet snippets/code/doc_src_wince-introduction.qdoc 0 To build the project inside of Visual Studio, on the command line write: - \snippet doc/src/snippets/code/doc_src_wince-introduction.qdoc 1 + \snippet snippets/code/doc_src_wince-introduction.qdoc 1 then start Visual Studio with the generated \c .vcproj or \c .sln file and select \e{Build project}. diff --git a/doc/src/platforms/wince-opengl.qdoc b/doc/src/platforms/wince-opengl.qdoc index 3a3c2408e..56d3123bb 100644 --- a/doc/src/platforms/wince-opengl.qdoc +++ b/doc/src/platforms/wince-opengl.qdoc @@ -42,7 +42,7 @@ Windows CE window manager. To configure Qt for Windows Mobile 5.0 and OpenGL ES Common support you can run \c{configure} like this: - \snippet doc/src/snippets/code/doc_src_wince-opengl.qdoc 0 + \snippet snippets/code/doc_src_wince-opengl.qdoc 0 OpenGL ES includes profiles for floating-point and fixed-point arithmetic. The floating point profile is called OpenGL ES CM (Common) and the |