From 2b08586059587e7f87cdbdf4f92285f745f4f178 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 28 Jun 2024 12:40:39 +0200 Subject: [PATCH] Quarter: Update Quarter code * Removes unused default constructors of the device classes * Changes several doc strings --- src/Gui/Quarter/ContextMenu.h | 14 +++--- src/Gui/Quarter/DragDropHandler.cpp | 16 +++---- src/Gui/Quarter/EventFilter.cpp | 12 ++--- src/Gui/Quarter/FocusHandler.cpp | 4 +- src/Gui/Quarter/ImageReader.cpp | 4 -- src/Gui/Quarter/InputDevice.cpp | 22 ++++----- src/Gui/Quarter/Keyboard.cpp | 9 +--- src/Gui/Quarter/Mouse.cpp | 13 ++--- src/Gui/Quarter/QuarterWidget.cpp | 48 +++++++++++-------- src/Gui/Quarter/QuarterWidget.h | 1 + src/Gui/Quarter/QuarterWidgetP.cpp | 4 +- src/Gui/Quarter/SpaceNavigatorDevice.cpp | 22 ++------- src/Gui/Quarter/devices/InputDevice.h | 13 +++-- src/Gui/Quarter/devices/Keyboard.h | 3 +- src/Gui/Quarter/devices/Mouse.h | 3 +- .../Quarter/devices/SpaceNavigatorDevice.h | 3 +- .../Quarter/eventhandlers/DragDropHandler.h | 4 +- src/Gui/Quarter/eventhandlers/EventFilter.h | 2 +- src/Gui/Quarter/eventhandlers/FocusHandler.h | 2 +- src/Gui/SoTouchEvents.cpp | 1 + src/Gui/View3DInventorViewer.cpp | 2 +- 21 files changed, 84 insertions(+), 118 deletions(-) diff --git a/src/Gui/Quarter/ContextMenu.h b/src/Gui/Quarter/ContextMenu.h index 8638684297..a4f8ff9d4f 100644 --- a/src/Gui/Quarter/ContextMenu.h +++ b/src/Gui/Quarter/ContextMenu.h @@ -1,22 +1,22 @@ /**************************************************************************\ * Copyright (c) Kongsberg Oil & Gas Technologies AS * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -33,7 +33,7 @@ #ifndef QUARTER_CONTEXTMENUHANDLERP_H #define QUARTER_CONTEXTMENUHANDLERP_H -#include +#include class QMenu; class QAction; @@ -45,7 +45,7 @@ class QuarterWidget; class ContextMenu : public QObject { Q_OBJECT public: - ContextMenu(QuarterWidget * quarterwidget); + explicit ContextMenu(QuarterWidget * quarterwidget); ~ContextMenu() override; QMenu * getMenu() const; diff --git a/src/Gui/Quarter/DragDropHandler.cpp b/src/Gui/Quarter/DragDropHandler.cpp index b75c57f2b0..4d2fbfd90c 100644 --- a/src/Gui/Quarter/DragDropHandler.cpp +++ b/src/Gui/Quarter/DragDropHandler.cpp @@ -1,22 +1,22 @@ /**************************************************************************\ * Copyright (c) Kongsberg Oil & Gas Technologies AS * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -54,7 +54,7 @@ namespace SIM { namespace Coin3D { namespace Quarter { class DragDropHandlerP { public: - DragDropHandlerP(DragDropHandler * master) { + explicit DragDropHandlerP(DragDropHandler * master) { this->master = master; } void dragEnterEvent(QDragEnterEvent * event); @@ -93,7 +93,7 @@ DragDropHandler::~DragDropHandler() /*! Detects a QDragEnterEvent and if the event is the dropping of a - valid Inventor or VRML it opens the file, reads in the scenegraph + valid Inventor or VRML file it opens the file, reads in the scene graph and calls setSceneGraph on the QuarterWidget */ bool @@ -158,7 +158,7 @@ DragDropHandlerP::dropEvent(QDropEvent * event) if (!root) return; - // set new scenegraph + // set new scene graph this->quarterwidget->setSceneGraph(root); this->quarterwidget->viewport()->update(); } diff --git a/src/Gui/Quarter/EventFilter.cpp b/src/Gui/Quarter/EventFilter.cpp index 5f381f1229..5e1f6a9ceb 100644 --- a/src/Gui/Quarter/EventFilter.cpp +++ b/src/Gui/Quarter/EventFilter.cpp @@ -66,10 +66,10 @@ public: void trackPointerPosition(QMouseEvent * event) { assert(this->windowsize[1] != -1); -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) - this->globalmousepos = event->globalPos(); -#else +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) this->globalmousepos = event->globalPosition().toPoint(); +#else + this->globalmousepos = event->globalPos(); #endif SbVec2s mousepos(event->pos().x(), this->windowsize[1] - event->pos().y() - 1); @@ -136,7 +136,7 @@ EventFilter::unregisterInputDevice(InputDevice * device) } /*! Translates Qt Events into Coin events and passes them on to the - event QuarterWidget for processing. If the event can not be + event QuarterWidget for processing. If the event cannot be translated or processed, it is forwarded to Qt and the method returns false. */ @@ -151,10 +151,10 @@ EventFilter::eventFilter(QObject * obj, QEvent * qevent) case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: - PRIVATE(this)->trackPointerPosition(static_cast(qevent)); + PRIVATE(this)->trackPointerPosition(dynamic_cast(qevent)); break; case QEvent::Resize: - PRIVATE(this)->trackWindowSize(static_cast(qevent)); + PRIVATE(this)->trackWindowSize(dynamic_cast(qevent)); break; default: break; diff --git a/src/Gui/Quarter/FocusHandler.cpp b/src/Gui/Quarter/FocusHandler.cpp index e7d12f3299..6d805732ca 100644 --- a/src/Gui/Quarter/FocusHandler.cpp +++ b/src/Gui/Quarter/FocusHandler.cpp @@ -33,8 +33,8 @@ /*! \class SIM::Coin3D::Quarter::FocusHandler FocusHandler.h Quarter/devices/FocusHandler.h - \brief The FocusHandler eventfilter provides Coin with focus in and - focus out events, if installed on QuarterWidget. + \brief The FocusHandler event filter provides Coin with focus in and + focus out events, if installed on a QuarterWidget. */ #include diff --git a/src/Gui/Quarter/ImageReader.cpp b/src/Gui/Quarter/ImageReader.cpp index 25aa9f92a4..de7c111e57 100644 --- a/src/Gui/Quarter/ImageReader.cpp +++ b/src/Gui/Quarter/ImageReader.cpp @@ -54,10 +54,6 @@ ImageReader::readImage(const SbString & filename, SbImage & sbimage) const { QImage image; if (image.load(filename.getString())) { - //int c; - //int w = image.width(); - //int h = image.height(); - // Keep in 8-bits mode if that was what we read if (image.depth() != 8 || !image.isGrayscale()) { // FIXME: consider if we should detect allGrayscale() and alpha (c = 2) diff --git a/src/Gui/Quarter/InputDevice.cpp b/src/Gui/Quarter/InputDevice.cpp index 9ae479a9fa..ea9323a5ac 100644 --- a/src/Gui/Quarter/InputDevice.cpp +++ b/src/Gui/Quarter/InputDevice.cpp @@ -46,26 +46,20 @@ using namespace SIM::Coin3D::Quarter; \class SIM::Coin3D::Quarter::InputDevice InputDevice.h Quarter/devices/InputDevice.h \brief The InputDevice class is the base class for devices such as - the Keyboard and Mouse. It can be subclassed to support other - devices. + keyboard and mouse. It can be subclassed to support other devices. */ -InputDevice::InputDevice() : quarter(nullptr) +InputDevice::InputDevice(QuarterWidget* quarter) : + quarter(quarter) { this->mousepos = SbVec2s(0, 0); } -InputDevice::InputDevice(QuarterWidget *quarter) : quarter(quarter) -{ - this->mousepos = SbVec2s(0, 0); -} - /*! - Sets the mouseposition + Sets the mouse position - \param[in] pos position of mouse in pixelcoordinates + \param[in] pos position of mouse in pixel coordinates */ - void InputDevice::setMousePosition(const SbVec2s & pos) { @@ -84,10 +78,10 @@ InputDevice::setWindowSize(const SbVec2s & size) } /*! - Transforms a qevent into an soevent + Transforms a QEvent into an SoEvent - \param[in,out] soevent the transformed event - \param[in] qevent incoming qevent + \param[in,out] SoEvent the transformed event + \param[in] QEvent incoming QEvent */ void InputDevice::setModifiers(SoEvent * soevent, const QInputEvent * qevent) diff --git a/src/Gui/Quarter/Keyboard.cpp b/src/Gui/Quarter/Keyboard.cpp index 1195212ae7..b5497899e2 100644 --- a/src/Gui/Quarter/Keyboard.cpp +++ b/src/Gui/Quarter/Keyboard.cpp @@ -53,17 +53,12 @@ using namespace SIM::Coin3D::Quarter; #define PRIVATE(obj) obj->pimpl -Keyboard::Keyboard() +Keyboard::Keyboard(QuarterWidget* quarter) : + InputDevice(quarter) { PRIVATE(this) = new KeyboardP(this); } -Keyboard::Keyboard(QuarterWidget* quarter) : - InputDevice(quarter) -{ - PRIVATE(this) = new KeyboardP(this); -} - Keyboard::~Keyboard() { delete PRIVATE(this); diff --git a/src/Gui/Quarter/Mouse.cpp b/src/Gui/Quarter/Mouse.cpp index e865f119f3..66bd3b83e6 100644 --- a/src/Gui/Quarter/Mouse.cpp +++ b/src/Gui/Quarter/Mouse.cpp @@ -37,8 +37,6 @@ QuarterWidget. */ -#include "PreCompiled.h" - #ifdef _MSC_VER #pragma warning(disable : 4267) #endif @@ -60,7 +58,7 @@ namespace SIM { namespace Coin3D { namespace Quarter { class MouseP { public: - MouseP(Mouse * publ) { + explicit MouseP(Mouse * publ) { this->publ = publ; this->location2 = new SoLocation2Event; this->mousebutton = new SoMouseButtonEvent; @@ -93,17 +91,12 @@ using namespace SIM::Coin3D::Quarter; #define PRIVATE(obj) obj->pimpl #define PUBLIC(obj) obj->publ -Mouse::Mouse() +Mouse::Mouse(QuarterWidget* quarter) : + InputDevice(quarter) { PRIVATE(this) = new MouseP(this); } -Mouse::Mouse(QuarterWidget *quarter) : - InputDevice(quarter) -{ - PRIVATE(this) = new MouseP(this); -} - Mouse::~Mouse() { delete PRIVATE(this); diff --git a/src/Gui/Quarter/QuarterWidget.cpp b/src/Gui/Quarter/QuarterWidget.cpp index 45776236e7..96a3bf66f1 100644 --- a/src/Gui/Quarter/QuarterWidget.cpp +++ b/src/Gui/Quarter/QuarterWidget.cpp @@ -776,7 +776,7 @@ QuarterWidget::viewAll() } /*! - Sets the current camera in seekmode, if supported by the underlying navigation system. + Sets the current camera in seek mode, if supported by the underlying navigation system. Camera typically seeks towards what the mouse is pointing at. */ void @@ -995,7 +995,7 @@ QuarterWidget::actualRedraw() /*! - Passes an event to the eventmanager. + Passes an event to the event manager. \param[in] event to pass \retval Returns true if the event was successfully processed @@ -1015,10 +1015,10 @@ QuarterWidget::processSoEvent(const SoEvent * event) */ /*! - Set backgroundcolor to a given QColor + Set background color to a given QColor Remember that QColors are given in integers between 0 and 255, as - opposed to SbColor4f which is in [0 ,1]. The default alpha value for + opposed to SbColor4f which is in [0, 1]. The default alpha value for a QColor is 255, but you'll probably want to set it to zero before using it as an OpenGL clear color. */ @@ -1074,7 +1074,7 @@ QuarterWidget::contextMenuEnabled() const */ /*! - Controls the display of the contextmenu + Controls the display of the context menu \param[in] yes Context menu on? */ @@ -1103,7 +1103,7 @@ QuarterWidget::addStateMachine(SoScXMLStateMachine * statemachine) } /*! - Convenience method that removes a state machine to the current + Convenience method that removes a state machine from the current SoEventManager. \sa addStateMachine @@ -1166,8 +1166,8 @@ QuarterWidget::renderModeActions() const that defines the possible states for the Coin navigation system Supports: - \li \b coin for internal coinresources - \li \b file for filesystem path to resources + \li \b coin for internal Coin resources + \li \b file for file system path to resources \sa scxml */ @@ -1180,10 +1180,25 @@ QuarterWidget::resetNavigationModeFile() { this->setNavigationModeFile(QUrl()); } +/** + * Sets up the default cursors for the widget. + */ +void QuarterWidget::setupDefaultCursors() +{ + this->setStateCursor("interact", Qt::ArrowCursor); + this->setStateCursor("idle", Qt::OpenHandCursor); + this->setStateCursor("rotate", Qt::ClosedHandCursor); + this->setStateCursor("pan", Qt::SizeAllCursor); + this->setStateCursor("zoom", Qt::SizeVerCursor); + this->setStateCursor("dolly", Qt::SizeVerCursor); + this->setStateCursor("seek", Qt::CrossCursor); + this->setStateCursor("spin", Qt::OpenHandCursor); +} + /*! Sets a navigation mode file. Supports the schemes "coin" and "file" - \param[in] url Url to the resource + \param[in] url URL to the resource */ void QuarterWidget::setNavigationModeFile(const QUrl & url) @@ -1250,8 +1265,8 @@ QuarterWidget::setNavigationModeFile(const QUrl & url) PRIVATE(this)->currentStateMachine = newsm; } else { - if (stateMachine) - delete stateMachine; + delete stateMachine; + stateMachine = nullptr; qDebug()<setStateCursor("interact", Qt::ArrowCursor); - this->setStateCursor("idle", Qt::OpenHandCursor); - this->setStateCursor("rotate", Qt::ClosedHandCursor); - this->setStateCursor("pan", Qt::SizeAllCursor); - this->setStateCursor("zoom", Qt::SizeVerCursor); - this->setStateCursor("dolly", Qt::SizeVerCursor); - this->setStateCursor("seek", Qt::CrossCursor); - this->setStateCursor("spin", Qt::OpenHandCursor); + setupDefaultCursors(); } } /*! - \retval The current navigationModeFile + \retval The current navigation mode file */ const QUrl & QuarterWidget::navigationModeFile() const diff --git a/src/Gui/Quarter/QuarterWidget.h b/src/Gui/Quarter/QuarterWidget.h index fdce8b3ab7..81ecfe9a04 100644 --- a/src/Gui/Quarter/QuarterWidget.h +++ b/src/Gui/Quarter/QuarterWidget.h @@ -131,6 +131,7 @@ public: void resetNavigationModeFile(); void setNavigationModeFile(const QUrl & url = QUrl(QString::fromLatin1(DEFAULT_NAVIGATIONFILE))); const QUrl & navigationModeFile() const; + void setupDefaultCursors(); void setContextMenuEnabled(bool yes); bool contextMenuEnabled() const; diff --git a/src/Gui/Quarter/QuarterWidgetP.cpp b/src/Gui/Quarter/QuarterWidgetP.cpp index 7771c4b79b..a469517566 100644 --- a/src/Gui/Quarter/QuarterWidgetP.cpp +++ b/src/Gui/Quarter/QuarterWidgetP.cpp @@ -106,9 +106,7 @@ QuarterWidgetP::~QuarterWidgetP() { QtGLWidget* glMaster = static_cast(this->master->viewport()); removeFromCacheContext(this->cachecontext, glMaster); - if (this->contextmenu) { - delete this->contextmenu; - } + delete this->contextmenu; } SoCamera * diff --git a/src/Gui/Quarter/SpaceNavigatorDevice.cpp b/src/Gui/Quarter/SpaceNavigatorDevice.cpp index 38c85f0390..2a636fc1bc 100644 --- a/src/Gui/Quarter/SpaceNavigatorDevice.cpp +++ b/src/Gui/Quarter/SpaceNavigatorDevice.cpp @@ -53,7 +53,7 @@ namespace SIM { namespace Coin3D { namespace Quarter { class SpaceNavigatorDeviceP { public: - SpaceNavigatorDeviceP(SpaceNavigatorDevice * master) { + explicit SpaceNavigatorDeviceP(SpaceNavigatorDevice * master) { this->master = master; this->hasdevice = false; this->windowid = 0; @@ -81,7 +81,8 @@ public: #define PRIVATE(obj) obj->pimpl using namespace SIM::Coin3D::Quarter; -SpaceNavigatorDevice::SpaceNavigatorDevice() +SpaceNavigatorDevice::SpaceNavigatorDevice(QuarterWidget* quarter) : + InputDevice(quarter) { PRIVATE(this) = new SpaceNavigatorDeviceP(this); @@ -97,23 +98,6 @@ SpaceNavigatorDevice::SpaceNavigatorDevice() #endif // HAVE_SPACENAV_LIB } -SpaceNavigatorDevice::SpaceNavigatorDevice(QuarterWidget *quarter) : - InputDevice(quarter) -{ - PRIVATE(this) = new SpaceNavigatorDeviceP(this); - -#ifdef HAVE_SPACENAV_LIB - PRIVATE(this)->hasdevice = - spnav_x11_open(QX11Info::display(), PRIVATE(this)->windowid) == -1 ? false : true; - - // FIXME: Use a debugmessage mechanism instead? (20101020 handegar) - if (!PRIVATE(this)->hasdevice) { - fprintf(stderr, "Quarter:: Could not hook up to Spacenav device.\n"); - } - -#endif // HAVE_SPACENAV_LIB -} - SpaceNavigatorDevice::~SpaceNavigatorDevice() { delete PRIVATE(this); diff --git a/src/Gui/Quarter/devices/InputDevice.h b/src/Gui/Quarter/devices/InputDevice.h index be46a1649a..76c9a1e0da 100644 --- a/src/Gui/Quarter/devices/InputDevice.h +++ b/src/Gui/Quarter/devices/InputDevice.h @@ -4,22 +4,22 @@ /**************************************************************************\ * Copyright (c) Kongsberg Oil & Gas Technologies AS * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -46,8 +46,7 @@ class QuarterWidget; class QUARTER_DLL_API InputDevice { public: - InputDevice(QuarterWidget * quarter); - InputDevice(); + explicit InputDevice(QuarterWidget* quarter); virtual ~InputDevice() {} /*! diff --git a/src/Gui/Quarter/devices/Keyboard.h b/src/Gui/Quarter/devices/Keyboard.h index d63cf30aa8..808965ffea 100644 --- a/src/Gui/Quarter/devices/Keyboard.h +++ b/src/Gui/Quarter/devices/Keyboard.h @@ -43,8 +43,7 @@ namespace SIM { namespace Coin3D { namespace Quarter { class QUARTER_DLL_API Keyboard : public InputDevice { public: - Keyboard(QuarterWidget* quarter); - Keyboard(); + explicit Keyboard(QuarterWidget* quarter); ~Keyboard() override; const SoEvent * translateEvent(QEvent * event) override; diff --git a/src/Gui/Quarter/devices/Mouse.h b/src/Gui/Quarter/devices/Mouse.h index 988a06ec8c..08e22f939e 100644 --- a/src/Gui/Quarter/devices/Mouse.h +++ b/src/Gui/Quarter/devices/Mouse.h @@ -43,8 +43,7 @@ namespace SIM { namespace Coin3D { namespace Quarter { class QUARTER_DLL_API Mouse : public InputDevice { public: - Mouse(QuarterWidget* quarter); - Mouse(); + explicit Mouse(QuarterWidget* quarter); ~Mouse() override; const SoEvent * translateEvent(QEvent * event) override; diff --git a/src/Gui/Quarter/devices/SpaceNavigatorDevice.h b/src/Gui/Quarter/devices/SpaceNavigatorDevice.h index f9e99fba61..aa16e2a93b 100644 --- a/src/Gui/Quarter/devices/SpaceNavigatorDevice.h +++ b/src/Gui/Quarter/devices/SpaceNavigatorDevice.h @@ -42,8 +42,7 @@ namespace SIM { namespace Coin3D { namespace Quarter { class QUARTER_DLL_API SpaceNavigatorDevice : public InputDevice { public: - SpaceNavigatorDevice(QuarterWidget* quarter); - SpaceNavigatorDevice(); + explicit SpaceNavigatorDevice(QuarterWidget* quarter); ~SpaceNavigatorDevice() override; const SoEvent * translateEvent(QEvent * event) override; diff --git a/src/Gui/Quarter/eventhandlers/DragDropHandler.h b/src/Gui/Quarter/eventhandlers/DragDropHandler.h index 5f194f6d27..e8f9bde73f 100644 --- a/src/Gui/Quarter/eventhandlers/DragDropHandler.h +++ b/src/Gui/Quarter/eventhandlers/DragDropHandler.h @@ -33,7 +33,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \**************************************************************************/ -#include +#include #include class QEvent; @@ -46,7 +46,7 @@ class QuarterWidget; class QUARTER_DLL_API DragDropHandler : public QObject { Q_OBJECT public: - DragDropHandler(QuarterWidget * parent); + explicit DragDropHandler(QuarterWidget * parent); ~DragDropHandler() override; protected: diff --git a/src/Gui/Quarter/eventhandlers/EventFilter.h b/src/Gui/Quarter/eventhandlers/EventFilter.h index 5fa746f6e9..0311051474 100644 --- a/src/Gui/Quarter/eventhandlers/EventFilter.h +++ b/src/Gui/Quarter/eventhandlers/EventFilter.h @@ -34,7 +34,7 @@ \**************************************************************************/ #include -#include +#include class QEvent; class QPoint; diff --git a/src/Gui/Quarter/eventhandlers/FocusHandler.h b/src/Gui/Quarter/eventhandlers/FocusHandler.h index 4c5200cc2c..a002b676ca 100644 --- a/src/Gui/Quarter/eventhandlers/FocusHandler.h +++ b/src/Gui/Quarter/eventhandlers/FocusHandler.h @@ -33,7 +33,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \**************************************************************************/ -#include +#include #include class QEvent; diff --git a/src/Gui/SoTouchEvents.cpp b/src/Gui/SoTouchEvents.cpp index b2a94bf025..628fb089c3 100644 --- a/src/Gui/SoTouchEvents.cpp +++ b/src/Gui/SoTouchEvents.cpp @@ -164,6 +164,7 @@ SbBool SoGestureSwipeEvent::isSoGestureSwipeEvent(const SoEvent *ev) const //----------------------------GesturesDevice------------------------------- GesturesDevice::GesturesDevice(QWidget* widget) + : InputDevice(nullptr) { if (SoGestureEvent::getClassTypeId().isBad()){ SoGestureEvent::initClass(); diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index debf170a5e..d7020b280a 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -262,7 +262,7 @@ public: class SpaceNavigatorDevice : public Quarter::InputDevice { public: - SpaceNavigatorDevice() = default; + SpaceNavigatorDevice() : InputDevice(nullptr) {} ~SpaceNavigatorDevice() override = default; const SoEvent* translateEvent(QEvent* event) override {