diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-09 16:04:14 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-14 12:22:10 +0200 |
commit | 3a037fe9a274953549c52d6d41e6112daa6362ac (patch) | |
tree | 2f5d801a7f3725df18ed14bfd878c201e0b304f0 | |
parent | 7eebf9997850de606bbd00f5eb64720888940c1c (diff) |
Add and make use of convenience item QtGuiApplication.
Using this item, building a Qt gui app against a static Qt
will work out of the box.
Also add the less useful QtApplication for completeness.
Change-Id: Idca1dbd3085659ebaf563f7df89f73b9daaf7001
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r-- | doc/reference/items/propertyoptions.qdoc | 2 | ||||
-rw-r--r-- | doc/reference/items/qtapplication.qdoc | 46 | ||||
-rw-r--r-- | doc/reference/items/qtguiapplication.qdoc | 58 | ||||
-rw-r--r-- | doc/reference/items/rule.qdoc | 2 | ||||
-rw-r--r-- | examples/helloworld-qt/hello.qbs | 3 | ||||
-rw-r--r-- | share/qbs/imports/qbs/base/QtApplication.qbs | 5 | ||||
-rw-r--r-- | share/qbs/imports/qbs/base/QtGuiApplication.qbs | 11 | ||||
-rw-r--r-- | tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs | 3 | ||||
-rw-r--r-- | tests/auto/autotest.qbs | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/add-qobject-macro-to-cpp-file/project.qbs | 3 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/lotsofdots/lots.of.dots.qbs | 4 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/objc/objc.qbs | 3 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/qml-debugging/project.qbs | 2 | ||||
-rw-r--r-- | tests/auto/blackbox/testdata/uic/uic.qbs | 4 | ||||
-rw-r--r-- | tests/fuzzy-test/fuzzy-test.qbs | 3 | ||||
-rw-r--r-- | tests/manual/minimumSystemVersion/minimumSystemVersion.qbs | 15 |
16 files changed, 136 insertions, 30 deletions
diff --git a/doc/reference/items/propertyoptions.qdoc b/doc/reference/items/propertyoptions.qdoc index b2be5238e..983f1cd18 100644 --- a/doc/reference/items/propertyoptions.qdoc +++ b/doc/reference/items/propertyoptions.qdoc @@ -31,7 +31,7 @@ \contentspage list-of-items.html \previouspage properties-item.html \page propertyoptions-item.html - \nextpage rule-item.html + \nextpage qtapplication-item.html \ingroup list-of-items \title PropertyOptions Item diff --git a/doc/reference/items/qtapplication.qdoc b/doc/reference/items/qtapplication.qdoc new file mode 100644 index 000000000..0e194f2cf --- /dev/null +++ b/doc/reference/items/qtapplication.qdoc @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +/*! + \contentspage list-of-items.html + \page qtapplication-item.html + \previouspage propertyoptions-item.html + \nextpage qtguiapplication-item.html + \ingroup list-of-items + + \title QtApplication Item + \brief Represents a product of application type with a dependency to the Qt Core module. + + A \c QtApplication is a convenience item that is entirely equivalent to the following: + \code + CppApplication { + Depends { name: "Qt.core" } } + } + \endcode + +*/ diff --git a/doc/reference/items/qtguiapplication.qdoc b/doc/reference/items/qtguiapplication.qdoc new file mode 100644 index 000000000..5af911e41 --- /dev/null +++ b/doc/reference/items/qtguiapplication.qdoc @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +/*! + \contentspage list-of-items.html + \page qtguiapplication-item.html + \previouspage propertyoptions-item.html + \nextpage rule-item.html + \ingroup list-of-items + + \title QtGuiApplication Item + \brief Represents a product of application type with a dependency to the Qt GUI module. + + A \c QtGuiApplication is a convenience item that extends the \c QtApplication item by loading + the \c Qt.gui module and possibly also the default QPA plugin. + + \section1 QtGuiApplication Properties + + \table + \header + \li Property + \li Type + \li Default + \li Description + \row + \li linkDefaultQpaPlugin + \li bool + \li Qt.core.staticBuild == true + \li Whether or not to add a depencency to the default QPA plugin. The default is to + do that in the case of a static build, where it is normally required. + \endtable + +*/ diff --git a/doc/reference/items/rule.qdoc b/doc/reference/items/rule.qdoc index 9a174e49c..85d18701e 100644 --- a/doc/reference/items/rule.qdoc +++ b/doc/reference/items/rule.qdoc @@ -28,7 +28,7 @@ ****************************************************************************/ /*! \contentspage list-of-items.html - \previouspage propertyoptions-item.html + \previouspage qtapplication-item.html \page rule-item.html \nextpage staticlibrary-item.html \ingroup list-of-items diff --git a/examples/helloworld-qt/hello.qbs b/examples/helloworld-qt/hello.qbs index 0e7fd97f1..aed20fabb 100644 --- a/examples/helloworld-qt/hello.qbs +++ b/examples/helloworld-qt/hello.qbs @@ -37,8 +37,7 @@ import qbs -CppApplication { +QtApplication { name: "HelloWorld-Qt" - Depends { name: "Qt.core" } files: "main.cpp" } diff --git a/share/qbs/imports/qbs/base/QtApplication.qbs b/share/qbs/imports/qbs/base/QtApplication.qbs new file mode 100644 index 000000000..7417150e1 --- /dev/null +++ b/share/qbs/imports/qbs/base/QtApplication.qbs @@ -0,0 +1,5 @@ +import qbs + +CppApplication { + Depends { name: "Qt.core" } +} diff --git a/share/qbs/imports/qbs/base/QtGuiApplication.qbs b/share/qbs/imports/qbs/base/QtGuiApplication.qbs new file mode 100644 index 000000000..fd75f18fd --- /dev/null +++ b/share/qbs/imports/qbs/base/QtGuiApplication.qbs @@ -0,0 +1,11 @@ +import qbs + +CppApplication { + Depends { name: "Qt.gui" } + Depends { + name: "Qt" + submodules: Qt.gui.defaultQpaPlugin + condition: linkDefaultQpaPlugin && Qt.gui.defaultQpaPlugin + } + property bool linkDefaultQpaPlugin: Qt.gui.isStaticLibrary +} diff --git a/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs b/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs index 855528615..504bf87b0 100644 --- a/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs +++ b/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs @@ -1,9 +1,8 @@ import qbs Project { - CppApplication { + QtApplication { type: "application" // suppress bundle generation - Depends { name: "Qt.core" } files: "main.cpp" name: "infinite-loop" } diff --git a/tests/auto/autotest.qbs b/tests/auto/autotest.qbs index 19d639432..8c802df98 100644 --- a/tests/auto/autotest.qbs +++ b/tests/auto/autotest.qbs @@ -1,6 +1,6 @@ import qbs -CppApplication { +QtApplication { type: "application" property string testName name: "tst_" + testName diff --git a/tests/auto/blackbox/testdata/add-qobject-macro-to-cpp-file/project.qbs b/tests/auto/blackbox/testdata/add-qobject-macro-to-cpp-file/project.qbs index 6c8db1913..40c5395ef 100644 --- a/tests/auto/blackbox/testdata/add-qobject-macro-to-cpp-file/project.qbs +++ b/tests/auto/blackbox/testdata/add-qobject-macro-to-cpp-file/project.qbs @@ -1,7 +1,6 @@ import qbs -CppApplication { - Depends { name: "Qt.core" } +QtApplication { files: ["main.cpp", "object.h", "object.cpp"] } diff --git a/tests/auto/blackbox/testdata/lotsofdots/lots.of.dots.qbs b/tests/auto/blackbox/testdata/lotsofdots/lots.of.dots.qbs index fdf101a49..9654100fc 100644 --- a/tests/auto/blackbox/testdata/lotsofdots/lots.of.dots.qbs +++ b/tests/auto/blackbox/testdata/lotsofdots/lots.of.dots.qbs @@ -1,12 +1,10 @@ import qbs 1.0 Project { - Product { + QtGuiApplication { type: "application" name: "lots.of.dots" - Depends { name: "Qt.gui" } - files : [ "m.a.i.n.cpp", "object.narf.h", diff --git a/tests/auto/blackbox/testdata/objc/objc.qbs b/tests/auto/blackbox/testdata/objc/objc.qbs index b878097c4..c069c5032 100644 --- a/tests/auto/blackbox/testdata/objc/objc.qbs +++ b/tests/auto/blackbox/testdata/objc/objc.qbs @@ -1,9 +1,8 @@ import qbs 1.0 Project { - CppApplication { + QtApplication { condition: qbs.targetOS.contains("osx") - Depends { name: "Qt.core" } files: "main.mm" cpp.frameworks: [ "Foundation" ] } diff --git a/tests/auto/blackbox/testdata/qml-debugging/project.qbs b/tests/auto/blackbox/testdata/qml-debugging/project.qbs index 690bf40f9..317dd940d 100644 --- a/tests/auto/blackbox/testdata/qml-debugging/project.qbs +++ b/tests/auto/blackbox/testdata/qml-debugging/project.qbs @@ -1,6 +1,6 @@ import qbs -CppApplication { +QtApplication { name: "debuggable-app" type: "application" Depends { name: "Qt.quick" } diff --git a/tests/auto/blackbox/testdata/uic/uic.qbs b/tests/auto/blackbox/testdata/uic/uic.qbs index cea4ec2a1..a216b86a9 100644 --- a/tests/auto/blackbox/testdata/uic/uic.qbs +++ b/tests/auto/blackbox/testdata/uic/uic.qbs @@ -1,12 +1,10 @@ import qbs 1.0 Project { - Product { + QtGuiApplication { type: "application" name: "ui" - Depends { name: "Qt.gui"} - files: [ "bla.cpp", "bla.h", diff --git a/tests/fuzzy-test/fuzzy-test.qbs b/tests/fuzzy-test/fuzzy-test.qbs index 87d6af196..c9c4fb0ac 100644 --- a/tests/fuzzy-test/fuzzy-test.qbs +++ b/tests/fuzzy-test/fuzzy-test.qbs @@ -1,9 +1,8 @@ import qbs -CppApplication { +QtApplication { name: "qbs_fuzzy-test" destinationDirectory: "bin" - Depends { name: "Qt.core" } condition: Qt.core.versionMajor >= 5 // We use QDir::removeRecursively() type: "application" consoleApplication: true diff --git a/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs b/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs index 51272a8d7..fbb592cc9 100644 --- a/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs +++ b/tests/manual/minimumSystemVersion/minimumSystemVersion.qbs @@ -2,9 +2,8 @@ import qbs 1.0 Project { // no minimum versions are specified so the profile defaults will be used - CppApplication { + QtApplication { type: "application" - Depends { name: "Qt.core" } name: "unspecified" files: "main.cpp" @@ -16,9 +15,8 @@ Project { // no minimum versions are specified, and explicitly set to undefined in // case the profile has set it - CppApplication { + QtApplication { type: "application" - Depends { name: "Qt.core" } name: "unspecified-forced" files: "main.cpp" cpp.minimumWindowsVersion: undefined @@ -35,9 +33,8 @@ Project { // a specific version of the operating systems is specified // when the application is run its output should confirm // that the given values took effect - CppApplication { + QtApplication { type: "application" - Depends { name: "Qt.core" } condition: qbs.targetOS.contains("windows") || qbs.targetOS.contains("osx") name: "specific" files: "main.cpp" @@ -57,9 +54,8 @@ Project { // non-existent versions of Windows should print a QBS warning // (but will still compile and link since we avoid passing a // bad value to the linker) - CppApplication { + QtApplication { type: "application" - Depends { name: "Qt.core" } condition: qbs.targetOS.contains("windows") name: "fakewindows" files: "main.cpp" @@ -69,9 +65,8 @@ Project { // just to make sure three-digit minimum versions work on OS X // this only affects the value of __MAC_OS_X_VERSION_MIN_REQUIRED, // not the actual LC_VERSION_MIN_MACOSX command which is limited to two - CppApplication { + QtApplication { type: "application" - Depends { name: "Qt.core" } condition: qbs.targetOS.contains("osx") name: "macappstore" files: "main.cpp" |