summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eliasson <andreas.eliasson@qt.io>2022-02-15 13:03:53 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-03-15 16:41:31 +0000
commit5a6cc548896bb0543e7413b4f855eb4e6a204d6f (patch)
tree8eca3bc625a3b84d72149f863951b881f93527fb
parente68dae6bdb8df47dbd0227f6983a50d79f6f9646 (diff)
Doc: Revise Qt3D module landing page
Add missing Building with Cmake section. This module landing page differs from other landing pages in that it contains information on how to use its subdirectories. Task-number: QTBUG-100369 Change-Id: I9fa2a94a11790faf94b48e64b399ffa72fc7eade Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> (cherry picked from commit 083199d1dc385c129b8dddd36a680729ff1640a8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/doc/src/qt3d-index.qdoc51
-rw-r--r--src/core/doc/src/qt3d-module-use.qdocinc62
2 files changed, 93 insertions, 20 deletions
diff --git a/src/core/doc/src/qt3d-index.qdoc b/src/core/doc/src/qt3d-index.qdoc
index 8a57a2b10..9a2a2d276 100644
--- a/src/core/doc/src/qt3d-index.qdoc
+++ b/src/core/doc/src/qt3d-index.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
** Contact: https://www.qt.io/licensing/
**
@@ -30,7 +30,7 @@
\page qt3d-index.html
\title Qt 3D
- \e{Qt 3D} provides functionality for near-realtime simulation systems
+ Qt 3D provides functionality for near-realtime simulation systems
with support for 2D and 3D rendering in both Qt C++ and Qt Quick
applications.
@@ -52,20 +52,13 @@
\annotatedlist qt3d-qmlmodules-preliminary
- \section1 Getting Started
+ \section1 Using the Module
- For a C++ application that performs 2D or 3D rendering, collision
- detection, and also handle user input, add the following line to its
- qmake \c .pro file:
+ For a C++ application that performs 2D or 3D rendering, collision detection,
+ and handles user input, include the following directives of the modules'
+ classes:
- \badcode
- QT += 3dcore 3drender 3dinput 3dlogic 3dextras 3danimation
- \endcode
-
- To include the definitions of the modules' classes, use the following
- directives:
-
- \badcode
+ \code
#include <Qt3DCore>
#include <Qt3DRender>
#include <Qt3DInput>
@@ -74,17 +67,35 @@
#include <Qt3DAnimation>
\endcode
- A Qt Quick application requires also additional dependencies:
+ To import the QML types into your application, use the following import
+ statement in your .qml file:
- \badcode
- QT += 3dcore 3drender 3dinput 3dlogic 3dextras qml quick 3dquick 3danimation
- \endcode
+ \qml
+ import Qt3D.Core
+ import Qt3D.Render
+ import Qt3D.Input
+ import Qt3D.Logic
+ import Qt3D.Extras
+ import Qt3D.Animation
+ import QtQuick.Scene2D
+ import QtQuick.Scene3D
+ \endqml
+
+ \include {module-use.qdocinc} {using the c++ api}
+
+ \section2 Building with CMake
+
+ \include qt3d-module-use.qdocinc cmakebuild
+
+ \section2 Building with qmake
+
+ \include qt3d-module-use.qdocinc qmakebuild
\section1 Overview
The high level design and motivation for Qt 3D is described in the \l {Qt 3D
- Overview}. The Qt 3D Render aspect offers support for data-driven
- configuration as described in \l {Qt 3D Render Framegraph}.
+ Overview}. The Qt 3D Render offers support for data-driven configuration as
+ described in \l {Qt 3D Render Framegraph}.
\section1 Reference
\list
diff --git a/src/core/doc/src/qt3d-module-use.qdocinc b/src/core/doc/src/qt3d-module-use.qdocinc
new file mode 100644
index 000000000..13506d40d
--- /dev/null
+++ b/src/core/doc/src/qt3d-module-use.qdocinc
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [cmakebuild]
+ Use the \c {find_package()} command to locate the needed module components
+ in the \c {Qt6} package:
+ \code
+ find_package(Qt6 REQUIRED COMPONENTS
+ 3DCore
+ 3DRender
+ 3DInput
+ 3DLogic
+ 3DExtras
+ 3DAnimation
+ )
+ target_link_libraries(mytarget PRIVATE
+ Qt6::3DCore
+ Qt6::3DRender
+ Qt6::3DLogic
+ Qt6::3DExtras
+ Qt6::3DAnimation
+ )
+ \endcode
+//! [cmakebuild]
+
+//! [qmakebuild]
+ To configure the module for building with qmake, add the modules to the \c
+ QT variable in the project's .pro file:
+ \code
+ QT += 3dcore 3drender 3dinput 3dlogic 3dextras 3danimation
+ \endcode
+
+ A Qt Quick application requires additional dependencies:
+
+ \code
+ QT += 3dcore 3drender 3dinput 3dlogic 3dextras 3danimation qml quick 3dquick
+ \endcode
+//! [qmakebuild]