summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r--src/corelib/tools/qstring.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index ec959b50a0..a110c129de 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -821,7 +821,9 @@ private:
friend inline bool operator> (QChar, QLatin1String) Q_DECL_NOTHROW;
void reallocData(uint alloc, bool grow = false);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void expand(int i);
+#endif
QString multiArg(int numArgs, const QString **args) const;
static int compare_helper(const QChar *data1, int length1,
const QChar *data2, int length2,
@@ -1008,7 +1010,7 @@ public:
inline operator QChar() const
{ return i < s.d->size ? s.d->data()[i] : 0; }
inline QCharRef &operator=(QChar c)
- { if (i >= s.d->size) s.expand(i); else s.detach();
+ { if (i >= s.d->size) s.resize(i + 1, QLatin1Char(' ')); else s.detach();
s.d->data()[i] = c.unicode(); return *this; }
// An operator= for each QChar cast constructors