diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-11-20 16:44:44 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-11-27 09:21:43 +0000 |
commit | 0194da9692c726b9b599f852e579fbfe5d4197f5 (patch) | |
tree | e4f9fac61a34069dded2cb22d52b07549ca36852 /doc/howtos.qdoc | |
parent | b45e0f46e3e06d0c80b6d7f95ed6756515b6299c (diff) | |
download | qbs-0194da9692c726b9b599f852e579fbfe5d4197f5.tar.gz |
Doc: add a how-to for printing the value of properties
Change-Id: I3684f2e1fb92f2b10fb97222fa9e777340608b99
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Richard Weickelt <richard@weickelt.de>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'doc/howtos.qdoc')
-rw-r--r-- | doc/howtos.qdoc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/howtos.qdoc b/doc/howtos.qdoc index 3a2f02525..b63e2ca96 100644 --- a/doc/howtos.qdoc +++ b/doc/howtos.qdoc @@ -49,6 +49,7 @@ \li \l{How do I limit the number of concurrent jobs for the linker only?} \li \l{How do I add QML files to a project?} \li \l{How do I define a reusable Group of files that can be included in other \QBS files?} + \li \l{How do I print the value of a property?} \endlist \section1 How do I build a Qt-based project? @@ -565,4 +566,23 @@ QmlUiFiles {} } \endcode + + \section1 How do I print the value of a property? + + Use the \l {Console API}{console API}. For example, suppose your project + is not built the way you expect it to be, and you suspect that + \c qbs.targetOS has the wrong value: + + \code + readonly property bool unix: qbs.targetOS.contains("unix") + \endcode + + To find out the value of \c qbs.targetOS, use \c {console.info()}: + + \code + readonly property bool unix: { + console.info("qbs.targetOS: " + qbs.targetOS) + return qbs.targetOS.contains("unix") + } + \endcode */ |