diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-05-14 08:52:45 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-05-19 07:03:19 +0000 |
commit | 6f6207fadc1a334d1aed98f840a0d074acf18d06 (patch) | |
tree | 083bf49b4d6bc999f099b3c1e2897cb23cb89887 /src/input | |
parent | 72f2c87d15c76cc861699aea536e01bc8d56c8f2 (diff) |
De-inline dtors of public polymorphic classes
By making the destructor (usually the first non-inline, non-pure,
virtual function, and therefore the trigger for most compilers to
emit the vtable and type_info structures for the class in that TU)
out-of-line, vtables and, more importantly, type_info structures for
the class are pinned to a single TU. This prevents false negative
dynamic_cast and catch evaluation.
It also allows to add code to them later, if necessary.
Change-Id: I0da301cd788162abba6cdbbb21910090a22adb9a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input')
35 files changed, 106 insertions, 0 deletions
diff --git a/src/input/frontend/qabstractphysicaldevice.cpp b/src/input/frontend/qabstractphysicaldevice.cpp index 82d721a73..98313773e 100644 --- a/src/input/frontend/qabstractphysicaldevice.cpp +++ b/src/input/frontend/qabstractphysicaldevice.cpp @@ -56,6 +56,11 @@ QAbstractPhysicalDevicePrivate::QAbstractPhysicalDevicePrivate() { } +/*! \internal */ +QAbstractPhysicalDevicePrivate::~QAbstractPhysicalDevicePrivate() +{ +} + /*! \class Qt3DInput::QAbstractPhysicalDevice \inmodule Qt3DInput @@ -84,6 +89,11 @@ QAbstractPhysicalDevice::QAbstractPhysicalDevice(Qt3DCore::QNode *parent) { } +/*! \internal */ +QAbstractPhysicalDevice::~QAbstractPhysicalDevice() +{ +} + QAbstractPhysicalDevice::QAbstractPhysicalDevice(QAbstractPhysicalDevicePrivate &dd, Qt3DCore::QNode *parent) : Qt3DCore::QNode(dd, parent) { diff --git a/src/input/frontend/qabstractphysicaldevice.h b/src/input/frontend/qabstractphysicaldevice.h index 3725ae1c4..8c0abae4e 100644 --- a/src/input/frontend/qabstractphysicaldevice.h +++ b/src/input/frontend/qabstractphysicaldevice.h @@ -58,6 +58,7 @@ class QT3DINPUTSHARED_EXPORT QAbstractPhysicalDevice : public Qt3DCore::QNode Q_OBJECT public: explicit QAbstractPhysicalDevice(Qt3DCore::QNode *parent = nullptr); + ~QAbstractPhysicalDevice(); virtual int axisCount() const; virtual int buttonCount() const; diff --git a/src/input/frontend/qabstractphysicaldevice_p.h b/src/input/frontend/qabstractphysicaldevice_p.h index 082522fa5..55e98723c 100644 --- a/src/input/frontend/qabstractphysicaldevice_p.h +++ b/src/input/frontend/qabstractphysicaldevice_p.h @@ -68,6 +68,7 @@ class QT3DINPUTSHARED_PRIVATE_EXPORT QAbstractPhysicalDevicePrivate : public Qt3 { public: QAbstractPhysicalDevicePrivate(); + ~QAbstractPhysicalDevicePrivate(); Q_DECLARE_PUBLIC(QAbstractPhysicalDevice) QVector<QAxisSetting *> m_axisSettings; diff --git a/src/input/frontend/qaction.cpp b/src/input/frontend/qaction.cpp index 2d7d29887..11a8d3ab6 100644 --- a/src/input/frontend/qaction.cpp +++ b/src/input/frontend/qaction.cpp @@ -76,6 +76,11 @@ QAction::QAction(Qt3DCore::QNode *parent) { } +/*! \internal */ +QAction::~QAction() +{ +} + /*! \fn QAction::nameChanged() diff --git a/src/input/frontend/qaction.h b/src/input/frontend/qaction.h index 9dc3ab3f4..937f2ec99 100644 --- a/src/input/frontend/qaction.h +++ b/src/input/frontend/qaction.h @@ -56,6 +56,7 @@ class QT3DINPUTSHARED_EXPORT QAction : public Qt3DCore::QNode Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) public: explicit QAction(Qt3DCore::QNode *parent = nullptr); + ~QAction(); bool isActive() const; diff --git a/src/input/frontend/qactioninput.cpp b/src/input/frontend/qactioninput.cpp index 1ecd872bc..466277028 100644 --- a/src/input/frontend/qactioninput.cpp +++ b/src/input/frontend/qactioninput.cpp @@ -89,6 +89,11 @@ QActionInput::QActionInput(Qt3DCore::QNode *parent) } +/*! \internal */ +QActionInput::~QActionInput() +{ +} + /*! Return the Buttons to trigger the QActionInput instance. */ diff --git a/src/input/frontend/qactioninput.h b/src/input/frontend/qactioninput.h index 2db2b9d95..9b06047b2 100644 --- a/src/input/frontend/qactioninput.h +++ b/src/input/frontend/qactioninput.h @@ -59,6 +59,7 @@ class QT3DINPUTSHARED_EXPORT QActionInput : public Qt3DInput::QAbstractActionInp public: explicit QActionInput(Qt3DCore::QNode *parent = nullptr); + ~QActionInput(); QAbstractPhysicalDevice *sourceDevice() const; QVector<int> buttons() const; diff --git a/src/input/frontend/qanalogaxisinput.cpp b/src/input/frontend/qanalogaxisinput.cpp index e688b0cec..92f3f5beb 100644 --- a/src/input/frontend/qanalogaxisinput.cpp +++ b/src/input/frontend/qanalogaxisinput.cpp @@ -66,6 +66,11 @@ QAnalogAxisInput::QAnalogAxisInput(Qt3DCore::QNode *parent) { } +/*! \internal */ +QAnalogAxisInput::~QAnalogAxisInput() +{ +} + void QAnalogAxisInput::setAxis(int axis) { Q_D(QAnalogAxisInput); diff --git a/src/input/frontend/qanalogaxisinput.h b/src/input/frontend/qanalogaxisinput.h index 8357332ea..f5523d0dd 100644 --- a/src/input/frontend/qanalogaxisinput.h +++ b/src/input/frontend/qanalogaxisinput.h @@ -56,6 +56,7 @@ class QT3DINPUTSHARED_EXPORT QAnalogAxisInput : public QAbstractAxisInput public: explicit QAnalogAxisInput(Qt3DCore::QNode *parent = nullptr); + ~QAnalogAxisInput(); int axis() const; diff --git a/src/input/frontend/qaxis.cpp b/src/input/frontend/qaxis.cpp index 1cee05203..a12b277e9 100644 --- a/src/input/frontend/qaxis.cpp +++ b/src/input/frontend/qaxis.cpp @@ -69,6 +69,11 @@ QAxis::QAxis(Qt3DCore::QNode *parent) { } +/*! \internal */ +QAxis::~QAxis() +{ +} + void QAxis::addInput(QAbstractAxisInput *input) { Q_D(QAxis); diff --git a/src/input/frontend/qaxis.h b/src/input/frontend/qaxis.h index 9d89c01b8..92abd9c0d 100644 --- a/src/input/frontend/qaxis.h +++ b/src/input/frontend/qaxis.h @@ -55,6 +55,7 @@ class QT3DINPUTSHARED_EXPORT QAxis : public Qt3DCore::QNode Q_PROPERTY(float value READ value NOTIFY valueChanged) public: explicit QAxis(Qt3DCore::QNode *parent = nullptr); + ~QAxis(); void addInput(QAbstractAxisInput *input); void removeInput(QAbstractAxisInput *input); diff --git a/src/input/frontend/qaxissetting.cpp b/src/input/frontend/qaxissetting.cpp index 7614f9e8d..bd21097ef 100644 --- a/src/input/frontend/qaxissetting.cpp +++ b/src/input/frontend/qaxissetting.cpp @@ -67,6 +67,11 @@ QAxisSetting::QAxisSetting(Qt3DCore::QNode *parent) { } +/*! \internal */ +QAxisSetting::~QAxisSetting() +{ +} + QVariantList QAxisSetting::axes() const { Q_D(const QAxisSetting); diff --git a/src/input/frontend/qaxissetting.h b/src/input/frontend/qaxissetting.h index aace04a1b..6298dcb40 100644 --- a/src/input/frontend/qaxissetting.h +++ b/src/input/frontend/qaxissetting.h @@ -60,6 +60,7 @@ class QT3DINPUTSHARED_EXPORT QAxisSetting : public Qt3DCore::QNode public: explicit QAxisSetting(Qt3DCore::QNode *parent = nullptr); + ~QAxisSetting(); float deadZoneRadius() const; QVariantList axes() const; diff --git a/src/input/frontend/qbuttonaxisinput.cpp b/src/input/frontend/qbuttonaxisinput.cpp index f392605aa..1586cc0dc 100644 --- a/src/input/frontend/qbuttonaxisinput.cpp +++ b/src/input/frontend/qbuttonaxisinput.cpp @@ -66,6 +66,11 @@ QButtonAxisInput::QButtonAxisInput(Qt3DCore::QNode *parent) { } +/*! \internal */ +QButtonAxisInput::~QButtonAxisInput() +{ +} + void QButtonAxisInput::setScale(float scale) { Q_D(QButtonAxisInput); diff --git a/src/input/frontend/qbuttonaxisinput.h b/src/input/frontend/qbuttonaxisinput.h index cb2cb891e..3e9aacc00 100644 --- a/src/input/frontend/qbuttonaxisinput.h +++ b/src/input/frontend/qbuttonaxisinput.h @@ -59,6 +59,7 @@ class QT3DINPUTSHARED_EXPORT QButtonAxisInput : public QAbstractAxisInput public: explicit QButtonAxisInput(Qt3DCore::QNode *parent = nullptr); + ~QButtonAxisInput(); float scale() const; QVector<int> buttons() const; diff --git a/src/input/frontend/qinputchord.cpp b/src/input/frontend/qinputchord.cpp index b00bccd4b..b5953498e 100644 --- a/src/input/frontend/qinputchord.cpp +++ b/src/input/frontend/qinputchord.cpp @@ -99,6 +99,11 @@ QInputChord::QInputChord(Qt3DCore::QNode *parent) } +/*! \internal */ +QInputChord::~QInputChord() +{ +} + /*! \fn QInputChord::timeoutChanged() diff --git a/src/input/frontend/qinputchord.h b/src/input/frontend/qinputchord.h index 5177b84c2..f3e603eb5 100644 --- a/src/input/frontend/qinputchord.h +++ b/src/input/frontend/qinputchord.h @@ -58,6 +58,7 @@ class QT3DINPUTSHARED_EXPORT QInputChord : public Qt3DInput::QAbstractActionInpu public: explicit QInputChord(Qt3DCore::QNode *parent = nullptr); + ~QInputChord(); int timeout() const; diff --git a/src/input/frontend/qinputsequence.cpp b/src/input/frontend/qinputsequence.cpp index 461605a64..2f89cd844 100644 --- a/src/input/frontend/qinputsequence.cpp +++ b/src/input/frontend/qinputsequence.cpp @@ -96,6 +96,11 @@ QInputSequence::QInputSequence(Qt3DCore::QNode *parent) } +/*! \internal */ +QInputSequence::~QInputSequence() +{ +} + /*! \fn QInputSequence::timeoutChanged() diff --git a/src/input/frontend/qinputsequence.h b/src/input/frontend/qinputsequence.h index b5a85c8a9..2baeb40b8 100644 --- a/src/input/frontend/qinputsequence.h +++ b/src/input/frontend/qinputsequence.h @@ -59,6 +59,7 @@ class QT3DINPUTSHARED_EXPORT QInputSequence : public Qt3DInput::QAbstractActionI public: explicit QInputSequence(Qt3DCore::QNode *parent = nullptr); + ~QInputSequence(); int timeout() const; int buttonInterval() const; diff --git a/src/input/frontend/qinputsettings.cpp b/src/input/frontend/qinputsettings.cpp index 73f5ec896..fde2feb55 100644 --- a/src/input/frontend/qinputsettings.cpp +++ b/src/input/frontend/qinputsettings.cpp @@ -56,6 +56,11 @@ QInputSettings::QInputSettings(Qt3DCore::QNode *parent) { } +/*! \internal */ +QInputSettings::~QInputSettings() +{ +} + QObject *QInputSettings::eventSource() const { Q_D(const QInputSettings); diff --git a/src/input/frontend/qinputsettings.h b/src/input/frontend/qinputsettings.h index b4ff0cf0f..8eb3b6bf2 100644 --- a/src/input/frontend/qinputsettings.h +++ b/src/input/frontend/qinputsettings.h @@ -55,6 +55,7 @@ class QT3DINPUTSHARED_EXPORT QInputSettings : public Qt3DCore::QComponent Q_PROPERTY(QObject *eventSource READ eventSource WRITE setEventSource NOTIFY eventSourceChanged) public: explicit QInputSettings(Qt3DCore::QNode *parent = nullptr); + ~QInputSettings(); QObject *eventSource() const; diff --git a/src/input/frontend/qkeyboarddevice.cpp b/src/input/frontend/qkeyboarddevice.cpp index cbfcd51f6..e2ade6efb 100644 --- a/src/input/frontend/qkeyboarddevice.cpp +++ b/src/input/frontend/qkeyboarddevice.cpp @@ -219,6 +219,11 @@ QKeyboardDevice::QKeyboardDevice(QNode *parent) { } +/*! \internal */ +QKeyboardDevice::~QKeyboardDevice() +{ +} + /*! \qmlproperty KeyboardHandler Qt3D.Input::KeyboardDevice::activeInput \readonly diff --git a/src/input/frontend/qkeyboarddevice.h b/src/input/frontend/qkeyboarddevice.h index 70ed438fd..a86687769 100644 --- a/src/input/frontend/qkeyboarddevice.h +++ b/src/input/frontend/qkeyboarddevice.h @@ -58,6 +58,7 @@ class QT3DINPUTSHARED_EXPORT QKeyboardDevice : public Qt3DInput::QAbstractPhysic public: explicit QKeyboardDevice(QNode *parent = nullptr); + ~QKeyboardDevice(); QKeyboardHandler *activeInput() const; diff --git a/src/input/frontend/qkeyboardhandler.cpp b/src/input/frontend/qkeyboardhandler.cpp index 927eed48e..647fc8650 100644 --- a/src/input/frontend/qkeyboardhandler.cpp +++ b/src/input/frontend/qkeyboardhandler.cpp @@ -158,6 +158,11 @@ QKeyboardHandler::QKeyboardHandler(QNode *parent) { } +/*! \internal */ +QKeyboardHandler::~QKeyboardHandler() +{ +} + void QKeyboardHandler::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change) { Q_D(QKeyboardHandler); diff --git a/src/input/frontend/qkeyboardhandler.h b/src/input/frontend/qkeyboardhandler.h index 2a5196775..ba1959bfe 100644 --- a/src/input/frontend/qkeyboardhandler.h +++ b/src/input/frontend/qkeyboardhandler.h @@ -58,6 +58,7 @@ class QT3DINPUTSHARED_EXPORT QKeyboardHandler : public Qt3DCore::QComponent Q_PROPERTY(bool focus READ focus WRITE setFocus NOTIFY focusChanged) public: explicit QKeyboardHandler(QNode *parent = nullptr); + ~QKeyboardHandler(); Qt3DInput::QKeyboardDevice *sourceDevice() const; bool focus() const; diff --git a/src/input/frontend/qkeyevent.cpp b/src/input/frontend/qkeyevent.cpp index 50fa6d3e4..d3b346da0 100644 --- a/src/input/frontend/qkeyevent.cpp +++ b/src/input/frontend/qkeyevent.cpp @@ -75,6 +75,11 @@ QKeyEvent::QKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &ke) m_event.setAccepted(false); } +/*! \internal */ +QKeyEvent::~QKeyEvent() +{ +} + /*! \qmlproperty int Qt3D.Input::KeyEvent::key \readonly diff --git a/src/input/frontend/qkeyevent.h b/src/input/frontend/qkeyevent.h index a75c0042b..0978a45e7 100644 --- a/src/input/frontend/qkeyevent.h +++ b/src/input/frontend/qkeyevent.h @@ -67,6 +67,7 @@ class QT3DINPUTSHARED_EXPORT QKeyEvent : public QObject public: explicit QKeyEvent(QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, const QString &text=QString(), bool autorep=false, ushort count=1); explicit QKeyEvent(const QT_PREPEND_NAMESPACE(QKeyEvent) &ke); + ~QKeyEvent(); inline int key() const { return m_event.key(); } inline QString text() const { return m_event.text(); } diff --git a/src/input/frontend/qlogicaldevice.cpp b/src/input/frontend/qlogicaldevice.cpp index 07f233e48..3cb3a8b24 100644 --- a/src/input/frontend/qlogicaldevice.cpp +++ b/src/input/frontend/qlogicaldevice.cpp @@ -140,6 +140,10 @@ QLogicalDevice::QLogicalDevice(Qt3DCore::QNode *parent) { } +QLogicalDevice::~QLogicalDevice() +{ +} + /*! \qmlproperty QQmlListProperty<Action> Qt3D.Input::LogicalDevice::actions diff --git a/src/input/frontend/qlogicaldevice.h b/src/input/frontend/qlogicaldevice.h index 018d2cb5c..f60cfe2b1 100644 --- a/src/input/frontend/qlogicaldevice.h +++ b/src/input/frontend/qlogicaldevice.h @@ -56,6 +56,7 @@ class QT3DINPUTSHARED_EXPORT QLogicalDevice : public Qt3DCore::QComponent Q_OBJECT public: explicit QLogicalDevice(Qt3DCore::QNode *parent = nullptr); + ~QLogicalDevice(); void addAction(QAction *action); void removeAction(QAction *action); diff --git a/src/input/frontend/qmousedevice.cpp b/src/input/frontend/qmousedevice.cpp index 40e5df47c..ec0a24f46 100644 --- a/src/input/frontend/qmousedevice.cpp +++ b/src/input/frontend/qmousedevice.cpp @@ -76,6 +76,11 @@ QMouseDevice::QMouseDevice(QNode *parent) { } +/*! \internal */ +QMouseDevice::~QMouseDevice() +{ +} + int QMouseDevice::axisCount() const { // TO DO: we could have mouse wheel later on diff --git a/src/input/frontend/qmousedevice.h b/src/input/frontend/qmousedevice.h index 5ba1be595..fe43c6c84 100644 --- a/src/input/frontend/qmousedevice.h +++ b/src/input/frontend/qmousedevice.h @@ -59,6 +59,7 @@ class QT3DINPUTSHARED_EXPORT QMouseDevice : public Qt3DInput::QAbstractPhysicalD Q_PROPERTY(float sensitivity READ sensitivity WRITE setSensitivity NOTIFY sensitivityChanged) public: explicit QMouseDevice(Qt3DCore::QNode *parent = nullptr); + ~QMouseDevice(); enum Axis { X, diff --git a/src/input/frontend/qmousehandler.cpp b/src/input/frontend/qmousehandler.cpp index 2d81b0b75..7f135d10c 100644 --- a/src/input/frontend/qmousehandler.cpp +++ b/src/input/frontend/qmousehandler.cpp @@ -118,6 +118,10 @@ QMouseHandler::QMouseHandler(QNode *parent) { } +QMouseHandler::~QMouseHandler() +{ +} + /*! * Sets the mouse device of the QMouseHandler instance to \a mouseDevice. */ diff --git a/src/input/frontend/qmousehandler.h b/src/input/frontend/qmousehandler.h index fbf62a127..750ed394d 100644 --- a/src/input/frontend/qmousehandler.h +++ b/src/input/frontend/qmousehandler.h @@ -59,6 +59,7 @@ class QT3DINPUTSHARED_EXPORT QMouseHandler : public Qt3DCore::QComponent public: explicit QMouseHandler(QNode *parent = nullptr); + ~QMouseHandler(); QMouseDevice *sourceDevice() const; bool containsMouse() const; diff --git a/src/input/frontend/qphysicaldevicecreatedchange.cpp b/src/input/frontend/qphysicaldevicecreatedchange.cpp index c9692b138..17edde76a 100644 --- a/src/input/frontend/qphysicaldevicecreatedchange.cpp +++ b/src/input/frontend/qphysicaldevicecreatedchange.cpp @@ -56,6 +56,11 @@ QPhysicalDeviceCreatedChangeBase::QPhysicalDeviceCreatedChangeBase(const QAbstra { } +/*! \internal */ +QPhysicalDeviceCreatedChangeBase::~QPhysicalDeviceCreatedChangeBase() +{ +} + Qt3DCore::QNodeIdVector QPhysicalDeviceCreatedChangeBase::axisSettingIds() const { Q_D(const QPhysicalDeviceCreatedChangeBase); diff --git a/src/input/frontend/qphysicaldevicecreatedchange.h b/src/input/frontend/qphysicaldevicecreatedchange.h index 42b5582e7..65cc4004a 100644 --- a/src/input/frontend/qphysicaldevicecreatedchange.h +++ b/src/input/frontend/qphysicaldevicecreatedchange.h @@ -51,6 +51,7 @@ class QT3DINPUTSHARED_EXPORT QPhysicalDeviceCreatedChangeBase : public Qt3DCore: { public: explicit QPhysicalDeviceCreatedChangeBase(const QAbstractPhysicalDevice *device); + ~QPhysicalDeviceCreatedChangeBase(); Qt3DCore::QNodeIdVector axisSettingIds() const; |