summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2015-06-12 15:53:11 +0200
committerTopi Reiniƶ <topi.reinio@digia.com>2015-06-15 11:16:18 +0000
commit6f93508bcd38d8d0fa524ac00d65b518fac0d82a (patch)
tree05c421e47f3de4360598a3710adbebe3493bceba
parentddf59ad0d0cf6e81b8e7fa821f0466937bc143aa (diff)
Doc: Add skeleton docs for Qt3D Input classes and QML types
Not fully documented yet, but enables the classes and QML types to be visible in the documentation. Change-Id: I557aeae9ff6314b697bcc9313c1061543363b645 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/doc/qt3dcore.qdocconf7
-rw-r--r--src/core/doc/src/qt3dinput-module.qdoc67
-rw-r--r--src/input/q3dkeyevent.cpp91
-rw-r--r--src/input/qinputaspect.cpp6
-rw-r--r--src/input/qkeyboardcontroller.cpp19
-rw-r--r--src/input/qkeyboardinput.cpp186
6 files changed, 374 insertions, 2 deletions
diff --git a/src/core/doc/qt3dcore.qdocconf b/src/core/doc/qt3dcore.qdocconf
index 251c0ab67..65e6e03fe 100644
--- a/src/core/doc/qt3dcore.qdocconf
+++ b/src/core/doc/qt3dcore.qdocconf
@@ -36,11 +36,13 @@ depends += qtcore qtqml qtquick qtdoc qt3drenderer
headerdirs += .. \
../../plugins \
- ../../quick3d/quick3d
+ ../../quick3d/quick3d \
+ ../../input
sourcedirs += .. \
../../plugins \
- ../../quick3d/quick3d
+ ../../quick3d/quick3d \
+ ../../input
exampledirs += src/snippets
@@ -49,6 +51,7 @@ exampledirs += src/snippets
imagedirs += images
Cpp.ignoretokens += QT3DCORE_PRIVATE_EXPORT \
+ QT3DINPUTSHARED_EXPORT \
QT3DCORESHARED_EXPORT
Cpp.ignoredirectives += Q_DECLARE_LOGGING_CATEGORY
diff --git a/src/core/doc/src/qt3dinput-module.qdoc b/src/core/doc/src/qt3dinput-module.qdoc
new file mode 100644
index 000000000..b82de6862
--- /dev/null
+++ b/src/core/doc/src/qt3dinput-module.qdoc
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \module Qt3DInput
+ \title Qt3D Input C++ Classes
+ \brief The Qt3D Input module provides classes for handling user input in
+ applications using Qt3D.
+
+ \ingroup modules
+ \ingroup qt3d-modules
+ \qtvariable 3dinput
+
+ To use classes from this module, add this directive into the C++ files:
+
+ \code
+ #include <Qt3DInput>
+ \endcode
+
+ To link against the corresponding C++ libraries, add the following to your qmake project file:
+
+ \badcode
+ QT += 3dinput
+ \endcode
+*/
+
+/*!
+ \qmlmodule Qt3D.Input 2.0
+ \title Qt3D Input QML Types
+ \ingroup qmlmodules
+ \ingroup qt3d-qmlmodules
+
+ \brief Provides QML types for Qt3D user input.
+
+ To import and use the module's QML types, use the following statement:
+
+ \badcode
+ import Qt3D.Input 2.0
+ \endcode
+
+ \section1 QML Types
+*/
+
diff --git a/src/input/q3dkeyevent.cpp b/src/input/q3dkeyevent.cpp
index c0de3a293..bb1990955 100644
--- a/src/input/q3dkeyevent.cpp
+++ b/src/input/q3dkeyevent.cpp
@@ -42,6 +42,22 @@ namespace Qt3D {
//Qt6: Move this into a QtQmlGui module and merge it with QQuickKeyEvent
+/*!
+ \class Qt3D::Q3DKeyEvent
+ \inmodule Qt3DInput
+ \since 5.5
+*/
+
+/*!
+ \qmltype KeyEvent
+ \inqmlmodule Qt3D.Input
+ \instantiates Qt3D::Q3DKeyEvent
+ \since 5.5
+
+ The KeyEvent QML type cannot be directly created. Objects of this type
+ are used as signal parameters in KeyboardInput.
+*/
+
Q3DKeyEvent::Q3DKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text, bool autorep, ushort count)
: QObject()
, m_event(type, key, modifiers, text, autorep, count)
@@ -56,6 +72,81 @@ Q3DKeyEvent::Q3DKeyEvent(const QKeyEvent &ke)
m_event.setAccepted(false);
}
+/*!
+ \qmlproperty int Qt3D.Input::KeyEvent::key
+ \readonly
+
+ This property holds the code of the key that was pressed or released.
+
+ See \l [CPP] {Qt::Key}{Qt.Key} for the list of keyboard codes.
+
+ \sa {QtQuick::KeyEvent::key}{KeyEvent.key}
+*/
+
+/*!
+ \qmlproperty string Qt3D.Input::KeyEvent::text
+ \readonly
+
+ This property holds the Unicode text that the key generated. The text
+ returned can be an empty string in cases where modifier keys, such as
+ Shift, Control, Alt, and Meta, are being pressed or released. In such
+ cases \l key will contain a valid value.
+*/
+
+/*!
+ \qmlproperty int Qt3D.Input::KeyEvent::modifiers
+ \readonly
+
+ This property holds the keyboard modifier flags that existed immediately
+ before the event occurred.
+
+ \sa {QtQuick::KeyEvent::modifiers}{KeyEvent.modifiers}
+*/
+
+/*!
+ \qmlproperty bool Qt3D.Input::KeyEvent::isAutoRepeat
+ \readonly
+
+ Holds whether this event comes from an auto-repeating key.
+*/
+
+/*!
+ \qmlproperty int Qt3D.Input::KeyEvent::count
+ \readonly
+
+ Holds the number of keys involved in this event. If \l text is not empty,
+ this is simply the length of the string.
+*/
+
+/*!
+ \qmlproperty quint32 Qt3D.Input::KeyEvent::nativeScanCodei
+ \readonly
+
+ This property contains the native scan code of the key that was pressed.
+ It is passed through from QKeyEvent unchanged.
+
+ \sa QKeyEvent::nativeScanCode()
+*/
+
+/*!
+ \qmlproperty bool Qt3D.Input::KeyEvent::accepted
+
+ Setting \e accepted to \c true prevents the key event from being propagated
+ to the item's parent.
+
+ Generally, if the item acts on the key event then it should be accepted so
+ that ancestor items do not also respond to the same event.
+*/
+
+/*!
+ \qmlmethod bool Qt3D.Input::KeyEvent::matches(StandardKey key)
+
+ Returns \c true if the key event matches the given standard key; otherwise
+ returns \c false.
+
+ \sa QKeySequence::StandardKey
+*/
+
} // Qt3D
QT_END_NAMESPACE
diff --git a/src/input/qinputaspect.cpp b/src/input/qinputaspect.cpp
index fc7fb8e8c..c16f06dc3 100644
--- a/src/input/qinputaspect.cpp
+++ b/src/input/qinputaspect.cpp
@@ -62,6 +62,12 @@ QInputAspectPrivate::QInputAspectPrivate()
m_aspectType = QAbstractAspect::AspectOther;
}
+/*!
+ \class Qt3D::QInputAspect
+ \inmodule Qt3DInput
+ \since 5.5
+*/
+
QInputAspect::QInputAspect(QObject *parent)
: QAbstractAspect(*new QInputAspectPrivate, parent)
{
diff --git a/src/input/qkeyboardcontroller.cpp b/src/input/qkeyboardcontroller.cpp
index 69e93b479..25b9b30ed 100644
--- a/src/input/qkeyboardcontroller.cpp
+++ b/src/input/qkeyboardcontroller.cpp
@@ -53,11 +53,30 @@ QKeyboardControllerPrivate::QKeyboardControllerPrivate()
{
}
+/*!
+ \class Qt3D::QKeyboardController
+ \inmodule Qt3DInput
+ \since 5.5
+*/
+
+/*!
+ \qmltype KeyboardController
+ \inqmlmodule Qt3D.Input
+ \since 5.5
+ \instantiates Qt3D::QKeyboardController
+ \inherits Node
+*/
+
QKeyboardController::QKeyboardController(QNode *parent)
: QNode(*new QKeyboardControllerPrivate, parent)
{
}
+/*!
+ \qmlproperty KeyboardInput Qt3D.Input::KeyboardController::activeInput
+ \readonly
+*/
+
QKeyboardInput *QKeyboardController::activeInput() const
{
Q_D(const QKeyboardController);
diff --git a/src/input/qkeyboardinput.cpp b/src/input/qkeyboardinput.cpp
index e7030799d..bf80abecf 100644
--- a/src/input/qkeyboardinput.cpp
+++ b/src/input/qkeyboardinput.cpp
@@ -56,6 +56,20 @@ QKeyboardInputPrivate::QKeyboardInputPrivate()
}
/*!
+ \class Qt3D::QKeyboardInput
+ \inmodule Qt3DInput
+ \since 5.5
+*/
+
+/*!
+ \qmltype KeyboardInput
+ \inqmlmodule Qt3D.Input
+ \instantiates Qt3D::QKeyboardInput
+ \inherits Component3D
+ \since 5.5
+*/
+
+/*!
Constructs a new QKeyboardInput instance with parent \a parent.
*/
QKeyboardInput::QKeyboardInput(QNode *parent)
@@ -167,6 +181,10 @@ void QKeyboardInput::keyEvent(Q3DKeyEvent *event)
}
/*!
+ \qmlproperty KeyboardController Qt3D.Input::KeyboardInput::controller
+*/
+
+/*!
Sets the keyboard controller to \a controller. Without a valid controller,
the QKeyboardInput won't receive any event.
*/
@@ -193,6 +211,10 @@ QKeyboardController *QKeyboardInput::controller() const
}
/*!
+ \qmlproperty bool Qt3D.Input::KeyboardInput::focus
+*/
+
+/*!
\returns the current focus.
*/
bool QKeyboardInput::focus() const
@@ -213,6 +235,170 @@ void QKeyboardInput::setFocus(bool focus)
}
}
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit0Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit1Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit2Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit3Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit4Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit5Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit6Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit7Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit8Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::digit9Pressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::leftPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::rightPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::upPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::downPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::tabPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::backtabPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::asteriskPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::numberSignPressed(KeyEvent event)
+*/
+
+/*!
+ \qmlsignal Qt3D.Input::KeyboardInput::backtabPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::escapePressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::returnPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::enterPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::deletePressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::spacePressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::backPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::cancelPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::selectPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::yesPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::noPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::context1Pressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::context2Pressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::context3Pressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::context4Pressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::callPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::hangupPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::flipPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::menuPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::volumeUpPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::volumeDownPressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::pressed(KeyEvent event)
+*/
+
+/*!
+ qmlsignal Qt3D.Input::KeyboardInput::released(KeyEvent event)
+*/
+
} // Qt3D
QT_END_NAMESPACE