Merge pull request #7016 from jherico/qml

QML Fixes
This commit is contained in:
Brad Hefta-Gaub 2016-02-02 14:08:45 -08:00
commit a025fab5c8
2 changed files with 14 additions and 18 deletions

View file

@ -1362,6 +1362,9 @@ void Application::paintGL() {
renderArgs._renderMode = RenderArgs::MIRROR_RENDER_MODE;
renderArgs._blitFramebuffer = DependencyManager::get<FramebufferCache>()->getSelfieFramebuffer();
auto inputs = AvatarInputs::getInstance();
_mirrorViewRect.moveTo(inputs->x(), inputs->y());
renderRearViewMirror(&renderArgs, _mirrorViewRect);
renderArgs._blitFramebuffer.reset();

View file

@ -220,18 +220,7 @@ QmlWindowClass::QmlWindowClass(QObject* qmlWindow)
}
QmlWindowClass::~QmlWindowClass() {
if (_qmlWindow) {
if (_toolWindow) {
auto offscreenUi = DependencyManager::get<OffscreenUi>();
auto toolWindow = offscreenUi->getToolWindow();
auto invokeResult = QMetaObject::invokeMethod(toolWindow, "removeTabForUrl", Qt::QueuedConnection,
Q_ARG(QVariant, _source));
Q_ASSERT(invokeResult);
} else {
_qmlWindow->deleteLater();
}
_qmlWindow = nullptr;
}
close();
}
void QmlWindowClass::registerObject(const QString& name, QObject* object) {
@ -331,14 +320,18 @@ void QmlWindowClass::setTitle(const QString& title) {
}
void QmlWindowClass::close() {
DependencyManager::get<OffscreenUi>()->executeOnUiThread([this] {
if (_qmlWindow) {
_qmlWindow->setProperty("destroyOnInvisible", true);
_qmlWindow->setProperty("visible", false);
if (_qmlWindow) {
if (_toolWindow) {
auto offscreenUi = DependencyManager::get<OffscreenUi>();
auto toolWindow = offscreenUi->getToolWindow();
auto invokeResult = QMetaObject::invokeMethod(toolWindow, "removeTabForUrl", Qt::QueuedConnection,
Q_ARG(QVariant, _source));
Q_ASSERT(invokeResult);
} else {
_qmlWindow->deleteLater();
_qmlWindow = nullptr;
}
});
_qmlWindow = nullptr;
}
}
void QmlWindowClass::hasClosed() {