diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-18 09:01:08 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-02-20 16:22:50 +0100 |
commit | 29b18a017968cbc79dfcd21ea1622de823dc1596 (patch) | |
tree | 88a331457654d73142a3081848c47042e6bcecaa /src/corelib/io/qsettings_p.h | |
parent | d49f5752a560d7c8fec99c57bbfb192a9be1b296 (diff) |
QSettings: overload value() instead of using a default argument
... of non-trivial type, which needs to be constructed every time the
function is called, no matter whether the user supplies one or not.
Effects on Linux AMD64 O2 C++20 tst_qsettings builds, as an example
heavy-duty QSettings::value() user:
GCC 11.2 libstdc++ (TEXT -= 4.6%):
text data bss dec hex filename
662317 10952 2824 676093 a50fd tst_qsettings-00-baseline
631849 10960 2824 645633 9da01 tst_qsettings-01-qvariant
Clang 10.0.0 libc++ (TEXT -= 2.8%)
text data bss dec hex filename
808448 10616 2832 821896 c8a88 tst_qsettings-00-baseline
785890 10624 2832 799346 c3272 tst_qsettings-01-qvariant
Pick-to: 6.3
Task-number: QTBUG-98117
Change-Id: I7366f063e3ec34c040fd35ffd274e8ed5a722132
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/io/qsettings_p.h')
-rw-r--r-- | src/corelib/io/qsettings_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index ddcbe0f76c..4849975f2a 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -208,6 +208,7 @@ public: virtual bool isWritable() const = 0; virtual QString fileName() const = 0; + QVariant value(const QString &key, const QVariant *defaultValue) const; QString actualKey(const QString &key) const; void beginGroupOrArray(const QSettingsGroup &group); void setStatus(QSettings::Status status) const; |