Merge pull request #10032 from hyperlogic/bug-fix/null-tablet-proxy

Mark the system TabletProxy object as Cpp ownership.
This commit is contained in:
Seth Alves 2017-03-28 10:08:05 -07:00 committed by GitHub
commit 39ec53d69a

View file

@ -17,6 +17,7 @@
#include <QtGui/QOpenGLContext>
#include <QtQuick/QQuickItem>
#include <QtQml/QQmlContext>
#include <QtQml/QQmlEngine>
#include <AbstractViewStateInterface.h>
#include <gpu/Batch.h>
@ -197,6 +198,10 @@ void Web3DOverlay::loadSourceURL() {
_webSurface->getRootContext()->setContextProperty("pathToFonts", "../../");
tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface->getRootItem(), _webSurface.data());
// mark the TabletProxy object as cpp ownership.
QObject* tablet = tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system");
_webSurface->getRootContext()->engine()->setObjectOwnership(tablet, QQmlEngine::CppOwnership);
// Override min fps for tablet UI, for silky smooth scrolling
setMaxFPS(90);
}