Doc: Compile QQuaternion snippets

Change-Id: Ica53a7307c3e77abeffa616db15c8e8ec39fce8f
Done-with: Nico Vertriest <nico.vertriest@qt.io>
Task-number: QTBUG-81486
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This commit is contained in:
Paul Wicking 2020-08-25 16:18:44 +02:00
parent ed3f50507a
commit 28f31002c4
2 changed files with 22 additions and 3 deletions

View File

@ -20,4 +20,5 @@ SOURCES = \
src_gui_kernel_qguiapplication.cpp \
src_gui_kernel_qguiapplication_x11.cpp \
src_gui_kernel_qkeysequence.cpp \
src_gui_kernel_qshortcutmap.cpp
src_gui_kernel_qshortcutmap.cpp \
src_gui_math3d_qquaternion.cpp

View File

@ -47,11 +47,29 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QQuaternion>
#include <QVector3D>
namespace src_gui_math3d_qquaternion {
QQuaternion q;
QVector3D vector;
void wrapper0() {
//! [0]
QVector3D result = q.rotatedVector(vector);
QVector3D result = q.rotatedVector(vector);
//! [0]
Q_UNUSED(result);
} // wrapper0
void wrapper1() {
//! [1]
QVector3D result = (q * QQuaternion(0, vector) * q.conjugated()).vector();
QVector3D result = (q * QQuaternion(0, vector) * q.conjugated()).vector();
//! [1]
Q_UNUSED(result);
} // wrapper1
} // src_gui_math3d_qquaternion