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:
parent
ed3f50507a
commit
28f31002c4
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user