From c57520e491f420dc83d44ce5382c403192ce4836 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 1 Apr 2019 15:49:47 +0200 Subject: Document how to use CMake on Qt Core, Qt GUI's central pages Add documentation on how to use a module from CMake, alongside the existing documentation about qmake. Separate generic info from module-specific examples, to make it possible to use one include file in all modules. While at it, also remove the mentioning of the central include; it is not something we should actively advocate anymore. Instead, the documentation of every class gives the correct include to use. Task-number: QTBUG-73058 Change-Id: I6b3c0e5ea218dd9c06a491c8fb799a7fcf42dd92 Reviewed-by: Leena Miettinen --- src/corelib/doc/snippets/code/doc_src_qtcore.cpp | 53 ---------------------- .../doc/snippets/overview/using-qt-core.cmake | 2 + src/corelib/doc/src/qtcore-index.qdoc | 21 +++++---- src/corelib/doc/src/qtcore.qdoc | 9 +--- 4 files changed, 14 insertions(+), 71 deletions(-) delete mode 100644 src/corelib/doc/snippets/code/doc_src_qtcore.cpp create mode 100644 src/corelib/doc/snippets/overview/using-qt-core.cmake (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/code/doc_src_qtcore.cpp b/src/corelib/doc/snippets/code/doc_src_qtcore.cpp deleted file mode 100644 index 61b71d993e..0000000000 --- a/src/corelib/doc/snippets/code/doc_src_qtcore.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [0] -#include -//! [0] diff --git a/src/corelib/doc/snippets/overview/using-qt-core.cmake b/src/corelib/doc/snippets/overview/using-qt-core.cmake new file mode 100644 index 0000000000..a5f43c1472 --- /dev/null +++ b/src/corelib/doc/snippets/overview/using-qt-core.cmake @@ -0,0 +1,2 @@ +find_package(Qt5 COMPONENTS Core REQUIRED) +target_link_libraries(mytarget Qt5::Core) diff --git a/src/corelib/doc/src/qtcore-index.qdoc b/src/corelib/doc/src/qtcore-index.qdoc index 04af0e9416..40a6584af0 100644 --- a/src/corelib/doc/src/qtcore-index.qdoc +++ b/src/corelib/doc/src/qtcore-index.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -31,17 +31,9 @@ \brief The Qt Core module is part of Qt's essential modules. - \section1 Getting Started - All other Qt modules rely on this module. To include the - definitions of the module's classes, use the following directive: - - \snippet code/doc_src_qtcore.cpp 0 - - If you use \l qmake to build your projects, Qt Core is included by default. - \section1 Core Functionalities - Qt adds these features to C++: + Qt Core adds these features to C++: \list \li a very powerful mechanism for seamless object communication called @@ -61,6 +53,15 @@ \li \l{Signals & Slots} \endlist + \include module-use.qdocinc using qt module + \quotefile overview/using-qt-core.cmake + + See also the \l[QtDoc]{Building with CMake} overview. + + \section2 Building with qmake + + If you use \l qmake to build your projects, Qt5Core is linked by default. + \section1 Threading and Concurrent Programming Qt provides thread support in the form of platform-independent \l{Threading diff --git a/src/corelib/doc/src/qtcore.qdoc b/src/corelib/doc/src/qtcore.qdoc index 047ea621ca..5d63af3b18 100644 --- a/src/corelib/doc/src/qtcore.qdoc +++ b/src/corelib/doc/src/qtcore.qdoc @@ -33,12 +33,5 @@ \brief Provides core non-GUI functionality. - All other Qt modules rely on this module. To include the - definitions of the module's classes, use the following directive: - - \snippet code/doc_src_qtcore.cpp 0 - - If you use \l qmake to build your projects, \l{Qt Core} is included by - default. - + All other Qt modules rely on this module. */ -- cgit v1.2.3