diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc index 6c37fa67bb3..ef8bc2ef64c 100644 --- a/examples/widgets/doc/src/application.qdoc +++ b/examples/widgets/doc/src/application.qdoc @@ -312,9 +312,8 @@ If we successfully opened the file, we use a QTextStream object to read in the data. QTextStream automatically converts the 8-bit data into a Unicode QString and supports various encodings. If no - encoding is specified, QTextStream assumes the file is written - using the system's default 8-bit encoding (for example, Latin-1; - see QTextCodec::codecForLocale() for details). + encoding is specified, QTextStream assumes the file is encoded in + UTF-8. Since the call to QTextStream::readAll() might take some time, we set the cursor to be Qt::WaitCursor for the entire application diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 1f4be249134..7182eb2a260 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -148,7 +148,7 @@ QT_BEGIN_NAMESPACE binary data (except for the NUL character). QProcessEnvironment will preserve such variables, but does not support manipulating variables whose names or values cannot be encoded by the current locale settings (see - QTextCodec::codecForLocale). + QString::toLocal8Bit). On Windows, the variable names are case-insensitive, but case-preserving. QProcessEnvironment behaves accordingly. diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h index 71ea124fbe0..057a0bc65bc 100644 --- a/src/corelib/kernel/qcoreapplication.h +++ b/src/corelib/kernel/qcoreapplication.h @@ -60,7 +60,6 @@ QT_BEGIN_NAMESPACE class QCoreApplicationPrivate; -class QTextCodec; class QTranslator; class QPostEventList; class QStringList; diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index 32ec1ca7e34..344eff56b2f 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -165,7 +165,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; parameter: qSetFieldWidth(), qSetPadChar(), and qSetRealNumberPrecision(). - \sa QDataStream, QIODevice, QFile, QBuffer, QTcpSocket, {Text Codecs Example} + \sa QDataStream, QIODevice, QFile, QBuffer, QTcpSocket */ /*! \enum QTextStream::RealNumberNotation diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h index 7b8c6f35b3b..2b164ce9b3f 100644 --- a/src/corelib/serialization/qtextstream.h +++ b/src/corelib/serialization/qtextstream.h @@ -55,10 +55,6 @@ QT_BEGIN_NAMESPACE - -class QTextCodec; -class QTextDecoder; - class QTextStreamPrivate; class Q_CORE_EXPORT QTextStream // text stream class { diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 72ad4ee6348..c26b0d11d2d 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -45,9 +45,6 @@ #include #include #include -#if QT_CONFIG(textcodec) -#include -#endif #include #include #include diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index a7cafced31b..28fb479788f 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -75,7 +75,6 @@ class QRegularExpression; class QRegularExpressionMatch; class QString; class QStringList; -class QTextCodec; class QStringRef; template class QVector; @@ -1021,7 +1020,6 @@ private: static qlonglong toIntegral_helper(const QChar *data, int len, bool *ok, int base); static qulonglong toIntegral_helper(const QChar *data, uint len, bool *ok, int base); void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen); - friend class QTextCodec; friend class QStringRef; friend class QStringView; friend class QByteArray; diff --git a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp index 6586b084f10..4961d8d5305 100644 --- a/src/platformsupport/input/libinput/qlibinputkeyboard.cpp +++ b/src/platformsupport/input/libinput/qlibinputkeyboard.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qlibinputkeyboard_p.h" -#include #include #include #include diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp index f8cc5e76ff7..840d4c2d5bc 100644 --- a/src/plugins/platforms/windows/qwindowsmime.cpp +++ b/src/plugins/platforms/windows/qwindowsmime.cpp @@ -42,7 +42,6 @@ #include #include -#include #include #include #include diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp index 76d9eec27ad..10c3e11bf20 100644 --- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp @@ -48,9 +48,6 @@ #include #include #include -#if QT_CONFIG(textcodec) -#include -#endif #include #include #include diff --git a/src/tools/uic/main.cpp b/src/tools/uic/main.cpp index 8327dd58295..cb212770866 100644 --- a/src/tools/uic/main.cpp +++ b/src/tools/uic/main.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index c09770db827..0f3e3818598 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -52,9 +52,6 @@ #if QT_CONFIG(regularexpression) #include #endif -#if QT_CONFIG(textcodec) -#include -#endif #include #include #include @@ -5942,7 +5939,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod const QDomNodePrivate* n = first; if(encUsed == QDomNode::EncodingFromDocument) { -#if QT_CONFIG(textcodec) && QT_CONFIG(regularexpression) +#if QT_CONFIG(regularexpression) const QDomNodePrivate* n = first; if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) { @@ -5977,11 +5974,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod else { // Write out the XML declaration. -#if !QT_CONFIG(textcodec) - const QLatin1String codecName("UTF-8"); -#else const QByteArray codecName = QStringConverter::nameForEncoding(s.encoding()); -#endif s << " #include #include -#include #include #ifdef Q_OS_WIN # include diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp index cdf79760f61..bfa9f1d7441 100644 --- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp +++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 31d1de42340..5a04d194a5d 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -36,7 +36,6 @@ #include #include -#include #include Q_DECLARE_METATYPE(QUrl::FormattingOptions) diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 29fa3cc075c..b9e14663ede 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #if QT_CONFIG(process) # include diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index 4fcbc0b87e3..321a4fcefbc 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -4184,7 +4183,6 @@ void tst_QString::stringRef_utf8() QCOMPARE( utf8, QByteArray(ref.toUtf8()) ); } -// copied to tst_QTextCodec::utf8Codec_data() void tst_QString::fromUtf8_data() { QTest::addColumn("utf8");