summaryrefslogtreecommitdiffstats
diff options
authorThiago Macieira <[email protected]>2025-10-23 08:27:25 -0700
committerThiago Macieira <[email protected]>2025-10-24 15:10:23 -0700
commit5ca1321684143647334cdd74abd312bdad89739b (patch)
tree342073c41bc9f52f176e2ed42834dc75d4205651
parent2e2040104931a06b0149c1caa58d57e469f1a0d0 (diff)
QSaveFile: merge the QString constructorsHEADdev
Now that we don't need to keep the !QT_NO_QOBJECT code. Change-Id: Iad40e29375680befca7cfffdec7085a7f641c76f Reviewed-by: MÃ¥rten Nordheim <[email protected]> Reviewed-by: BogDan Vatra <[email protected]>
-rw-r--r--src/corelib/compat/removed_api.cpp7
-rw-r--r--src/corelib/io/qsavefile.cpp10
-rw-r--r--src/corelib/io/qsavefile.h5
3 files changed, 10 insertions, 12 deletions
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
index f7587f1b446..6303a455491 100644
--- a/src/corelib/compat/removed_api.cpp
+++ b/src/corelib/compat/removed_api.cpp
@@ -1516,6 +1516,13 @@ void QReadWriteLock::unlock()
}
#endif // QT_CONFIG(thread)
+#include "qsavefile.h"
+
+QSaveFile::QSaveFile(const QString &name)
+ : QSaveFile(name, nullptr)
+{
+}
+
#include "qtimer.h"
void QTimer::singleShotImpl(int msec, Qt::TimerType timerType,
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index a5108710614..e6204ffc6ce 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -72,16 +72,6 @@ QSaveFilePrivate::~QSaveFilePrivate()
*/
/*!
- Constructs a new file object to represent the file with the given \a name.
-*/
-QSaveFile::QSaveFile(const QString &name)
- : QFileDevice(*new QSaveFilePrivate, nullptr)
-{
- Q_D(QSaveFile);
- d->fileName = name;
-}
-
-/*!
Constructs a new file object with the given \a parent.
You need to call setFileName() before open().
*/
diff --git a/src/corelib/io/qsavefile.h b/src/corelib/io/qsavefile.h
index cc35901f75c..1738969ffa1 100644
--- a/src/corelib/io/qsavefile.h
+++ b/src/corelib/io/qsavefile.h
@@ -27,10 +27,11 @@ class Q_CORE_EXPORT QSaveFile : public QFileDevice
Q_DECLARE_PRIVATE(QSaveFile)
public:
-
+#if QT_CORE_REMOVED_SINCE(6, 11)
explicit QSaveFile(const QString &name);
+#endif
explicit QSaveFile(QObject *parent = nullptr);
- explicit QSaveFile(const QString &name, QObject *parent);
+ explicit QSaveFile(const QString &name, QObject *parent = nullptr);
~QSaveFile();
QString fileName() const override;