summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-08-10 11:39:34 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-11 10:03:26 +0000
commita51df96b3850fc9541daa3e5be3d1b9036ac2ad7 (patch)
tree72449a8ea5e8f2d4e0e66159180e746cb1956191
parentcfaaad9d3144815e4993a52bd7cf7889744e501d (diff)
AssimpIOSystem: use std::unique_ptr instead of QScopedPointer
... because QScopedPointer::take() is deprecated. Task-number: QTBUG-105513 Change-Id: I494088950a3f6791a6512ecbf230cd1d85ad7395 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit a0ed019e4ccb7505d10fc5977bc4b52b677cc8f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/plugins/sceneparsers/assimp/assimphelpers.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/sceneparsers/assimp/assimphelpers.cpp b/src/plugins/sceneparsers/assimp/assimphelpers.cpp
index 77209a7a9..2f81e460c 100644
--- a/src/plugins/sceneparsers/assimp/assimphelpers.cpp
+++ b/src/plugins/sceneparsers/assimp/assimphelpers.cpp
@@ -45,6 +45,8 @@
#include <QtCore/QDir>
#include <QtCore/QDebug>
+#include <memory>
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
@@ -208,9 +210,9 @@ Assimp::IOStream *AssimpIOSystem::Open(const char *pFile, const char *pMode)
const QLatin1String cleanedMode = QLatin1String{pMode}.trimmed();
if (const QIODevice::OpenMode openMode = openModeFromText(cleanedMode.data())) {
- QScopedPointer<QFile> file(new QFile(fileName));
+ auto file = std::make_unique<QFile>(fileName);
if (file->open(openMode))
- return new AssimpIOStream(file.take());
+ return new AssimpIOStream(file.release());
}
return nullptr;
}