summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-06 14:52:45 +0200
committerLars Knoll <lars.knoll@qt.io>2020-04-16 23:14:57 +0200
commit83f5c3c26a59849197bd8d3a661afc87893866ba (patch)
tree9dbd6b25e0397828f5a9f123fd67ffc8fc827dd1
parentea7cc7f6f95030c38d86c4430ac8ee4386099d6b (diff)
Remove QString::from/toAscii()
These methods have been deprecated since 5.0 Change-Id: I3ceed57a364ea59a63ccc51452ab3b4da7140ce4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/corelib/text/qstring.cpp51
-rw-r--r--src/corelib/text/qstring.h13
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp29
3 files changed, 0 insertions, 93 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 53e3afab3f..8e7e2e5dce 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -5170,19 +5170,6 @@ QByteArray QString::toLatin1_helper_inplace(QString &s)
\sa fromLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
*/
-/*!
- \fn QByteArray QString::toAscii() const
- \deprecated
- Returns an 8-bit representation of the string as a QByteArray.
-
- This function does the same as toLatin1().
-
- Note that, despite the name, this function does not necessarily return an US-ASCII
- (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.
-
- \sa fromAscii(), toLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
-*/
-
static QByteArray qt_convert_to_local_8bit(QStringView string);
/*!
@@ -5412,29 +5399,6 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
return fromLatin1(str, size);
}
-/*! \fn QString QString::fromAscii(const char *, int size);
- \deprecated
-
- Returns a QString initialized with the first \a size characters
- from the string \a str.
-
- If \a size is -1 (default), it is taken to be strlen(\a
- str).
-
- This function does the same as fromLatin1().
-
- \sa toAscii(), fromLatin1(), fromUtf8(), fromLocal8Bit()
-*/
-
-/*!
- \fn QString QString::fromAscii(const QByteArray &str)
- \deprecated
- \overload
- \since 5.0
-
- Returns a QString initialized with the string \a str.
-*/
-
/*! \fn QString QString::fromUtf8(const char *str, int size)
Returns a QString initialized with the first \a size bytes
of the UTF-8 string \a str.
@@ -12240,21 +12204,6 @@ QByteArray QStringRef::toLatin1() const
}
/*!
- \fn QByteArray QStringRef::toAscii() const
- \since 4.8
- \deprecated
-
- Returns an 8-bit representation of the string as a QByteArray.
-
- This function does the same as toLatin1().
-
- Note that, despite the name, this function does not necessarily return an US-ASCII
- (ANSI X3.4-1986) string and its result may not be US-ASCII compatible.
-
- \sa toLatin1(), toUtf8(), toLocal8Bit(), QTextCodec
-*/
-
-/*!
\since 4.8
Returns the local 8-bit representation of the string as a
diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h
index d5101b7ff3..ad6c481209 100644
--- a/src/corelib/text/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -718,15 +718,6 @@ public:
{ return fromUcs4(reinterpret_cast<const uint *>(str), size); }
#endif
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static inline QString fromAscii(const char *str, int size = -1)
- { return fromLatin1(str, size); }
- QT_DEPRECATED static inline QString fromAscii(const QByteArray &str)
- { return fromLatin1(str); }
- Q_REQUIRED_RESULT QByteArray toAscii() const
- { return toLatin1(); }
-#endif
-
inline int toWCharArray(wchar_t *array) const;
Q_REQUIRED_RESULT static inline QString fromWCharArray(const wchar_t *string, int size = -1);
@@ -1594,10 +1585,6 @@ public:
inline const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
inline const_reverse_iterator crend() const { return rend(); }
-#if QT_DEPRECATED_SINCE(5, 0)
- Q_REQUIRED_RESULT QT_DEPRECATED QByteArray toAscii() const
- { return toLatin1(); }
-#endif
Q_REQUIRED_RESULT QByteArray toLatin1() const;
Q_REQUIRED_RESULT QByteArray toUtf8() const;
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const;
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index bfecbf2b4b..2e7b0fb1ed 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -522,9 +522,6 @@ private slots:
void stringRef_local8Bit_data();
void stringRef_local8Bit();
void fromLatin1();
-#if QT_DEPRECATED_SINCE(5, 0)
- void fromAscii();
-#endif
void fromUcs4();
void toUcs4();
void arg();
@@ -4612,32 +4609,6 @@ void tst_QString::fromLatin1()
QVERIFY(a.size() == 5);
}
-#if QT_DEPRECATED_SINCE(5, 0)
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED
-void tst_QString::fromAscii()
-{
- QString a;
- a = QString::fromAscii( 0 );
- QVERIFY( a.isNull() );
- QVERIFY( a.isEmpty() );
- a = QString::fromAscii( "" );
- QVERIFY( !a.isNull() );
- QVERIFY( a.isEmpty() );
-
- a = QString::fromAscii(0, 0);
- QVERIFY(a.isNull());
- a = QString::fromAscii(0, 5);
- QVERIFY(a.isNull());
- a = QString::fromAscii("\0abcd", 0);
- QVERIFY(!a.isNull());
- QVERIFY(a.isEmpty());
- a = QString::fromAscii("\0abcd", 5);
- QVERIFY(a.size() == 5);
-}
-QT_WARNING_POP
-#endif
-
void tst_QString::fromUcs4()
{
const uint *null = 0;