summaryrefslogtreecommitdiffstats
path: root/src/pdfquick/qquickpdfdocument.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-03-28 12:31:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2022-04-12 19:06:19 +0200
commit217958ac3df79f668f3fa943e76b1dbf09981457 (patch)
tree5370df86508b7edea1c40353458ea43ed96ef53a /src/pdfquick/qquickpdfdocument.cpp
parent034f5b6bb740eb11db21a974330b59bd049a5b16 (diff)
PdfQuick: deal with loading a different document
When loading a new document, clear the navigation stack, reset the view to the upper-left corner, and clear the special device in PdfPageImage. Task-number: QTBUG-102294 Change-Id: I275b46f8958d4e8abe3814c1f358df5969c36d4d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/pdfquick/qquickpdfdocument.cpp')
-rw-r--r--src/pdfquick/qquickpdfdocument.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index f7c6df75f..cda72b2c8 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2020 The Qt Company Ltd.
+** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
@@ -104,6 +104,8 @@ void QQuickPdfDocument::setSource(QUrl source)
m_source = source;
m_maxPageWidthHeight = QSizeF();
+ m_carrierFile->deleteLater();
+ m_carrierFile = nullptr;
emit sourceChanged();
const QQmlContext *context = qmlContext(this);
m_resolvedSource = context ? context->resolvedUrl(source) : source;