From ae804357d884835946b37ee1a980c54ff929618c Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 23 Apr 2015 14:10:54 -0700 Subject: [PATCH 01/14] Attempting to fix backspace issue in new UI --- interface/src/Application.cpp | 5 +++ libraries/render-utils/src/OffscreenUi.cpp | 44 +++++++++++++++++++--- libraries/render-utils/src/OffscreenUi.h | 1 + 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1df771f127..9ae54ac83e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1028,6 +1028,11 @@ bool Application::event(QEvent* event) { bool Application::eventFilter(QObject* object, QEvent* event) { if (event->type() == QEvent::ShortcutOverride) { + if (DependencyManager::get()->shouldSwallowShortcut(event)) { + event->accept(); + return true; + } + // Filter out captured keys before they're used for shortcut actions. if (_controllerScriptingInterface.isKeyCaptured(static_cast(event))) { event->accept(); diff --git a/libraries/render-utils/src/OffscreenUi.cpp b/libraries/render-utils/src/OffscreenUi.cpp index 969d3052cd..837affab59 100644 --- a/libraries/render-utils/src/OffscreenUi.cpp +++ b/libraries/render-utils/src/OffscreenUi.cpp @@ -89,7 +89,15 @@ void OffscreenUi::create(QOpenGLContext* shareContext) { // is needed too). connect(_renderControl, &QQuickRenderControl::renderRequested, this, &OffscreenUi::requestRender); connect(_renderControl, &QQuickRenderControl::sceneChanged, this, &OffscreenUi::requestUpdate); - _quickWindow->focusObject(); + +#ifdef DEBUG + connect(_quickWindow, &QQuickWindow::focusObjectChanged, [this]{ + qDebug() << "New focus item " << _quickWindow->focusObject(); + }); + connect(_quickWindow, &QQuickWindow::activeFocusItemChanged, [this] { + qDebug() << "New active focus item " << _quickWindow->activeFocusItem(); + }); +#endif _qmlComponent = new QQmlComponent(_qmlEngine); // Initialize the render control and our OpenGL resources. @@ -257,6 +265,24 @@ QPointF OffscreenUi::mapWindowToUi(const QPointF& sourcePosition, QObject* sourc return QPointF(offscreenPosition.x, offscreenPosition.y); } +// This hack allows the QML UI to work with keys that are also bound as +// shortcuts at the application level. However, it seems as though the +// bound actions are still getting triggered. At least for backspace. +// Not sure why. +// +// However, the problem may go away once we switch to the new menu system, +// so I think it's OK for the time being. +bool OffscreenUi::shouldSwallowShortcut(QEvent * event) { + Q_ASSERT(event->type() == QEvent::ShortcutOverride); + QObject * focusObject = _quickWindow->focusObject(); + if (focusObject != _quickWindow && focusObject != _rootItem) { + //qDebug() << "Swallowed shortcut " << static_cast(event)->key(); + event->accept(); + return true; + } + return false; +} + /////////////////////////////////////////////////////// // // Event handling customization @@ -268,11 +294,17 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) { return false; } + +#ifdef DEBUG // Don't intercept our own events, or we enter an infinite recursion - if (originalDestination == _quickWindow) { - return false; + QObject * recurseTest = originalDestination; + while (recurseTest) { + Q_ASSERT(recurseTest != _rootItem && recurseTest != _quickWindow); + recurseTest = recurseTest->parent(); } - +#endif + + switch (event->type()) { case QEvent::Resize: { QResizeEvent* resizeEvent = static_cast(event); @@ -280,12 +312,14 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) { if (widget) { this->resize(resizeEvent->size()); } - return false; + break; } case QEvent::KeyPress: case QEvent::KeyRelease: { event->ignore(); + //if (_quickWindow->activeFocusItem()) { + // _quickWindow->sendEvent(_quickWindow->activeFocusItem(), event); if (QCoreApplication::sendEvent(_quickWindow, event)) { return event->isAccepted(); } diff --git a/libraries/render-utils/src/OffscreenUi.h b/libraries/render-utils/src/OffscreenUi.h index d86f99554e..c64d0d833c 100644 --- a/libraries/render-utils/src/OffscreenUi.h +++ b/libraries/render-utils/src/OffscreenUi.h @@ -73,6 +73,7 @@ public: void resume(); bool isPaused() const; void setProxyWindow(QWindow* window); + bool shouldSwallowShortcut(QEvent* event); QPointF mapWindowToUi(const QPointF& sourcePosition, QObject* sourceObject); virtual bool eventFilter(QObject* originalDestination, QEvent* event); void setMouseTranslator(MouseTranslator mouseTranslator) { From 4127ec8019539a95868663748ff952c87938bd0a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 24 Apr 2015 09:42:59 -0700 Subject: [PATCH 02/14] Add checkboxes.html --- examples/checkboxes.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 examples/checkboxes.html diff --git a/examples/checkboxes.html b/examples/checkboxes.html new file mode 100644 index 0000000000..7c919bfd2d --- /dev/null +++ b/examples/checkboxes.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + +
Checkbox 2
Checkbox 3
Checkbox 4
+ +
+ +
From e2b60d35f040d84dd7c5bb980c73ede0f146ffb8 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 24 Apr 2015 18:50:03 +0200 Subject: [PATCH 03/14] Generate touchEndEvent if last event was more than 50 ms ago --- examples/look.js | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/examples/look.js b/examples/look.js index 6bba57e3ad..773a4ff73b 100644 --- a/examples/look.js +++ b/examples/look.js @@ -31,7 +31,9 @@ var yawFromTouch = 0; var pitchFromTouch = 0; // Touch Data +var TIME_BEFORE_GENERATED_END_TOUCH_EVENT = 50; // ms var startedTouching = false; +var lastTouchEvent = 0; var lastMouseX = 0; var lastMouseY = 0; var yawFromMouse = 0; @@ -80,11 +82,17 @@ function touchBeginEvent(event) { yawFromTouch = 0; pitchFromTouch = 0; startedTouching = true; + var d = new Date(); + lastTouchEvent = d.getTime(); } function touchEndEvent(event) { if (wantDebugging) { - print("touchEndEvent event.x,y=" + event.x + ", " + event.y); + if (event) { + print("touchEndEvent event.x,y=" + event.x + ", " + event.y); + } else { + print("touchEndEvent generated"); + } } startedTouching = false; } @@ -96,23 +104,31 @@ function touchUpdateEvent(event) { } if (!startedTouching) { - // handle Qt 5.4.x bug where we get touch update without a touch begin event - startedTouching = true; - lastTouchX = event.x; - lastTouchY = event.y; + // handle Qt 5.4.x bug where we get touch update without a touch begin event + touchBeginEvent(event); + return; } yawFromTouch += ((event.x - lastTouchX) * TOUCH_YAW_SCALE * FIXED_TOUCH_TIMESTEP); pitchFromTouch += ((event.y - lastTouchY) * TOUCH_PITCH_SCALE * FIXED_TOUCH_TIMESTEP); lastTouchX = event.x; lastTouchY = event.y; -} + var d = new Date(); + lastTouchEvent = d.getTime();} function update(deltaTime) { if (wantDebugging) { print("update()..."); } + + if(startedTouching) { + var d = new Date(); + var sinceLastTouch = d.getTime() - lastTouchEvent; + if (sinceLastTouch > TIME_BEFORE_GENERATED_END_TOUCH_EVENT) { + touchEndEvent(); + } + } if (yawFromTouch != 0 || yawFromMouse != 0) { var newOrientation = Quat.multiply(MyAvatar.orientation, Quat.fromPitchYawRollRadians(0, yawFromTouch + yawFromMouse, 0)); From fb5a0c8b010acc7d587f31519956743ecc996abf Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 24 Apr 2015 18:50:45 +0200 Subject: [PATCH 04/14] Only send touchUpdateEvent if it is one ie. not for touchBeginEvent --- interface/src/Application.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1df771f127..285bd11952 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1492,9 +1492,11 @@ void Application::mouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) { } void Application::touchUpdateEvent(QTouchEvent* event) { - TouchEvent thisEvent(*event, _lastTouchEvent); - _controllerScriptingInterface.emitTouchUpdateEvent(thisEvent); // send events to any registered scripts - _lastTouchEvent = thisEvent; + if (event->type() == QEvent::TouchUpdate) { + TouchEvent thisEvent(*event, _lastTouchEvent); + _controllerScriptingInterface.emitTouchUpdateEvent(thisEvent); // send events to any registered scripts + _lastTouchEvent = thisEvent; + } // if one of our scripts have asked to capture this event, then stop processing it if (_controllerScriptingInterface.isTouchCaptured()) { From 53577107de006332703a562ff77eea6268ddccaa Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 24 Apr 2015 19:06:46 +0200 Subject: [PATCH 05/14] Formatting --- examples/look.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/look.js b/examples/look.js index 773a4ff73b..7adcd054c2 100644 --- a/examples/look.js +++ b/examples/look.js @@ -114,7 +114,8 @@ function touchUpdateEvent(event) { lastTouchX = event.x; lastTouchY = event.y; var d = new Date(); - lastTouchEvent = d.getTime();} + lastTouchEvent = d.getTime(); +} function update(deltaTime) { @@ -122,7 +123,7 @@ function update(deltaTime) { print("update()..."); } - if(startedTouching) { + if (startedTouching) { var d = new Date(); var sinceLastTouch = d.getTime() - lastTouchEvent; if (sinceLastTouch > TIME_BEFORE_GENERATED_END_TOUCH_EVENT) { From 37928dcd6d83276b1b70d6cfbd90c86df06155eb Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 24 Apr 2015 11:30:18 -0700 Subject: [PATCH 06/14] fix default avatars on first run --- interface/src/avatar/MyAvatar.cpp | 33 +++++++++++++++++++----------- libraries/avatars/src/AvatarData.h | 4 ++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 5adc818258..17f361e6a8 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -683,12 +683,12 @@ void MyAvatar::loadData() { _useFullAvatar = settings.value("useFullAvatar").toBool(); _headURLFromPreferences = settings.value("faceModelURL", DEFAULT_HEAD_MODEL_URL).toUrl(); - _fullAvatarURLFromPreferences = settings.value("fullAvatarURL").toUrl(); - _skeletonURLFromPreferences = settings.value("skeletonModelURL").toUrl(); - _headModelName = settings.value("headModelName").toString(); - _bodyModelName = settings.value("bodyModelName").toString(); - _fullAvatarModelName = settings.value("fullAvatarModelName").toString();; - + _fullAvatarURLFromPreferences = settings.value("fullAvatarURL", DEFAULT_FULL_AVATAR_MODEL_URL).toUrl(); + _skeletonURLFromPreferences = settings.value("skeletonModelURL", DEFAULT_BODY_MODEL_URL).toUrl(); + _headModelName = settings.value("headModelName", DEFAULT_HEAD_MODEL_NAME).toString(); + _bodyModelName = settings.value("bodyModelName", DEFAULT_BODY_MODEL_NAME).toString(); + _fullAvatarModelName = settings.value("fullAvatarModelName", DEFAULT_FULL_AVATAR_MODEL_NAME).toString(); + if (isOldSettings) { bool assumeFullAvatar = _headURLFromPreferences.isEmpty(); _useFullAvatar = assumeFullAvatar; @@ -706,13 +706,22 @@ void MyAvatar::loadData() { } else { _fullAvatarURLFromPreferences = DEFAULT_FULL_AVATAR_MODEL_URL; - _skeletonURLFromPreferences = settings.value("skeletonModelURL").toUrl(); + _skeletonURLFromPreferences = settings.value("skeletonModelURL", DEFAULT_BODY_MODEL_URL).toUrl(); - QVariantHash headFST = FSTReader::downloadMapping(_headURLFromPreferences.toString()); - QVariantHash bodyFST = FSTReader::downloadMapping(_skeletonURLFromPreferences.toString()); - - _headModelName = headFST["name"].toString(); - _bodyModelName = bodyFST["name"].toString(); + if (_skeletonURLFromPreferences == DEFAULT_BODY_MODEL_URL) { + _bodyModelName = DEFAULT_BODY_MODEL_NAME; + } else { + QVariantHash bodyFST = FSTReader::downloadMapping(_skeletonURLFromPreferences.toString()); + _bodyModelName = bodyFST["name"].toString(); + } + + if (_headURLFromPreferences == DEFAULT_HEAD_MODEL_URL) { + _headModelName = DEFAULT_HEAD_MODEL_NAME; + } else { + QVariantHash headFST = FSTReader::downloadMapping(_headURLFromPreferences.toString()); + _headModelName = headFST["name"].toString(); + } + _fullAvatarModelName = "Default"; } } diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 410b945f1d..58e9c42c3c 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -105,6 +105,10 @@ const QUrl DEFAULT_HEAD_MODEL_URL = QUrl("http://public.highfidelity.io/models/h const QUrl DEFAULT_BODY_MODEL_URL = QUrl("http://public.highfidelity.io/models/skeletons/defaultAvatar_body.fst"); const QUrl DEFAULT_FULL_AVATAR_MODEL_URL = QUrl("http://public.highfidelity.io/marketplace/contents/029db3d4-da2c-4cb2-9c08-b9612ba576f5/02949063e7c4aed42ad9d1a58461f56d.fst"); +const QString DEFAULT_HEAD_MODEL_NAME = QString("Robot"); +const QString DEFAULT_BODY_MODEL_NAME = QString("Robot"); +const QString DEFAULT_FULL_AVATAR_MODEL_NAME = QString("Default"); + // Where one's own Avatar begins in the world (will be overwritten if avatar data file is found). // This is the start location in the Sandbox (xyz: 6270, 211, 6000). From df591f9ad74aac9de9b1ebe6d237f8fe2b988fdf Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 24 Apr 2015 11:49:33 -0700 Subject: [PATCH 07/14] Set style of webview --- interface/src/scripting/WebWindowClass.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/src/scripting/WebWindowClass.cpp b/interface/src/scripting/WebWindowClass.cpp index 1c9fced619..07188e62b6 100644 --- a/interface/src/scripting/WebWindowClass.cpp +++ b/interface/src/scripting/WebWindowClass.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "Application.h" #include "ui/DataWebPage.h" @@ -46,6 +47,7 @@ WebWindowClass::WebWindowClass(const QString& title, const QString& url, int wid dockWidget->setFeatures(QDockWidget::DockWidgetMovable); _webView = new QWebView(dockWidget); + _webView->setStyle(QStyleFactory::create("fusion")); addEventBridgeToWindowObject(); dockWidget->setWidget(_webView); @@ -64,6 +66,7 @@ WebWindowClass::WebWindowClass(const QString& title, const QString& url, int wid dialogWidget->setLayout(layout); _webView = new QWebView(dialogWidget); + _webView->setStyle(QStyleFactory::create("fusion")); layout->addWidget(_webView); From a141ebbf934373ffcf245d2f2e70fe002b9eff47 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 24 Apr 2015 12:49:41 -0700 Subject: [PATCH 08/14] Log Faceshift FPS after a reset --- interface/src/devices/Faceshift.cpp | 28 +++++++++++++++++++++++++++- interface/src/devices/Faceshift.h | 7 ++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index 4768571bd2..bef97fc38a 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -10,6 +10,7 @@ // #include +#include #include #include @@ -30,9 +31,14 @@ const QString DEFAULT_FACESHIFT_HOSTNAME = "localhost"; const quint16 FACESHIFT_PORT = 33433; const float DEFAULT_FACESHIFT_EYE_DEFLECTION = 0.25f; +const int FPS_TIMER_DELAY = 2000; // ms +const int FPS_TIMER_DURATION = 2000; // ms + Faceshift::Faceshift() : _eyeDeflection("faceshiftEyeDeflection", DEFAULT_FACESHIFT_EYE_DEFLECTION), - _hostname("faceshiftHostname", DEFAULT_FACESHIFT_HOSTNAME) + _hostname("faceshiftHostname", DEFAULT_FACESHIFT_HOSTNAME), + _isCalculatingFPS(false), + _frameCount(0) { #ifdef HAVE_FACESHIFT connect(&_tcpSocket, SIGNAL(connected()), SLOT(noteConnected())); @@ -81,6 +87,12 @@ void Faceshift::reset() { string message; fsBinaryStream::encode_message(message, fsMsgCalibrateNeutral()); send(message); + + // Log camera FPS after a reset + if (!_isCalculatingFPS) { + QTimer::singleShot(FPS_TIMER_DELAY, this, SLOT(startFPSTimer())); + _isCalculatingFPS = true; + } } _longTermAverageInitialized = false; } @@ -283,6 +295,10 @@ void Faceshift::receive(const QByteArray& buffer) { } } #endif + // Count frames if timing + if (_isCalculatingFPS) { + _frameCount++; + } } void Faceshift::setEyeDeflection(float faceshiftEyeDeflection) { @@ -292,3 +308,13 @@ void Faceshift::setEyeDeflection(float faceshiftEyeDeflection) { void Faceshift::setHostname(const QString& hostname) { _hostname.set(hostname); } + +void Faceshift::startFPSTimer() { + _frameCount = 0; + QTimer::singleShot(FPS_TIMER_DURATION, this, SLOT(finishFPSTimer())); +} + +void Faceshift::finishFPSTimer() { + qCDebug(interfaceapp) << "Faceshift: FPS =" << (float)_frameCount / ((float)FPS_TIMER_DURATION / 1000.0f); + _isCalculatingFPS = false; +} diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index f224448b8e..18d88e6fe9 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -95,7 +95,9 @@ private slots: void noteError(QAbstractSocket::SocketError error); void readPendingDatagrams(); void readFromSocket(); - + void startFPSTimer(); + void finishFPSTimer(); + private: Faceshift(); virtual ~Faceshift() {} @@ -152,6 +154,9 @@ private: int _mouthSmileRightIndex = 29; int _jawOpenIndex = 21; + + bool _isCalculatingFPS; + int _frameCount; }; #endif // hifi_Faceshift_h From a4f03f8b1cdf74fe7223d3c378d07a68f628a0b6 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 24 Apr 2015 22:16:21 +0200 Subject: [PATCH 09/14] Zones use avatar position not view frustum --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index dde13552f3..c744ec0165 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -643,7 +643,7 @@ void EntityTreeRenderer::renderElement(OctreeElement* element, RenderArgs* args) // NOTE: Zone Entities are a special case we handle here... Zones don't render // like other entity types. So we will skip the normal rendering tests if (entityItem->getType() == EntityTypes::Zone) { - if (entityItem->contains(args->_viewFrustum->getPosition())) { + if (entityItem->contains(_viewState->getAvatarPosition())) { float entityVolumeEstimate = entityItem->getVolumeEstimate(); if (entityVolumeEstimate < _bestZoneVolume) { _bestZoneVolume = entityVolumeEstimate; From 0a9398808f2e140f77e4d631fecf78c517e9aa42 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 24 Apr 2015 13:25:30 -0700 Subject: [PATCH 10/14] CR comments --- libraries/render-utils/src/OffscreenUi.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/render-utils/src/OffscreenUi.cpp b/libraries/render-utils/src/OffscreenUi.cpp index 837affab59..ac78317703 100644 --- a/libraries/render-utils/src/OffscreenUi.cpp +++ b/libraries/render-utils/src/OffscreenUi.cpp @@ -318,8 +318,6 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) { case QEvent::KeyPress: case QEvent::KeyRelease: { event->ignore(); - //if (_quickWindow->activeFocusItem()) { - // _quickWindow->sendEvent(_quickWindow->activeFocusItem(), event); if (QCoreApplication::sendEvent(_quickWindow, event)) { return event->isAccepted(); } From 6087a3e8a93b4e990c611711e28112a8b3e8c05c Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 24 Apr 2015 13:40:02 -0700 Subject: [PATCH 11/14] Revert "Add checkboxes.html" This reverts commit 4127ec8019539a95868663748ff952c87938bd0a. --- examples/checkboxes.html | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 examples/checkboxes.html diff --git a/examples/checkboxes.html b/examples/checkboxes.html deleted file mode 100644 index 7c919bfd2d..0000000000 --- a/examples/checkboxes.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - -
Checkbox 2
Checkbox 3
Checkbox 4
- -
- -
From 547b0e5ee64ffd1f850cb71a70c97414b91e35c7 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 24 Apr 2015 13:42:03 -0700 Subject: [PATCH 12/14] Update style of webview to only be set when 'fusion' exists --- interface/src/scripting/WebWindowClass.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/src/scripting/WebWindowClass.cpp b/interface/src/scripting/WebWindowClass.cpp index 07188e62b6..be36fe1989 100644 --- a/interface/src/scripting/WebWindowClass.cpp +++ b/interface/src/scripting/WebWindowClass.cpp @@ -47,7 +47,6 @@ WebWindowClass::WebWindowClass(const QString& title, const QString& url, int wid dockWidget->setFeatures(QDockWidget::DockWidgetMovable); _webView = new QWebView(dockWidget); - _webView->setStyle(QStyleFactory::create("fusion")); addEventBridgeToWindowObject(); dockWidget->setWidget(_webView); @@ -66,7 +65,6 @@ WebWindowClass::WebWindowClass(const QString& title, const QString& url, int wid dialogWidget->setLayout(layout); _webView = new QWebView(dialogWidget); - _webView->setStyle(QStyleFactory::create("fusion")); layout->addWidget(_webView); @@ -75,6 +73,11 @@ WebWindowClass::WebWindowClass(const QString& title, const QString& url, int wid _windowWidget = dialogWidget; } + auto style = QStyleFactory::create("fusion"); + if (style) { + _webView->setStyle(style); + } + _webView->setPage(new DataWebPage()); _webView->setUrl(url); From e33f3c9d00319836b8d444432435a033ba363dd4 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 24 Apr 2015 13:42:56 -0700 Subject: [PATCH 13/14] Remove unnecessary #include --- interface/src/devices/Faceshift.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index bef97fc38a..a2c1cd693a 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -10,7 +10,6 @@ // #include -#include #include #include From ba507cef98aa1a34a0d47235906d6967ee8e3c08 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Sat, 25 Apr 2015 11:01:02 +0200 Subject: [PATCH 14/14] Fix a few warnings --- interface/src/Application.cpp | 1 - interface/src/ui/ApplicationOverlay.cpp | 1 - libraries/entities/src/EntityItem.cpp | 1 - libraries/gpu/src/gpu/GLBackendTexture.cpp | 6 ++++-- libraries/physics/src/DynamicCharacterController.cpp | 2 -- libraries/render-utils/src/Model.cpp | 4 ++-- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b4d155319d..95700f3257 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1058,7 +1058,6 @@ void Application::keyPressEvent(QKeyEvent* event) { bool isShifted = event->modifiers().testFlag(Qt::ShiftModifier); bool isMeta = event->modifiers().testFlag(Qt::ControlModifier); bool isOption = event->modifiers().testFlag(Qt::AltModifier); - bool isKeypad = event->modifiers().testFlag(Qt::KeypadModifier); switch (event->key()) { break; case Qt::Key_L: diff --git a/interface/src/ui/ApplicationOverlay.cpp b/interface/src/ui/ApplicationOverlay.cpp index 2a8f01aafc..bf93a3e7d2 100644 --- a/interface/src/ui/ApplicationOverlay.cpp +++ b/interface/src/ui/ApplicationOverlay.cpp @@ -257,7 +257,6 @@ void ApplicationOverlay::displayOverlayTexture() { if (_alpha == 0.0f) { return; } - auto glCanvas = Application::getInstance()->getGLWidget(); glMatrixMode(GL_PROJECTION); glPushMatrix(); { glLoadIdentity(); diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index f968244ab3..65d4849b0e 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -1080,7 +1080,6 @@ const float MIN_ALIGNMENT_DOT = 0.999999f; const float MIN_VELOCITY_DELTA = 0.01f; const float MIN_DAMPING_DELTA = 0.001f; const float MIN_GRAVITY_DELTA = 0.001f; -const float MIN_ACCELERATION_DELTA = 0.001f; const float MIN_SPIN_DELTA = 0.0003f; void EntityItem::updatePositionInDomainUnits(const glm::vec3& value) { diff --git a/libraries/gpu/src/gpu/GLBackendTexture.cpp b/libraries/gpu/src/gpu/GLBackendTexture.cpp index b8f9ab0bf1..1c41860f49 100755 --- a/libraries/gpu/src/gpu/GLBackendTexture.cpp +++ b/libraries/gpu/src/gpu/GLBackendTexture.cpp @@ -16,8 +16,8 @@ GLBackend::GLTexture::GLTexture() : _storageStamp(0), _contentStamp(0), _texture(0), - _size(0), - _target(GL_TEXTURE_2D) + _target(GL_TEXTURE_2D), + _size(0) {} GLBackend::GLTexture::~GLTexture() { @@ -176,6 +176,8 @@ public: texel.internalFormat = GL_DEPTH_COMPONENT24; break; } + case gpu::NUM_TYPES: + Q_UNREACHABLE(); } break; default: diff --git a/libraries/physics/src/DynamicCharacterController.cpp b/libraries/physics/src/DynamicCharacterController.cpp index 46ff2e524e..3557511fab 100644 --- a/libraries/physics/src/DynamicCharacterController.cpp +++ b/libraries/physics/src/DynamicCharacterController.cpp @@ -8,11 +8,9 @@ const btVector3 LOCAL_UP_AXIS(0.0f, 1.0f, 0.0f); const float DEFAULT_GRAVITY = -5.0f; -const float TERMINAL_VELOCITY = 55.0f; const float JUMP_SPEED = 3.5f; const float MAX_FALL_HEIGHT = 20.0f; -const float MIN_HOVER_HEIGHT = 3.0f; const uint32_t PENDING_FLAG_ADD_TO_SIMULATION = 1U << 0; const uint32_t PENDING_FLAG_REMOVE_FROM_SIMULATION = 1U << 1; diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 4bc69f1bea..fe82af6b3c 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -111,7 +111,7 @@ void Model::RenderPipelineLib::addRenderPipeline(Model::RenderKey key, slotBindings.insert(gpu::Shader::Binding(std::string("emissiveMap"), 3)); gpu::ShaderPointer program = gpu::ShaderPointer(gpu::Shader::createProgram(vertexShader, pixelShader)); - bool makeResult = gpu::Shader::makeProgram(*program, slotBindings); + gpu::Shader::makeProgram(*program, slotBindings); auto locations = std::shared_ptr(new Locations()); @@ -139,7 +139,7 @@ void Model::RenderPipelineLib::addRenderPipeline(Model::RenderKey key, // Good to go add the brand new pipeline auto pipeline = gpu::PipelinePointer(gpu::Pipeline::create(program, state)); - auto it = insert(value_type(key.getRaw(), RenderPipeline(pipeline, locations))); + insert(value_type(key.getRaw(), RenderPipeline(pipeline, locations))); // If not a shadow pass, create the mirror version from the same state, just change the FrontFace if (!key.isShadow()) {