--- a/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp +++ b/src/plugins/qmltooling/qmldbg_preview/qqmlpreviewhandler.cpp @@ -115,7 +115,7 @@ bool QQmlPreviewHandler::eventFilter(QObject *obj, QEvent *event) qobject_cast(obj) == m_currentWindow) { // we always start with factor 1 so calculate and save the origin as it would be not scaled m_lastPosition.setPosition(m_currentWindow->framePosition() * - QHighDpiScaling::factor(m_currentWindow)); + QHighDpiScaling::factor(m_currentWindow.data())); } return QObject::eventFilter(obj, event); @@ -214,7 +214,7 @@ void QQmlPreviewHandler::zoom(qreal newFactor) // On single-window devices we allow any scale factor as the window will adapt to the screen. if (m_supportsMultipleWindows) { const QSize newAvailableScreenSize = QQmlPreviewPosition::currentScreenSize(m_currentWindow) - * QHighDpiScaling::factor(m_currentWindow) / newFactor; + * QHighDpiScaling::factor(m_currentWindow.data()) / newFactor; if (m_currentWindow->size().width() > newAvailableScreenSize.width()) { errorMessage = QString::fromLatin1( "Zooming with factor: " @@ -229,7 +229,7 @@ void QQmlPreviewHandler::zoom(qreal newFactor) if (errorMessage.isEmpty()) { const QPoint newToOriginMappedPosition = m_currentWindow->position() * - QHighDpiScaling::factor(m_currentWindow) / newFactor; + QHighDpiScaling::factor(m_currentWindow.data()) / newFactor; m_currentWindow->destroy(); QHighDpiScaling::setScreenFactor(m_currentWindow->screen(), newFactor); if (resetZoom)