Merge remote-tracking branch 'origin/5.9' into dev

Conflicts:
	src/corelib/tools/qbytearray.h
	src/corelib/tools/qdatetime.h
	src/corelib/tools/qstring.h
	src/corelib/tools/qversionnumber.h
	src/plugins/platforms/android/qandroidplatformintegration.cpp
	tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp

Change-Id: Iefd92a435e687a76cd593099e40d9a9620a1454d
This commit is contained in:
Liang Qi 2017-04-20 11:19:14 +02:00
commit 7950b6b283
181 changed files with 1951 additions and 1044 deletions

View File

@ -14,6 +14,7 @@ defines += Q_QDOC \
QT_DEPRECATED_* \
Q_NO_USING_KEYWORD \
__cplusplus \
Q_STDLIB_UNICODE_STRINGS \
Q_COMPILER_INITIALIZER_LISTS \
Q_COMPILER_UNICODE_STRINGS \
Q_COMPILER_UNIFORM_INIT \
@ -57,6 +58,7 @@ clangdefines += __cplusplus \
Q_COMPILER_UNICODE_STRINGS \
Q_COMPILER_VARIADIC_MACROS \
Q_COMPILER_VARIADIC_TEMPLATES \
Q_STDLIB_UNICODE_STRINGS \
Q_ATOMIC_INT16_IS_SUPPORTED \
Q_ATOMIC_INT64_IS_SUPPORTED \
Q_ATOMIC_INT8_IS_SUPPORTED \

View File

@ -270,19 +270,18 @@ private:
inFlightStatus |= className == "FlightDetailHeaderStatus";
inFlightMap |= className == "flightMap";
if (xml.name() == "td" && !className.isEmpty()) {
QString cn = className.toString();
if (cn.contains("fieldTitle")) {
if (className.contains("fieldTitle")) {
inFieldName = true;
fieldNames += QString();
fieldValues += QString();
}
if (cn.contains("fieldValue"))
if (className.contains("fieldValue"))
inFieldValue = true;
}
if (xml.name() == "img" && inFlightMap) {
QString src = xml.attributes().value("src").toString();
src.prepend("http://mobile.flightview.com/");
QUrl url = QUrl::fromPercentEncoding(src.toLatin1());
const QByteArray encoded
= ("http://mobile.flightview.com/" % xml.attributes().value("src")).toLatin1();
QUrl url = QUrl::fromPercentEncoding(encoded);
mapReplies.append(m_manager.get(QNetworkRequest(url)));
}
}

View File

@ -111,14 +111,15 @@ GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
if (reader.name() == "submarine") {
SubmarineDescription desc;
desc.name = reader.attributes().value("name").toString();
desc.points = reader.attributes().value("points").toString().toInt();
desc.type = reader.attributes().value("type").toString().toInt();
desc.points = reader.attributes().value("points").toInt();
desc.type = reader.attributes().value("type").toInt();
submarinesData.append(desc);
} else if (reader.name() == "level") {
currentLevel.id = reader.attributes().value("id").toString().toInt();
currentLevel.id = reader.attributes().value("id").toInt();
currentLevel.name = reader.attributes().value("name").toString();
} else if (reader.name() == "subinstance") {
currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toString().toInt(), reader.attributes().value("nb").toString().toInt()));
currentLevel.submarines.append(qMakePair(reader.attributes().value("type").toInt(),
reader.attributes().value("nb").toInt()));
}
} else if (reader.tokenType() == QXmlStreamReader::EndElement) {
if (reader.name() == "level") {

View File

@ -29,8 +29,8 @@
\example richtext/syntaxhighlighter
\title Syntax Highlighter Example
\ingroup examples-richtext
\brief The Syntax Highligher example shows how to perform
simple syntax highlighing.
\brief The Syntax Highlighter example shows how to perform
simple syntax highlighting.
\brief The Syntax Highlighter example shows how to perform simple syntax
highlighting by subclassing the QSyntaxHighlighter class.
@ -64,8 +64,9 @@
and define your own highlighting rules.
We have chosen to store our highlighting rules using a private
struct: A rule consists of a QRegExp pattern and a QTextCharFormat
instance. The various rules are then stored using a QVector.
struct: A rule consists of a QRegularExpression pattern and a
QTextCharFormat instance. The various rules are then stored using a
QVector.
The QTextCharFormat class provides formatting information for
characters in a QTextDocument specifying the visual properties of
@ -78,7 +79,7 @@
When subclassing the QSyntaxHighlighter class you must pass the
parent parameter to the base class constructor. The parent is the
text document upon which the syntax highligning will be
text document upon which the syntax highlighting will be
applied. In this example, we have also chosen to define our
highlighting rules in the constructor:
@ -138,11 +139,11 @@
First we apply the syntax highlighting rules that we stored in the
\c highlightingRules vector. For each rule (i.e. for each
HighlightingRule object) we search for the pattern in the given
textblock using the QString::indexOf() function. When the first
text block using the QString::indexOf() function. When the first
occurrence of the pattern is found, we use the
QRegExp::matchedLength() function to determine the string that
will be formatted. QRegExp::matchedLength() returns the length of
the last matched string, or -1 if there was no match.
QRegularExpressionMatch::capturedLength() function to determine the string
that will be formatted. QRegularExpressionMatch::capturedLength() returns
the length of the last matched string, or 0 if there was no match.
To perform the actual formatting the QSyntaxHighlighter class
provides the \l {QSyntaxHighlighter::setFormat()}{setFormat()}

View File

@ -68,9 +68,9 @@ Highlighter::Highlighter(QTextDocument *parent)
<< "\\bslots\\b" << "\\bstatic\\b" << "\\bstruct\\b"
<< "\\btemplate\\b" << "\\btypedef\\b" << "\\btypename\\b"
<< "\\bunion\\b" << "\\bunsigned\\b" << "\\bvirtual\\b"
<< "\\bvoid\\b" << "\\bvolatile\\b";
<< "\\bvoid\\b" << "\\bvolatile\\b" << "\\bbool\\b";
foreach (const QString &pattern, keywordPatterns) {
rule.pattern = QRegExp(pattern);
rule.pattern = QRegularExpression(pattern);
rule.format = keywordFormat;
highlightingRules.append(rule);
//! [0] //! [1]
@ -80,14 +80,14 @@ Highlighter::Highlighter(QTextDocument *parent)
//! [2]
classFormat.setFontWeight(QFont::Bold);
classFormat.setForeground(Qt::darkMagenta);
rule.pattern = QRegExp("\\bQ[A-Za-z]+\\b");
rule.pattern = QRegularExpression("\\bQ[A-Za-z]+\\b");
rule.format = classFormat;
highlightingRules.append(rule);
//! [2]
//! [3]
singleLineCommentFormat.setForeground(Qt::red);
rule.pattern = QRegExp("//[^\n]*");
rule.pattern = QRegularExpression("//[^\n]*");
rule.format = singleLineCommentFormat;
highlightingRules.append(rule);
@ -96,7 +96,7 @@ Highlighter::Highlighter(QTextDocument *parent)
//! [4]
quotationFormat.setForeground(Qt::darkGreen);
rule.pattern = QRegExp("\".*\"");
rule.pattern = QRegularExpression("\".*\"");
rule.format = quotationFormat;
highlightingRules.append(rule);
//! [4]
@ -104,14 +104,14 @@ Highlighter::Highlighter(QTextDocument *parent)
//! [5]
functionFormat.setFontItalic(true);
functionFormat.setForeground(Qt::blue);
rule.pattern = QRegExp("\\b[A-Za-z0-9_]+(?=\\()");
rule.pattern = QRegularExpression("\\b[A-Za-z0-9_]+(?=\\()");
rule.format = functionFormat;
highlightingRules.append(rule);
//! [5]
//! [6]
commentStartExpression = QRegExp("/\\*");
commentEndExpression = QRegExp("\\*/");
commentStartExpression = QRegularExpression("/\\*");
commentEndExpression = QRegularExpression("\\*/");
}
//! [6]
@ -119,12 +119,10 @@ Highlighter::Highlighter(QTextDocument *parent)
void Highlighter::highlightBlock(const QString &text)
{
foreach (const HighlightingRule &rule, highlightingRules) {
QRegExp expression(rule.pattern);
int index = expression.indexIn(text);
while (index >= 0) {
int length = expression.matchedLength();
setFormat(index, length, rule.format);
index = expression.indexIn(text, index + length);
QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text);
while (matchIterator.hasNext()) {
QRegularExpressionMatch match = matchIterator.next();
setFormat(match.capturedStart(), match.capturedLength(), rule.format);
}
}
//! [7] //! [8]
@ -134,22 +132,23 @@ void Highlighter::highlightBlock(const QString &text)
//! [9]
int startIndex = 0;
if (previousBlockState() != 1)
startIndex = commentStartExpression.indexIn(text);
startIndex = text.indexOf(commentStartExpression);
//! [9] //! [10]
while (startIndex >= 0) {
//! [10] //! [11]
int endIndex = commentEndExpression.indexIn(text, startIndex);
int commentLength;
QRegularExpressionMatch match = commentEndExpression.match(text, startIndex);
int endIndex = match.capturedStart();
int commentLength = 0;
if (endIndex == -1) {
setCurrentBlockState(1);
commentLength = text.length() - startIndex;
} else {
commentLength = endIndex - startIndex
+ commentEndExpression.matchedLength();
+ match.capturedLength();
}
setFormat(startIndex, commentLength, multiLineCommentFormat);
startIndex = commentStartExpression.indexIn(text, startIndex + commentLength);
startIndex = text.indexOf(commentStartExpression, startIndex + commentLength);
}
}
//! [11]

View File

@ -53,6 +53,7 @@
#include <QSyntaxHighlighter>
#include <QTextCharFormat>
#include <QRegularExpression>
QT_BEGIN_NAMESPACE
class QTextDocument;
@ -72,13 +73,13 @@ protected:
private:
struct HighlightingRule
{
QRegExp pattern;
QRegularExpression pattern;
QTextCharFormat format;
};
QVector<HighlightingRule> highlightingRules;
QRegExp commentStartExpression;
QRegExp commentEndExpression;
QRegularExpression commentStartExpression;
QRegularExpression commentEndExpression;
QTextCharFormat keywordFormat;
QTextCharFormat classFormat;

View File

@ -231,9 +231,9 @@ void RSSListing::parseXml()
} else if (xml.isCharacters() && !xml.isWhitespace()) {
if (currentTag == "title")
titleString += xml.text().toString();
titleString += xml.text();
else if (currentTag == "link")
linkString += xml.text().toString();
linkString += xml.text();
}
}
if (xml.error() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {

View File

@ -9,3 +9,5 @@ QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
QMAKE_AR_LTCG = libtool -static -o
QMAKE_CFLAGS_APPLICATION_EXTENSION = -fapplication-extension

View File

@ -47,7 +47,7 @@ greaterThan(QMAKE_MSC_VER, 1799) {
MSVC_VER = 12.0
COMPAT_MKSPEC = win32-msvc2013
QMAKE_CFLAGS += -FS
QMAKE_CXXFLAGS += -FS
QMAKE_CXXFLAGS += -FS -Zc:rvalueCast -Zc:inline
QMAKE_CFLAGS_F16C = -arch:AVX
@ -80,6 +80,7 @@ greaterThan(QMAKE_MSC_VER, 1909) {
# Visual Studio 2017 (15.0) / Visual C++ 19.10 and up
MSVC_VER = 15.0
COMPAT_MKSPEC = win32-msvc2017
QMAKE_CXXFLAGS += -Zc:referenceBinding
}
greaterThan(QMAKE_MSC_VER, 1910) {

View File

@ -0,0 +1,2 @@
load(android)
load(resolve_target)

View File

@ -1,6 +1,8 @@
gcc {
# on Windows, MinGW's support for -flto=N is broken
!clang:!intel_icc:!equals(QMAKE_HOST.os, Windows):greaterThan(QMAKE_HOST.cpu_count, 1) {
intel_icc {
QMAKE_LFLAGS_LTCG ~= s/-ipo/-ipo=$$QMAKE_HOST.cpu_count/
} else: !clang:!equals(QMAKE_HOST.os, Windows):greaterThan(QMAKE_HOST.cpu_count, 1) {
# Override LTO number of jobs
QMAKE_LFLAGS_LTCG ~= s/^-flto$/-flto=$$QMAKE_HOST.cpu_count/
}

View File

@ -40,10 +40,10 @@ qt {
!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
app_extension_api_only {
QMAKE_CFLAGS += -fapplication-extension
QMAKE_CXXFLAGS += -fapplication-extension
QMAKE_CXXFLAGS_PRECOMPILE += -fapplication-extension
QMAKE_LFLAGS += -fapplication-extension
QMAKE_CFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
QMAKE_CXXFLAGS_PRECOMPILE += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION
}
macx-xcode {
@ -157,13 +157,23 @@ macx-xcode {
# Enable precompiled headers for multiple architectures
QMAKE_CFLAGS_USE_PRECOMPILE =
for (arch, VALID_ARCHS) {
icc_pch_style: \
use_flag = "-pch-use "
else: \
use_flag = -include
QMAKE_CFLAGS_USE_PRECOMPILE += \
-Xarch_$${arch} \
-include${QMAKE_PCH_OUTPUT_$${arch}}
$${use_flag}${QMAKE_PCH_OUTPUT_$${arch}}
}
icc_pch_style {
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE -include ${QMAKE_PCH_INPUT}
QMAKE_CFLAGS_USE_PRECOMPILE =
} else {
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
}

View File

@ -158,12 +158,18 @@ MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MOD
}
SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER
# Automatically enable precompiled headers for Qt modules,
# except for Gcc/Windows: Larger precompiled headers crash cc1plus.exe
# (e.g. with i686-4.8.2-release-posix-dwarf-rt_v3-rev3)
!if(gcc:equals(QMAKE_HOST.os, Windows)):!equals(TEMPLATE, aux) {
isEmpty(PRECOMPILED_HEADER): PRECOMPILED_HEADER = $$MODULE_MASTER_DEPS_HEADER
# Automatically enable precompiled headers for Qt modules with more than 2 sources
combined_SOURCES = $$SOURCES $$OBJECTIVE_SOURCES
count(combined_SOURCES, 2, >) {
# except for Gcc/Windows: Larger precompiled headers crash cc1plus.exe
# (e.g. with i686-4.8.2-release-posix-dwarf-rt_v3-rev3)
!if(gcc:equals(QMAKE_HOST.os, Windows)):!equals(TEMPLATE, aux) {
!defined(PRECOMPILED_HEADER, "var"): PRECOMPILED_HEADER = $$MODULE_MASTER_DEPS_HEADER
}
} else {
CONFIG -= precompile_header
}
unset(combined_SOURCES)
headersclean:!internal_module {
# Make sure that the header compiles with our strict options

View File

@ -96,6 +96,8 @@ QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
QMAKE_APPLE_DEVICE_ARCHS = x86_64
include(../common/macx.conf)
load(qt_config)

View File

@ -1292,9 +1292,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
if (fi.isDir())
cmd = "-$(INSTALL_DIR)";
else if (is_target || fi.isExecutable())
cmd = "-$(INSTALL_PROGRAM)";
cmd = "-$(QINSTALL_PROGRAM)";
else
cmd = "-$(INSTALL_FILE)";
cmd = "-$(QINSTALL_FILE)";
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@ -1318,9 +1318,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += filestr;
}
} else if (installConfigValues.contains("executable")) {
cmd = QLatin1String("-$(INSTALL_PROGRAM)");
cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
} else {
cmd = QLatin1String("-$(INSTALL_FILE)");
cmd = QLatin1String("-$(QINSTALL_FILE)");
}
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
@ -1336,7 +1336,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += Option::dir_sep;
dst_file += fi.fileName();
}
QString cmd = QString(fi.isDir() ? "-$(INSTALL_DIR)" : "-$(INSTALL_FILE)") + " " +
QString cmd = QString(fi.isDir() ? "-$(INSTALL_DIR)" : "-$(QINSTALL_FILE)") + " " +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@ -2248,6 +2248,8 @@ MakefileGenerator::writeDefaultVariables(QTextStream &t)
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
t << "QINSTALL_FILE = " << var("QMAKE_QMAKE") << " -install qinstall file" << endl;
t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall program" << endl;
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
@ -3310,19 +3312,19 @@ MakefileGenerator::writePkgConfigFile()
}
t << shellQuote(pkgConfiglibName) << " \n";
ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
libs = project->values("QMAKE_INTERNAL_PRL_LIBS");
} else {
libs << "QMAKE_LIBS"; //obvious one
if (project->isActiveConfig("staticlib")) {
ProStringList libs;
if (!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS"))
libs = project->values("QMAKE_INTERNAL_PRL_LIBS");
else
libs << "QMAKE_LIBS"; //obvious one
libs << "QMAKE_LIBS_PRIVATE";
libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread?
t << "Libs.private:";
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it)
t << ' ' << fixLibFlags((*it).toKey()).join(' ');
t << endl;
}
libs << "QMAKE_LIBS_PRIVATE";
libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread?
t << "Libs.private: ";
for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) {
t << fixLibFlags((*it).toKey()).join(' ') << ' ';
}
t << endl;
// flags
// ### too many

View File

@ -180,6 +180,13 @@ UnixMakefileGenerator::init()
// icc style
pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"),
escapeFilePath(pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT")));
const ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
for (const ProString &arch : pchArchs) {
QString suffix = project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_") + arch + QLatin1Char('}'),
escapeFilePath(pchBaseName + suffix));
}
} else {
// gcc style (including clang_pch_style)
QString headerSuffix;
@ -334,10 +341,19 @@ QStringList
header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
if (project->isActiveConfig("icc_pch_style")) {
// icc style
for(QStringList::Iterator it = Option::cpp_ext.begin(); it != Option::cpp_ext.end(); ++it) {
if(file.endsWith(*it)) {
ret += header_prefix;
break;
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
if (pchArchs.isEmpty())
pchArchs << ProString(); // normal single-arch PCH
for (const ProString &arch : qAsConst(pchArchs)) {
auto pfx = header_prefix;
if (!arch.isEmpty())
pfx.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
for (QStringList::Iterator it = Option::cpp_ext.begin();
it != Option::cpp_ext.end(); ++it) {
if (file.endsWith(*it)) {
ret += pfx;
break;
}
}
}
} else {
@ -584,7 +600,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1)));
if(!ret.isEmpty())
ret += "\n\t";
ret += "-$(INSTALL_FILE) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
ret += "-$(QINSTALL_FILE) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
@ -622,14 +638,14 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
if (bundle == SolidBundle) {
copy_cmd += "-$(INSTALL_DIR) " + src_targ + ' ' + plain_targ;
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
copy_cmd += "-$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
copy_cmd += "-$(QINSTALL_FILE) " + src_targ + ' ' + dst_targ;
} else if (!isAux) {
if (bundle == SlicedBundle) {
if (!ret.isEmpty())
ret += "\n\t";
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false);
}
copy_cmd += "-$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
copy_cmd += "-$(QINSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
}
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {

View File

@ -1006,14 +1006,22 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (project->isActiveConfig("icc_pch_style")) {
// icc style
ProString pchBaseName = project->first("QMAKE_ORIG_TARGET");
ProString pchOutput;
if(!project->isEmpty("PRECOMPILED_DIR"))
pchOutput = project->first("PRECOMPILED_DIR");
pchOutput += pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT");
ProString sourceFile = pchOutput + Option::cpp_ext.first();
ProString objectFile = createObjectList(ProStringList(sourceFile)).first();
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
if (pchArchs.isEmpty())
pchArchs << ProString(); // normal single-arch PCH
for (const ProString &arch : qAsConst(pchArchs)) {
ProString pchOutput;
if (!project->isEmpty("PRECOMPILED_DIR"))
pchOutput = project->first("PRECOMPILED_DIR");
pchOutput += pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT");
if (!arch.isEmpty())
pchOutput = ProString(pchOutput.toQString().replace(
QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString()));
precomp_files << precomph_out_dir << sourceFile << objectFile;
ProString sourceFile = pchOutput + Option::cpp_ext.first();
ProString objectFile = createObjectList(ProStringList(sourceFile)).first();
precomp_files << precomph_out_dir << sourceFile << objectFile;
}
} else {
// gcc style (including clang_pch_style)
precomph_out_dir += Option::dir_sep;
@ -1115,19 +1123,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isActiveConfig("clang_pch_style"))
pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
if (project->isActiveConfig("icc_pch_style")) {
// icc style
QString sourceFile = pchOutput + Option::cpp_ext.first();
QString sourceFile_f = escapeFilePath(sourceFile);
QString objectFile = createObjectList(ProStringList(sourceFile)).first().toQString();
t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' '
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
<< "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f
<< "\n\trm -f " << escapeFilePath(pchOutput);
pchFlags.replace(QLatin1String("${QMAKE_PCH_TEMP_SOURCE}"), sourceFile_f)
.replace(QLatin1String("${QMAKE_PCH_TEMP_OBJECT}"), escapeFilePath(objectFile));
} else {
if (!project->isActiveConfig("icc_pch_style")) {
// gcc style (including clang_pch_style)
ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX");
ProString header_suffix = project->isActiveConfig("clang_pch_style")
@ -1148,18 +1144,28 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (!arch.isEmpty())
pchArchOutput.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
if (!project->isActiveConfig("icc_pch_style")) {
const auto pchFilePath_d = escapeDependencyPath(pchArchOutput);
if (!arch.isEmpty()) {
t << pchFilePath_d << ": " << "EXPORT_ARCH_ARGS = -arch " << arch << "\n\n";
t << pchFilePath_d << ": "
<< "EXPORT_QMAKE_XARCH_CFLAGS = $(EXPORT_QMAKE_XARCH_CFLAGS_" << arch << ")" << "\n\n";
t << pchFilePath_d << ": "
<< "EXPORT_QMAKE_XARCH_LFLAGS = $(EXPORT_QMAKE_XARCH_LFLAGS_" << arch << ")" << "\n\n";
}
t << pchFilePath_d << ": " << escapeDependencyPath(pchInput) << ' '
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(pchOutputDir);
const auto pchFilePath_d = escapeDependencyPath(pchArchOutput);
if (!arch.isEmpty()) {
t << pchFilePath_d << ": " << "EXPORT_ARCH_ARGS = -arch " << arch << "\n\n";
t << pchFilePath_d << ": "
<< "EXPORT_QMAKE_XARCH_CFLAGS = $(EXPORT_QMAKE_XARCH_CFLAGS_" << arch << ")" << "\n\n";
t << pchFilePath_d << ": "
<< "EXPORT_QMAKE_XARCH_LFLAGS = $(EXPORT_QMAKE_XARCH_LFLAGS_" << arch << ")" << "\n\n";
}
t << pchFilePath_d << ": " << escapeDependencyPath(pchInput) << ' '
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t");
if (project->isActiveConfig("icc_pch_style")) {
QString sourceFile = pchArchOutput + Option::cpp_ext.first();
QString sourceFile_f = escapeFilePath(sourceFile);
QString objectFile = createObjectList(ProStringList(sourceFile)).first().toQString();
pchFlags.replace(QLatin1String("${QMAKE_PCH_TEMP_SOURCE}"), sourceFile_f)
.replace(QLatin1String("${QMAKE_PCH_TEMP_OBJECT}"), escapeFilePath(objectFile));
t << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f
<< "\n\trm -f " << escapeFilePath(pchArchOutput);
} else {
t << "\n\t" << mkdir_p_asstring(pchOutputDir);
}
auto pchArchFlags = pchFlags;

View File

@ -530,6 +530,8 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
t << "QINSTALL_FILE = " << var("QMAKE_QMAKE") << " -install qinstall file" << endl;
t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall program" << endl;
t << endl;
t << "####### Output directory\n\n";

View File

@ -37,8 +37,13 @@
# include <sys/types.h>
# include <sys/stat.h>
# include <unistd.h>
# include <utime.h>
# include <fcntl.h>
# include <errno.h>
#endif
#define fL1S(s) QString::fromLatin1(s)
QT_BEGIN_NAMESPACE
using namespace QMakeInternal;
@ -183,4 +188,69 @@ QString IoUtils::shellQuoteWin(const QString &arg)
return ret;
}
#if defined(PROEVALUATOR_FULL)
# if defined(Q_OS_WIN)
static QString windowsErrorCode()
{
wchar_t *string = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&string,
0,
NULL);
QString ret = QString::fromWCharArray(string);
LocalFree((HLOCAL)string);
return ret.trimmed();
}
# endif
bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceFileName, QString *errorString)
{
# ifdef Q_OS_UNIX
struct stat st;
if (stat(referenceFileName.toLocal8Bit().constData(), &st)) {
*errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno)));
return false;
}
# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0;
# else
struct utimbuf utb;
utb.actime = time(0);
utb.modtime = st.st_mtime;
const bool utimeError= utime(targetFileName.toLocal8Bit().constData(), &utb) < 0;
# endif
if (utimeError) {
*errorString = fL1S("Cannot touch %1: %2.").arg(targetFileName, fL1S(strerror(errno)));
return false;
}
# else
HANDLE rHand = CreateFile((wchar_t*)referenceFileName.utf16(),
GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (rHand == INVALID_HANDLE_VALUE) {
*errorString = fL1S("Cannot open reference file %1: %2").arg(referenceFileName, windowsErrorCode());
return false;
}
FILETIME ft;
GetFileTime(rHand, 0, 0, &ft);
CloseHandle(rHand);
HANDLE wHand = CreateFile((wchar_t*)targetFileName.utf16(),
GENERIC_WRITE, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (wHand == INVALID_HANDLE_VALUE) {
*errorString = fL1S("Cannot open %1: %2").arg(targetFileName, windowsErrorCode());
return false;
}
SetFileTime(wHand, 0, 0, &ft);
CloseHandle(wHand);
# endif
return true;
}
#endif
QT_END_NAMESPACE

View File

@ -62,6 +62,9 @@ public:
#else
{ return shellQuoteWin(arg); }
#endif
#if defined(PROEVALUATOR_FULL)
static bool touchFile(const QString &targetFileName, const QString &referenceFileName, QString *errorString);
#endif
};
} // namespace ProFileEvaluatorInternal

View File

@ -57,9 +57,7 @@
#ifdef Q_OS_UNIX
#include <time.h>
#include <utime.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
@ -260,23 +258,6 @@ QMakeEvaluator::getMemberArgs(const ProKey &func, int srclen, const ProStringLis
return true;
}
#if defined(Q_OS_WIN) && defined(PROEVALUATOR_FULL)
static QString windowsErrorCode()
{
wchar_t *string = 0;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR)&string,
0,
NULL);
QString ret = QString::fromWCharArray(string);
LocalFree((HLOCAL)string);
return ret.trimmed();
}
#endif
QString
QMakeEvaluator::quoteValue(const ProString &val)
{
@ -1830,46 +1811,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
#ifdef PROEVALUATOR_FULL
const QString &tfn = resolvePath(args.at(0).toQString(m_tmp1));
const QString &rfn = resolvePath(args.at(1).toQString(m_tmp2));
#ifdef Q_OS_UNIX
struct stat st;
if (stat(rfn.toLocal8Bit().constData(), &st)) {
evalError(fL1S("Cannot stat() reference file %1: %2.").arg(rfn, fL1S(strerror(errno))));
QString error;
if (!IoUtils::touchFile(tfn, rfn, &error)) {
evalError(error);
return ReturnFalse;
}
#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
const bool utimeError = utimensat(AT_FDCWD, tfn.toLocal8Bit().constData(), times, 0) < 0;
#else
struct utimbuf utb;
utb.actime = time(0);
utb.modtime = st.st_mtime;
const bool utimeError = utime(tfn.toLocal8Bit().constData(), &utb) < 0;
#endif
if (utimeError) {
evalError(fL1S("Cannot touch %1: %2.").arg(tfn, fL1S(strerror(errno))));
return ReturnFalse;
}
#else
HANDLE rHand = CreateFile((wchar_t*)rfn.utf16(),
GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (rHand == INVALID_HANDLE_VALUE) {
evalError(fL1S("Cannot open reference file %1: %2").arg(rfn, windowsErrorCode()));
return ReturnFalse;
}
FILETIME ft;
GetFileTime(rHand, 0, 0, &ft);
CloseHandle(rHand);
HANDLE wHand = CreateFile((wchar_t*)tfn.utf16(),
GENERIC_WRITE, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (wHand == INVALID_HANDLE_VALUE) {
evalError(fL1S("Cannot open %1: %2").arg(tfn, windowsErrorCode()));
return ReturnFalse;
}
SetFileTime(wHand, 0, 0, &ft);
CloseHandle(wHand);
#endif
#endif
return ReturnTrue;
}

View File

@ -47,6 +47,8 @@
# include <qt_windows.h>
#endif
using namespace QMakeInternal;
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN
@ -232,20 +234,86 @@ static int doLink(int argc, char **argv)
return 0;
}
#endif
static int installFile(const QString &source, const QString &targetFileOrDirectory, bool exe = false)
{
QFile sourceFile(source);
QString target(targetFileOrDirectory);
if (QFileInfo(target).isDir())
target += QDir::separator() + QFileInfo(sourceFile.fileName()).fileName();
if (QFile::exists(target))
QFile::remove(target);
QDir::root().mkpath(QFileInfo(target).absolutePath());
if (!sourceFile.copy(target)) {
fprintf(stderr, "Error copying %s to %s: %s\n", source.toLatin1().constData(), qPrintable(target), qPrintable(sourceFile.errorString()));
return 3;
}
if (exe) {
QFile targetFile(target);
if (!targetFile.setPermissions(sourceFile.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeUser |
QFileDevice::ExeGroup | QFileDevice::ExeOther)) {
fprintf(stderr, "Error setting execute permissions on %s: %s\n",
qPrintable(target), qPrintable(targetFile.errorString()));
return 3;
}
}
// Copy file times
QString error;
if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) {
fprintf(stderr, "%s", qPrintable(error));
return 3;
}
return 0;
}
static int doQInstall(int argc, char **argv)
{
if (argc != 3) {
fprintf(stderr, "Error: this qinstall command requires exactly three arguments (type, source, destination)\n");
return 3;
}
const QString source = QString::fromLocal8Bit(argv[1]);
const QString target = QString::fromLocal8Bit(argv[2]);
if (!strcmp(argv[0], "file"))
return installFile(source, target);
if (!strcmp(argv[0], "program"))
return installFile(source, target, /*exe=*/true);
fprintf(stderr, "Error: Unsupported qinstall command type %s\n", argv[0]);
return 3;
}
static int doInstall(int argc, char **argv)
{
if (!argc) {
fprintf(stderr, "Error: -install requires further arguments\n");
return 3;
}
#ifdef Q_OS_WIN
if (!strcmp(argv[0], "sed"))
return doSed(argc - 1, argv + 1);
if (!strcmp(argv[0], "ln"))
return doLink(argc - 1, argv + 1);
#endif
if (!strcmp(argv[0], "qinstall"))
return doQInstall(argc - 1, argv + 1);
fprintf(stderr, "Error: unrecognized -install subcommand '%s'\n", argv[0]);
return 3;
}
#ifdef Q_OS_WIN
static int dumpMacros(const wchar_t *cmdline)
{
// from http://stackoverflow.com/questions/3665537/how-to-find-out-cl-exes-built-in-macros
@ -300,11 +368,11 @@ int runQMake(int argc, char **argv)
// This is particularly important for things like QtCreator and scripted builds.
setvbuf(stdout, (char *)NULL, _IONBF, 0);
#ifdef Q_OS_WIN
// Workaround for inferior/missing command line tools on Windows: make our own!
if (argc >= 2 && !strcmp(argv[1], "-install"))
return doInstall(argc - 2, argv + 2);
#ifdef Q_OS_WIN
{
// Support running as Visual C++'s compiler
const wchar_t *cmdline = _wgetenv(L"MSC_CMD_FLAGS");

View File

@ -462,7 +462,9 @@ Option::init(int argc, char **argv)
void Option::prepareProject(const QString &pfile)
{
QString srcpath = QDir::cleanPath(QFileInfo(pfile).absolutePath());
// Canonicalize only the directory, otherwise things will go haywire
// if the file itself is a symbolic link.
const QString srcpath = QFileInfo(QFileInfo(pfile).absolutePath()).canonicalFilePath();
globals->setDirectories(srcpath, output_dir);
}

View File

@ -2,7 +2,7 @@
"Id": "pcre2",
"Name": "PCRE2",
"QDocModule": "qtcore",
"QtUsage": "Optionally used in Qt Core (QRegularExpression). Configure with -system-pcre2 or -no-pcre2 to avoid.",
"QtUsage": "Optionally used in Qt Core (QRegularExpression). Configure with -system-pcre or -no-pcre to avoid.",
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
"Homepage": "http://www.pcre.org/",

View File

@ -4,7 +4,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.3'
}
}

View File

@ -172,7 +172,11 @@
/* Clang also masquerades as GCC */
# if defined(__apple_build_version__)
# /* http://en.wikipedia.org/wiki/Xcode#Toolchain_Versions */
# if __apple_build_version__ >= 7000053
# if __apple_build_version__ >= 8020041
# define Q_CC_CLANG 309
# elif __apple_build_version__ >= 8000038
# define Q_CC_CLANG 308
# elif __apple_build_version__ >= 7000053
# define Q_CC_CLANG 306
# elif __apple_build_version__ >= 6000051
# define Q_CC_CLANG 305
@ -628,10 +632,7 @@
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
# define Q_COMPILER_INHERITING_CONSTRUCTORS
# ifndef Q_OS_OSX
// C++11 thread_local is broken on OS X (Clang doesn't support it either)
# define Q_COMPILER_THREAD_LOCAL
# endif
# define Q_COMPILER_THREAD_LOCAL
# define Q_COMPILER_UDL
# endif
# ifdef _MSC_VER
@ -993,6 +994,10 @@
# endif /* __cplusplus */
#endif /* Q_CC_MSVC */
#ifdef Q_COMPILER_UNICODE_STRINGS
# define Q_STDLIB_UNICODE_STRINGS
#endif
#ifdef __cplusplus
# include <utility>
# if defined(Q_OS_QNX)
@ -1015,8 +1020,9 @@
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
# undef Q_COMPILER_UNICODE_STRINGS
# undef Q_COMPILER_NOEXCEPT
// Disable C++11 library features:
# undef Q_STDLIB_UNICODE_STRINGS
# endif // !_HAS_CPP0X
# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T
# undef Q_COMPILER_NULLPTR

View File

@ -81,18 +81,18 @@ private:
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
Q_CORE_EXPORT Q_REQUIRED_RESULT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
Q_CORE_EXPORT Q_REQUIRED_RESULT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
Q_CORE_EXPORT Q_REQUIRED_RESULT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
// The remainder of these utility functions complement qglobal.h
inline Q_REQUIRED_RESULT int qRound(qfloat16 d) Q_DECL_NOTHROW
Q_REQUIRED_RESULT inline int qRound(qfloat16 d) Q_DECL_NOTHROW
{ return qRound(static_cast<float>(d)); }
inline Q_REQUIRED_RESULT qint64 qRound64(qfloat16 d) Q_DECL_NOTHROW
Q_REQUIRED_RESULT inline qint64 qRound64(qfloat16 d) Q_DECL_NOTHROW
{ return qRound64(static_cast<float>(d)); }
inline Q_REQUIRED_RESULT bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOTHROW
Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOTHROW
{
float f1 = static_cast<float>(p1);
float f2 = static_cast<float>(p2);
@ -105,7 +105,7 @@ inline Q_REQUIRED_RESULT bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOT
return (qAbs(f1 - f2) * 102.5f <= qMin(qAbs(f1), qAbs(f2)));
}
inline Q_REQUIRED_RESULT bool qIsNull(qfloat16 f) Q_DECL_NOTHROW
Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW
{
return (f.b16 & static_cast<quint16>(0x7fff)) == 0;
}
@ -115,6 +115,7 @@ inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wc99-extensions")
QT_WARNING_DISABLE_GCC("-Wold-style-cast")
inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
{
#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__))
@ -246,7 +247,7 @@ QT_WARNING_POP
/*!
\internal
*/
inline Q_REQUIRED_RESULT bool qFuzzyIsNull(qfloat16 f) Q_DECL_NOTHROW
Q_REQUIRED_RESULT inline bool qFuzzyIsNull(qfloat16 f) Q_DECL_NOTHROW
{
return qAbs(static_cast<float>(f)) <= 0.001f;
}

View File

@ -2643,12 +2643,14 @@ QString QSysInfo::kernelVersion()
to determine the distribution name and returns that. If determining the
distribution name failed, it returns "unknown".
\b{Darwin, \macos, iOS, tvOS, and watchOS note}: this function returns
"macos" for \macos systems, "ios" for iOS systems, "tvos" for tvOS systems,
"watchos" for watchOS systems, and "darwin" in case the system could not
be determined.
\b{\macos note}: this function returns "osx" for all \macos systems,
regardless of Apple naming convention. The returned string will be updated
for Qt 6. Note that this function erroneously returned "macos" for \macos
10.12 in Qt versions 5.6.2, 5.7.1, and 5.8.0.
\b{OS X note}: this function returns "osx" for versions of \macos prior to 10.12.
\b{Darwin, iOS, tvOS, and watchOS note}: this function returns "ios" for
iOS systems, "tvos" for tvOS systems, "watchos" for watchOS systems, and
"darwin" in case the system could not be determined.
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
"unknown" otherwise.
@ -2681,10 +2683,12 @@ QString QSysInfo::productType()
#elif defined(Q_OS_WATCHOS)
return QStringLiteral("watchos");
#elif defined(Q_OS_MACOS)
const auto version = QOperatingSystemVersion::current();
if (version.majorVersion() == 10 && version.minorVersion() < 12)
return QStringLiteral("osx");
// ### Qt6: remove fallback
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return QStringLiteral("macos");
# else
return QStringLiteral("osx");
# endif
#elif defined(Q_OS_DARWIN)
return QStringLiteral("darwin");
@ -3198,12 +3202,16 @@ static QBasicMutex environmentMutex;
Returns the value of the environment variable with name \a
varName. To get the variable string, use QByteArray::constData().
To convert the data to a QString use QString::fromLocal8Bit().
\note qgetenv() was introduced because getenv() from the standard
C library was deprecated in VC2005 (and later versions). qgetenv()
uses the new replacement function in VC, and calls the standard C
library's implementation on all other platforms.
\warning Don't use qgetenv on Windows if the content may contain
non-US-ASCII characters, like file paths.
\sa qputenv(), qEnvironmentVariableIsSet(), qEnvironmentVariableIsEmpty()
*/
QByteArray qgetenv(const char *varName)

View File

@ -783,26 +783,22 @@ typedef void (*QFunctionPointer)();
# define Q_UNIMPLEMENTED() qWarning("Unimplemented code.")
#endif
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2) Q_REQUIRED_RESULT Q_DECL_UNUSED;
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2)
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyCompare(double p1, double p2)
{
return (qAbs(p1 - p2) * 1000000000000. <= qMin(qAbs(p1), qAbs(p2)));
}
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2) Q_REQUIRED_RESULT Q_DECL_UNUSED;
Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2)
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyCompare(float p1, float p2)
{
return (qAbs(p1 - p2) * 100000.f <= qMin(qAbs(p1), qAbs(p2)));
}
Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(double d) Q_REQUIRED_RESULT Q_DECL_UNUSED;
Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(double d)
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyIsNull(double d)
{
return qAbs(d) <= 0.000000000001;
}
Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f) Q_REQUIRED_RESULT Q_DECL_UNUSED;
Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f)
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyIsNull(float f)
{
return qAbs(f) <= 0.00001f;
}
@ -812,8 +808,7 @@ Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f)
check whether the actual value is 0 or close to 0, but whether
it is binary 0, disregarding sign.
*/
static inline bool qIsNull(double d) Q_REQUIRED_RESULT Q_DECL_UNUSED;
static inline bool qIsNull(double d)
Q_REQUIRED_RESULT static inline Q_DECL_UNUSED bool qIsNull(double d)
{
union U {
double d;
@ -829,8 +824,7 @@ static inline bool qIsNull(double d)
check whether the actual value is 0 or close to 0, but whether
it is binary 0, disregarding sign.
*/
static inline bool qIsNull(float f) Q_REQUIRED_RESULT Q_DECL_UNUSED;
static inline bool qIsNull(float f)
Q_REQUIRED_RESULT static inline Q_DECL_UNUSED bool qIsNull(float f)
{
union U {
float f;

View File

@ -213,6 +213,7 @@ public:
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
QT_WARNING_DISABLE_INTEL(1478)
QT_WARNING_DISABLE_INTEL(1786)
QT_WARNING_DISABLE_MSVC(4996)
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)

View File

@ -771,6 +771,17 @@ int QDataStream::readBlock(char *data, int len)
return readResult;
}
/*!
\fn QDataStream &QDataStream::operator>>(std::nullptr &ptr)
\since 5.9
\overload
Simulates reading a \c{std::nullptr_t} from the stream into \a ptr and
returns a reference to the stream. This function does not actually read
anything from the stream, as \c{std::nullptr_t} values are stored as 0
bytes.
*/
/*!
\fn QDataStream &QDataStream::operator>>(quint8 &i)
\overload
@ -1085,6 +1096,15 @@ int QDataStream::readRawData(char *s, int len)
QDataStream write functions
*****************************************************************************/
/*!
\fn QDataStream &QDataStream::operator<<(std::nullptr ptr)
\since 5.9
\overload
Simulates writing a \c{std::nullptr_t}, \a ptr, to the stream and returns a
reference to the stream. This function does not actually write anything to
the stream, as \c{std::nullptr_t} values are stored as 0 bytes.
*/
/*!
\fn QDataStream &QDataStream::operator<<(quint8 i)

View File

@ -153,6 +153,7 @@ public:
QDataStream &operator>>(quint32 &i);
QDataStream &operator>>(qint64 &i);
QDataStream &operator>>(quint64 &i);
QDataStream &operator>>(std::nullptr_t &ptr) { ptr = nullptr; return *this; }
QDataStream &operator>>(bool &i);
QDataStream &operator>>(qfloat16 &f);
@ -168,6 +169,7 @@ public:
QDataStream &operator<<(quint32 i);
QDataStream &operator<<(qint64 i);
QDataStream &operator<<(quint64 i);
QDataStream &operator<<(std::nullptr_t) { return *this; }
QDataStream &operator<<(bool i);
QDataStream &operator<<(qfloat16 f);
QDataStream &operator<<(float f);

View File

@ -139,7 +139,7 @@ public:
inline QDebug &operator<<(signed short t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(unsigned short t) { stream->ts << t; return maybeSpace(); }
#ifdef Q_COMPILER_UNICODE_STRINGS
inline QDebug &operator<<(char16_t t) { return *this << QChar(t); }
inline QDebug &operator<<(char16_t t) { return *this << QChar(ushort(t)); }
inline QDebug &operator<<(char32_t t) { putUcs4(t); return maybeSpace(); }
#endif
inline QDebug &operator<<(signed int t) { stream->ts << t; return maybeSpace(); }

View File

@ -363,6 +363,7 @@ void QFileSelectorPrivate::updateSelectors()
QStringList QFileSelectorPrivate::platformSelectors()
{
// similar, but not identical to QSysInfo::osType
// ### Qt6: remove macOS fallbacks to "mac" and the future compatibility
QStringList ret;
#if defined(Q_OS_WIN)
ret << QStringLiteral("windows");
@ -380,12 +381,11 @@ QStringList QFileSelectorPrivate::platformSelectors()
# endif
# endif
QString productName = QSysInfo::productType();
# ifdef Q_OS_MACOS
if (productName != QLatin1String("osx"))
ret << QStringLiteral("osx"); // compatibility
# endif
if (productName != QLatin1String("unknown"))
ret << productName; // "opensuse", "fedora", "macos", "ios", "android"
ret << productName; // "opensuse", "fedora", "osx", "ios", "android"
# if defined(Q_OS_MACOS)
ret << QStringLiteral("macos"); // future compatibility
# endif
#endif
return ret;
}

View File

@ -1,5 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2017 Intel Corporation.
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
** Contact: https://www.qt.io/licensing/
@ -607,25 +608,7 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
if (!createParents)
return false;
// we need the cleaned path in order to create the parents
// and we save errno just in case encodeName needs to load codecs
int savedErrno = errno;
bool pathChanged;
{
QString cleanName = QDir::cleanPath(dirName);
// Check if the cleaned name is the same or not. If we were given a
// path with resolvable "../" sections, cleanPath will remove them, but
// this may change the target dir if one of those segments was a
// symlink. This operation depends on cleanPath's optimization of
// returning the original string if it didn't modify anything.
pathChanged = !dirName.isSharedWith(cleanName);
if (pathChanged)
nativeName = QFile::encodeName(cleanName);
}
errno = savedErrno;
return createDirectoryWithParents(nativeName, pathChanged);
return createDirectoryWithParents(nativeName, false);
}
//static

View File

@ -186,9 +186,10 @@ void QLoggingRule::parse(const QStringRef &pattern)
*/
void QLoggingSettingsParser::setContent(const QString &content)
{
QString content_ = content;
QTextStream stream(&content_, QIODevice::ReadOnly);
setContent(stream);
_rules.clear();
const auto lines = content.splitRef(QLatin1Char('\n'));
for (const auto &line : lines)
parseNextLine(line);
}
/*!
@ -198,42 +199,50 @@ void QLoggingSettingsParser::setContent(const QString &content)
void QLoggingSettingsParser::setContent(QTextStream &stream)
{
_rules.clear();
while (!stream.atEnd()) {
QString line = stream.readLine();
QString line;
while (stream.readLineInto(&line))
parseNextLine(QStringRef(&line));
}
// Remove all whitespace from line
line = line.simplified();
line.remove(QLatin1Char(' '));
/*!
\internal
Parses one line of the configuation file
*/
// comment
if (line.startsWith(QLatin1Char(';')))
continue;
void QLoggingSettingsParser::parseNextLine(QStringRef line)
{
// Remove whitespace at start and end of line:
line = line.trimmed();
if (line.startsWith(QLatin1Char('[')) && line.endsWith(QLatin1Char(']'))) {
// new section
_section = line.mid(1, line.size() - 2);
continue;
}
// comment
if (line.startsWith(QLatin1Char(';')))
return;
if (_section.compare(QLatin1String("rules"), Qt::CaseInsensitive) == 0) {
int equalPos = line.indexOf(QLatin1Char('='));
if (equalPos != -1) {
if (line.lastIndexOf(QLatin1Char('=')) == equalPos) {
const QStringRef pattern = line.leftRef(equalPos);
const QStringRef valueStr = line.midRef(equalPos + 1);
int value = -1;
if (valueStr == QLatin1String("true"))
value = 1;
else if (valueStr == QLatin1String("false"))
value = 0;
QLoggingRule rule(pattern, (value == 1));
if (rule.flags != 0 && (value != -1))
_rules.append(rule);
else
warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
} else {
if (line.startsWith(QLatin1Char('[')) && line.endsWith(QLatin1Char(']'))) {
// new section
auto sectionName = line.mid(1, line.size() - 2).trimmed();
m_inRulesSection = sectionName.compare(QLatin1String("rules"), Qt::CaseInsensitive) == 0;
return;
}
if (m_inRulesSection) {
int equalPos = line.indexOf(QLatin1Char('='));
if (equalPos != -1) {
if (line.lastIndexOf(QLatin1Char('=')) == equalPos) {
const auto pattern = line.left(equalPos).trimmed();
const auto valueStr = line.mid(equalPos + 1).trimmed();
int value = -1;
if (valueStr == QLatin1String("true"))
value = 1;
else if (valueStr == QLatin1String("false"))
value = 0;
QLoggingRule rule(pattern, (value == 1));
if (rule.flags != 0 && (value != -1))
_rules.append(rule);
else
warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
}
} else {
warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData());
}
}
}
@ -286,7 +295,7 @@ void QLoggingRegistry::init()
if (!rulesSrc.isEmpty()) {
QTextStream stream(rulesSrc);
QLoggingSettingsParser parser;
parser.setSection(QStringLiteral("Rules"));
parser.setImplicitRulesSection(true);
parser.setContent(stream);
er += parser.rules();
}
@ -350,7 +359,7 @@ void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)
void QLoggingRegistry::setApiRules(const QString &content)
{
QLoggingSettingsParser parser;
parser.setSection(QStringLiteral("Rules"));
parser.setImplicitRulesSection(true);
parser.setContent(content);
if (qtLoggingDebug())

View File

@ -93,7 +93,7 @@ Q_DECLARE_TYPEINFO(QLoggingRule, Q_MOVABLE_TYPE);
class Q_AUTOTEST_EXPORT QLoggingSettingsParser
{
public:
void setSection(const QString &section) { _section = section; }
void setImplicitRulesSection(bool inRulesSection) { m_inRulesSection = inRulesSection; }
void setContent(const QString &content);
void setContent(QTextStream &stream);
@ -101,7 +101,10 @@ public:
QVector<QLoggingRule> rules() const { return _rules; }
private:
QString _section;
void parseNextLine(QStringRef line);
private:
bool m_inRulesSection = false;
QVector<QLoggingRule> _rules;
};

View File

@ -122,6 +122,10 @@ QT_BEGIN_NAMESPACE
#if !defined(Q_OS_DARWIN)
QT_BEGIN_INCLUDE_NAMESPACE
extern char **environ;
QT_END_INCLUDE_NAMESPACE
QProcessEnvironment QProcessEnvironment::systemEnvironment()
{
QProcessEnvironment env;

View File

@ -196,7 +196,7 @@ public:
QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
QString toString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
QString toDisplayString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
QUrl adjusted(FormattingOptions options) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QUrl adjusted(FormattingOptions options) const;
QByteArray toEncoded(FormattingOptions options = FullyEncoded) const;
static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode);
@ -255,7 +255,7 @@ public:
QString fragment(ComponentFormattingOptions options = PrettyDecoded) const;
void setFragment(const QString &fragment, ParsingMode mode = TolerantMode);
QUrl resolved(const QUrl &relative) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QUrl resolved(const QUrl &relative) const;
bool isRelative() const;
bool isParentOf(const QUrl &url) const;

View File

@ -64,9 +64,7 @@ static QString qt_convertJString(jstring string)
static inline bool exceptionCheckAndClear(JNIEnv *env)
{
if (Q_UNLIKELY(env->ExceptionCheck())) {
#ifdef QT_DEBUG
env->ExceptionDescribe();
#endif // QT_DEBUG
env->ExceptionClear();
return true;
}

View File

@ -1350,6 +1350,7 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data)
case QMetaType::QJsonDocument:
return false;
case QMetaType::Nullptr:
stream << *static_cast<const std::nullptr_t *>(data);
return true;
case QMetaType::Long:
stream << qlonglong(*static_cast<const long *>(data));
@ -1573,6 +1574,7 @@ bool QMetaType::load(QDataStream &stream, int type, void *data)
case QMetaType::QJsonDocument:
return false;
case QMetaType::Nullptr:
stream >> *static_cast<std::nullptr_t *>(data);
return true;
case QMetaType::Long: {
qlonglong l;

View File

@ -649,6 +649,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::Bool:
*ba = QByteArray(d->data.b ? "true" : "false");
break;
case QVariant::Uuid:
*ba = v_cast<QUuid>(d)->toByteArray();
break;
default:
#ifndef QT_NO_QOBJECT
{
@ -916,6 +919,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok)
case QVariant::String:
*static_cast<QUuid *>(result) = QUuid(*v_cast<QString>(d));
break;
case QVariant::ByteArray:
*static_cast<QUuid *>(result) = QUuid(*v_cast<QByteArray>(d));
break;
default:
return false;
}
@ -2526,8 +2532,9 @@ QRegularExpression QVariant::toRegularExpression() const
/*!
\since 5.0
Returns the variant as a QUuid if the variant has userType() \l
QUuid; otherwise returns a default constructed QUuid.
Returns the variant as a QUuid if the variant has type()
\l QMetaType::QUuid, \l QMetaType::QByteArray or \l QMetaType::QString;
otherwise returns a default-constructed QUuid.
\sa canConvert(), convert()
*/
@ -2874,7 +2881,8 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
/*QStringList*/ 1 << QVariant::List | 1 << QVariant::String,
/*QByteArray*/ 1 << QVariant::String | 1 << QVariant::Int | 1 << QVariant::UInt | 1 << QVariant::Bool
| 1 << QVariant::Double | 1 << QVariant::LongLong | 1 << QVariant::ULongLong,
| 1 << QVariant::Double | 1 << QVariant::LongLong | 1 << QVariant::ULongLong
| 1 << QVariant::Uuid,
/*QBitArray*/ 0,
@ -2910,7 +2918,7 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
/*QEasingCurve*/ 0,
/*QUuid*/ 1 << QVariant::String
/*QUuid*/ 1 << QVariant::String | 1 << QVariant::ByteArray,
};
static const size_t qCanConvertMatrixMaximumTargetType = 8 * sizeof(*qCanConvertMatrix);
@ -2965,7 +2973,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\l QMetaType::UInt, \l QMetaType::ULongLong
\row \li \l QMetaType::QByteArray \li \l QMetaType::Double,
\l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString,
\l QMetaType::UInt, \l QMetaType::ULongLong
\l QMetaType::UInt, \l QMetaType::ULongLong, \l QMetaType::QUuid
\row \li \l QMetaType::QChar \li \l QMetaType::Bool, \l QMetaType::Int,
\l QMetaType::UInt, \l QMetaType::LongLong, \l QMetaType::ULongLong
\row \li \l QMetaType::QColor \li \l QMetaType::QString
@ -2995,7 +3003,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\l QMetaType::QDate, \l QMetaType::QDateTime, \l QMetaType::Double,
\l QMetaType::QFont, \l QMetaType::Int, \l QMetaType::QKeySequence,
\l QMetaType::LongLong, \l QMetaType::QStringList, \l QMetaType::QTime,
\l QMetaType::UInt, \l QMetaType::ULongLong
\l QMetaType::UInt, \l QMetaType::ULongLong, \l QMetaType::QUuid
\row \li \l QMetaType::QStringList \li \l QMetaType::QVariantList,
\l QMetaType::QString (if the list contains exactly one item)
\row \li \l QMetaType::QTime \li \l QMetaType::QString
@ -3005,6 +3013,7 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\row \li \l QMetaType::ULongLong \li \l QMetaType::Bool,
\l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int,
\l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt
\row \li \l QMetaType::QUuid \li \l QMetaType::QByteArray, \l QMetaType::QString
\endtable
A QVariant containing a pointer to a type derived from QObject will also return true for this

View File

@ -88,7 +88,7 @@ public:
QT_DEPRECATED_X("use tryTake(), but note the different deletion rules")
void cancel(QRunnable *runnable);
#endif
bool tryTake(QRunnable *runnable) Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT bool tryTake(QRunnable *runnable);
};
QT_END_NAMESPACE

View File

@ -112,12 +112,10 @@ struct Q_CORE_EXPORT QArrayData
return result;
}
static QArrayData *allocate(size_t objectSize, size_t alignment,
size_t capacity, AllocationOptions options = Default)
Q_DECL_NOTHROW Q_REQUIRED_RESULT;
static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize,
size_t newCapacity, AllocationOptions newOptions = Default)
Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static QArrayData *allocate(size_t objectSize, size_t alignment,
size_t capacity, AllocationOptions options = Default) Q_DECL_NOTHROW;
Q_REQUIRED_RESULT static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize,
size_t newCapacity, AllocationOptions newOptions = Default) Q_DECL_NOTHROW;
static void deallocate(QArrayData *data, size_t objectSize,
size_t alignment) Q_DECL_NOTHROW;
@ -217,8 +215,8 @@ struct QTypedArrayData
class AlignmentDummy { QArrayData header; T data; };
static QTypedArrayData *allocate(size_t capacity,
AllocationOptions options = Default) Q_REQUIRED_RESULT
Q_REQUIRED_RESULT static QTypedArrayData *allocate(size_t capacity,
AllocationOptions options = Default)
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
return static_cast<QTypedArrayData *>(QArrayData::allocate(sizeof(T),

View File

@ -174,7 +174,7 @@ public:
}
private:
Data *clone(QArrayData::AllocationOptions options) const Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Data *clone(QArrayData::AllocationOptions options) const
{
Data *x = Data::allocate(d->detachCapacity(d->size), options);
Q_CHECK_PTR(x);

View File

@ -231,10 +231,10 @@ public:
int count(const char *a) const;
int count(const QByteArray &a) const;
QByteArray left(int len) const Q_REQUIRED_RESULT;
QByteArray right(int len) const Q_REQUIRED_RESULT;
QByteArray mid(int index, int len = -1) const Q_REQUIRED_RESULT;
QByteArray chopped(int len) const Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray left(int len) const;
Q_REQUIRED_RESULT QByteArray right(int len) const;
Q_REQUIRED_RESULT QByteArray mid(int index, int len = -1) const;
Q_REQUIRED_RESULT QByteArray chopped(int len) const
{ Q_ASSERT(len >= 0); Q_ASSERT(len <= size()); return left(size() - len); }
bool startsWith(const QByteArray &a) const;
@ -249,41 +249,41 @@ public:
void chop(int n);
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC)
# if defined(Q_CC_GNU)
# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
// required due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941
# pragma push_macro("Q_REQUIRED_RESULT")
# undef Q_REQUIRED_RESULT
# define Q_REQUIRED_RESULT
# define Q_REQUIRED_RESULT_pushed
# endif
Q_ALWAYS_INLINE QByteArray toLower() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toLower() const &
{ return toLower_helper(*this); }
Q_ALWAYS_INLINE QByteArray toLower() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toLower() &&
{ return toLower_helper(*this); }
Q_ALWAYS_INLINE QByteArray toUpper() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toUpper() const &
{ return toUpper_helper(*this); }
Q_ALWAYS_INLINE QByteArray toUpper() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toUpper() &&
{ return toUpper_helper(*this); }
Q_ALWAYS_INLINE QByteArray trimmed() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray trimmed() const &
{ return trimmed_helper(*this); }
Q_ALWAYS_INLINE QByteArray trimmed() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray trimmed() &&
{ return trimmed_helper(*this); }
Q_ALWAYS_INLINE QByteArray simplified() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray simplified() const &
{ return simplified_helper(*this); }
Q_ALWAYS_INLINE QByteArray simplified() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray simplified() &&
{ return simplified_helper(*this); }
# ifdef Q_REQUIRED_RESULT_pushed
# pragma pop_macro("Q_REQUIRED_RESULT")
# endif
#else
QByteArray toLower() const Q_REQUIRED_RESULT;
QByteArray toUpper() const Q_REQUIRED_RESULT;
QByteArray trimmed() const Q_REQUIRED_RESULT;
QByteArray simplified() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QByteArray toLower() const;
Q_REQUIRED_RESULT QByteArray toUpper() const;
Q_REQUIRED_RESULT QByteArray trimmed() const;
Q_REQUIRED_RESULT QByteArray simplified() const;
#endif
QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const Q_REQUIRED_RESULT;
QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const;
Q_REQUIRED_RESULT QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const;
QByteArray &prepend(char c);
inline QByteArray &prepend(int count, char c);
@ -318,7 +318,7 @@ public:
QList<QByteArray> split(char sep) const;
QByteArray repeated(int times) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QByteArray repeated(int times) const;
#ifndef QT_NO_CAST_TO_ASCII
QT_ASCII_CAST_WARN QByteArray &append(const QString &s);
@ -368,16 +368,16 @@ public:
QByteArray &setNum(double, char f = 'g', int prec = 6);
QByteArray &setRawData(const char *a, uint n); // ### Qt 6: use an int
static QByteArray number(int, int base = 10) Q_REQUIRED_RESULT;
static QByteArray number(uint, int base = 10) Q_REQUIRED_RESULT;
static QByteArray number(qlonglong, int base = 10) Q_REQUIRED_RESULT;
static QByteArray number(qulonglong, int base = 10) Q_REQUIRED_RESULT;
static QByteArray number(double, char f = 'g', int prec = 6) Q_REQUIRED_RESULT;
static QByteArray fromRawData(const char *, int size) Q_REQUIRED_RESULT;
static QByteArray fromBase64(const QByteArray &base64, Base64Options options) Q_REQUIRED_RESULT;
static QByteArray fromBase64(const QByteArray &base64) Q_REQUIRED_RESULT; // ### Qt6 merge with previous
static QByteArray fromHex(const QByteArray &hexEncoded) Q_REQUIRED_RESULT;
static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%') Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static QByteArray number(int, int base = 10);
Q_REQUIRED_RESULT static QByteArray number(uint, int base = 10);
Q_REQUIRED_RESULT static QByteArray number(qlonglong, int base = 10);
Q_REQUIRED_RESULT static QByteArray number(qulonglong, int base = 10);
Q_REQUIRED_RESULT static QByteArray number(double, char f = 'g', int prec = 6);
Q_REQUIRED_RESULT static QByteArray fromRawData(const char *, int size);
Q_REQUIRED_RESULT static QByteArray fromBase64(const QByteArray &base64, Base64Options options);
Q_REQUIRED_RESULT static QByteArray fromBase64(const QByteArray &base64); // ### Qt6 merge with previous
Q_REQUIRED_RESULT static QByteArray fromHex(const QByteArray &hexEncoded);
Q_REQUIRED_RESULT static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
static QByteArray fromCFData(CFDataRef data);

View File

@ -2317,10 +2317,11 @@ static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localT
tm local;
bool valid = false;
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// localtime() is required to work as if tzset() was called before it.
// localtime_r() does not have this requirement, so make an explicit call.
// The explicit call should also request the timezone info be re-parsed.
qt_tzset();
#if !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// Use the reentrant version of localtime() where available
// as is thread-safe and doesn't use a shared static data area
tm *res = 0;

View File

@ -106,9 +106,9 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
#endif // < Qt 6
void getDate(int *year, int *month, int *day) const;
QDate addDays(qint64 days) const Q_REQUIRED_RESULT;
QDate addMonths(int months) const Q_REQUIRED_RESULT;
QDate addYears(int years) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QDate addDays(qint64 days) const;
Q_REQUIRED_RESULT QDate addMonths(int months) const;
Q_REQUIRED_RESULT QDate addYears(int years) const;
qint64 daysTo(const QDate &) const;
Q_DECL_CONSTEXPR bool operator==(const QDate &other) const { return jd == other.jd; }
@ -172,9 +172,9 @@ public:
#endif
bool setHMS(int h, int m, int s, int ms = 0);
QTime addSecs(int secs) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QTime addSecs(int secs) const;
int secsTo(const QTime &) const;
QTime addMSecs(int ms) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QTime addMSecs(int ms) const;
int msecsTo(const QTime &) const;
Q_DECL_CONSTEXPR bool operator==(const QTime &other) const { return mds == other.mds; }
@ -306,11 +306,11 @@ public:
#endif
QString toString(QStringView format) const;
#endif
QDateTime addDays(qint64 days) const Q_REQUIRED_RESULT;
QDateTime addMonths(int months) const Q_REQUIRED_RESULT;
QDateTime addYears(int years) const Q_REQUIRED_RESULT;
QDateTime addSecs(qint64 secs) const Q_REQUIRED_RESULT;
QDateTime addMSecs(qint64 msecs) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QDateTime addDays(qint64 days) const;
Q_REQUIRED_RESULT QDateTime addMonths(int months) const;
Q_REQUIRED_RESULT QDateTime addYears(int years) const;
Q_REQUIRED_RESULT QDateTime addSecs(qint64 secs) const;
Q_REQUIRED_RESULT QDateTime addMSecs(qint64 msecs) const;
QDateTime toTimeSpec(Qt::TimeSpec spec) const;
inline QDateTime toLocalTime() const { return toTimeSpec(Qt::LocalTime); }

View File

@ -73,10 +73,10 @@ public:
inline void translate(const QPoint &p);
inline void translate(int dx, int dy);
Q_DECL_CONSTEXPR inline QLine translated(const QPoint &p) const Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QLine translated(int dx, int dy) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLine translated(const QPoint &p) const;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLine translated(int dx, int dy) const;
Q_DECL_CONSTEXPR inline QPoint center() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QPoint center() const;
inline void setP1(const QPoint &p1);
inline void setP2(const QPoint &p2);
@ -221,7 +221,7 @@ public:
Q_DECL_CONSTEXPR inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
Q_DECL_CONSTEXPR inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
static QLineF fromPolar(qreal length, qreal angle) Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static QLineF fromPolar(qreal length, qreal angle);
Q_DECL_CONSTEXPR bool isNull() const;
@ -245,8 +245,8 @@ public:
qreal angleTo(const QLineF &l) const;
QLineF unitVector() const Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QLineF normalVector() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QLineF unitVector() const;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF normalVector() const;
// ### Qt 6: rename intersects() or intersection() and rename IntersectType IntersectionType
IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
@ -257,10 +257,10 @@ public:
inline void translate(const QPointF &p);
inline void translate(qreal dx, qreal dy);
Q_DECL_CONSTEXPR inline QLineF translated(const QPointF &p) const Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QLineF translated(qreal dx, qreal dy) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF translated(const QPointF &p) const;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF translated(qreal dx, qreal dy) const;
Q_DECL_CONSTEXPR inline QPointF center() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QPointF center() const;
inline void setP1(const QPointF &p1);
inline void setP2(const QPointF &p2);

View File

@ -38,13 +38,13 @@
**
****************************************************************************/
#include "qglobal.h"
#if !defined(QWS) && defined(Q_OS_MAC)
# include "private/qcore_mac_p.h"
# include <CoreFoundation/CoreFoundation.h>
#endif
#include "qglobal.h"
#include "qplatformdefs.h"
#include "qdatastream.h"

View File

@ -209,8 +209,10 @@ struct QMapData : public QMapDataBase
Node *root() const { return static_cast<Node *>(header.left); }
const Node *end() const { return static_cast<const Node *>(&header); }
Node *end() { return static_cast<Node *>(&header); }
// using reinterpret_cast because QMapDataBase::header is not
// actually a QMapNode.
const Node *end() const { return reinterpret_cast<const Node *>(&header); }
Node *end() { return reinterpret_cast<Node *>(&header); }
const Node *begin() const { if (root()) return static_cast<const Node*>(mostLeftNode); return end(); }
Node *begin() { if (root()) return static_cast<Node*>(mostLeftNode); return end(); }

View File

@ -94,7 +94,7 @@ public:
friend Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &, qreal);
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
CGPoint toCGPoint() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW;
#endif
private:
@ -256,8 +256,8 @@ public:
Q_DECL_CONSTEXPR QPoint toPoint() const;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
static QPointF fromCGPoint(CGPoint point) Q_DECL_NOTHROW Q_REQUIRED_RESULT;
CGPoint toCGPoint() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static QPointF fromCGPoint(CGPoint point) Q_DECL_NOTHROW;
Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW;
#endif
private:

View File

@ -70,7 +70,7 @@ public:
Q_DECL_CONSTEXPR inline int top() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline int right() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline int bottom() const Q_DECL_NOTHROW;
QRect normalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QRect normalized() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline int x() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline int y() const Q_DECL_NOTHROW;
@ -104,9 +104,9 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void translate(int dx, int dy) Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPoint &p) Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QRect transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect transposed() const Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void moveTo(int x, int t) Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPoint &p) Q_DECL_NOTHROW;
@ -118,7 +118,7 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
Q_DECL_RELAXED_CONSTEXPR inline void adjust(int x1, int y1, int x2, int y2) Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QSize size() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline int width() const Q_DECL_NOTHROW;
@ -136,8 +136,8 @@ public:
bool contains(const QPoint &p, bool proper=false) const Q_DECL_NOTHROW;
inline bool contains(int x, int y) const Q_DECL_NOTHROW;
inline bool contains(int x, int y, bool proper) const Q_DECL_NOTHROW;
inline QRect united(const QRect &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
inline QRect intersected(const QRect &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT inline QRect united(const QRect &other) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT inline QRect intersected(const QRect &other) const Q_DECL_NOTHROW;
bool intersects(const QRect &r) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRect marginsAdded(const QMargins &margins) const Q_DECL_NOTHROW;
@ -146,15 +146,15 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline QRect &operator-=(const QMargins &margins) Q_DECL_NOTHROW;
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED QRect unite(const QRect &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return united(r); }
QT_DEPRECATED QRect intersect(const QRect &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return intersected(r); }
Q_REQUIRED_RESULT QT_DEPRECATED QRect unite(const QRect &r) const Q_DECL_NOTHROW { return united(r); }
Q_REQUIRED_RESULT QT_DEPRECATED QRect intersect(const QRect &r) const Q_DECL_NOTHROW { return intersected(r); }
#endif
friend Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) Q_DECL_NOTHROW;
friend Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) Q_DECL_NOTHROW;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
CGRect toCGRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW;
#endif
private:
@ -520,7 +520,7 @@ public:
Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
QRectF normalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QRectF normalized() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline qreal left() const Q_DECL_NOTHROW { return xp; }
Q_DECL_CONSTEXPR inline qreal top() const Q_DECL_NOTHROW { return yp; }
@ -560,10 +560,10 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void translate(qreal dx, qreal dy) Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPointF &p) Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRectF transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF transposed() const Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void moveTo(qreal x, qreal y) Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPointF &p) Q_DECL_NOTHROW;
@ -575,7 +575,7 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
Q_DECL_RELAXED_CONSTEXPR inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QSizeF size() const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline qreal width() const Q_DECL_NOTHROW;
@ -592,8 +592,8 @@ public:
bool contains(const QRectF &r) const Q_DECL_NOTHROW;
bool contains(const QPointF &p) const Q_DECL_NOTHROW;
inline bool contains(qreal x, qreal y) const Q_DECL_NOTHROW;
inline QRectF united(const QRectF &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
inline QRectF intersected(const QRectF &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT inline QRectF united(const QRectF &other) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT inline QRectF intersected(const QRectF &other) const Q_DECL_NOTHROW;
bool intersects(const QRectF &r) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRectF marginsAdded(const QMarginsF &margins) const Q_DECL_NOTHROW;
@ -602,19 +602,19 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator-=(const QMarginsF &margins) Q_DECL_NOTHROW;
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED QRectF unite(const QRectF &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return united(r); }
QT_DEPRECATED QRectF intersect(const QRectF &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return intersected(r); }
Q_REQUIRED_RESULT QT_DEPRECATED QRectF unite(const QRectF &r) const Q_DECL_NOTHROW { return united(r); }
Q_REQUIRED_RESULT QT_DEPRECATED QRectF intersect(const QRectF &r) const Q_DECL_NOTHROW { return intersected(r); }
#endif
friend Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
friend Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QRect toRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
QRect toAlignedRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect toRect() const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT QRect toAlignedRect() const Q_DECL_NOTHROW;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
static QRectF fromCGRect(CGRect rect) Q_DECL_NOTHROW Q_REQUIRED_RESULT;
CGRect toCGRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static QRectF fromCGRect(CGRect rect) Q_DECL_NOTHROW;
Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW;
#endif
private:

View File

@ -445,19 +445,25 @@ QT_BEGIN_NAMESPACE
Other differences are outlined below.
\section2 Exact matching
\section2 Porting from QRegExp::exactMatch()
QRegExp::exactMatch() in Qt 4 served two purposes: it exactly matched
a regular expression against a subject string, and it implemented partial
matching. In fact, if an exact match was not found, one could still find
out how much of the subject string was matched by the regular expression
by calling QRegExp::matchedLength(). If the returned length was equal
to the subject string's length, then one could desume that a partial match
was found.
matching.
QRegularExpression supports partial matching explicitly by means of the
appropriate MatchType. If instead you simply want to be sure that the
subject string matches the regular expression exactly, you can wrap the
\section3 Porting from QRegExp's Exact Matching
Exact matching indicates whether the regular expression matches the entire
subject string. For example, the classes yield on the subject string \c{"abc123"}:
\table
\header \li \li QRegExp::exactMatch() \li QRegularExpressionMatch::hasMatch()
\row \li \c{"\\d+"} \li \b false \li \b true
\row \li \c{"[a-z]+\\d+"} \li \b true \li \b true
\endtable
Exact matching is not reflected in QRegularExpression. If you want to be
sure that the subject string matches the regular expression exactly, you can wrap the
pattern between a couple of anchoring expressions. Simply
putting the pattern between the \c{^} and the \c{$} anchors is enough
in most cases:
@ -479,6 +485,17 @@ QT_BEGIN_NAMESPACE
Note the usage of the non-capturing group in order to preserve the meaning
of the branch operator inside the pattern.
\section3 Porting from QRegExp's Partial Matching
When using QRegExp::exactMatch(), if an exact match was not found, one
could still find out how much of the subject string was matched by the
regular expression by calling QRegExp::matchedLength(). If the returned length
was equal to the subject string's length, then one could conclude that a partial
match was found.
QRegularExpression supports partial matching explicitly by means of the
appropriate MatchType.
\section2 Global matching
Due to limitations of the QRegExp API it was impossible to implement global

View File

@ -260,6 +260,7 @@ namespace QtSharedPointer {
internalSafetyCheckRemove(self);
deleter(self);
}
static void noDeleter(ExternalRefCountData *) { }
static inline ExternalRefCountData *create(T **ptr, DestroyerFn destroy)
{
@ -433,11 +434,13 @@ public:
# else
typename Private::DestroyerFn destroy = &Private::deleter;
# endif
typename Private::DestroyerFn noDestroy = &Private::noDeleter;
QSharedPointer result(Qt::Uninitialized);
result.d = Private::create(&result.value, destroy);
result.d = Private::create(&result.value, noDestroy);
// now initialize the data
new (result.data()) T(std::forward<Args>(arguments)...);
result.d->destroyer = destroy;
result.d->setQObjectShared(result.value, true);
# ifdef QT_SHAREDPOINTER_TRACK_POINTERS
internalSafetyCheckAdd(result.d, result.value);

View File

@ -166,10 +166,11 @@
# define __MIPS_DSPR2__
# endif
#elif (defined(Q_CC_INTEL) || defined(Q_CC_MSVC) \
|| (defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && (__GNUC__-0) * 100 + (__GNUC_MINOR__-0) >= 409)) \
|| (defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && Q_CC_GNU >= 409) \
|| (defined(Q_CC_CLANG) && Q_CC_CLANG >= 308)) \
&& !defined(QT_BOOTSTRAPPED)
# define QT_COMPILER_SUPPORTS_SIMD_ALWAYS
# define QT_COMPILER_SUPPORTS_HERE(x) QT_COMPILER_SUPPORTS(x)
# define QT_COMPILER_SUPPORTS_HERE(x) ((__ ## x ## __) || QT_COMPILER_SUPPORTS(x))
# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL)
/* GCC requires attributes for a function */
# define QT_FUNCTION_TARGET(x) __attribute__((__target__(QT_FUNCTION_TARGET_STRING_ ## x)))

View File

@ -64,15 +64,15 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) Q_DECL_NOTHROW;
void transpose() Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QSize transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize transposed() const Q_DECL_NOTHROW;
inline void scale(int w, int h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
inline void scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
QSize scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QSize scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline int &rwidth() Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline int &rheight() Q_DECL_NOTHROW;
@ -91,7 +91,7 @@ public:
friend inline const QSize operator/(const QSize &, qreal);
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
CGSize toCGSize() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW;
#endif
private:
@ -228,15 +228,15 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) Q_DECL_NOTHROW;
void transpose() Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QSizeF transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF transposed() const Q_DECL_NOTHROW;
inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline qreal &rwidth() Q_DECL_NOTHROW;
Q_DECL_RELAXED_CONSTEXPR inline qreal &rheight() Q_DECL_NOTHROW;
@ -257,8 +257,8 @@ public:
Q_DECL_CONSTEXPR inline QSize toSize() const Q_DECL_NOTHROW;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
static QSizeF fromCGSize(CGSize size) Q_DECL_NOTHROW Q_REQUIRED_RESULT;
CGSize toCGSize() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static QSizeF fromCGSize(CGSize size) Q_DECL_NOTHROW;
Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW;
#endif
private:

View File

@ -312,58 +312,58 @@ public:
const QChar operator[](uint i) const;
QCharRef operator[](uint i);
inline QChar front() const Q_REQUIRED_RESULT { return at(0); }
inline QCharRef front() Q_REQUIRED_RESULT;
inline QChar back() const Q_REQUIRED_RESULT { return at(size() - 1); }
inline QCharRef back() Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT inline QChar front() const { return at(0); }
Q_REQUIRED_RESULT inline QCharRef front();
Q_REQUIRED_RESULT inline QChar back() const { return at(size() - 1); }
Q_REQUIRED_RESULT inline QCharRef back();
QString arg(qlonglong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(qulonglong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(long a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(ulong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(int a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(uint a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(short a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(ushort a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(char a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(QChar a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString arg(qlonglong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(qulonglong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(long a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(ulong a, int fieldwidth=0, int base=10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(int a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(uint a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(short a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(ushort a, int fieldWidth = 0, int base = 10,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(char a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(QChar a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
#if QT_STRINGVIEW_LEVEL < 2
QString arg(const QString &a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString arg(const QString &a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
#endif
QString arg(QStringView a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(QLatin1String a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
Q_REQUIRED_RESULT QString arg(QStringView a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(QLatin1String a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a7) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8) const Q_REQUIRED_RESULT;
QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a7, const QString &a8) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8, const QString &a9) const Q_REQUIRED_RESULT;
const QString &a7, const QString &a8, const QString &a9) const;
QString &vsprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(2, 0);
QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
@ -425,16 +425,16 @@ public:
#ifndef QT_NO_REGULAREXPRESSION
QString section(const QRegularExpression &re, int start, int end = -1, SectionFlags flags = SectionDefault) const;
#endif
QString left(int n) const Q_REQUIRED_RESULT;
QString right(int n) const Q_REQUIRED_RESULT;
QString mid(int position, int n = -1) const Q_REQUIRED_RESULT;
QString chopped(int n) const Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QString left(int n) const;
Q_REQUIRED_RESULT QString right(int n) const;
Q_REQUIRED_RESULT QString mid(int position, int n = -1) const;
Q_REQUIRED_RESULT QString chopped(int n) const
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return left(size() - n); }
QStringRef leftRef(int n) const Q_REQUIRED_RESULT;
QStringRef rightRef(int n) const Q_REQUIRED_RESULT;
QStringRef midRef(int position, int n = -1) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QStringRef leftRef(int n) const;
Q_REQUIRED_RESULT QStringRef rightRef(int n) const;
Q_REQUIRED_RESULT QStringRef midRef(int position, int n = -1) const;
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@ -445,48 +445,48 @@ public:
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT;
QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const;
Q_REQUIRED_RESULT QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const;
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC)
# if defined(Q_CC_GNU)
# if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
// required due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61941
# pragma push_macro("Q_REQUIRED_RESULT")
# undef Q_REQUIRED_RESULT
# define Q_REQUIRED_RESULT
# define Q_REQUIRED_RESULT_pushed
# endif
Q_ALWAYS_INLINE QString toLower() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toLower() const &
{ return toLower_helper(*this); }
Q_ALWAYS_INLINE QString toLower() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toLower() &&
{ return toLower_helper(*this); }
Q_ALWAYS_INLINE QString toUpper() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toUpper() const &
{ return toUpper_helper(*this); }
Q_ALWAYS_INLINE QString toUpper() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toUpper() &&
{ return toUpper_helper(*this); }
Q_ALWAYS_INLINE QString toCaseFolded() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toCaseFolded() const &
{ return toCaseFolded_helper(*this); }
Q_ALWAYS_INLINE QString toCaseFolded() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toCaseFolded() &&
{ return toCaseFolded_helper(*this); }
Q_ALWAYS_INLINE QString trimmed() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString trimmed() const &
{ return trimmed_helper(*this); }
Q_ALWAYS_INLINE QString trimmed() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString trimmed() &&
{ return trimmed_helper(*this); }
Q_ALWAYS_INLINE QString simplified() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString simplified() const &
{ return simplified_helper(*this); }
Q_ALWAYS_INLINE QString simplified() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString simplified() &&
{ return simplified_helper(*this); }
# ifdef Q_REQUIRED_RESULT_pushed
# pragma pop_macro("Q_REQUIRED_RESULT")
# endif
#else
QString toLower() const Q_REQUIRED_RESULT;
QString toUpper() const Q_REQUIRED_RESULT;
QString toCaseFolded() const Q_REQUIRED_RESULT;
QString trimmed() const Q_REQUIRED_RESULT;
QString simplified() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString toLower() const;
Q_REQUIRED_RESULT QString toUpper() const;
Q_REQUIRED_RESULT QString toCaseFolded() const;
Q_REQUIRED_RESULT QString trimmed() const;
Q_REQUIRED_RESULT QString simplified() const;
#endif
QString toHtmlEscaped() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString toHtmlEscaped() const;
QString &insert(int i, QChar c);
QString &insert(int i, const QChar *uc, int len);
@ -545,21 +545,21 @@ public:
enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
QVector<QStringRef> splitRef(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
QStringList split(QChar sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
QVector<QStringRef> splitRef(QChar sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
Q_REQUIRED_RESULT QStringList split(QChar sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(QChar sep, SplitBehavior behavior = KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#ifndef QT_NO_REGEXP
QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
QVector<QStringRef> splitRef(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const;
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const;
#endif
#ifndef QT_NO_REGULAREXPRESSION
QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
QVector<QStringRef> splitRef(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const;
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const;
#endif
enum NormalizationForm {
NormalizationForm_D,
@ -567,31 +567,31 @@ public:
NormalizationForm_KD,
NormalizationForm_KC
};
QString normalized(NormalizationForm mode, QChar::UnicodeVersion version = QChar::Unicode_Unassigned) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString normalized(NormalizationForm mode, QChar::UnicodeVersion version = QChar::Unicode_Unassigned) const;
QString repeated(int times) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QString repeated(int times) const;
const ushort *utf16() const;
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC)
QByteArray toLatin1() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toLatin1() const &
{ return toLatin1_helper(*this); }
QByteArray toLatin1() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toLatin1() &&
{ return toLatin1_helper_inplace(*this); }
QByteArray toUtf8() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toUtf8() const &
{ return toUtf8_helper(*this); }
QByteArray toUtf8() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toUtf8() &&
{ return toUtf8_helper(*this); }
QByteArray toLocal8Bit() const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const &
{ return toLocal8Bit_helper(isNull() ? nullptr : constData(), size()); }
QByteArray toLocal8Bit() && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toLocal8Bit() &&
{ return toLocal8Bit_helper(isNull() ? nullptr : constData(), size()); }
#else
QByteArray toLatin1() const Q_REQUIRED_RESULT;
QByteArray toUtf8() const Q_REQUIRED_RESULT;
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QByteArray toLatin1() const;
Q_REQUIRED_RESULT QByteArray toUtf8() const;
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const;
#endif
QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QVector<uint> toUcs4() const;
// note - this are all inline so we can benefit from strlen() compile time optimizations
static inline QString fromLatin1(const char *str, int size = -1)
@ -629,12 +629,12 @@ public:
{ return fromLatin1(str, size); }
QT_DEPRECATED static inline QString fromAscii(const QByteArray &str)
{ return fromLatin1(str); }
QByteArray toAscii() const Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QByteArray toAscii() const
{ return toLatin1(); }
#endif
inline int toWCharArray(wchar_t *array) const;
static inline QString fromWCharArray(const wchar_t *string, int size = -1) Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT static inline QString fromWCharArray(const wchar_t *string, int size = -1);
QString &setRawData(const QChar *unicode, int size);
QString &setUnicode(const QChar *unicode, int size);
@ -823,7 +823,7 @@ public:
static inline QString fromStdWString(const std::wstring &s);
inline std::wstring toStdWString() const;
#if defined(Q_COMPILER_UNICODE_STRINGS) || defined(Q_QDOC)
#if defined(Q_STDLIB_UNICODE_STRINGS) || defined(Q_QDOC)
static inline QString fromStdU16String(const std::u16string &s);
inline std::u16string toStdU16String() const;
static inline QString fromStdU32String(const std::u32string &s);
@ -1409,7 +1409,7 @@ inline std::wstring QString::toStdWString() const
inline QString QString::fromStdWString(const std::wstring &s)
{ return fromWCharArray(s.data(), int(s.size())); }
#if defined(Q_COMPILER_UNICODE_STRINGS)
#if defined(Q_STDLIB_UNICODE_STRINGS)
inline QString QString::fromStdU16String(const std::u16string &s)
{ return fromUtf16(s.data(), int(s.size())); }
@ -1495,15 +1495,15 @@ public:
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
QVector<QStringRef> split(const QString &sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
QVector<QStringRef> split(QChar sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QVector<QStringRef> split(const QString &sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
Q_REQUIRED_RESULT QVector<QStringRef> split(QChar sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
QStringRef left(int n) const Q_REQUIRED_RESULT;
QStringRef right(int n) const Q_REQUIRED_RESULT;
QStringRef mid(int pos, int n = -1) const Q_REQUIRED_RESULT;
QStringRef chopped(int n) const Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QStringRef left(int n) const;
Q_REQUIRED_RESULT QStringRef right(int n) const;
Q_REQUIRED_RESULT QStringRef mid(int pos, int n = -1) const;
Q_REQUIRED_RESULT QStringRef chopped(int n) const
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return left(size() - n); }
void truncate(int pos) Q_DECL_NOTHROW { m_size = qBound(0, pos, m_size); }
@ -1550,13 +1550,13 @@ public:
inline const_reverse_iterator crend() const { return rend(); }
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED QByteArray toAscii() const Q_REQUIRED_RESULT
Q_REQUIRED_RESULT QT_DEPRECATED QByteArray toAscii() const
{ return toLatin1(); }
#endif
QByteArray toLatin1() const Q_REQUIRED_RESULT;
QByteArray toUtf8() const Q_REQUIRED_RESULT;
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT;
QVector<uint> toUcs4() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QByteArray toLatin1() const;
Q_REQUIRED_RESULT QByteArray toUtf8() const;
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const;
Q_REQUIRED_RESULT QVector<uint> toUcs4() const;
inline void clear() { m_string = Q_NULLPTR; m_position = m_size = 0; }
QString toString() const;
@ -1600,7 +1600,7 @@ public:
static int localeAwareCompare(const QStringRef &s1, const QString &s2);
static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2);
QStringRef trimmed() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QStringRef trimmed() const;
short toShort(bool *ok = Q_NULLPTR, int base = 10) const;
ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const;
int toInt(bool *ok = Q_NULLPTR, int base = 10) const;

View File

@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
\reentrant
\since 4.6
\brief The QStringBuilder class is a template class that provides a facility to build up QStrings from smaller chunks.
\brief The QStringBuilder class is a template class that provides a facility to build up QStrings and QByteArrays from smaller chunks.
\ingroup tools
\ingroup shared
@ -58,22 +58,34 @@ QT_BEGIN_NAMESPACE
To build a QString by multiple concatenations, QString::operator+()
is typically used. This causes \e{n - 1} reallocations when building
a string from \e{n} chunks.
is typically used. This causes \e{n - 1} allocations when building
a string from \e{n} chunks. The same is true for QByteArray.
QStringBuilder uses expression templates to collect the individual
chunks, compute the total size, allocate the required amount of
memory for the final QString object, and copy the chunks into the
memory for the final string object, and copy the chunks into the
allocated memory.
The QStringBuilder class is not to be used explicitly in user
code. Instances of the class are created as return values of the
operator%() function, acting on objects of type QString,
QLatin1String, QStringRef, QChar, QCharRef,
QLatin1Char, and \c char.
operator%() function, acting on objects of the following types:
For building QStrings:
\li QString, QStringRef,
\li QChar, QCharRef, QLatin1Char,
\li QLatin1String,
\li QByteArray, \c char, \c{const char[]}.
The types in the last list point are only available when
QT_NO_CAST_FROM_ASCII is not defined.
For building QByteArrays:
\li QByteArray, \c char, \c{const char[]}.
Concatenating strings with operator%() generally yields better
performance then using \c QString::operator+() on the same chunks
performance than using \c QString::operator+() on the same chunks
if there are three or more of them, and performs equally well in other
cases.

View File

@ -154,12 +154,12 @@ public:
QLocale::Country country);
// returns "UTC" QString and QByteArray
static inline QString utcQString() Q_REQUIRED_RESULT
Q_REQUIRED_RESULT static inline QString utcQString()
{
return QStringLiteral("UTC");
}
static inline QByteArray utcQByteArray() Q_REQUIRED_RESULT
Q_REQUIRED_RESULT static inline QByteArray utcQByteArray()
{
return QByteArrayLiteral("UTC");
}

View File

@ -248,43 +248,43 @@ public:
inline explicit QVersionNumber(int maj, int min, int mic)
{ m_segments.setSegments(3, maj, min, mic); }
inline bool isNull() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline bool isNull() const Q_DECL_NOTHROW
{ return segmentCount() == 0; }
inline bool isNormalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline bool isNormalized() const Q_DECL_NOTHROW
{ return isNull() || segmentAt(segmentCount() - 1) != 0; }
inline int majorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline int majorVersion() const Q_DECL_NOTHROW
{ return segmentAt(0); }
inline int minorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline int minorVersion() const Q_DECL_NOTHROW
{ return segmentAt(1); }
inline int microVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline int microVersion() const Q_DECL_NOTHROW
{ return segmentAt(2); }
Q_CORE_EXPORT QVersionNumber normalized() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT QVersionNumber normalized() const;
Q_CORE_EXPORT QVector<int> segments() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<int> segments() const;
inline int segmentAt(int index) const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline int segmentAt(int index) const Q_DECL_NOTHROW
{ return (m_segments.size() > index) ? m_segments.at(index) : 0; }
inline int segmentCount() const Q_DECL_NOTHROW Q_REQUIRED_RESULT
Q_REQUIRED_RESULT inline int segmentCount() const Q_DECL_NOTHROW
{ return m_segments.size(); }
Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW;
Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW;
Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2) Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2);
Q_CORE_EXPORT QString toString() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT QString toString() const;
#if QT_STRINGVIEW_LEVEL < 2
Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR) Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR);
#endif
Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QLatin1String string, int *suffixIndex = nullptr) Q_REQUIRED_RESULT;
Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QStringView string, int *suffixIndex = nullptr) Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QLatin1String string, int *suffixIndex = nullptr);
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(QStringView string, int *suffixIndex = nullptr);
private:
#ifndef QT_NO_DATASTREAM

View File

@ -92,7 +92,6 @@ function(QT5_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -optio
cmake_parse_arguments(_DBUS_INTERFACE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(_customName ${_DBUS_INTERFACE_UNPARSED_ARGUMENTS})
set(_qt4_dbus_options ${_DBUS_INTERFACE_OPTIONS})
get_filename_component(_in_file ${_header} ABSOLUTE)
get_filename_component(_basename ${_header} NAME_WE)
@ -112,7 +111,7 @@ function(QT5_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -optio
endif()
add_custom_command(OUTPUT ${_target}
COMMAND ${Qt5DBus_QDBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}
COMMAND ${Qt5DBus_QDBUSCPP2XML_EXECUTABLE} ${_DBUS_INTERFACE_OPTIONS} ${_in_file} -o ${_target}
DEPENDS ${_in_file} VERBATIM
)
endfunction()

View File

@ -243,7 +243,7 @@
]
},
"xcb_syslibs": {
"label": "XCB (secondary)",
"label": "XCB (extensions)",
"test": "qpa/xcb-syslibs",
"sources": [
{ "type": "pkgConfig",
@ -737,11 +737,11 @@
"output": [ "privateFeature" ]
},
"system-xcb": {
"label": "Using system provided XCB libraries",
"enable": "input.xcb == 'system' || input.xcb == 'yes'",
"disable": "input.xcb == 'qt' || input.xcb == 'no'",
"label": "Using system-provided XCB libraries",
"enable": "input.xcb == 'system'",
"disable": "input.xcb == 'qt'",
"autoDetect": "!config.darwin",
"condition": "libs.xcb && libs.xcb_syslibs",
"condition": "features.xcb && libs.xcb_syslibs",
"output": [ "privateFeature" ]
},
"x11-prefix": {
@ -757,8 +757,14 @@
},
"xcb-render": {
"label": "XCB render",
"emitIf": "features.system-xcb",
"condition": "libs.xcb_render",
"emitIf": "features.xcb",
"condition": "!features.system-xcb || libs.xcb_render",
"output": [ "privateFeature" ]
},
"xkb": {
"label": "XCB XKB",
"emitIf": "features.xcb",
"condition": "!features.system-xcb || libs.xcb_xkb",
"output": [ "privateFeature" ]
},
"xcb-xlib": {
@ -775,6 +781,7 @@
},
"xinput2": {
"label": "Xinput2",
"emitIf": "features.xcb",
"condition": "libs.xinput2",
"output": [ "privateFeature" ]
},
@ -791,11 +798,6 @@
"condition": "libs.xkbcommon_x11",
"output": [ "privateFeature" ]
},
"xkb": {
"label": "XCB XKB",
"condition": "features.system-xcb && libs.xcb_xkb",
"output": [ "privateFeature" ]
},
"xkb-config-root": {
"label": "XKB config root",
"emitIf": "features.xcb",

View File

@ -39,7 +39,8 @@ depends += \
qtquick \
qtwidgets \
qtdoc \
qmake
qmake \
qttestlib
headerdirs += ..

View File

@ -1071,7 +1071,7 @@ QImage::operator QVariant() const
Nothing is done if there is just a single reference.
\sa copy(), isDetached(), {Implicit Data Sharing}
\sa copy(), {QImage::isDetached()}{isDetached()}, {Implicit Data Sharing}
*/
void QImage::detach()
{
@ -2127,7 +2127,7 @@ QImage QImage::convertToFormat(Format format, const QVector<QRgb> &colorTable, Q
/*!
\since 5.9
Changes the format of the image without changing the data. Only
Changes the \a format of the image without changing the data. Only
works between formats of the same depth.
Returns \c true if successful.
@ -4671,7 +4671,7 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode
}
// initizialize the data
if (d->format == QImage::Format_Indexed8) {
if (target_format == QImage::Format_Indexed8) {
if (dImage.d->colortable.size() < 256) {
// colors are left in the color table, so pick that one as transparent
dImage.d->colortable.append(0x0);

View File

@ -179,9 +179,9 @@ public:
Format format() const;
#if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QIMAGE_COMPAT_CPP)
Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const & Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const &
{ return convertToFormat_helper(f, flags); }
Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) && Q_REQUIRED_RESULT
Q_REQUIRED_RESULT Q_ALWAYS_INLINE QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) &&
{
if (convertToFormat_inplace(f, flags))
return std::move(*this);
@ -189,9 +189,9 @@ public:
return convertToFormat_helper(f, flags);
}
#else
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QImage convertToFormat(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
#endif
QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QImage convertToFormat(Format f, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
bool reinterpretAsFormat(Format f);
int width() const;

View File

@ -830,7 +830,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, volatile int quality_in, c
int color_type = 0;
if (image.colorCount()) {
if (image.format() <= QImage::Format_Indexed8) {
if (image.isGrayscale())
color_type = PNG_COLOR_TYPE_GRAY;
else

View File

@ -4090,6 +4090,20 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
}
dbg << ')';
break;
case QEvent::ScrollPrepare: {
const QScrollPrepareEvent *se = static_cast<const QScrollPrepareEvent *>(e);
dbg << "QScrollPrepareEvent(viewportSize=" << se->viewportSize()
<< ", contentPosRange=" << se->contentPosRange()
<< ", contentPos=" << se->contentPos() << ')';
}
break;
case QEvent::Scroll: {
const QScrollEvent *se = static_cast<const QScrollEvent *>(e);
dbg << "QScrollEvent(contentPos=" << se->contentPos()
<< ", overshootDistance=" << se->overshootDistance()
<< ", scrollState=" << se->scrollState() << ')';
}
break;
default:
dbg << eventClassName(type) << '(';
QtDebugUtils::formatQEnum(dbg, type);

View File

@ -2027,13 +2027,23 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
window = QGuiApplication::focusWindow();
}
#if defined(Q_OS_ANDROID)
static bool backKeyPressAccepted = false;
static bool menuKeyPressAccepted = false;
#endif
#if !defined(Q_OS_OSX)
// FIXME: Include OS X in this code path by passing the key event through
// QPlatformInputContext::filterEvent().
if (e->keyType == QEvent::KeyPress && window) {
if (QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers,
e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount))
e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount)) {
#if defined(Q_OS_ANDROID)
backKeyPressAccepted = e->key == Qt::Key_Back;
menuKeyPressAccepted = e->key == Qt::Key_Menu;
#endif
return;
}
}
#endif
@ -2050,8 +2060,6 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
else
ev.setAccepted(false);
static bool backKeyPressAccepted = false;
static bool menuKeyPressAccepted = false;
if (e->keyType == QEvent::KeyPress) {
backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted();
menuKeyPressAccepted = e->key == Qt::Key_Menu && ev.isAccepted();

View File

@ -528,7 +528,9 @@ QImage QOpenGLWindow::grabFramebuffer()
return QImage();
makeCurrent();
return qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
QImage img = qt_gl_read_framebuffer(size() * devicePixelRatio(), false, false);
img.setDevicePixelRatio(devicePixelRatio());
return img;
}
/*!

View File

@ -63,6 +63,8 @@ QT_BEGIN_NAMESPACE
QPlatformGraphicsBuffer is intended to be created by using platform specific
APIs available from QtPlatformHeaders, or there might be accessor functions
similar to the accessor function that QPlatformBackingstore has.
\internal
*/
/*!

View File

@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE
\inmodule QtGui
\brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction.
\internal
\sa QSystemTrayIcon
*/
@ -82,16 +83,10 @@ QT_BEGIN_NAMESPACE
\sa activated()
*/
/*!
\internal
*/
QPlatformSystemTrayIcon::QPlatformSystemTrayIcon()
{
}
/*!
\internal
*/
QPlatformSystemTrayIcon::~QPlatformSystemTrayIcon()
{
}

View File

@ -215,7 +215,10 @@ static void cleanupDevicesList()
/*!
Returns a list of all registered devices.
\note The returned list cannot be used to add new devices. Use QWindowSystemInterface::registerTouchDevice() instead.
\note The returned list cannot be used to add new devices. To add a simulated
touch screen for an autotest, QTest::createTouchDevice() can be used.
To add real touch screens to QPA plugins, the private
\c QWindowSystemInterface::registerTouchDevice() function can be used.
*/
QList<const QTouchDevice *> QTouchDevice::devices()
{

View File

@ -1317,6 +1317,10 @@ void QWindow::setTransientParent(QWindow *parent)
qWarning() << parent << "must be a top level window.";
return;
}
if (parent == this) {
qWarning() << "transient parent" << parent << "can not be same as window";
return;
}
d->transientParent = parent;

View File

@ -64,7 +64,7 @@ public:
void fill(T value);
QGenericMatrix<M, N, T> transposed() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QGenericMatrix<M, N, T> transposed() const;
QGenericMatrix<N, M, T>& operator+=(const QGenericMatrix<N, M, T>& other);
QGenericMatrix<N, M, T>& operator-=(const QGenericMatrix<N, M, T>& other);

View File

@ -1940,7 +1940,7 @@ QMatrix4x4 QMatrix4x4::orthonormalInverse() const
Normally the QMatrix4x4 class keeps track of this special type internally
as operations are performed. However, if the matrix is modified
directly with operator()() or data(), then QMatrix4x4 will lose track of
directly with {QLoggingCategory::operator()}{operator()()} or data(), then QMatrix4x4 will lose track of
the special type and will revert to the safest but least efficient
operations thereafter.
@ -1948,7 +1948,7 @@ QMatrix4x4 QMatrix4x4::orthonormalInverse() const
the programmer can force QMatrix4x4 to recover the special type if
the elements appear to conform to one of the known optimized types.
\sa operator()(), data(), translate()
\sa {QLoggingCategory::operator()}{operator()()}, data(), translate()
*/
void QMatrix4x4::optimize()
{

View File

@ -423,8 +423,9 @@ inline QMatrix4x4& QMatrix4x4::operator-=(const QMatrix4x4& other)
return *this;
}
inline QMatrix4x4& QMatrix4x4::operator*=(const QMatrix4x4& other)
inline QMatrix4x4& QMatrix4x4::operator*=(const QMatrix4x4& o)
{
const QMatrix4x4 other = o; // prevent aliasing when &o == this ### Qt 6: take o by value
flagBits |= other.flagBits;
if (flagBits < Rotation2D) {

View File

@ -90,14 +90,14 @@ public:
float length() const;
float lengthSquared() const;
QQuaternion normalized() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QQuaternion normalized() const;
void normalize();
inline QQuaternion inverted() const;
QQuaternion conjugated() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QQuaternion conjugated() const;
#if QT_DEPRECATED_SINCE(5, 5)
QT_DEPRECATED QQuaternion conjugate() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QT_DEPRECATED QQuaternion conjugate() const;
#endif
QVector3D rotatedVector(const QVector3D& vector) const;

View File

@ -82,7 +82,7 @@ public:
float length() const;
float lengthSquared() const; //In Qt 6 convert to inline and constexpr
QVector2D normalized() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QVector2D normalized() const;
void normalize();
float distanceToPoint(const QVector2D &point) const;

View File

@ -88,7 +88,7 @@ public:
float length() const;
float lengthSquared() const; //In Qt 6 convert to inline and constexpr
QVector4D normalized() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QVector4D normalized() const;
void normalize();
QVector4D &operator+=(const QVector4D &vector);

View File

@ -49,7 +49,7 @@
# include <QtCore/qt_windows.h>
#endif
// Note: Mac OSX is a "controlled platform" for OpenGL ABI so we
// Note: Apple is a "controlled platform" for OpenGL ABI so we
// use the system provided headers there. Controlled means that the
// headers always match the actual driver implementation so there
// is no possibility of drivers exposing additional functionality
@ -64,7 +64,7 @@
// which the system headers do not.
#if defined(QT_OPENGL_ES_2)
# if defined(Q_OS_MAC) // iOS
# if defined(Q_OS_IOS) || defined(Q_OS_TVOS)
# if defined(QT_OPENGL_ES_3)
# include <OpenGLES/ES3/gl.h>
# include <OpenGLES/ES3/glext.h>
@ -81,7 +81,7 @@
*/
typedef void* GLeglImageOES;
# else // "uncontrolled" ES2 platforms
# elif !defined(Q_OS_DARWIN) // "uncontrolled" ES2 platforms
// In "es2" builds (QT_OPENGL_ES_2) additional defines indicate GLES 3.0 or
// higher is available *at build time*. In this case include the corresponding

View File

@ -3302,6 +3302,9 @@ void QOpenGLTexture::setData(int mipLevel, int layer, CubeMapFace cubeFace,
/*!
\since 5.9
\overload
Parameter \a layerCount is the number of layers in a texture array
that are being uploaded/populated by this call.
*/
void QOpenGLTexture::setData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options)
{
@ -3476,6 +3479,9 @@ void QOpenGLTexture::setCompressedData(int mipLevel, int layer, CubeMapFace cube
/*!
\since 5.9
\overload
Parameter \a layerCount is the number of layers in a texture array
that are being uploaded/populated by this call.
*/
void QOpenGLTexture::setCompressedData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions * const options)
{

View File

@ -197,7 +197,7 @@ public:
QColor toCmyk() const Q_DECL_NOTHROW;
QColor toHsl() const Q_DECL_NOTHROW;
QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW;
static QColor fromRgb(QRgb rgb) Q_DECL_NOTHROW;
static QColor fromRgba(QRgb rgba) Q_DECL_NOTHROW;
@ -217,10 +217,10 @@ public:
static QColor fromHsl(int h, int s, int l, int a = 255);
static QColor fromHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
QColor light(int f = 150) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
QColor lighter(int f = 150) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
QColor dark(int f = 200) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
QColor darker(int f = 200) const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW;
Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW;
bool operator==(const QColor &c) const Q_DECL_NOTHROW;
bool operator!=(const QColor &c) const Q_DECL_NOTHROW;

View File

@ -188,11 +188,7 @@ typedef ptrdiff_t QT_FT_PtrDist;
#include <stdlib.h>
#include <stdio.h>
/* This macro is used to indicate that a function parameter is unused. */
/* Its purpose is simply to reduce compiler warnings. Note also that */
/* simply defining it as `(void)x' doesn't avoid warnings with certain */
/* ANSI compilers (e.g. LCC). */
#define QT_FT_UNUSED( x ) (x) = (x)
#define QT_FT_UNUSED( x ) (void) x
#define QT_FT_TRACE5( x ) do { } while ( 0 ) /* nothing */
#define QT_FT_TRACE7( x ) do { } while ( 0 ) /* nothing */

View File

@ -108,7 +108,7 @@ public:
bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); }
qreal determinant() const { return _m11*_m22 - _m12*_m21; }
QMatrix inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QMatrix inverted(bool *invertible = Q_NULLPTR) const;
bool operator==(const QMatrix &) const;
bool operator!=(const QMatrix &) const;

View File

@ -154,8 +154,8 @@ public:
void translate(qreal dx, qreal dy);
inline void translate(const QPointF &offset);
QPainterPath translated(qreal dx, qreal dy) const Q_REQUIRED_RESULT;
inline QPainterPath translated(const QPointF &offset) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPainterPath translated(qreal dx, qreal dy) const;
Q_REQUIRED_RESULT inline QPainterPath translated(const QPointF &offset) const;
QRectF boundingRect() const;
QRectF controlPointRect() const;
@ -165,7 +165,7 @@ public:
bool isEmpty() const;
QPainterPath toReversed() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPainterPath toReversed() const;
QList<QPolygonF> toSubpathPolygons(const QMatrix &matrix = QMatrix()) const;
QList<QPolygonF> toFillPolygons(const QMatrix &matrix = QMatrix()) const;
QPolygonF toFillPolygon(const QMatrix &matrix = QMatrix()) const;
@ -185,12 +185,12 @@ public:
bool intersects(const QPainterPath &p) const;
bool contains(const QPainterPath &p) const;
QPainterPath united(const QPainterPath &r) const Q_REQUIRED_RESULT;
QPainterPath intersected(const QPainterPath &r) const Q_REQUIRED_RESULT;
QPainterPath subtracted(const QPainterPath &r) const Q_REQUIRED_RESULT;
QPainterPath subtractedInverted(const QPainterPath &r) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPainterPath united(const QPainterPath &r) const;
Q_REQUIRED_RESULT QPainterPath intersected(const QPainterPath &r) const;
Q_REQUIRED_RESULT QPainterPath subtracted(const QPainterPath &r) const;
Q_REQUIRED_RESULT QPainterPath subtractedInverted(const QPainterPath &r) const;
QPainterPath simplified() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPainterPath simplified() const;
bool operator==(const QPainterPath &other) const;
bool operator!=(const QPainterPath &other) const;

View File

@ -78,8 +78,8 @@ public:
void translate(int dx, int dy);
void translate(const QPoint &offset);
QPolygon translated(int dx, int dy) const Q_REQUIRED_RESULT;
inline QPolygon translated(const QPoint &offset) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPolygon translated(int dx, int dy) const;
Q_REQUIRED_RESULT inline QPolygon translated(const QPoint &offset) const;
QRect boundingRect() const;
@ -95,9 +95,9 @@ public:
bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const;
QPolygon united(const QPolygon &r) const Q_REQUIRED_RESULT;
QPolygon intersected(const QPolygon &r) const Q_REQUIRED_RESULT;
QPolygon subtracted(const QPolygon &r) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPolygon united(const QPolygon &r) const;
Q_REQUIRED_RESULT QPolygon intersected(const QPolygon &r) const;
Q_REQUIRED_RESULT QPolygon subtracted(const QPolygon &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygon)
@ -162,7 +162,7 @@ public:
void translate(const QPointF &offset);
inline QPolygonF translated(qreal dx, qreal dy) const;
QPolygonF translated(const QPointF &offset) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPolygonF translated(const QPointF &offset) const;
QPolygon toPolygon() const;
@ -172,9 +172,9 @@ public:
bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const;
QPolygonF united(const QPolygonF &r) const Q_REQUIRED_RESULT;
QPolygonF intersected(const QPolygonF &r) const Q_REQUIRED_RESULT;
QPolygonF subtracted(const QPolygonF &r) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QPolygonF united(const QPolygonF &r) const;
Q_REQUIRED_RESULT QPolygonF intersected(const QPolygonF &r) const;
Q_REQUIRED_RESULT QPolygonF subtracted(const QPolygonF &r) const;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QPolygonF)

View File

@ -99,23 +99,23 @@ public:
void translate(int dx, int dy);
inline void translate(const QPoint &p) { translate(p.x(), p.y()); }
QRegion translated(int dx, int dy) const Q_REQUIRED_RESULT;
inline QRegion translated(const QPoint &p) const Q_REQUIRED_RESULT { return translated(p.x(), p.y()); }
Q_REQUIRED_RESULT QRegion translated(int dx, int dy) const;
Q_REQUIRED_RESULT inline QRegion translated(const QPoint &p) const { return translated(p.x(), p.y()); }
QRegion united(const QRegion &r) const Q_REQUIRED_RESULT;
QRegion united(const QRect &r) const Q_REQUIRED_RESULT;
QRegion intersected(const QRegion &r) const Q_REQUIRED_RESULT;
QRegion intersected(const QRect &r) const Q_REQUIRED_RESULT;
QRegion subtracted(const QRegion &r) const Q_REQUIRED_RESULT;
QRegion xored(const QRegion &r) const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QRegion united(const QRegion &r) const;
Q_REQUIRED_RESULT QRegion united(const QRect &r) const;
Q_REQUIRED_RESULT QRegion intersected(const QRegion &r) const;
Q_REQUIRED_RESULT QRegion intersected(const QRect &r) const;
Q_REQUIRED_RESULT QRegion subtracted(const QRegion &r) const;
Q_REQUIRED_RESULT QRegion xored(const QRegion &r) const;
#if QT_DEPRECATED_SINCE(5, 0)
inline QT_DEPRECATED QRegion unite(const QRegion &r) const Q_REQUIRED_RESULT { return united(r); }
inline QT_DEPRECATED QRegion unite(const QRect &r) const Q_REQUIRED_RESULT { return united(r); }
inline QT_DEPRECATED QRegion intersect(const QRegion &r) const Q_REQUIRED_RESULT { return intersected(r); }
inline QT_DEPRECATED QRegion intersect(const QRect &r) const Q_REQUIRED_RESULT { return intersected(r); }
inline QT_DEPRECATED QRegion subtract(const QRegion &r) const Q_REQUIRED_RESULT { return subtracted(r); }
inline QT_DEPRECATED QRegion eor(const QRegion &r) const Q_REQUIRED_RESULT { return xored(r); }
Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion unite(const QRegion &r) const { return united(r); }
Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion unite(const QRect &r) const { return united(r); }
Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion intersect(const QRegion &r) const { return intersected(r); }
Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion intersect(const QRect &r) const { return intersected(r); }
Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion subtract(const QRegion &r) const { return subtracted(r); }
Q_REQUIRED_RESULT inline QT_DEPRECATED QRegion eor(const QRegion &r) const { return xored(r); }
#endif
bool intersects(const QRegion &r) const;

View File

@ -116,9 +116,9 @@ public:
qreal m21, qreal m22, qreal m23,
qreal m31, qreal m32, qreal m33);
QTransform inverted(bool *invertible = Q_NULLPTR) const Q_REQUIRED_RESULT;
QTransform adjoint() const Q_REQUIRED_RESULT;
QTransform transposed() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT QTransform inverted(bool *invertible = Q_NULLPTR) const;
Q_REQUIRED_RESULT QTransform adjoint() const;
Q_REQUIRED_RESULT QTransform transposed() const;
QTransform &translate(qreal dx, qreal dy);
QTransform &scale(qreal sx, qreal sy);

View File

@ -45,6 +45,7 @@
#include <qpa/qplatformscreen.h>
#include <QtCore/QLibraryInfo>
#include <QtCore/QDir>
#include <QtCore/QMetaEnum>
#include <algorithm>
#include <iterator>
@ -201,6 +202,26 @@ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWr
return *this;
}
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, const QSupportedWritingSystems &sws)
{
QMetaObject mo = QFontDatabase::staticMetaObject;
QMetaEnum me = mo.enumerator(mo.indexOfEnumerator("WritingSystem"));
QDebugStateSaver saver(debug);
debug.nospace() << "QSupportedWritingSystems(";
int i = sws.d->vector.indexOf(true);
while (i > 0) {
debug << me.valueToKey(i);
i = sws.d->vector.indexOf(true, i + 1);
if (i > 0)
debug << ", ";
}
debug << ")";
return debug;
}
#endif
/*!
Destroys the supported writing systems object.
*/

View File

@ -84,11 +84,18 @@ private:
friend Q_GUI_EXPORT bool operator==(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
friend Q_GUI_EXPORT bool operator!=(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
#ifndef QT_NO_DEBUG_STREAM
friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QSupportedWritingSystems &);
#endif
};
Q_GUI_EXPORT bool operator==(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
Q_GUI_EXPORT bool operator!=(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
#ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug, const QSupportedWritingSystems &);
#endif
class QFontRequestPrivate;
class QFontEngineMulti;

View File

@ -292,7 +292,7 @@ void QSyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block)
/*!
Constructs a QSyntaxHighlighter with the given \a parent.
If the parent is a QTextEdit, it installs the syntaxhighlighter on the
If the parent is a QTextEdit, it installs the syntax highlighter on the
parents document. The specified QTextEdit also becomes the owner of
the QSyntaxHighlighter.
*/

View File

@ -825,9 +825,13 @@ bool QTextHtmlImporter::closeTag()
break;
case Html_div:
if (closedNode->children.isEmpty())
break;
Q_FALLTHROUGH();
if (cursor.position() > 0) {
const QChar curChar = cursor.document()->characterAt(cursor.position() - 1);
if (!closedNode->children.isEmpty() && curChar != QChar::LineSeparator) {
blockTagClosed = true;
}
}
break;
default:
if (closedNode->isBlock())
blockTagClosed = true;

View File

@ -103,11 +103,11 @@ QHstsPolicy::QHstsPolicy() : d(new QHstsPolicyPrivate)
}
/*!
Constructs QHstsPolicy with \a expiry (in UTC); \a includeSubDomains parameter
defines if this policy must also include subdomains, \a host data is interpreted
according to \a mode.
Constructs QHstsPolicy with \a expiry (in UTC):
- \a host data is interpreted according to \a mode;
- \a flags selects options to apply to this policy.
\sa QUrl::setHost(), QUrl::ParsingMode
\sa QUrl::setHost(), QUrl::ParsingMode, QHstsPolicy::PolicyFlag
*/
QHstsPolicy::QHstsPolicy(const QDateTime &expiry, PolicyFlags flags,
const QString &host, QUrl::ParsingMode mode)

View File

@ -114,7 +114,7 @@ QNetworkAccessFtpBackend::~QNetworkAccessFtpBackend()
//if backend destroyed while in use, then abort (this is the code path from QNetworkReply::abort)
if (ftp && state != Disconnecting)
ftp->abort();
disconnectFromFtp();
disconnectFromFtp(RemoveCachedConnection);
}
void QNetworkAccessFtpBackend::open()

View File

@ -739,7 +739,7 @@ bool QNetworkAccessManager::isStrictTransportSecurityEnabled() const
\note While processing HTTP responses, QNetworkAccessManager can also update
the HSTS cache, removing or updating exitsting policies or introducing new
known hosts. The current implementation thus is server-driven, client code
\a knownHosts. The current implementation thus is server-driven, client code
can provide QNetworkAccessManager with previously known or discovered
policies, but this information can be overridden by "Strict-Transport-Security"
response headers.
@ -1045,7 +1045,7 @@ QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccess
{
Q_D(const QNetworkAccessManager);
if (d->networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined))
if (d->customNetworkConfiguration && d->networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined))
return UnknownAccessibility;
if (d->networkSessionRequired) {
@ -1841,6 +1841,7 @@ void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession
} else if (state == QNetworkSession::Connected || state == QNetworkSession::Roaming) {
reallyOnline = true;
}
online = reallyOnline;
if (!reallyOnline) {
if (state != QNetworkSession::Connected && state != QNetworkSession::Roaming) {
@ -1856,7 +1857,6 @@ void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession
emit q->networkAccessibleChanged(networkAccessible);
}
}
online = reallyOnline;
if (online && (state != QNetworkSession::Connected && state != QNetworkSession::Roaming)) {
_q_networkSessionClosed();
createSession(q->configuration());

View File

@ -1883,6 +1883,12 @@ void QNetworkReplyHttpImplPrivate::_q_cacheLoadReadyRead()
totalSize.isNull() ? Q_INT64_C(-1) : totalSize.toLongLong());
}
}
// A signal we've emitted might be handled by a slot that aborts,
// so we need to check for that and bail out if it's happened:
if (!q->isOpen())
return;
// If there are still bytes available in the cacheLoadDevice then the user did not read
// in response to the readyRead() signal. This means we have to load from the cacheLoadDevice
// and buffer that stuff. This is needed to be able to properly emit finished() later.

View File

@ -64,8 +64,8 @@ public:
Q_NETWORK_EXPORT static QSslEllipticCurve fromShortName(const QString &name);
Q_NETWORK_EXPORT static QSslEllipticCurve fromLongName(const QString &name);
Q_NETWORK_EXPORT QString shortName() const Q_REQUIRED_RESULT;
Q_NETWORK_EXPORT QString longName() const Q_REQUIRED_RESULT;
Q_REQUIRED_RESULT Q_NETWORK_EXPORT QString shortName() const;
Q_REQUIRED_RESULT Q_NETWORK_EXPORT QString longName() const;
Q_DECL_CONSTEXPR bool isValid() const Q_DECL_NOTHROW
{

View File

@ -168,10 +168,10 @@
\fn bool QWindowsWindowFunctions::isTabletMode()
This is a convenience function that can be used directly instead of resolving
the function pointer. The function can be used to query whether Windows 10
operates in \e{Tablet Mode}. In this mode, Windows forces all application
main windows to open in maximized state. Applications should then avoid
resizing windows or restoring geometries to non-maximized states.
the function pointer. Returns true if Windows 10 operates in \e{Tablet Mode}.
In this mode, Windows forces all application main windows to open in maximized
state. Applications should then avoid resizing windows or restoring geometries
to non-maximized states.
\sa QWidget::showMaximized(), QWidget::saveGeometry(), QWidget::restoreGeometry()
\since 5.9

View File

@ -5,7 +5,6 @@ QT = core-private gui-private
CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h
HEADERS += \
qaccessiblebridgeutils_p.h

Some files were not shown because too many files have changed in this diff Show More