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

Conflicts:
	src/corelib/io/qfilesystemengine_win.cpp
	src/gui/text/qdistancefield.cpp
	src/plugins/platforms/xcb/qxcbconnection.h

Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
This commit is contained in:
Liang Qi 2017-03-20 08:44:28 +01:00
commit ae2695535a
232 changed files with 1626 additions and 1048 deletions

View File

@ -1,52 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <X11/Xlib.h>
#include <X11/extensions/Xrender.h>
#if RENDER_MAJOR == 0 && RENDER_MINOR < 5
# error "Required Xrender version 0.6 not found."
#else
int main(int, char **)
{
XRenderPictFormat *format;
format = 0;
return 0;
}
#endif

View File

@ -1,3 +0,0 @@
SOURCES = xrender.cpp
CONFIG += x11
CONFIG -= qt

View File

@ -835,7 +835,7 @@ defineTest(qtConfOutput_preparePaths) {
!equals(QT_SOURCE_TREE, $$QT_BUILD_TREE): \ !equals(QT_SOURCE_TREE, $$QT_BUILD_TREE): \
cont += \ cont += \
"[EffectiveSourcePaths]" \ "[EffectiveSourcePaths]" \
"Prefix=$$QT_SOURCE_TREE" "Prefix=$$[QT_INSTALL_PREFIX/src]"
write_file($$QT_BUILD_TREE/bin/qt.conf, cont)|error() write_file($$QT_BUILD_TREE/bin/qt.conf, cont)|error()
reload_properties() reload_properties()

View File

@ -38,3 +38,17 @@ macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>" macro.endfloat.HTML = "</div>"
macro.clearfloat.HTML = "<br style=\"clear: both\" />" macro.clearfloat.HTML = "<br style=\"clear: both\" />"
macro.emptyspan.HTML = "<span></span>" macro.emptyspan.HTML = "<span></span>"
# Embed YouTube content by video ID - Example: \youtube dQw4w9WgXcQ
# Also requires a <ID>.jpg thumbnail for offline docs. In .qdocconf, add:
#
# HTML.extraimages += images/dQw4w9WgXcQ.jpg
# qhp.ProjectName.extraFiles += images/dQw4w9WgXcQ.jpg
#
macro.youtube.HTML = "<div class=\"video\">\n<span class=\"vspan\"></span>\n" \
"<iframe src=\"https://www.youtube.com/embed/\1\"" \
"frameborder=\"0\" allowfullscreen>\n" \
"<a href=\"https://www.youtube.com/watch/?v=\1\">\n"\
"<img src=\"images/\1.jpg\"" \
"title=\"Click to play in a browser\" /></a>\n" \
"</iframe></div>\n"

View File

@ -160,3 +160,7 @@ td#buildversion {
.footer p { .footer p {
margin: 0px; margin: 0px;
} }
.video {
margin: 15px 0 0 15px;
}

View File

@ -780,3 +780,23 @@ div.multi-column div {
margin-right: 4em; margin-right: 4em;
width: 24em; width: 24em;
} }
.mainContent .video {
width:40%;
max-width:640px;
margin: 15px 0 0 15px;
position:relative;
display:table
}
.mainContent .video > .vspan {
padding-top:60%;
display:block
}
.mainContent .video iframe {
width:100%;
height:100%;
position:absolute;
top:0;
left:0
}

View File

@ -1721,3 +1721,22 @@ a.qa-mark:target:before {
color: #ff0000; color: #ff0000;
} }
.mainContent .video {
width:60%;
max-width:640px;
margin: 0.5em 0 1.5em 0.5em;
position:relative;
display:table
}
.mainContent .video > .vspan {
padding-top:60%;
display:block
}
.mainContent .video iframe {
width:100%;
height:100%;
position:absolute;
top:0;
left:0
}

View File

@ -117,7 +117,7 @@ int main(int argc, char *argv[])
initializeModel(&model); initializeModel(&model);
QTableView *view = createView(QObject::tr("Relational Table Model"), &model); QScopedPointer<QTableView> view(createView(QObject::tr("Relational Table Model"), &model));
view->show(); view->show();
return app.exec(); return app.exec();

View File

@ -194,16 +194,17 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
if (line.isEmpty() || trimmedLine.isEmpty()) if (line.isEmpty() || trimmedLine.isEmpty())
continue; continue;
QRegExp re("^\\s+"); QRegularExpression re("^\\s+");
int nonws = re.indexIn(line); QRegularExpressionMatch match = re.match(line);
int nonws = match.capturedStart();
int level = 0; int level = 0;
if (nonws == -1) { if (nonws == -1) {
level = 0; level = 0;
} else { } else {
if (line.startsWith("\t")) { if (line.startsWith("\t")) {
level = re.cap(0).length(); level = match.capturedLength();
} else { } else {
level = re.cap(0).length()/4; level = match.capturedLength()/4;
} }
} }

View File

@ -32,6 +32,11 @@ qt {
equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
} }
# Don't pass -headerpad_max_install_names when using Bitcode.
# In that case the linker emits a warning stating that the flag is ignored when
# used with bitcode, for reasons that cannot be determined (rdar://problem/20748962).
# Using this flag is also unnecessary in practice on UIKit platforms since they
# are sandboxed, and only UIKit platforms support bitcode to begin with.
!bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD !bitcode: QMAKE_LFLAGS += $$QMAKE_LFLAGS_HEADERPAD
app_extension_api_only { app_extension_api_only {

View File

@ -125,7 +125,8 @@ defineTest(qtConfValidateValue) {
defineTest(qtConfCommandline_string) { defineTest(qtConfCommandline_string) {
opt = $${1} opt = $${1}
val = $${2} val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg() nextok = $${3}
isEmpty(val):$$nextok: val = $$qtConfGetNextCommandlineArg()
# Note: Arguments which are variable assignments are legit here. # Note: Arguments which are variable assignments are legit here.
contains(val, "^-.*")|isEmpty(val) { contains(val, "^-.*")|isEmpty(val) {
@ -142,9 +143,10 @@ defineTest(qtConfCommandline_string) {
defineTest(qtConfCommandline_optionalString) { defineTest(qtConfCommandline_optionalString) {
opt = $${1} opt = $${1}
val = $${2} val = $${2}
nextok = $${3}
isEmpty(val) { isEmpty(val) {
v = $$qtConfPeekNextCommandlineArg() $$nextok: val = $$qtConfPeekNextCommandlineArg()
contains(v, "^-.*|[A-Z_]+=.*")|isEmpty(v): \ contains(val, "^-.*|[A-Z_]+=.*")|isEmpty(val): \
val = "yes" val = "yes"
else: \ else: \
val = $$qtConfGetNextCommandlineArg() val = $$qtConfGetNextCommandlineArg()
@ -160,7 +162,8 @@ defineTest(qtConfCommandline_optionalString) {
defineTest(qtConfCommandline_addString) { defineTest(qtConfCommandline_addString) {
opt = $${1} opt = $${1}
val = $${2} val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg() nextok = $${3}
isEmpty(val):$$nextok: val = $$qtConfGetNextCommandlineArg()
# Note: Arguments which are variable assignments are legit here. # Note: Arguments which are variable assignments are legit here.
contains(val, "^-.*")|isEmpty(val) { contains(val, "^-.*")|isEmpty(val) {
@ -236,6 +239,7 @@ defineTest(qtConfParseCommandLine) {
} }
# parse out opt and val # parse out opt and val
nextok = false
contains(c, "^--?enable-(.*)") { contains(c, "^--?enable-(.*)") {
opt = $$replace(c, "^--?enable-(.*)", "\\1") opt = $$replace(c, "^--?enable-(.*)", "\\1")
val = yes val = yes
@ -247,10 +251,11 @@ defineTest(qtConfParseCommandLine) {
val = $$replace(c, "^--([^=]+)=(.*)", "\\2") val = $$replace(c, "^--([^=]+)=(.*)", "\\2")
} else: contains(c, "^--(.*)") { } else: contains(c, "^--(.*)") {
opt = $$replace(c, "^--(.*)", "\\1") opt = $$replace(c, "^--(.*)", "\\1")
val = yes val =
} else: contains(c, "^-(.*)") { } else: contains(c, "^-(.*)") {
opt = $$replace(c, "^-(.*)", "\\1") opt = $$replace(c, "^-(.*)", "\\1")
val = val =
nextok = true
for (cc, allConfigs) { for (cc, allConfigs) {
type = $$eval($${cc}.commandline.options.$${opt}) type = $$eval($${cc}.commandline.options.$${opt})
!isEmpty(type): break() !isEmpty(type): break()
@ -277,6 +282,7 @@ defineTest(qtConfParseCommandLine) {
contains(c, $$e) { contains(c, $$e) {
opt = $$eval($${cc}.commandline.prefix.$${p}) opt = $$eval($${cc}.commandline.prefix.$${p})
val = $$replace(c, $$e, "\\1") val = $$replace(c, $$e, "\\1")
nextok = true
type = "addString" type = "addString"
break() break()
} }
@ -315,7 +321,7 @@ defineTest(qtConfParseCommandLine) {
error("Command line option '$$c' has unknown type '$$type'.") error("Command line option '$$c' has unknown type '$$type'.")
# now that we have opt and value, process it # now that we have opt and value, process it
$${call}($$opt, $$val) $${call}($$opt, $$val, $$nextok)
} }
} }
@ -1743,10 +1749,6 @@ defineTest(qtConfProcessOneOutput) {
fpfx = $${currentConfig}.features.$${feature} fpfx = $${currentConfig}.features.$${feature}
opfx = $${fpfx}.output.$${2} opfx = $${fpfx}.output.$${2}
condition = $$eval($${opfx}.condition)
!isEmpty(condition):!$$qtConfEvaluate($$condition): \
return()
call = $$eval($${opfx}.type) call = $$eval($${opfx}.type)
isEmpty(call) { isEmpty(call) {
# output is just a string, not an object # output is just a string, not an object
@ -1755,11 +1757,8 @@ defineTest(qtConfProcessOneOutput) {
!defined("qtConfOutput_$$call", test): \ !defined("qtConfOutput_$$call", test): \
error("Undefined type '$$call' in output '$$2' of feature '$$feature'.") error("Undefined type '$$call' in output '$$2' of feature '$$feature'.")
condition = $$eval($${opfx}.condition) !$$qtConfEvaluate($$eval($${opfx}.condition)): \
!isEmpty(condition) { return()
!$$qtConfEvaluate($$condition): \
return(false)
}
$${opfx}.feature = $$feature $${opfx}.feature = $$feature
qtConfOutput_$${call}($$opfx, $$eval($${fpfx}.available)) qtConfOutput_$${call}($$opfx, $$eval($${fpfx}.available))

View File

@ -182,7 +182,7 @@ headersclean:!internal_module {
# Turn on some extra warnings not found in -Wall -Wextra. # Turn on some extra warnings not found in -Wall -Wextra.
# Common to GCC, Clang and ICC (and other compilers that masquerade as GCC): # Common to GCC, Clang and ICC (and other compilers that masquerade as GCC):
hcleanFLAGS = -Wall -Wextra -Werror \ hcleanFLAGS = -Wall -Wextra -Werror \
-Woverloaded-virtual -Wshadow -Wundef \ -Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal \
-Wnon-virtual-dtor -Wpointer-arith -Wformat-security \ -Wnon-virtual-dtor -Wpointer-arith -Wformat-security \
-Wno-long-long -Wno-variadic-macros -pedantic-errors -Wno-long-long -Wno-variadic-macros -pedantic-errors

View File

@ -1,7 +1,13 @@
lessThan(QMAKE_XCODE_VERSION, "7.0") { lessThan(QMAKE_XCODE_VERSION, "7.0") {
warning("You need to update Xcode to version 7 or newer to support bitcode") warning("You need to update Xcode to version 7 or newer to support bitcode")
} else { } else: !macx-xcode {
release:device { # Simulator builds and all debug builds SHOULD use -fembed-bitcode-marker,
# but unfortunately the -fembed-bitcode and -fembed-bitcode-marker driver
# flags do not work in conjunction with -Xarch, so we'll have to let it use
# the "wrong" flags for now (note that this issue affects only the Makefile
# generator). We also don't want the flags to be passed in Xcode builds, as
# the Xcode ENABLE_BITCODE setting will take care of that for us.
release {
QMAKE_CFLAGS += -fembed-bitcode QMAKE_CFLAGS += -fembed-bitcode
QMAKE_CXXFLAGS += -fembed-bitcode QMAKE_CXXFLAGS += -fembed-bitcode
QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode

View File

@ -1477,13 +1477,20 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QMap<QString, QString> settings; QMap<QString, QString> settings;
if (!project->isActiveConfig("no_xcode_development_team")) { if (!project->isActiveConfig("no_xcode_development_team")) {
const QList<QVariantMap> teams = provisioningTeams(); QString teamId;
if (!teams.isEmpty()) { if (!project->isEmpty("QMAKE_DEVELOPMENT_TEAM")) {
// first suitable team we find is the one we'll use by default teamId = project->first("QMAKE_DEVELOPMENT_TEAM").toQString();
settings.insert("DEVELOPMENT_TEAM", } else {
teams.first().value(QLatin1String("teamID")).toString()); const QList<QVariantMap> teams = provisioningTeams();
if (!teams.isEmpty()) // first suitable team we find is the one we'll use by default
teamId = teams.first().value(QLatin1String("teamID")).toString();
} }
if (!teamId.isEmpty())
settings.insert("DEVELOPMENT_TEAM", teamId);
if (!project->isEmpty("QMAKE_PROVISIONING_PROFILE"))
settings.insert("PROVISIONING_PROFILE_SPECIFIER", project->first("QMAKE_PROVISIONING_PROFILE").toQString());
} }
settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO"));
settings.insert("APPLICATION_EXTENSION_API_ONLY", project->isActiveConfig("app_extension_api_only") ? "YES" : "NO"); settings.insert("APPLICATION_EXTENSION_API_ONLY", project->isActiveConfig("app_extension_api_only") ? "YES" : "NO");
// required for tvOS (and watchos), optional on iOS (deployment target >= iOS 6.0) // required for tvOS (and watchos), optional on iOS (deployment target >= iOS 6.0)

View File

@ -1153,7 +1153,12 @@ bool VCCLCompilerTool::parseOption(const char* option)
} }
found = false; break; found = false; break;
case 'u': case 'u':
UndefineAllPreprocessorDefinitions = _True; if (!second)
UndefineAllPreprocessorDefinitions = _True;
else if (second == 't' && third == 'f' && fourth == '8')
AdditionalOptions += option;
else
found = false;
break; break;
case 'v': case 'v':
if(second == 'd' || second == 'm') { if(second == 'd' || second == 'm') {

View File

@ -470,7 +470,7 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
return ReturnTrue; return ReturnTrue;
} }
#ifndef QT_BOOTSTRAPPED #if QT_CONFIG(process)
void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
{ {
proc->setWorkingDirectory(currentDirectory()); proc->setWorkingDirectory(currentDirectory());
@ -491,7 +491,7 @@ void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
QByteArray QMakeEvaluator::getCommandOutput(const QString &args, int *exitCode) const QByteArray QMakeEvaluator::getCommandOutput(const QString &args, int *exitCode) const
{ {
QByteArray out; QByteArray out;
#ifndef QT_BOOTSTRAPPED #if QT_CONFIG(process)
QProcess proc; QProcess proc;
runProcess(&proc, args); runProcess(&proc, args);
*exitCode = (proc.exitStatus() == QProcess::NormalExit) ? proc.exitCode() : -1; *exitCode = (proc.exitStatus() == QProcess::NormalExit) ? proc.exitCode() : -1;
@ -1712,7 +1712,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
#ifdef PROEVALUATOR_FULL #ifdef PROEVALUATOR_FULL
if (m_cumulative) // Anything else would be insanity if (m_cumulative) // Anything else would be insanity
return ReturnFalse; return ReturnFalse;
#ifndef QT_BOOTSTRAPPED #if QT_CONFIG(process)
QProcess proc; QProcess proc;
proc.setProcessChannelMode(QProcess::ForwardedChannels); proc.setProcessChannelMode(QProcess::ForwardedChannels);
runProcess(&proc, args.at(0).toQString(m_tmp2)); runProcess(&proc, args.at(0).toQString(m_tmp2));

View File

@ -44,7 +44,7 @@
#include <qstring.h> #include <qstring.h>
#include <qstringlist.h> #include <qstringlist.h>
#include <qshareddata.h> #include <qshareddata.h>
#ifndef QT_BOOTSTRAPPED #if QT_CONFIG(process)
# include <qprocess.h> # include <qprocess.h>
#else #else
# include <qiodevice.h> # include <qiodevice.h>
@ -237,7 +237,7 @@ public:
VisitReturn writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode, VisitReturn writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
bool exe, const QString &contents); bool exe, const QString &contents);
#ifndef QT_BOOTSTRAPPED #if QT_CONFIG(process)
void runProcess(QProcess *proc, const QString &command) const; void runProcess(QProcess *proc, const QString &command) const;
#endif #endif
QByteArray getCommandOutput(const QString &args, int *exitCode) const; QByteArray getCommandOutput(const QString &args, int *exitCode) const;

View File

@ -281,7 +281,7 @@ static void notifyAndFreeInfo(Header *header, ProcessInfo *entry,
freeInfo(header, entry); freeInfo(header, entry);
} }
static void sigchld_handler(int signum) static void sigchld_handler(int signum, siginfo_t *handler_info, void *handler_context)
{ {
/* /*
* This is a signal handler, so we need to be careful about which functions * This is a signal handler, so we need to be careful about which functions
@ -289,7 +289,20 @@ static void sigchld_handler(int signum)
* specification at: * specification at:
* http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03 * http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03
* *
* The handler_info and handler_context parameters may not be valid, if
* we're a chained handler from another handler that did not use
* SA_SIGINFO. Therefore, we must obtain the siginfo ourselves directly by
* calling waitid.
*
* But we pass them anyway. Let's call the chained handler first, while
* those two arguments have a chance of being correct.
*/ */
if (old_sigaction.sa_handler != SIG_IGN && old_sigaction.sa_handler != SIG_DFL) {
if (old_sigaction.sa_flags & SA_SIGINFO)
old_sigaction.sa_sigaction(signum, handler_info, handler_context);
else
old_sigaction.sa_handler(signum);
}
if (ffd_atomic_load(&forkfd_status, FFD_ATOMIC_RELAXED) == 1) { if (ffd_atomic_load(&forkfd_status, FFD_ATOMIC_RELAXED) == 1) {
/* is this one of our children? */ /* is this one of our children? */
@ -317,9 +330,8 @@ search_next_child:
waitid(P_ALL, 0, &info, WNOHANG | WNOWAIT | WEXITED); waitid(P_ALL, 0, &info, WNOHANG | WNOWAIT | WEXITED);
if (info.si_pid == 0) { if (info.si_pid == 0) {
/* there are no further un-waited-for children, so we can just exit. /* there are no further un-waited-for children, so we can just exit.
* But before, transfer control to the chained SIGCHLD handler.
*/ */
goto chain_handler; return;
} }
for (i = 0; i < (int)sizeofarray(children.entries); ++i) { for (i = 0; i < (int)sizeofarray(children.entries); ++i) {
@ -407,12 +419,6 @@ search_arrays:
array = ffd_atomic_load(&array->header.nextArray, FFD_ATOMIC_ACQUIRE); array = ffd_atomic_load(&array->header.nextArray, FFD_ATOMIC_ACQUIRE);
} }
} }
#ifdef HAVE_WAITID
chain_handler:
#endif
if (old_sigaction.sa_handler != SIG_IGN && old_sigaction.sa_handler != SIG_DFL)
old_sigaction.sa_handler(signum);
} }
static void ignore_sigpipe() static void ignore_sigpipe()
@ -457,8 +463,8 @@ static void forkfd_initialize()
struct sigaction action; struct sigaction action;
memset(&action, 0, sizeof action); memset(&action, 0, sizeof action);
sigemptyset(&action.sa_mask); sigemptyset(&action.sa_mask);
action.sa_flags = SA_NOCLDSTOP; action.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
action.sa_handler = sigchld_handler; action.sa_sigaction = sigchld_handler;
/* ### RACE CONDITION /* ### RACE CONDITION
* The sigaction function does a memcpy from an internal buffer * The sigaction function does a memcpy from an internal buffer

View File

@ -43,7 +43,6 @@ QT_REQUIRE_CONFIG(iconv);
#include "qiconvcodec_p.h" #include "qiconvcodec_p.h"
#include "qtextcodec_p.h" #include "qtextcodec_p.h"
#include <qlibrary.h>
#include <qdebug.h> #include <qdebug.h>
#include <qthreadstorage.h> #include <qthreadstorage.h>

View File

@ -56,6 +56,9 @@
}, },
{ "libs": "-licuin -licuuc -licudt", "condition": "config.win32 && features.shared" }, { "libs": "-licuin -licuuc -licudt", "condition": "config.win32 && features.shared" },
{ "libs": "-licui18n -licuuc -licudata", "condition": "!config.win32" } { "libs": "-licui18n -licuuc -licudata", "condition": "!config.win32" }
],
"use": [
{ "lib": "libdl", "condition": "features.dlopen" }
] ]
}, },
"journald": { "journald": {
@ -74,10 +77,10 @@
] ]
}, },
"libdl": { "libdl": {
"label": "dlopen() in libdl", "label": "dlopen()",
"export": "",
"test": "unix/dlopen", "test": "unix/dlopen",
"sources": [ "sources": [
"",
"-ldl" "-ldl"
] ]
}, },
@ -131,11 +134,6 @@
"type": "compile", "type": "compile",
"test": "unix/cloexec" "test": "unix/cloexec"
}, },
"dlopen": {
"label": "dlopen() in libc",
"type": "compile",
"test": "unix/dlopen"
},
"eventfd": { "eventfd": {
"label": "eventfd", "label": "eventfd",
"type": "compile", "type": "compile",
@ -211,12 +209,8 @@
}, },
"dlopen": { "dlopen": {
"label": "dlopen()", "label": "dlopen()",
"condition": "tests.dlopen || libs.libdl" "condition": "config.unix && libs.libdl",
}, "output": [ "privateFeature" ]
"libdl": {
"label": "dlopen() in libdl",
"condition": "!tests.dlopen && libs.libdl",
"output": [ { "type": "privateConfig", "negative": true } ]
}, },
"doubleconversion": { "doubleconversion": {
"label": "DoubleConversion", "label": "DoubleConversion",

View File

@ -71,9 +71,9 @@
#define QT_FEATURE_iconv -1 #define QT_FEATURE_iconv -1
#define QT_FEATURE_icu -1 #define QT_FEATURE_icu -1
#define QT_FEATURE_journald -1 #define QT_FEATURE_journald -1
#define QT_NO_LIBRARY
#define QT_FEATURE_library -1 #define QT_FEATURE_library -1
#define QT_NO_QOBJECT #define QT_NO_QOBJECT
#define QT_FEATURE_process -1
#define QT_NO_SYSTEMLOCALE #define QT_NO_SYSTEMLOCALE
#define QT_FEATURE_slog2 -1 #define QT_FEATURE_slog2 -1
#define QT_FEATURE_syslog -1 #define QT_FEATURE_syslog -1

View File

@ -196,6 +196,10 @@ QF16_MAKE_ARITH_OP_INT(*)
QF16_MAKE_ARITH_OP_INT(/) QF16_MAKE_ARITH_OP_INT(/)
#undef QF16_MAKE_ARITH_OP_INT #undef QF16_MAKE_ARITH_OP_INT
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
inline bool operator>(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) > static_cast<float>(b); } inline bool operator>(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) > static_cast<float>(b); }
inline bool operator<(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) < static_cast<float>(b); } inline bool operator<(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) < static_cast<float>(b); }
inline bool operator>=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) >= static_cast<float>(b); } inline bool operator>=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) >= static_cast<float>(b); }
@ -230,6 +234,8 @@ QF16_MAKE_BOOL_OP_INT(==)
QF16_MAKE_BOOL_OP_INT(!=) QF16_MAKE_BOOL_OP_INT(!=)
#undef QF16_MAKE_BOOL_OP_INT #undef QF16_MAKE_BOOL_OP_INT
QT_WARNING_POP
/*! /*!
\internal \internal
*/ */

View File

@ -958,7 +958,8 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in
\snippet code/src_corelib_global_qglobal.cpp 53 \snippet code/src_corelib_global_qglobal.cpp 53
\sa qConstOverload(), qNonConstOverload() \sa qConstOverload(), qNonConstOverload(), {Differences between String-Based
and Functor-Based Connections}
*/ */
/*! \fn auto qConstOverload(T memberFunctionPointer) /*! \fn auto qConstOverload(T memberFunctionPointer)
@ -969,7 +970,8 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in
\snippet code/src_corelib_global_qglobal.cpp 54 \snippet code/src_corelib_global_qglobal.cpp 54
\sa qOverload, qNonConstOverload \sa qOverload, qNonConstOverload, {Differences between String-Based
and Functor-Based Connections}
*/ */
/*! \fn auto qNonConstOverload(T memberFunctionPointer) /*! \fn auto qNonConstOverload(T memberFunctionPointer)
@ -980,7 +982,8 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in
\snippet code/src_corelib_global_qglobal.cpp 54 \snippet code/src_corelib_global_qglobal.cpp 54
\sa qOverload, qNonConstOverload \sa qOverload, qNonConstOverload, {Differences between String-Based
and Functor-Based Connections}
*/ */
/*! /*!

View File

@ -39,7 +39,6 @@
// these might be defined via precompiled headers // these might be defined via precompiled headers
#include <QtCore/qatomic.h> #include <QtCore/qatomic.h>
#include "qprocess_p.h"
#define FORKFD_NO_SPAWNFD #define FORKFD_NO_SPAWNFD

View File

@ -22,8 +22,6 @@ HEADERS += \
io/qlockfile.h \ io/qlockfile.h \
io/qlockfile_p.h \ io/qlockfile_p.h \
io/qnoncontiguousbytedevice_p.h \ io/qnoncontiguousbytedevice_p.h \
io/qprocess.h \
io/qprocess_p.h \
io/qtextstream.h \ io/qtextstream.h \
io/qtextstream_p.h \ io/qtextstream_p.h \
io/qtemporarydir.h \ io/qtemporarydir.h \
@ -72,7 +70,6 @@ SOURCES += \
io/qiodevice.cpp \ io/qiodevice.cpp \
io/qlockfile.cpp \ io/qlockfile.cpp \
io/qnoncontiguousbytedevice.cpp \ io/qnoncontiguousbytedevice.cpp \
io/qprocess.cpp \
io/qstorageinfo.cpp \ io/qstorageinfo.cpp \
io/qtextstream.cpp \ io/qtextstream.cpp \
io/qtemporarydir.cpp \ io/qtemporarydir.cpp \
@ -96,6 +93,19 @@ SOURCES += \
io/qloggingcategory.cpp \ io/qloggingcategory.cpp \
io/qloggingregistry.cpp io/qloggingregistry.cpp
qtConfig(processenvironment) {
SOURCES += \
io/qprocess.cpp
HEADERS += \
io/qprocess.h \
io/qprocess_p.h
win32:!winrt: \
SOURCES += io/qprocess_win.cpp
else: unix: \
SOURCES += io/qprocess_unix.cpp
}
win32 { win32 {
SOURCES += io/qfsfileengine_win.cpp SOURCES += io/qfsfileengine_win.cpp
SOURCES += io/qlockfile_win.cpp SOURCES += io/qlockfile_win.cpp
@ -112,7 +122,6 @@ win32 {
io/qwinoverlappedionotifier_p.h io/qwinoverlappedionotifier_p.h
SOURCES += \ SOURCES += \
io/qprocess_win.cpp \
io/qsettings_win.cpp \ io/qsettings_win.cpp \
io/qstandardpaths_win.cpp \ io/qstandardpaths_win.cpp \
io/qstorageinfo_win.cpp \ io/qstorageinfo_win.cpp \
@ -132,7 +141,6 @@ win32 {
io/qfsfileengine_unix.cpp \ io/qfsfileengine_unix.cpp \
io/qfilesystemengine_unix.cpp \ io/qfilesystemengine_unix.cpp \
io/qlockfile_unix.cpp \ io/qlockfile_unix.cpp \
io/qprocess_unix.cpp \
io/qfilesystemiterator_unix.cpp io/qfilesystemiterator_unix.cpp
!integrity:!uikit { !integrity:!uikit {

View File

@ -151,14 +151,15 @@ QT_BEGIN_NAMESPACE
Q_CORE_EXPORT int qt_ntfs_permission_lookup = 0; Q_CORE_EXPORT int qt_ntfs_permission_lookup = 0;
#if defined(Q_OS_WINRT) #if defined(Q_OS_WINRT)
// As none of the functions we try to resolve do exist on WinRT // As none of the functions we try to resolve do exist on WinRT we
// we use QT_NO_LIBRARY to shorten everything up a little bit. // avoid library loading on WinRT in general to shorten everything
# ifndef QT_NO_LIBRARY // up a little bit.
# define QT_NO_LIBRARY 1 # define QT_FEATURE_fslibs -1
# endif #else
# define QT_FEATURE_fslibs QT_FEATURE_library
#endif // Q_OS_WINRT #endif // Q_OS_WINRT
#if !defined(QT_NO_LIBRARY) #if QT_CONFIG(fslibs)
QT_BEGIN_INCLUDE_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE
typedef DWORD (WINAPI *PtrGetNamedSecurityInfoW)(LPWSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID*, PSID*, PACL*, PACL*, PSECURITY_DESCRIPTOR*); typedef DWORD (WINAPI *PtrGetNamedSecurityInfoW)(LPWSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID*, PSID*, PACL*, PACL*, PSECURITY_DESCRIPTOR*);
static PtrGetNamedSecurityInfoW ptrGetNamedSecurityInfoW = 0; static PtrGetNamedSecurityInfoW ptrGetNamedSecurityInfoW = 0;
@ -255,7 +256,7 @@ struct LibResolver
Q_GLOBAL_STATIC(LibResolver, resolveLibs) Q_GLOBAL_STATIC(LibResolver, resolveLibs)
} // anonymous namespace } // anonymous namespace
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(fslibs)
QT_BEGIN_INCLUDE_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE
typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD); typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD);
@ -327,7 +328,7 @@ static QString readSymLink(const QFileSystemEntry &link)
free(rdb); free(rdb);
CloseHandle(handle); CloseHandle(handle);
#if !defined(QT_NO_LIBRARY) #if QT_CONFIG(fslibs)
resolveLibs(); resolveLibs();
QRegExp matchVolName(QLatin1String("^Volume\\{([a-z]|[0-9]|-)+\\}\\\\"), Qt::CaseInsensitive); QRegExp matchVolName(QLatin1String("^Volume\\{([a-z]|[0-9]|-)+\\}\\\\"), Qt::CaseInsensitive);
if (matchVolName.indexIn(result) == 0) { if (matchVolName.indexIn(result) == 0) {
@ -337,7 +338,7 @@ static QString readSymLink(const QFileSystemEntry &link)
if (GetVolumePathNamesForVolumeName(reinterpret_cast<LPCWSTR>(volumeName.utf16()), buffer, MAX_PATH, &len) != 0) if (GetVolumePathNamesForVolumeName(reinterpret_cast<LPCWSTR>(volumeName.utf16()), buffer, MAX_PATH, &len) != 0)
result.replace(0,matchVolName.matchedLength(), QString::fromWCharArray(buffer)); result.replace(0,matchVolName.matchedLength(), QString::fromWCharArray(buffer));
} }
#endif // !Q_OS_WINRT #endif // QT_CONFIG(fslibs)
} }
#else #else
Q_UNUSED(link); Q_UNUSED(link);
@ -347,7 +348,7 @@ static QString readSymLink(const QFileSystemEntry &link)
static QString readLink(const QFileSystemEntry &link) static QString readLink(const QFileSystemEntry &link)
{ {
#if !defined(QT_NO_LIBRARY) #if QT_CONFIG(fslibs)
QString ret; QString ret;
bool neededCoInit = false; bool neededCoInit = false;
@ -386,7 +387,7 @@ static QString readLink(const QFileSystemEntry &link)
#else #else
Q_UNUSED(link); Q_UNUSED(link);
return QString(); return QString();
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(fslibs)
} }
static bool uncShareExists(const QString &server) static bool uncShareExists(const QString &server)
@ -619,7 +620,7 @@ QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
QString QFileSystemEngine::owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own) QString QFileSystemEngine::owner(const QFileSystemEntry &entry, QAbstractFileEngine::FileOwner own)
{ {
QString name; QString name;
#if !defined(QT_NO_LIBRARY) #if QT_CONFIG(fslibs)
extern int qt_ntfs_permission_lookup; extern int qt_ntfs_permission_lookup;
if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) {
resolveLibs(); resolveLibs();
@ -669,7 +670,7 @@ QString QFileSystemEngine::owner(const QFileSystemEntry &entry, QAbstractFileEng
bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data, bool QFileSystemEngine::fillPermissions(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what) QFileSystemMetaData::MetaDataFlags what)
{ {
#if !defined(QT_NO_LIBRARY) #if QT_CONFIG(fslibs)
if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) {
resolveLibs(); resolveLibs();
if(ptrGetNamedSecurityInfoW && ptrBuildTrusteeWithSidW && ptrGetEffectiveRightsFromAclW) { if(ptrGetNamedSecurityInfoW && ptrBuildTrusteeWithSidW && ptrGetEffectiveRightsFromAclW) {
@ -1133,7 +1134,7 @@ QString QFileSystemEngine::rootPath()
QString QFileSystemEngine::homePath() QString QFileSystemEngine::homePath()
{ {
QString ret; QString ret;
#if !defined(QT_NO_LIBRARY) #if QT_CONFIG(fslibs)
resolveLibs(); resolveLibs();
if (ptrGetUserProfileDirectoryW) { if (ptrGetUserProfileDirectoryW) {
HANDLE hnd = ::GetCurrentProcess(); HANDLE hnd = ::GetCurrentProcess();

View File

@ -108,6 +108,20 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
{ {
Q_Q(QFSFileEngine); Q_Q(QFSFileEngine);
// Check if the file name is valid:
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
const QString fileName = fileEntry.fileName();
for (QString::const_iterator it = fileName.constBegin(), end = fileName.constEnd();
it != end; ++it) {
const QChar c = *it;
if (c == QLatin1Char('<') || c == QLatin1Char('>') || c == QLatin1Char(':') ||
c == QLatin1Char('\"') || c == QLatin1Char('/') || c == QLatin1Char('\\') ||
c == QLatin1Char('|') || c == QLatin1Char('?') || c == QLatin1Char('*')) {
q->setError(QFile::OpenError, QStringLiteral("Invalid file name"));
return false;
}
}
// All files are opened in share mode (both read and write). // All files are opened in share mode (both read and write).
DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
@ -589,7 +603,7 @@ bool QFSFileEnginePrivate::doStat(QFileSystemMetaData::MetaDataFlags flags) cons
bool QFSFileEngine::link(const QString &newName) bool QFSFileEngine::link(const QString &newName)
{ {
#if !defined(Q_OS_WINRT) #if !defined(Q_OS_WINRT)
# if !defined(QT_NO_LIBRARY) # if QT_CONFIG(library)
bool ret = false; bool ret = false;
QString linkName = newName; QString linkName = newName;
@ -630,10 +644,10 @@ bool QFSFileEngine::link(const QString &newName)
CoUninitialize(); CoUninitialize();
return ret; return ret;
# else // QT_NO_LIBRARY # else // QT_CONFIG(library)
Q_UNUSED(newName); Q_UNUSED(newName);
return false; return false;
# endif // QT_NO_LIBRARY # endif // QT_CONFIG(library)
#else // !Q_OS_WINRT #else // !Q_OS_WINRT
Q_UNUSED(newName); Q_UNUSED(newName);
Q_UNIMPLEMENTED(); Q_UNIMPLEMENTED();

View File

@ -99,8 +99,6 @@ QT_END_NAMESPACE
#include <private/qcore_unix_p.h> #include <private/qcore_unix_p.h>
#endif #endif
#if QT_CONFIG(processenvironment)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
/*! /*!
@ -430,8 +428,6 @@ void QProcessEnvironment::insert(const QProcessEnvironment &e)
d->insert(*e.d); d->insert(*e.d);
} }
#endif // QT_CONFIG(processenvironment)
#if QT_CONFIG(process) #if QT_CONFIG(process)
void QProcessPrivate::Channel::clear() void QProcessPrivate::Channel::clear()
@ -2605,9 +2601,8 @@ QString QProcess::nullDevice()
\sa QProcess::pid() \sa QProcess::pid()
*/ */
#endif // QT_CONFIG(process)
QT_END_NAMESPACE QT_END_NAMESPACE
#include "moc_qprocess.cpp" #include "moc_qprocess.cpp"
#endif // QT_NO_PROCESS

View File

@ -46,12 +46,12 @@
#include <functional> #include <functional>
QT_REQUIRE_CONFIG(processenvironment);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QProcessPrivate; class QProcessPrivate;
#if QT_CONFIG(processenvironment)
#if !defined(Q_OS_WIN) || defined(Q_CLANG_QDOC) #if !defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
typedef qint64 Q_PID; typedef qint64 Q_PID;
#else #else
@ -105,8 +105,6 @@ private:
Q_DECLARE_SHARED(QProcessEnvironment) Q_DECLARE_SHARED(QProcessEnvironment)
#endif // QT_CONFIG(processenvironment)
#if QT_CONFIG(process) #if QT_CONFIG(process)
class Q_CORE_EXPORT QProcess : public QIODevice class Q_CORE_EXPORT QProcess : public QIODevice
@ -302,7 +300,7 @@ private:
friend class QProcessManager; friend class QProcessManager;
}; };
#endif // QT_NO_PROCESS #endif // QT_CONFIG(process)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -57,6 +57,9 @@
#include "QtCore/qhash.h" #include "QtCore/qhash.h"
#include "QtCore/qshareddata.h" #include "QtCore/qshareddata.h"
#include "private/qiodevice_p.h" #include "private/qiodevice_p.h"
QT_REQUIRE_CONFIG(processenvironment);
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
#include <QtCore/private/qorderedmutexlocker_p.h> #include <QtCore/private/qorderedmutexlocker_p.h>
#endif #endif
@ -78,8 +81,6 @@ class QWindowsPipeWriter;
class QWinEventNotifier; class QWinEventNotifier;
class QTimer; class QTimer;
#if QT_CONFIG(processenvironment)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
class QProcEnvKey : public QString class QProcEnvKey : public QString
{ {
@ -233,8 +234,6 @@ template<> Q_INLINE_TEMPLATE void QSharedDataPointer<QProcessEnvironmentPrivate>
d = x; d = x;
} }
#endif // QT_CONFIG(processenvironment)
#if QT_CONFIG(process) #if QT_CONFIG(process)
class QProcessPrivate : public QIODevicePrivate class QProcessPrivate : public QIODevicePrivate
@ -390,7 +389,7 @@ public:
void setErrorAndEmit(QProcess::ProcessError error, const QString &description = QString()); void setErrorAndEmit(QProcess::ProcessError error, const QString &description = QString());
}; };
#endif // QT_NO_PROCESS #endif // QT_CONFIG(process)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -119,7 +119,7 @@ QT_END_NAMESPACE
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if QT_CONFIG(processenvironment) && !defined(Q_OS_DARWIN) #if !defined(Q_OS_DARWIN)
QProcessEnvironment QProcessEnvironment::systemEnvironment() QProcessEnvironment QProcessEnvironment::systemEnvironment()
{ {
@ -138,7 +138,7 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment()
return env; return env;
} }
#endif // QT_CONFIG(processenvironment) && !defined(Q_OS_DARWIN) #endif // !defined(Q_OS_DARWIN)
#if QT_CONFIG(process) #if QT_CONFIG(process)
@ -1040,6 +1040,6 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
return success; return success;
} }
#endif // QT_NO_PROCESS #endif // QT_CONFIG(process)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -62,8 +62,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if QT_CONFIG(processenvironment)
QProcessEnvironment QProcessEnvironment::systemEnvironment() QProcessEnvironment QProcessEnvironment::systemEnvironment()
{ {
QProcessEnvironment env; QProcessEnvironment env;
@ -86,8 +84,6 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment()
return env; return env;
} }
#endif // QT_CONFIG(processenvironment)
#if QT_CONFIG(process) #if QT_CONFIG(process)
static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
@ -895,6 +891,6 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a
return success; return success;
} }
#endif // QT_NO_PROCESS #endif // QT_CONFIG(process)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -156,4 +156,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PROCESS #endif // QWINDOWSPIPEWRITER_P_H

View File

@ -3071,7 +3071,7 @@ void QAbstractItemModel::endRemoveColumns()
When reimplementing a subclass, this method simplifies moving When reimplementing a subclass, this method simplifies moving
entities in your model. This method is responsible for moving entities in your model. This method is responsible for moving
persistent indexes in the model, which you would otherwise be persistent indexes in the model, which you would otherwise be
required to do yourself. Using beginMoveRows and endMoveRows required to do yourself. Using beginMoveColumns and endMoveColumns
is an alternative to emitting layoutAboutToBeChanged and is an alternative to emitting layoutAboutToBeChanged and
layoutChanged directly along with changePersistentIndex. layoutChanged directly along with changePersistentIndex.

View File

@ -302,7 +302,7 @@ static inline int qt_safe_close(int fd)
#define QT_CLOSE qt_safe_close #define QT_CLOSE qt_safe_close
// - VxWorks & iOS/tvOS/watchOS don't have processes // - VxWorks & iOS/tvOS/watchOS don't have processes
#if !defined(Q_OS_VXWORKS) && !defined(QT_NO_PROCESS) #if QT_CONFIG(process)
static inline int qt_safe_execve(const char *filename, char *const argv[], static inline int qt_safe_execve(const char *filename, char *const argv[],
char *const envp[]) char *const envp[])
{ {
@ -331,7 +331,7 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options)
EINTR_LOOP(ret, ::waitpid(pid, status, options)); EINTR_LOOP(ret, ::waitpid(pid, status, options));
return ret; return ret;
} }
#endif // Q_OS_VXWORKS #endif // QT_CONFIG(process)
#if !defined(_POSIX_MONOTONIC_CLOCK) #if !defined(_POSIX_MONOTONIC_CLOCK)
# define _POSIX_MONOTONIC_CLOCK -1 # define _POSIX_MONOTONIC_CLOCK -1

View File

@ -376,7 +376,7 @@ struct QCoreApplicationData {
bool applicationNameSet; // true if setApplicationName was called bool applicationNameSet; // true if setApplicationName was called
bool applicationVersionSet; // true if setApplicationVersion was called bool applicationVersionSet; // true if setApplicationVersion was called
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
QScopedPointer<QStringList> app_libpaths; QScopedPointer<QStringList> app_libpaths;
QScopedPointer<QStringList> manual_libpaths; QScopedPointer<QStringList> manual_libpaths;
#endif #endif
@ -569,7 +569,7 @@ void QCoreApplicationPrivate::checkReceiverThread(QObject *receiver)
void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
{ {
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
QStringList *app_libpaths = coreappdata()->app_libpaths.data(); QStringList *app_libpaths = coreappdata()->app_libpaths.data();
if (!app_libpaths) if (!app_libpaths)
coreappdata()->app_libpaths.reset(app_libpaths = new QStringList); coreappdata()->app_libpaths.reset(app_libpaths = new QStringList);
@ -773,7 +773,7 @@ void QCoreApplicationPrivate::init()
QLoggingRegistry::instance()->init(); QLoggingRegistry::instance()->init();
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
// Reset the lib paths, so that they will be recomputed, taking the availability of argv[0] // Reset the lib paths, so that they will be recomputed, taking the availability of argv[0]
// into account. If necessary, recompute right away and replay the manual changes on top of the // into account. If necessary, recompute right away and replay the manual changes on top of the
// new lib paths. // new lib paths.
@ -872,7 +872,7 @@ QCoreApplication::~QCoreApplication()
QCoreApplicationPrivate::eventDispatcher = 0; QCoreApplicationPrivate::eventDispatcher = 0;
#endif #endif
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
coreappdata()->app_libpaths.reset(); coreappdata()->app_libpaths.reset();
coreappdata()->manual_libpaths.reset(); coreappdata()->manual_libpaths.reset();
#endif #endif
@ -2479,7 +2479,7 @@ QString QCoreApplication::applicationVersion()
return coreappdata() ? coreappdata()->applicationVersion : QString(); return coreappdata() ? coreappdata()->applicationVersion : QString();
} }
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive)) Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
@ -2691,7 +2691,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
QFactoryLoader::refreshAll(); QFactoryLoader::refreshAll();
} }
#endif //QT_NO_LIBRARY #endif // QT_CONFIG(library)
#ifndef QT_NO_QOBJECT #ifndef QT_NO_QOBJECT

View File

@ -141,12 +141,12 @@ public:
static QString applicationFilePath(); static QString applicationFilePath();
static qint64 applicationPid(); static qint64 applicationPid();
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
static void setLibraryPaths(const QStringList &); static void setLibraryPaths(const QStringList &);
static QStringList libraryPaths(); static QStringList libraryPaths();
static void addLibraryPath(const QString &); static void addLibraryPath(const QString &);
static void removeLibraryPath(const QString &); static void removeLibraryPath(const QString &);
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
#ifndef QT_NO_TRANSLATION #ifndef QT_NO_TRANSLATION
static bool installTranslator(QTranslator * messageFile); static bool installTranslator(QTranslator * messageFile);

View File

@ -2653,7 +2653,8 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM
call qRegisterMetaType() to register the data type before you call qRegisterMetaType() to register the data type before you
establish the connection. establish the connection.
\sa disconnect(), sender(), qRegisterMetaType(), Q_DECLARE_METATYPE() \sa disconnect(), sender(), qRegisterMetaType(), Q_DECLARE_METATYPE(),
{Differences between String-Based and Functor-Based Connections}
*/ */
QMetaObject::Connection QObject::connect(const QObject *sender, const char *signal, QMetaObject::Connection QObject::connect(const QObject *sender, const char *signal,
const QObject *receiver, const char *method, const QObject *receiver, const char *method,
@ -4655,6 +4656,8 @@ void qDeleteInEventHandler(QObject *o)
make sure to declare the argument type with Q_DECLARE_METATYPE make sure to declare the argument type with Q_DECLARE_METATYPE
Overloaded functions can be resolved with help of \l qOverload. Overloaded functions can be resolved with help of \l qOverload.
\sa {Differences between String-Based and Functor-Based Connections}
*/ */
/*! /*!

View File

@ -90,14 +90,9 @@ namespace QtPrivate {
explicit ApplyReturnValue(void *data_) : data(data_) {} explicit ApplyReturnValue(void *data_) : data(data_) {}
}; };
template<typename T, typename U> template<typename T, typename U>
void operator,(const T &value, const ApplyReturnValue<U> &container) {
if (container.data)
*reinterpret_cast<U*>(container.data) = value;
}
template<typename T, typename U>
void operator,(T &&value, const ApplyReturnValue<U> &container) { void operator,(T &&value, const ApplyReturnValue<U> &container) {
if (container.data) if (container.data)
*reinterpret_cast<U*>(container.data) = value; *reinterpret_cast<U *>(container.data) = std::forward<T>(value);
} }
template<typename T> template<typename T>
void operator,(T, const ApplyReturnValue<void> &) {} void operator,(T, const ApplyReturnValue<void> &) {}

View File

@ -168,7 +168,7 @@ public:
Q_ALWAYS_INLINE Q_ALWAYS_INLINE
void setInterval(std::chrono::milliseconds value) void setInterval(std::chrono::milliseconds value)
{ {
setInterval(value.count()); setInterval(int(value.count()));
} }
Q_ALWAYS_INLINE Q_ALWAYS_INLINE

View File

@ -1,38 +1,37 @@
# Qt core library plugin module # Qt core library plugin module
HEADERS += \ HEADERS += \
plugin/qfactoryinterface.h \ plugin/qfactoryinterface.h \
plugin/qpluginloader.h \ plugin/qpluginloader.h \
plugin/qlibrary.h \ plugin/qplugin.h \
plugin/qlibrary_p.h \ plugin/quuid.h \
plugin/qplugin.h \ plugin/qfactoryloader_p.h
plugin/quuid.h \
plugin/qfactoryloader_p.h \ SOURCES += \
plugin/qsystemlibrary_p.h \ plugin/qfactoryinterface.cpp \
plugin/qpluginloader.cpp \
plugin/qfactoryloader.cpp \
plugin/quuid.cpp
win32 {
HEADERS += plugin/qsystemlibrary_p.h
SOURCES += plugin/qsystemlibrary.cpp
}
qtConfig(library) {
HEADERS += \
plugin/qlibrary.h \
plugin/qlibrary_p.h \
plugin/qelfparser_p.h \ plugin/qelfparser_p.h \
plugin/qmachparser_p.h plugin/qmachparser_p.h
SOURCES += \ SOURCES += \
plugin/qfactoryinterface.cpp \ plugin/qlibrary.cpp \
plugin/qpluginloader.cpp \
plugin/qfactoryloader.cpp \
plugin/quuid.cpp \
plugin/qlibrary.cpp \
plugin/qelfparser_p.cpp \ plugin/qelfparser_p.cpp \
plugin/qmachparser.cpp plugin/qmachparser.cpp
win32 { unix: SOURCES += plugin/qlibrary_unix.cpp
SOURCES += \ else: SOURCES += plugin/qlibrary_win.cpp
plugin/qlibrary_win.cpp \
plugin/qsystemlibrary.cpp
}
unix { qtConfig(dlopen): QMAKE_USE_PRIVATE += libdl
SOURCES += plugin/qlibrary_unix.cpp
} }
integrity {
SOURCES += plugin/qlibrary_unix.cpp
}
!no-libdl: LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD

View File

@ -39,7 +39,6 @@
#include "qelfparser_p.h" #include "qelfparser_p.h"
#ifndef QT_NO_LIBRARY
#if defined (Q_OF_ELF) && defined(Q_CC_GNU) #if defined (Q_OF_ELF) && defined(Q_CC_GNU)
#include "qlibrary_p.h" #include "qlibrary_p.h"
@ -237,4 +236,3 @@ int QElfParser::parse(const char *dataStart, ulong fdlen, const QString &library
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) #endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)
#endif // QT_NO_LIBRARY

View File

@ -54,7 +54,8 @@
#include <qendian.h> #include <qendian.h>
#include <private/qglobal_p.h> #include <private/qglobal_p.h>
#ifndef QT_NO_LIBRARY QT_REQUIRE_CONFIG(library);
#if defined (Q_OF_ELF) && defined(Q_CC_GNU) #if defined (Q_OF_ELF) && defined(Q_CC_GNU)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -101,6 +102,5 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) #endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)
#endif // QT_NO_LIBRARY
#endif // QELFPARSER_P_H #endif // QELFPARSER_P_H

View File

@ -62,7 +62,7 @@ class QFactoryLoaderPrivate : public QObjectPrivate
public: public:
QFactoryLoaderPrivate(){} QFactoryLoaderPrivate(){}
QByteArray iid; QByteArray iid;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
~QFactoryLoaderPrivate(); ~QFactoryLoaderPrivate();
mutable QMutex mutex; mutable QMutex mutex;
QList<QLibraryPrivate*> libraryList; QList<QLibraryPrivate*> libraryList;
@ -73,7 +73,7 @@ public:
#endif #endif
}; };
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
Q_GLOBAL_STATIC(QList<QFactoryLoader *>, qt_factory_loaders) Q_GLOBAL_STATIC(QList<QFactoryLoader *>, qt_factory_loaders)
@ -232,7 +232,7 @@ void QFactoryLoader::refreshAll()
} }
} }
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
QFactoryLoader::QFactoryLoader(const char *iid, QFactoryLoader::QFactoryLoader(const char *iid,
const QString &suffix, const QString &suffix,
@ -242,7 +242,7 @@ QFactoryLoader::QFactoryLoader(const char *iid,
moveToThread(QCoreApplicationPrivate::mainThread()); moveToThread(QCoreApplicationPrivate::mainThread());
Q_D(QFactoryLoader); Q_D(QFactoryLoader);
d->iid = iid; d->iid = iid;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
d->cs = cs; d->cs = cs;
d->suffix = suffix; d->suffix = suffix;
@ -259,7 +259,7 @@ QList<QJsonObject> QFactoryLoader::metaData() const
{ {
Q_D(const QFactoryLoader); Q_D(const QFactoryLoader);
QList<QJsonObject> metaData; QList<QJsonObject> metaData;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
QMutexLocker locker(&d->mutex); QMutexLocker locker(&d->mutex);
for (int i = 0; i < d->libraryList.size(); ++i) for (int i = 0; i < d->libraryList.size(); ++i)
metaData.append(d->libraryList.at(i)->metaData); metaData.append(d->libraryList.at(i)->metaData);
@ -281,7 +281,7 @@ QObject *QFactoryLoader::instance(int index) const
if (index < 0) if (index < 0)
return 0; return 0;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
QMutexLocker lock(&d->mutex); QMutexLocker lock(&d->mutex);
if (index < d->libraryList.size()) { if (index < d->libraryList.size()) {
QLibraryPrivate *library = d->libraryList.at(index); QLibraryPrivate *library = d->libraryList.at(index);

View File

@ -60,7 +60,9 @@
#include "QtCore/qjsondocument.h" #include "QtCore/qjsondocument.h"
#include "QtCore/qmap.h" #include "QtCore/qmap.h"
#include "QtCore/qendian.h" #include "QtCore/qendian.h"
#if QT_CONFIG(library)
#include "private/qlibrary_p.h" #include "private/qlibrary_p.h"
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -84,7 +86,7 @@ public:
const QString &suffix = QString(), const QString &suffix = QString(),
Qt::CaseSensitivity = Qt::CaseSensitive); Qt::CaseSensitivity = Qt::CaseSensitive);
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
~QFactoryLoader(); ~QFactoryLoader();
void update(); void update();
@ -93,7 +95,7 @@ public:
#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) #if defined(Q_OS_UNIX) && !defined (Q_OS_MAC)
QLibraryPrivate *library(const QString &key) const; QLibraryPrivate *library(const QString &key) const;
#endif // Q_OS_UNIX && !Q_OS_MAC #endif // Q_OS_UNIX && !Q_OS_MAC
#endif // !QT_NO_LIBRARY #endif // QT_CONFIG(library)
QMultiMap<int, QString> keyMap() const; QMultiMap<int, QString> keyMap() const;
int indexOf(const QString &needle) const; int indexOf(const QString &needle) const;

View File

@ -40,8 +40,6 @@
#include "qplatformdefs.h" #include "qplatformdefs.h"
#include "qlibrary.h" #include "qlibrary.h"
#ifndef QT_NO_LIBRARY
#include "qfactoryloader_p.h" #include "qfactoryloader_p.h"
#include "qlibrary_p.h" #include "qlibrary_p.h"
#include <qstringlist.h> #include <qstringlist.h>
@ -1131,5 +1129,3 @@ bool qt_debug_component()
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_LIBRARY

View File

@ -42,9 +42,9 @@
#include <QtCore/qobject.h> #include <QtCore/qobject.h>
QT_BEGIN_NAMESPACE QT_REQUIRE_CONFIG(library);
#ifndef QT_NO_LIBRARY QT_BEGIN_NAMESPACE
class QLibraryPrivate; class QLibraryPrivate;
@ -99,8 +99,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QLibrary::LoadHints) Q_DECLARE_OPERATORS_FOR_FLAGS(QLibrary::LoadHints)
#endif //QT_NO_LIBRARY
QT_END_NAMESPACE QT_END_NAMESPACE
#endif //QLIBRARY_H #endif //QLIBRARY_H

View File

@ -62,11 +62,10 @@
# include "QtCore/qt_windows.h" # include "QtCore/qt_windows.h"
#endif #endif
QT_REQUIRE_CONFIG(library);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY
bool qt_debug_component(); bool qt_debug_component();
class QLibraryStore; class QLibraryStore;
@ -130,8 +129,6 @@ private:
friend class QLibraryStore; friend class QLibraryStore;
}; };
#endif // QT_NO_LIBRARY
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QLIBRARY_P_H #endif // QLIBRARY_P_H

View File

@ -44,8 +44,6 @@
#include <qcoreapplication.h> #include <qcoreapplication.h>
#include <private/qfilesystementry_p.h> #include <private/qfilesystementry_p.h>
#ifndef QT_NO_LIBRARY
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
# include <private/qcore_mac_p.h> # include <private/qcore_mac_p.h>
#endif #endif
@ -308,5 +306,3 @@ QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_LIBRARY

View File

@ -44,8 +44,6 @@
#include "qfileinfo.h" #include "qfileinfo.h"
#include <private/qfilesystementry_p.h> #include <private/qfilesystementry_p.h>
#ifndef QT_NO_LIBRARY
#include <qt_windows.h> #include <qt_windows.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -174,5 +172,3 @@ QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
return QFunctionPointer(address); return QFunctionPointer(address);
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_LIBRARY

View File

@ -39,7 +39,7 @@
#include "qmachparser_p.h" #include "qmachparser_p.h"
#if defined(Q_OF_MACH_O) && !defined(QT_NO_LIBRARY) #if defined(Q_OF_MACH_O)
#include <qendian.h> #include <qendian.h>
#include "qlibrary_p.h" #include "qlibrary_p.h"

View File

@ -54,7 +54,8 @@
#include <qendian.h> #include <qendian.h>
#include <private/qglobal_p.h> #include <private/qglobal_p.h>
#ifndef QT_NO_LIBRARY QT_REQUIRE_CONFIG(library);
#if defined(Q_OF_MACH_O) #if defined(Q_OF_MACH_O)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -72,6 +73,5 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) #endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)
#endif // QT_NO_LIBRARY
#endif // QMACHPARSER_P_H #endif // QMACHPARSER_P_H

View File

@ -49,7 +49,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
/*! /*!
\class QPluginLoader \class QPluginLoader
@ -417,7 +417,7 @@ QLibrary::LoadHints QPluginLoader::loadHints() const
return d ? d->loadHints() : QLibrary::LoadHints(); return d ? d->loadHints() : QLibrary::LoadHints();
} }
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
typedef QVector<QStaticPlugin> StaticPluginList; typedef QVector<QStaticPlugin> StaticPluginList;
Q_GLOBAL_STATIC(StaticPluginList, staticPluginList) Q_GLOBAL_STATIC(StaticPluginList, staticPluginList)

View File

@ -40,12 +40,15 @@
#ifndef QPLUGINLOADER_H #ifndef QPLUGINLOADER_H
#define QPLUGINLOADER_H #define QPLUGINLOADER_H
#include <QtCore/qglobal.h>
#if QT_CONFIG(library)
#include <QtCore/qlibrary.h> #include <QtCore/qlibrary.h>
#endif
#include <QtCore/qplugin.h> #include <QtCore/qplugin.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
class QLibraryPrivate; class QLibraryPrivate;
class QJsonObject; class QJsonObject;
@ -93,7 +96,7 @@ public:
static QVector<QStaticPlugin> staticPlugins(); static QVector<QStaticPlugin> staticPlugins();
}; };
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -159,7 +159,7 @@ public:
~QFutureInterface() ~QFutureInterface()
{ {
if (!derefT()) if (!derefT())
resultStore().clear(); resultStoreBase().template clear<T>();
} }
static QFutureInterface canceledResult() static QFutureInterface canceledResult()
@ -169,7 +169,7 @@ public:
{ {
other.refT(); other.refT();
if (!derefT()) if (!derefT())
resultStore().clear(); resultStoreBase().template clear<T>();
QFutureInterfaceBase::operator=(other); QFutureInterfaceBase::operator=(other);
return *this; return *this;
} }
@ -184,11 +184,6 @@ public:
inline const T &resultReference(int index) const; inline const T &resultReference(int index) const;
inline const T *resultPointer(int index) const; inline const T *resultPointer(int index) const;
inline QList<T> results(); inline QList<T> results();
private:
QtPrivate::ResultStore<T> &resultStore()
{ return static_cast<QtPrivate::ResultStore<T> &>(resultStoreBase()); }
const QtPrivate::ResultStore<T> &resultStore() const
{ return static_cast<const QtPrivate::ResultStore<T> &>(resultStoreBase()); }
}; };
template <typename T> template <typename T>
@ -199,15 +194,14 @@ inline void QFutureInterface<T>::reportResult(const T *result, int index)
return; return;
} }
QtPrivate::ResultStore<T> &store = resultStore(); QtPrivate::ResultStoreBase &store = resultStoreBase();
if (store.filterMode()) { if (store.filterMode()) {
const int resultCountBefore = store.count(); const int resultCountBefore = store.count();
store.addResult(index, result); store.addResult<T>(index, result);
this->reportResultsReady(resultCountBefore, resultCountBefore + store.count()); this->reportResultsReady(resultCountBefore, resultCountBefore + store.count());
} else { } else {
const int insertIndex = store.addResult(index, result); const int insertIndex = store.addResult<T>(index, result);
this->reportResultsReady(insertIndex, insertIndex + 1); this->reportResultsReady(insertIndex, insertIndex + 1);
} }
} }
@ -226,7 +220,7 @@ inline void QFutureInterface<T>::reportResults(const QVector<T> &_results, int b
return; return;
} }
QtPrivate::ResultStore<T> &store = resultStore(); auto &store = resultStoreBase();
if (store.filterMode()) { if (store.filterMode()) {
const int resultCountBefore = store.count(); const int resultCountBefore = store.count();
@ -250,14 +244,14 @@ template <typename T>
inline const T &QFutureInterface<T>::resultReference(int index) const inline const T &QFutureInterface<T>::resultReference(int index) const
{ {
QMutexLocker lock(mutex()); QMutexLocker lock(mutex());
return resultStore().resultAt(index).value(); return resultStoreBase().resultAt(index).template value<T>();
} }
template <typename T> template <typename T>
inline const T *QFutureInterface<T>::resultPointer(int index) const inline const T *QFutureInterface<T>::resultPointer(int index) const
{ {
QMutexLocker lock(mutex()); QMutexLocker lock(mutex());
return resultStore().resultAt(index).pointer(); return resultStoreBase().resultAt(index).template pointer<T>();
} }
template <typename T> template <typename T>
@ -272,9 +266,9 @@ inline QList<T> QFutureInterface<T>::results()
QList<T> res; QList<T> res;
QMutexLocker lock(mutex()); QMutexLocker lock(mutex());
QtPrivate::ResultIterator<T> it = resultStore().begin(); QtPrivate::ResultIteratorBase it = resultStoreBase().begin();
while (it != resultStore().end()) { while (it != resultStoreBase().end()) {
res.append(it.value()); res.append(it.value<T>());
++it; ++it;
} }

View File

@ -98,6 +98,12 @@ bool ResultIteratorBase::canIncrementVectorIndex() const
ResultStoreBase::ResultStoreBase() ResultStoreBase::ResultStoreBase()
: insertIndex(0), resultCount(0), m_filterMode(false), filteredResults(0) { } : insertIndex(0), resultCount(0), m_filterMode(false), filteredResults(0) { }
ResultStoreBase::~ResultStoreBase()
{
// QFutureInterface's dtor must delete the contents of m_results.
Q_ASSERT(m_results.isEmpty());
}
void ResultStoreBase::setFilterMode(bool enable) void ResultStoreBase::setFilterMode(bool enable)
{ {
m_filterMode = enable; m_filterMode = enable;

View File

@ -93,20 +93,14 @@ public:
protected: protected:
QMap<int, ResultItem>::const_iterator mapIterator; QMap<int, ResultItem>::const_iterator mapIterator;
int m_vectorIndex; int m_vectorIndex;
};
template <typename T>
class ResultIterator : public ResultIteratorBase
{
public: public:
ResultIterator(const ResultIteratorBase &base) template <typename T>
: ResultIteratorBase(base) { }
const T &value() const const T &value() const
{ {
return *pointer(); return *pointer<T>();
} }
template <typename T>
const T *pointer() const const T *pointer() const
{ {
if (mapIterator.value().isVector()) if (mapIterator.value().isVector())
@ -130,7 +124,7 @@ public:
ResultIteratorBase resultAt(int index) const; ResultIteratorBase resultAt(int index) const;
bool contains(int index) const; bool contains(int index) const;
int count() const; int count() const;
virtual ~ResultStoreBase() { } virtual ~ResultStoreBase();
protected: protected:
int insertResultItem(int index, ResultItem &resultItem); int insertResultItem(int index, ResultItem &resultItem);
@ -147,64 +141,44 @@ protected:
QMap<int, ResultItem> pendingResults; QMap<int, ResultItem> pendingResults;
int filteredResults; int filteredResults;
};
template <typename T>
class ResultStore : public ResultStoreBase
{
public: public:
ResultStore() { } template <typename T>
int addResult(int index, const T *result)
ResultStore(const ResultStoreBase &base)
: ResultStoreBase(base) { }
int addResult(int index, const T *result)
{ {
if (result == 0) if (result == 0)
return ResultStoreBase::addResult(index, result); return addResult(index, static_cast<void *>(nullptr));
else else
return ResultStoreBase::addResult(index, new T(*result)); return addResult(index, static_cast<void *>(new T(*result)));
} }
template <typename T>
int addResults(int index, const QVector<T> *results) int addResults(int index, const QVector<T> *results)
{ {
return ResultStoreBase::addResults(index, new QVector<T>(*results), results->count(), results->count()); return addResults(index, new QVector<T>(*results), results->count(), results->count());
} }
template <typename T>
int addResults(int index, const QVector<T> *results, int totalCount) int addResults(int index, const QVector<T> *results, int totalCount)
{ {
if (m_filterMode == true && results->count() != totalCount && 0 == results->count()) if (m_filterMode == true && results->count() != totalCount && 0 == results->count())
return ResultStoreBase::addResults(index, 0, 0, totalCount); return addResults(index, 0, 0, totalCount);
else else
return ResultStoreBase::addResults(index, new QVector<T>(*results), results->count(), totalCount); return addResults(index, new QVector<T>(*results), results->count(), totalCount);
} }
int addCanceledResult(int index) int addCanceledResult(int index)
{ {
return addResult(index, 0); return addResult(index, static_cast<void *>(nullptr));
} }
template <typename T>
int addCanceledResults(int index, int _count) int addCanceledResults(int index, int _count)
{ {
QVector<T> empty; QVector<T> empty;
return addResults(index, &empty, _count); return addResults(index, &empty, _count);
} }
ResultIterator<T> begin() const template <typename T>
{
return static_cast<ResultIterator<T> >(ResultStoreBase::begin());
}
ResultIterator<T> end() const
{
return static_cast<ResultIterator<T> >(ResultStoreBase::end());
}
ResultIterator<T> resultAt(int index) const
{
return static_cast<ResultIterator<T> >(ResultStoreBase::resultAt(index));
}
void clear() void clear()
{ {
QMap<int, ResultItem>::const_iterator mapIterator = m_results.constBegin(); QMap<int, ResultItem>::const_iterator mapIterator = m_results.constBegin();
@ -218,12 +192,6 @@ public:
resultCount = 0; resultCount = 0;
m_results.clear(); m_results.clear();
} }
~ResultStore()
{
clear();
}
}; };
} // namespace QtPrivate } // namespace QtPrivate

View File

@ -1971,7 +1971,7 @@ QTime QTime::fromString(const QString& string, Qt::DateFormat format)
case Qt::ISODateWithMs: case Qt::ISODateWithMs:
case Qt::TextDate: case Qt::TextDate:
default: default:
return fromIsoTimeString(&string, format, 0); return fromIsoTimeString(QStringRef(&string), format, 0);
} }
} }
@ -2853,6 +2853,9 @@ inline bool QDateTime::Data::isShort() const
{ {
bool b = quintptr(d) & QDateTimePrivate::ShortData; bool b = quintptr(d) & QDateTimePrivate::ShortData;
// sanity check:
Q_ASSERT(b || (d->m_status & QDateTimePrivate::ShortData) == 0);
// even if CanBeSmall = false, we have short data for a default-constructed // even if CanBeSmall = false, we have short data for a default-constructed
// QDateTime object. But it's unlikely. // QDateTime object. But it's unlikely.
if (CanBeSmall) if (CanBeSmall)
@ -3678,7 +3681,7 @@ void QDateTime::setMSecsSinceEpoch(qint64 msecs)
d.data.status = status; d.data.status = status;
} else { } else {
d.detach(); d.detach();
d->m_status = status; d->m_status = status & ~QDateTimePrivate::ShortData;
d->m_msecs = msecs; d->m_msecs = msecs;
} }

View File

@ -49,7 +49,7 @@
//#define QDATETIMEPARSER_DEBUG //#define QDATETIMEPARSER_DEBUG
#if defined (QDATETIMEPARSER_DEBUG) && !defined(QT_NO_DEBUG_STREAM) #if defined (QDATETIMEPARSER_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
# define QDTPDEBUG qDebug() << QString("%1:%2").arg(__FILE__).arg(__LINE__) # define QDTPDEBUG qDebug()
# define QDTPDEBUGN qDebug # define QDTPDEBUGN qDebug
#else #else
# define QDTPDEBUG if (false) qDebug() # define QDTPDEBUG if (false) qDebug()
@ -1325,39 +1325,16 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
} }
const QLocale l = locale(); const QLocale l = locale();
for (int day=startDay; day<=7; ++day) { for (int day=startDay; day<=7; ++day) {
const QString str2 = l.dayName(day, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat); const QString dayName = l.dayName(day, sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat);
const QString str2 = dayName.toLower();
if (str1.startsWith(str2.toLower())) {
if (used)
*used = str2.size();
if (usedDay) {
*usedDay = str2;
}
return day;
}
if (context == FromString)
continue;
const int limit = qMin(str1.size(), str2.size()); const int limit = qMin(str1.size(), str2.size());
bool found = true; int i = 0;
for (int i=0; i<limit; ++i) { while (i < limit && str1.at(i) == str2.at(i))
if (str1.at(i) != str2.at(i) && !str1.at(i).isSpace()) { ++i;
if (i > bestCount) { if (i > bestCount) {
bestCount = i; bestCount = i;
bestMatch = day; bestMatch = day;
}
found = false;
break;
}
}
if (found) {
if (used)
*used = limit;
if (usedDay)
*usedDay = str2;
return day;
} }
} }
if (usedDay && bestMatch != -1) { if (usedDay && bestMatch != -1) {

View File

@ -40,7 +40,9 @@
#include "qharfbuzz_p.h" #include "qharfbuzz_p.h"
#include "qunicodetables_p.h" #include "qunicodetables_p.h"
#if QT_CONFIG(library)
#include "qlibrary.h" #include "qlibrary.h"
#endif
QT_USE_NAMESPACE QT_USE_NAMESPACE
@ -70,7 +72,7 @@ HB_UChar16 HB_GetMirroredChar(HB_UChar16 ch)
void (*HB_Library_Resolve(const char *library, int version, const char *symbol))() void (*HB_Library_Resolve(const char *library, int version, const char *symbol))()
{ {
#ifdef QT_NO_LIBRARY #if !QT_CONFIG(library)
Q_UNUSED(library); Q_UNUSED(library);
Q_UNUSED(version); Q_UNUSED(version);
Q_UNUSED(symbol); Q_UNUSED(symbol);

View File

@ -895,7 +895,7 @@ Q_OUTOFLINE_TEMPLATE int QList<T>::removeAll(const T &_t)
*n++ = *i; *n++ = *i;
} }
int removedCount = e - n; int removedCount = int(e - n);
d->end -= removedCount; d->end -= removedCount;
return removedCount; return removedCount;
} }

View File

@ -972,7 +972,7 @@ QLocale::NumberOptions QLocale::numberOptions() const
*/ */
QString QLocale::quoteString(const QString &str, QuotationStyle style) const QString QLocale::quoteString(const QString &str, QuotationStyle style) const
{ {
return quoteString(&str, style); return quoteString(QStringRef(&str), style);
} }
/*! /*!
@ -2117,8 +2117,8 @@ QList<QLocale> QLocale::matchingLocales(QLocale::Language language,
&& (language == QLocale::AnyLanguage || data->m_language_id == uint(language))) { && (language == QLocale::AnyLanguage || data->m_language_id == uint(language))) {
if ((script == QLocale::AnyScript || data->m_script_id == uint(script)) if ((script == QLocale::AnyScript || data->m_script_id == uint(script))
&& (country == QLocale::AnyCountry || data->m_country_id == uint(country))) { && (country == QLocale::AnyCountry || data->m_country_id == uint(country))) {
QLocale locale(*QLocalePrivate::create(data)); result.append(QLocale(*(data->m_language_id == C ? c_private()
result.append(locale); : QLocalePrivate::create(data))));
} }
++data; ++data;
} }

View File

@ -38,7 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include "qglobal.h" #include "qglobal.h"
#include "qlibrary.h"
#include "qdebug.h" #include "qdebug.h"
#include "qlocale_p.h" #include "qlocale_p.h"
#include "qmutex.h" #include "qmutex.h"

View File

@ -662,12 +662,18 @@ Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r) Q_DECL_NOTHROW
{ {
} }
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
Q_DECL_CONSTEXPR inline bool QRectF::isNull() const Q_DECL_NOTHROW Q_DECL_CONSTEXPR inline bool QRectF::isNull() const Q_DECL_NOTHROW
{ return w == 0. && h == 0.; } { return w == 0. && h == 0.; }
Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const Q_DECL_NOTHROW Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const Q_DECL_NOTHROW
{ return w <= 0. || h <= 0.; } { return w <= 0. || h <= 0.; }
QT_WARNING_POP
Q_DECL_CONSTEXPR inline bool QRectF::isValid() const Q_DECL_NOTHROW Q_DECL_CONSTEXPR inline bool QRectF::isValid() const Q_DECL_NOTHROW
{ return w > 0. && h > 0.; } { return w > 0. && h > 0.; }

View File

@ -775,7 +775,9 @@ inline char qToLower(char ch)
} }
#if QT_DEPRECATED_SINCE(5, 9)
const QString::Null QString::null = { }; const QString::Null QString::null = { };
#endif
/*! /*!
\macro QT_RESTRICTED_CAST_FROM_ASCII \macro QT_RESTRICTED_CAST_FROM_ASCII
@ -9794,9 +9796,7 @@ QStringRef QStringRef::left(int n) const
*/ */
QStringRef QString::leftRef(int n) const QStringRef QString::leftRef(int n) const
{ {
if (uint(n) >= uint(d->size)) return QStringRef(this).left(n);
n = d->size;
return QStringRef(this, 0, n);
} }
/*! /*!
@ -9833,9 +9833,7 @@ QStringRef QStringRef::right(int n) const
*/ */
QStringRef QString::rightRef(int n) const QStringRef QString::rightRef(int n) const
{ {
if (uint(n) >= uint(d->size)) return QStringRef(this).right(n);
n = d->size;
return QStringRef(this, d->size - n, n);
} }
/*! /*!
@ -9894,19 +9892,7 @@ QStringRef QStringRef::mid(int pos, int n) const
*/ */
QStringRef QString::midRef(int position, int n) const QStringRef QString::midRef(int position, int n) const
{ {
using namespace QtPrivate; return QStringRef(this).mid(position, n);
switch (QContainerImplHelper::mid(d->size, &position, &n)) {
case QContainerImplHelper::Null:
return QStringRef();
case QContainerImplHelper::Empty:
return QStringRef(this, 0, 0);
case QContainerImplHelper::Full:
return QStringRef(this, 0, d->size);
case QContainerImplHelper::Subset:
return QStringRef(this, position, n);
}
Q_UNREACHABLE();
return QStringRef();
} }
/*! /*!

View File

@ -795,10 +795,13 @@ public:
NSString *toNSString() const Q_DECL_NS_RETURNS_AUTORELEASED; NSString *toNSString() const Q_DECL_NS_RETURNS_AUTORELEASED;
#endif #endif
// compatibility // compatibility
#if QT_DEPRECATED_SINCE(5, 9)
struct Null { }; struct Null { };
QT_DEPRECATED_X("use QString()")
static const Null null; static const Null null;
inline QString(const Null &): d(Data::sharedNull()) {} inline QString(const Null &): d(Data::sharedNull()) {}
inline QString &operator=(const Null &) { *this = QString(); return *this; } inline QString &operator=(const Null &) { *this = QString(); return *this; }
#endif
inline bool isNull() const { return d == Data::sharedNull(); } inline bool isNull() const { return d == Data::sharedNull(); }
@ -1159,13 +1162,18 @@ inline bool QString::contains(QLatin1String s, Qt::CaseSensitivity cs) const
inline bool QString::contains(QChar c, Qt::CaseSensitivity cs) const inline bool QString::contains(QChar c, Qt::CaseSensitivity cs) const
{ return indexOf(c, 0, cs) != -1; } { return indexOf(c, 0, cs) != -1; }
#if QT_DEPRECATED_SINCE(5, 9)
inline bool operator==(QString::Null, QString::Null) { return true; } inline bool operator==(QString::Null, QString::Null) { return true; }
QT_DEPRECATED_X("use QString::isNull()")
inline bool operator==(QString::Null, const QString &s) { return s.isNull(); } inline bool operator==(QString::Null, const QString &s) { return s.isNull(); }
QT_DEPRECATED_X("use QString::isNull()")
inline bool operator==(const QString &s, QString::Null) { return s.isNull(); } inline bool operator==(const QString &s, QString::Null) { return s.isNull(); }
inline bool operator!=(QString::Null, QString::Null) { return false; } inline bool operator!=(QString::Null, QString::Null) { return false; }
QT_DEPRECATED_X("use !QString::isNull()")
inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); } inline bool operator!=(QString::Null, const QString &s) { return !s.isNull(); }
QT_DEPRECATED_X("use !QString::isNull()")
inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); } inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
#endif
inline bool operator==(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW inline bool operator==(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ return s1.size() == s2.size() && (!s1.size() || !memcmp(s1.latin1(), s2.latin1(), s1.size())); } { return s1.size() == s2.size() && (!s1.size() || !memcmp(s1.latin1(), s2.latin1(), s1.size())); }

View File

@ -692,7 +692,7 @@ typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, c
{ {
Q_ASSERT_X(isValidIterator(before), "QVector::insert", "The specified iterator argument 'before' is invalid"); Q_ASSERT_X(isValidIterator(before), "QVector::insert", "The specified iterator argument 'before' is invalid");
int offset = std::distance(d->begin(), before); const auto offset = std::distance(d->begin(), before);
if (n != 0) { if (n != 0) {
const T copy(t); const T copy(t);
if (!isDetached() || d->size + n > int(d->alloc)) if (!isDetached() || d->size + n > int(d->alloc))
@ -728,7 +728,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
Q_ASSERT_X(isValidIterator(abegin), "QVector::erase", "The specified iterator argument 'abegin' is invalid"); Q_ASSERT_X(isValidIterator(abegin), "QVector::erase", "The specified iterator argument 'abegin' is invalid");
Q_ASSERT_X(isValidIterator(aend), "QVector::erase", "The specified iterator argument 'aend' is invalid"); Q_ASSERT_X(isValidIterator(aend), "QVector::erase", "The specified iterator argument 'aend' is invalid");
const int itemsToErase = aend - abegin; const auto itemsToErase = aend - abegin;
if (!itemsToErase) if (!itemsToErase)
return abegin; return abegin;
@ -737,7 +737,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
Q_ASSERT(aend <= d->end()); Q_ASSERT(aend <= d->end());
Q_ASSERT(abegin <= aend); Q_ASSERT(abegin <= aend);
const int itemsUntouched = abegin - d->begin(); const auto itemsUntouched = abegin - d->begin();
// FIXME we could do a proper realloc, which copy constructs only needed data. // FIXME we could do a proper realloc, which copy constructs only needed data.
// FIXME we are about to delete data - maybe it is good time to shrink? // FIXME we are about to delete data - maybe it is good time to shrink?
@ -766,7 +766,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
memmove(static_cast<void *>(abegin), static_cast<void *>(aend), memmove(static_cast<void *>(abegin), static_cast<void *>(aend),
(d->size - itemsToErase - itemsUntouched) * sizeof(T)); (d->size - itemsToErase - itemsUntouched) * sizeof(T));
} }
d->size -= itemsToErase; d->size -= int(itemsToErase);
} }
return d->begin() + itemsUntouched; return d->begin() + itemsUntouched;
} }

View File

@ -73,7 +73,7 @@ public:
static bool isNameChar(const QChar c); static bool isNameChar(const QChar c);
static bool isLetter(const QChar c); static bool isLetter(const QChar c);
static bool isNCName(const QStringRef &ncName); static bool isNCName(const QStringRef &ncName);
static inline bool isNCName(const QString &ncName) { return isNCName(&ncName); } static inline bool isNCName(const QString &ncName) { return isNCName(QStringRef(&ncName)); }
static bool isPublicID(const QString &candidate); static bool isPublicID(const QString &candidate);
private: private:

View File

@ -39,7 +39,7 @@
****************************************************************************/ ****************************************************************************/
#include <QtCore/qglobal.h> #include <QtCore/qglobal.h>
#ifndef QT_BOOTSTRAPPED #if QT_CONFIG(library)
#include <QtCore/qlibrary.h> #include <QtCore/qlibrary.h>
#endif #endif
#include <QtCore/qmutex.h> #include <QtCore/qmutex.h>
@ -54,7 +54,7 @@ void (*qdbus_resolve_me(const char *name))();
#if !defined QT_LINKED_LIBDBUS #if !defined QT_LINKED_LIBDBUS
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
static QLibrary *qdbus_libdbus = 0; static QLibrary *qdbus_libdbus = 0;
void qdbus_unloadLibDBus() void qdbus_unloadLibDBus()
@ -71,7 +71,7 @@ void qdbus_unloadLibDBus()
bool qdbus_loadLibDBus() bool qdbus_loadLibDBus()
{ {
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
#ifdef QT_BUILD_INTERNAL #ifdef QT_BUILD_INTERNAL
// this is to simulate a library load failure for our autotest suite. // this is to simulate a library load failure for our autotest suite.
if (!qEnvironmentVariableIsEmpty("QT_SIMULATE_DBUS_LIBFAIL")) if (!qEnvironmentVariableIsEmpty("QT_SIMULATE_DBUS_LIBFAIL"))
@ -126,7 +126,7 @@ bool qdbus_loadLibDBus()
#endif #endif
} }
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
void (*qdbus_resolve_conditionally(const char *name))() void (*qdbus_resolve_conditionally(const char *name))()
{ {
if (qdbus_loadLibDBus()) if (qdbus_loadLibDBus())
@ -137,7 +137,7 @@ void (*qdbus_resolve_conditionally(const char *name))()
void (*qdbus_resolve_me(const char *name))() void (*qdbus_resolve_me(const char *name))()
{ {
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
if (Q_UNLIKELY(!qdbus_loadLibDBus())) if (Q_UNLIKELY(!qdbus_loadLibDBus()))
qFatal("Cannot find libdbus-1 in your system to resolve symbol '%s'.", name); qFatal("Cannot find libdbus-1 in your system to resolve symbol '%s'.", name);
@ -161,7 +161,7 @@ static void qdbus_unloadLibDBus()
#endif // !QT_LINKED_LIBDBUS #endif // !QT_LINKED_LIBDBUS
#if defined(QT_LINKED_LIBDBUS) || !defined(QT_NO_LIBRARY) #if defined(QT_LINKED_LIBDBUS) || QT_CONFIG(library)
Q_DESTRUCTOR_FUNCTION(qdbus_unloadLibDBus) Q_DESTRUCTOR_FUNCTION(qdbus_unloadLibDBus)
#endif #endif

View File

@ -1772,7 +1772,7 @@ static QDBusConnection::ConnectionCapabilities connectionCapabilies(DBusConnecti
# if DBUS_VERSION-0 >= 0x010400 # if DBUS_VERSION-0 >= 0x010400
can_send_type = dbus_connection_can_send_type; can_send_type = dbus_connection_can_send_type;
# endif # endif
#elif !defined(QT_NO_LIBRARY) #elif QT_CONFIG(library)
// run-time check if the next functions are available // run-time check if the next functions are available
can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type"); can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
#endif #endif

View File

@ -46,8 +46,7 @@
"xkb-config-root": "string", "xkb-config-root": "string",
"xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] }, "xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] },
"xkbcommon-evdev": "boolean", "xkbcommon-evdev": "boolean",
"xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] }, "xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] }
"xrender": "boolean"
} }
}, },
@ -304,13 +303,6 @@
"sources": [ "sources": [
{ "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" } { "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" }
] ]
},
"xrender": {
"label": "XRender",
"test": "x11/xrender",
"sources": [
"-lXrender"
]
} }
}, },
@ -812,11 +804,6 @@
"condition": "tests.xlib", "condition": "tests.xlib",
"output": [ "privateFeature" ] "output": [ "privateFeature" ]
}, },
"xrender": {
"label": "Xrender",
"condition": "libs.xrender",
"output": [ "privateFeature", "feature" ]
},
"texthtmlparser": { "texthtmlparser": {
"label": "HtmlParser", "label": "HtmlParser",
"purpose": "Provides a parser for HTML.", "purpose": "Provides a parser for HTML.",
@ -1153,7 +1140,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"section": "X11", "section": "X11",
"condition": "features.xcb", "condition": "features.xcb",
"entries": [ "entries": [
"system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xrender", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system" "system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system"
] ]
}, },
{ {

View File

@ -341,7 +341,6 @@ bool QPMCache::insert(const QString& key, const QPixmap &pixmap, int cost)
} else { } else {
//Insertion failed we released the new allocated key //Insertion failed we released the new allocated key
cacheKeys.remove(key); cacheKeys.remove(key);
releaseKey(cacheKey);
} }
return success; return success;
} }
@ -355,9 +354,6 @@ QPixmapCache::Key QPMCache::insert(const QPixmap &pixmap, int cost)
theid = startTimer(flush_time); theid = startTimer(flush_time);
t = false; t = false;
} }
} else {
//Insertion failed we released the key and return an invalid one
releaseKey(cacheKey);
} }
return cacheKey; return cacheKey;
} }
@ -377,9 +373,6 @@ bool QPMCache::replace(const QPixmapCache::Key &key, const QPixmap &pixmap, int
t = false; t = false;
} }
const_cast<QPixmapCache::Key&>(key) = cacheKey; const_cast<QPixmapCache::Key&>(key) = cacheKey;
} else {
//Insertion failed we released the key
releaseKey(cacheKey);
} }
return success; return success;
} }

View File

@ -852,6 +852,9 @@ static bool read_xpm_header(
#endif #endif
return false; // < 4 numbers parsed return false; // < 4 numbers parsed
if (*w <= 0 || *w > 32767 || *h <= 0 || *h > 32767 || *ncols <= 0 || *ncols > (64 * 64 * 64 * 64) || *cpp <= 0 || *cpp > 15)
return false; // failed sanity check
return true; return true;
} }

View File

@ -99,7 +99,7 @@
#include <QtGui/QClipboard> #include <QtGui/QClipboard>
#endif #endif
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
#include <QtCore/QLibrary> #include <QtCore/QLibrary>
#endif #endif
@ -670,7 +670,7 @@ void QGuiApplication::setApplicationDisplayName(const QString &name)
disconnect(qGuiApp, &QGuiApplication::applicationNameChanged, disconnect(qGuiApp, &QGuiApplication::applicationNameChanged,
qGuiApp, &QGuiApplication::applicationDisplayNameChanged); qGuiApp, &QGuiApplication::applicationDisplayNameChanged);
if (QGuiApplicationPrivate::displayName != applicationName()) if (*QGuiApplicationPrivate::displayName != applicationName())
emit qGuiApp->applicationDisplayNameChanged(); emit qGuiApp->applicationDisplayNameChanged();
} }
} else if (name != *QGuiApplicationPrivate::displayName) { } else if (name != *QGuiApplicationPrivate::displayName) {
@ -1449,7 +1449,7 @@ void QGuiApplicationPrivate::init()
session_manager = new QSessionManager(q, session_id, session_key); session_manager = new QSessionManager(q, session_id, session_key);
#endif #endif
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
if (qEnvironmentVariableIntValue("QT_LOAD_TESTABILITY") > 0) if (qEnvironmentVariableIntValue("QT_LOAD_TESTABILITY") > 0)
loadTestability = true; loadTestability = true;
@ -1469,7 +1469,7 @@ void QGuiApplicationPrivate::init()
} }
#else #else
Q_UNUSED(loadTestability); Q_UNUSED(loadTestability);
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
if (layout_direction == Qt::LayoutDirectionAuto || force_reverse) if (layout_direction == Qt::LayoutDirectionAuto || force_reverse)
QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight); QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight);

View File

@ -51,14 +51,14 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformIntegrationFactoryInterface_iid, QLatin1String("/platforms"), Qt::CaseInsensitive)) (QPlatformIntegrationFactoryInterface_iid, QLatin1String("/platforms"), Qt::CaseInsensitive))
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QPlatformIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) (QPlatformIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif // !QT_NO_LIBRARY #endif // QT_CONFIG(library)
QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platform, const QStringList &paramList, int &argc, char **argv, const QString &platformPluginPath) QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platform, const QStringList &paramList, int &argc, char **argv, const QString &platformPluginPath)
{ {
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first: // Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) { if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath); QCoreApplication::addLibraryPath(platformPluginPath);
@ -81,7 +81,7 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platfor
QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath) QStringList QPlatformIntegrationFactory::keys(const QString &platformPluginPath)
{ {
QStringList list; QStringList list;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
if (!platformPluginPath.isEmpty()) { if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath); QCoreApplication::addLibraryPath(platformPluginPath);
list = directLoader()->keyMap().values(); list = directLoader()->keyMap().values();

View File

@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive)) (QPlatformThemeFactoryInterface_iid, QLatin1String("/platformthemes"), Qt::CaseInsensitive))
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QPlatformThemeFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) (QPlatformThemeFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif #endif
@ -60,7 +60,7 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString
{ {
QStringList paramList = key.split(QLatin1Char(':')); QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower(); const QString platform = paramList.takeFirst().toLower();
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
// Try loading the plugin from platformPluginPath first: // Try loading the plugin from platformPluginPath first:
if (!platformPluginPath.isEmpty()) { if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath); QCoreApplication::addLibraryPath(platformPluginPath);
@ -83,7 +83,7 @@ QStringList QPlatformThemeFactory::keys(const QString &platformPluginPath)
{ {
QStringList list; QStringList list;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
if (!platformPluginPath.isEmpty()) { if (!platformPluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(platformPluginPath); QCoreApplication::addLibraryPath(platformPluginPath);
list += directLoader()->keyMap().values(); list += directLoader()->keyMap().values();

View File

@ -212,6 +212,9 @@ private:
friend class QGraphicsRotation; friend class QGraphicsRotation;
}; };
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
Q_DECLARE_TYPEINFO(QMatrix4x4, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(QMatrix4x4, Q_MOVABLE_TYPE);
inline QMatrix4x4::QMatrix4x4 inline QMatrix4x4::QMatrix4x4
@ -1093,6 +1096,8 @@ inline void QMatrix4x4::viewport(const QRectF &rect)
viewport(rect.x(), rect.y(), rect.width(), rect.height()); viewport(rect.x(), rect.y(), rect.width(), rect.height());
} }
QT_WARNING_POP
#ifndef QT_NO_DEBUG_STREAM #ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QMatrix4x4 &m); Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QMatrix4x4 &m);
#endif #endif

View File

@ -168,7 +168,9 @@ inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {}
inline QQuaternion::QQuaternion(float aScalar, float xpos, float ypos, float zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {} inline QQuaternion::QQuaternion(float aScalar, float xpos, float ypos, float zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {}
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
inline bool QQuaternion::isNull() const inline bool QQuaternion::isNull() const
{ {
return wp == 0.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f; return wp == 0.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f;
@ -179,6 +181,12 @@ inline bool QQuaternion::isIdentity() const
return wp == 1.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f; return wp == 1.0f && xp == 0.0f && yp == 0.0f && zp == 0.0f;
} }
inline bool operator==(const QQuaternion &q1, const QQuaternion &q2)
{
return q1.wp == q2.wp && q1.xp == q2.xp && q1.yp == q2.yp && q1.zp == q2.zp;
}
QT_WARNING_POP
inline float QQuaternion::x() const { return xp; } inline float QQuaternion::x() const { return xp; }
inline float QQuaternion::y() const { return yp; } inline float QQuaternion::y() const { return yp; }
inline float QQuaternion::z() const { return zp; } inline float QQuaternion::z() const { return zp; }
@ -277,11 +285,6 @@ inline QQuaternion &QQuaternion::operator/=(float divisor)
return *this; return *this;
} }
inline bool operator==(const QQuaternion &q1, const QQuaternion &q2)
{
return q1.wp == q2.wp && q1.xp == q2.xp && q1.yp == q2.yp && q1.zp == q2.zp;
}
inline bool operator!=(const QQuaternion &q1, const QQuaternion &q2) inline bool operator!=(const QQuaternion &q1, const QQuaternion &q2)
{ {
return !operator==(q1, q2); return !operator==(q1, q2);

View File

@ -204,6 +204,9 @@ inline QVector2D &QVector2D::operator/=(const QVector2D &vector)
return *this; return *this;
} }
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
Q_DECL_CONSTEXPR inline bool operator==(const QVector2D &v1, const QVector2D &v2) Q_DECL_CONSTEXPR inline bool operator==(const QVector2D &v1, const QVector2D &v2)
{ {
return v1.xp == v2.xp && v1.yp == v2.yp; return v1.xp == v2.xp && v1.yp == v2.yp;
@ -213,6 +216,7 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QVector2D &v1, const QVector2D &v2
{ {
return v1.xp != v2.xp || v1.yp != v2.yp; return v1.xp != v2.xp || v1.yp != v2.yp;
} }
QT_WARNING_POP
Q_DECL_CONSTEXPR inline const QVector2D operator+(const QVector2D &v1, const QVector2D &v2) Q_DECL_CONSTEXPR inline const QVector2D operator+(const QVector2D &v1, const QVector2D &v2)
{ {

View File

@ -229,6 +229,9 @@ inline QVector3D &QVector3D::operator/=(const QVector3D &vector)
return *this; return *this;
} }
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
Q_DECL_CONSTEXPR inline bool operator==(const QVector3D &v1, const QVector3D &v2) Q_DECL_CONSTEXPR inline bool operator==(const QVector3D &v1, const QVector3D &v2)
{ {
return v1.xp == v2.xp && v1.yp == v2.yp && v1.zp == v2.zp; return v1.xp == v2.xp && v1.yp == v2.yp && v1.zp == v2.zp;
@ -238,6 +241,7 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QVector3D &v1, const QVector3D &v2
{ {
return v1.xp != v2.xp || v1.yp != v2.yp || v1.zp != v2.zp; return v1.xp != v2.xp || v1.yp != v2.yp || v1.zp != v2.zp;
} }
QT_WARNING_POP
Q_DECL_CONSTEXPR inline const QVector3D operator+(const QVector3D &v1, const QVector3D &v2) Q_DECL_CONSTEXPR inline const QVector3D operator+(const QVector3D &v1, const QVector3D &v2)
{ {

View File

@ -229,6 +229,9 @@ inline QVector4D &QVector4D::operator/=(const QVector4D &vector)
return *this; return *this;
} }
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
Q_DECL_CONSTEXPR inline bool operator==(const QVector4D &v1, const QVector4D &v2) Q_DECL_CONSTEXPR inline bool operator==(const QVector4D &v1, const QVector4D &v2)
{ {
return v1.xp == v2.xp && v1.yp == v2.yp && v1.zp == v2.zp && v1.wp == v2.wp; return v1.xp == v2.xp && v1.yp == v2.yp && v1.zp == v2.zp && v1.wp == v2.wp;
@ -238,6 +241,7 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QVector4D &v1, const QVector4D &v2
{ {
return v1.xp != v2.xp || v1.yp != v2.yp || v1.zp != v2.zp || v1.wp != v2.wp; return v1.xp != v2.xp || v1.yp != v2.yp || v1.zp != v2.zp || v1.wp != v2.wp;
} }
QT_WARNING_POP
Q_DECL_CONSTEXPR inline const QVector4D operator+(const QVector4D &v1, const QVector4D &v2) Q_DECL_CONSTEXPR inline const QVector4D operator+(const QVector4D &v1, const QVector4D &v2)
{ {

View File

@ -47,7 +47,6 @@
#include <private/qfont_p.h> #include <private/qfont_p.h>
#include <qwindow.h> #include <qwindow.h>
#include <qlibrary.h>
#include <qimage.h> #include <qimage.h>
#include <QtCore/qbytearray.h> #include <QtCore/qbytearray.h>

View File

@ -5968,7 +5968,7 @@ void QPainter::drawText(const QRect &r, int flags, const QString &str, QRect *br
\snippet code/src_gui_painting_qpainter.cpp 17 \snippet code/src_gui_painting_qpainter.cpp 17
\endtable \endtable
The \a boundingRect (if not null) is set to the what the bounding rectangle The \a boundingRect (if not null) is set to what the bounding rectangle
should be in order to enclose the whole text. For example, in the following should be in order to enclose the whole text. For example, in the following
image, the dotted line represents \a boundingRect as calculated by the image, the dotted line represents \a boundingRect as calculated by the
function, and the dashed line represents \a rectangle: function, and the dashed line represents \a rectangle:

View File

@ -64,26 +64,14 @@ class QRgba64 {
#endif #endif
}; };
// No constructors are allowed in C++98, since this needs to be usable in a union.
// We however require one for constexprs in C++11/C++14
#ifdef Q_COMPILER_CONSTEXPR
explicit Q_ALWAYS_INLINE Q_DECL_CONSTEXPR QRgba64(quint64 c) : rgba(c) { } explicit Q_ALWAYS_INLINE Q_DECL_CONSTEXPR QRgba64(quint64 c) : rgba(c) { }
#endif
public: public:
#ifdef Q_COMPILER_CONSTEXPR QRgba64() = default;
Q_ALWAYS_INLINE Q_DECL_CONSTEXPR QRgba64() : rgba(0) { }
#endif
Q_DECL_CONSTEXPR static Q_DECL_CONSTEXPR static
QRgba64 fromRgba64(quint64 c) QRgba64 fromRgba64(quint64 c)
{ {
#ifdef Q_COMPILER_CONSTEXPR
return QRgba64(c); return QRgba64(c);
#else
QRgba64 rgba64;
rgba64.rgba = c;
return rgba64;
#endif
} }
Q_DECL_CONSTEXPR static Q_DECL_CONSTEXPR static
QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha) QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)

View File

@ -291,6 +291,10 @@ inline qreal QTransform::dy() const
return affine._dy; return affine._dy;
} }
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
inline QTransform &QTransform::operator*=(qreal num) inline QTransform &QTransform::operator*=(qreal num)
{ {
if (num == 1.) if (num == 1.)
@ -348,6 +352,8 @@ inline QTransform &QTransform::operator-=(qreal num)
return *this; return *this;
} }
QT_WARNING_POP
inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2) inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
{ {
return qFuzzyCompare(t1.m11(), t2.m11()) return qFuzzyCompare(t1.m11(), t2.m11())

View File

@ -436,8 +436,8 @@ static void drawPolygons(qint32 *bits, int width, int height, const QPoint *vert
const quint32 *indices, int indexCount, qint32 value) const quint32 *indices, int indexCount, qint32 value)
{ {
Q_ASSERT(indexCount != 0); Q_ASSERT(indexCount != 0);
Q_ASSERT(height <= 128); typedef QVarLengthArray<quint16, 16> ScanLine;
QVarLengthArray<quint16, 16> scans[128]; QVarLengthArray<ScanLine, 128> scans(height);
int first = 0; int first = 0;
for (int i = 1; i < indexCount; ++i) { for (int i = 1; i < indexCount; ++i) {
quint32 idx1 = indices[i - 1]; quint32 idx1 = indices[i - 1];

View File

@ -1445,7 +1445,8 @@ static PSecurityFunctionTable pSecurityFunctionTable = NULL;
static bool q_NTLM_SSPI_library_load() static bool q_NTLM_SSPI_library_load()
{ {
QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&pSecurityFunctionTable)); static QBasicMutex mutex;
QMutexLocker l(&mutex);
// Initialize security interface // Initialize security interface
if (pSecurityFunctionTable == NULL) { if (pSecurityFunctionTable == NULL) {

View File

@ -39,7 +39,9 @@
#include "qdnslookup_p.h" #include "qdnslookup_p.h"
#if QT_CONFIG(library)
#include <qlibrary.h> #include <qlibrary.h>
#endif
#include <qscopedpointer.h> #include <qscopedpointer.h>
#include <qurl.h> #include <qurl.h>
#include <private/qnativesocketengine_p.h> #include <private/qnativesocketengine_p.h>
@ -58,7 +60,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
#if defined(Q_OS_OPENBSD) #if defined(Q_OS_OPENBSD)
typedef struct __res_state* res_state; typedef struct __res_state* res_state;
@ -382,6 +384,6 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
return; return;
} }
#endif /* ifndef QT_NO_LIBRARY */ #endif /* QT_CONFIG(library) */
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -45,7 +45,9 @@
#include "private/qnativesocketengine_p.h" #include "private/qnativesocketengine_p.h"
#include "qiodevice.h" #include "qiodevice.h"
#include <qbytearray.h> #include <qbytearray.h>
#if QT_CONFIG(library)
#include <qlibrary.h> #include <qlibrary.h>
#endif
#include <qbasicatomic.h> #include <qbasicatomic.h>
#include <qurl.h> #include <qurl.h>
#include <qfile.h> #include <qfile.h>
@ -93,7 +95,7 @@ static res_state_ptr local_res = 0;
static bool resolveLibraryInternal() static bool resolveLibraryInternal()
{ {
#if !defined(QT_NO_LIBRARY) && !defined(Q_OS_QNX) #if QT_CONFIG(library) && !defined(Q_OS_QNX)
QLibrary lib; QLibrary lib;
#ifdef LIBRESOLV_SO #ifdef LIBRESOLV_SO
lib.setFileName(QStringLiteral(LIBRESOLV_SO)); lib.setFileName(QStringLiteral(LIBRESOLV_SO));

View File

@ -575,6 +575,7 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
{ {
QSslCipher ciph; QSslCipher ciph;
switch (cipher) { switch (cipher) {
// Sorted as in CipherSuite.h (and groupped by their RFC)
case SSL_RSA_WITH_NULL_MD5: case SSL_RSA_WITH_NULL_MD5:
ciph.d->name = QLatin1String("NULL-MD5"); ciph.d->name = QLatin1String("NULL-MD5");
ciph.d->protocol = QSsl::SslV3; ciph.d->protocol = QSsl::SslV3;
@ -592,38 +593,21 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
ciph.d->protocol = QSsl::SslV3; ciph.d->protocol = QSsl::SslV3;
break; break;
case TLS_RSA_WITH_3DES_EDE_CBC_SHA: // TLS addenda using AES, per RFC 3268
ciph.d->name = QLatin1String("DES-CBC3-SHA");
break;
case TLS_RSA_WITH_AES_128_CBC_SHA: case TLS_RSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("AES128-SHA"); ciph.d->name = QLatin1String("AES128-SHA");
break; break;
case TLS_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("AES128-SHA256");
break;
case TLS_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("AES256-SHA");
break;
case TLS_RSA_WITH_AES_256_CBC_SHA256:
ciph.d->name = QLatin1String("AES256-SHA256");
break;
case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("DHE-RSA-DES-CBC3-SHA");
break;
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA: case TLS_DHE_RSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("DHE-RSA-AES128-SHA"); ciph.d->name = QLatin1String("DHE-RSA-AES128-SHA");
break; break;
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: case TLS_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("DHE-RSA-AES128-SHA256"); ciph.d->name = QLatin1String("AES256-SHA");
break; break;
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA: case TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("DHE-RSA-AES256-SHA"); ciph.d->name = QLatin1String("DHE-RSA-AES256-SHA");
break; break;
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256:
ciph.d->name = QLatin1String("DHE-RSA-AES256-SHA256");
break;
// ECDSA addenda, RFC 4492
case TLS_ECDH_ECDSA_WITH_NULL_SHA: case TLS_ECDH_ECDSA_WITH_NULL_SHA:
ciph.d->name = QLatin1String("ECDH-ECDSA-NULL-SHA"); ciph.d->name = QLatin1String("ECDH-ECDSA-NULL-SHA");
break; break;
@ -636,38 +620,9 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES128-SHA"); ciph.d->name = QLatin1String("ECDH-ECDSA-AES128-SHA");
break; break;
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES128-SHA256");
break;
case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES256-SHA"); ciph.d->name = QLatin1String("ECDH-ECDSA-AES256-SHA");
break; break;
case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES256-SHA384");
break;
case TLS_ECDH_RSA_WITH_NULL_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-NULL-SHA");
break;
case TLS_ECDH_RSA_WITH_RC4_128_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-AES256-SHA");
break;
case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-DES-CBC3-SHA");
break;
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-AES128-SHA");
break;
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDH-RSA-AES128-SHA256");
break;
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-AES256-SHA");
break;
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDH-RSA-AES256-SHA384");
break;
case TLS_ECDHE_ECDSA_WITH_NULL_SHA: case TLS_ECDHE_ECDSA_WITH_NULL_SHA:
ciph.d->name = QLatin1String("ECDHE-ECDSA-NULL-SHA"); ciph.d->name = QLatin1String("ECDHE-ECDSA-NULL-SHA");
break; break;
@ -680,21 +635,29 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES128-SHA"); ciph.d->name = QLatin1String("ECDHE-ECDSA-AES128-SHA");
break; break;
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES128-SHA256");
break;
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES256-SHA"); ciph.d->name = QLatin1String("ECDHE-ECDSA-AES256-SHA");
break; break;
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: case TLS_ECDH_RSA_WITH_NULL_SHA:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES256-SHA384"); ciph.d->name = QLatin1String("ECDH-RSA-NULL-SHA");
break;
case TLS_ECDH_RSA_WITH_RC4_128_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-RC4-SHA");
break;
case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-DES-CBC3-SHA");
break;
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-AES128-SHA");
break;
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-RSA-AES256-SHA");
break; break;
case TLS_ECDHE_RSA_WITH_NULL_SHA: case TLS_ECDHE_RSA_WITH_NULL_SHA:
ciph.d->name = QLatin1String("ECDHE-RSA-NULL-SHA"); ciph.d->name = QLatin1String("ECDHE-RSA-NULL-SHA");
break; break;
case TLS_ECDHE_RSA_WITH_RC4_128_SHA: case TLS_ECDHE_RSA_WITH_RC4_128_SHA:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA"); ciph.d->name = QLatin1String("ECDHE-RSA-RC4-SHA");
break; break;
case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("ECDHE-RSA-DES-CBC3-SHA"); ciph.d->name = QLatin1String("ECDHE-RSA-DES-CBC3-SHA");
@ -702,18 +665,76 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDHE-RSA-AES128-SHA"); ciph.d->name = QLatin1String("ECDHE-RSA-AES128-SHA");
break; break;
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDHE-RSA-AES128-SHA256");
break;
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA"); ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA");
break; break;
// TLS 1.2 addenda, RFC 5246
case TLS_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("DES-CBC3-SHA");
break;
case TLS_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("AES128-SHA256");
break;
case TLS_RSA_WITH_AES_256_CBC_SHA256:
ciph.d->name = QLatin1String("AES256-SHA256");
break;
case TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("DHE-RSA-DES-CBC3-SHA");
break;
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("DHE-RSA-AES128-SHA256");
break;
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256:
ciph.d->name = QLatin1String("DHE-RSA-AES256-SHA256");
break;
// Addendum from RFC 4279, TLS PSK
// all missing atm.
// RFC 4785 - Pre-Shared Key (PSK) Ciphersuites with NULL Encryption
// all missing atm.
// Addenda from rfc 5288 AES Galois Counter Mode (CGM) Cipher Suites for TLS
case TLS_RSA_WITH_AES_256_GCM_SHA384:
ciph.d->name = QLatin1String("AES256-GCM-SHA384");
break;
// RFC 5487 - PSK with SHA-256/384 and AES GCM
// all missing atm.
// Addenda from rfc 5289 Elliptic Curve Cipher Suites with HMAC SHA-256/384
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES128-SHA256");
break;
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES256-SHA384");
break;
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES128-SHA256");
break;
case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES256-SHA384");
break;
case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDHE-RSA-AES128-SHA256");
break;
case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA384"); ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA384");
break; break;
case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("ECDH-RSA-AES128-SHA256");
break;
case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDH-RSA-AES256-SHA384");
break;
// Addenda from rfc 5289 Elliptic Curve Cipher Suites
// with SHA-256/384 and AES Galois Counter Mode (GCM)
case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-GCM-SHA384"); ciph.d->name = QLatin1String("ECDHE-RSA-AES256-GCM-SHA384");
break; break;
default: default:
return ciph; return ciph;
} }

View File

@ -78,7 +78,6 @@
#include <QtCore/qthread.h> #include <QtCore/qthread.h>
#include <QtCore/qurl.h> #include <QtCore/qurl.h>
#include <QtCore/qvarlengtharray.h> #include <QtCore/qvarlengtharray.h>
#include <QLibrary> // for loading the security lib for the CA store
#include <string.h> #include <string.h>
@ -572,7 +571,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
resetDefaultCiphers(); resetDefaultCiphers();
resetDefaultEllipticCurves(); resetDefaultEllipticCurves();
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
//load symbols needed to receive certificates from system store //load symbols needed to receive certificates from system store
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
HINSTANCE hLib = LoadLibraryW(L"Crypt32"); HINSTANCE hLib = LoadLibraryW(L"Crypt32");
@ -600,7 +599,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
} }
} }
#endif #endif
#endif //QT_NO_LIBRARY #endif // QT_CONFIG(library)
// if on-demand loading was not enabled, load the certs now // if on-demand loading was not enabled, load the certs now
if (!s_loadRootCertsOnDemand) if (!s_loadRootCertsOnDemand)
setDefaultCaCertificates(systemCaCertificates()); setDefaultCaCertificates(systemCaCertificates());

View File

@ -58,7 +58,7 @@
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# include <private/qsystemlibrary_p.h> # include <private/qsystemlibrary_p.h>
#else #elif QT_CONFIG(library)
# include <QtCore/qlibrary.h> # include <QtCore/qlibrary.h>
#endif #endif
#include <QtCore/qmutex.h> #include <QtCore/qmutex.h>
@ -125,7 +125,7 @@ void qsslSocketUnresolvedSymbolWarning(const char *functionName)
qCWarning(lcSsl, "QSslSocket: cannot call unresolved function %s", functionName); qCWarning(lcSsl, "QSslSocket: cannot call unresolved function %s", functionName);
} }
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
void qsslSocketCannotResolveSymbolWarning(const char *functionName) void qsslSocketCannotResolveSymbolWarning(const char *functionName)
{ {
qCWarning(lcSsl, "QSslSocket: cannot resolve %s", functionName); qCWarning(lcSsl, "QSslSocket: cannot resolve %s", functionName);
@ -473,12 +473,11 @@ DEFINEFUNC(void, PKCS12_free, PKCS12 *pkcs12, pkcs12, return, DUMMYARG)
#if !defined QT_LINKED_OPENSSL #if !defined QT_LINKED_OPENSSL
#ifdef QT_NO_LIBRARY #if !QT_CONFIG(library)
bool q_resolveOpenSslSymbols() bool q_resolveOpenSslSymbols()
{ {
qCWarning(lcSsl, "QSslSocket: unable to resolve symbols. " qCWarning(lcSsl, "QSslSocket: unable to resolve symbols. Qt is configured without the "
"QT_NO_LIBRARY is defined which means runtime resolving of " "'library' feature, which means runtime resolving of libraries won't work.");
"libraries won't work.");
qCWarning(lcSsl, "Either compile Qt statically or with support for runtime resolving " qCWarning(lcSsl, "Either compile Qt statically or with support for runtime resolving "
"of libraries."); "of libraries.");
return false; return false;
@ -1044,7 +1043,7 @@ bool q_resolveOpenSslSymbols()
delete libs.second; delete libs.second;
return true; return true;
} }
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
#else // !defined QT_LINKED_OPENSSL #else // !defined QT_LINKED_OPENSSL

View File

@ -65,7 +65,6 @@
#include <private/qimagepixmapcleanuphooks_p.h> #include <private/qimagepixmapcleanuphooks_p.h>
#include "qcolormap.h" #include "qcolormap.h"
#include "qfile.h" #include "qfile.h"
#include "qlibrary.h"
#include <qmutex.h> #include <qmutex.h>
#include "qsurfaceformat.h" #include "qsurfaceformat.h"

View File

@ -45,7 +45,6 @@
#include <private/qfont_p.h> #include <private/qfont_p.h>
#include "gl2paintengineex/qpaintengineex_opengl2_p.h" #include "gl2paintengineex/qpaintengineex_opengl2_p.h"
#include <qlibrary.h>
#include <qimage.h> #include <qimage.h>
#include <qwindow.h> #include <qwindow.h>

View File

@ -38,6 +38,6 @@ qtConfig(xlib) {
} }
CONFIG += egl CONFIG += egl
LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD qtConfig(dlopen): QMAKE_USE += libdl
load(qt_module) load(qt_module)

View File

@ -7,7 +7,6 @@ CONFIG += static internal_module
DEFINES += QT_NO_CAST_FROM_ASCII DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h
qtConfig(xrender): QMAKE_USE_PRIVATE += xrender
LIBS_PRIVATE += $$QMAKE_LIBS_X11 LIBS_PRIVATE += $$QMAKE_LIBS_X11
HEADERS += qglxconvenience_p.h HEADERS += qglxconvenience_p.h

View File

@ -47,10 +47,6 @@
#include <QtCore/QVector> #include <QtCore/QVector>
#include <QtCore/QVarLengthArray> #include <QtCore/QVarLengthArray>
#ifndef QT_NO_XRENDER
#include <X11/extensions/Xrender.h>
#endif
#include <GL/glxext.h> #include <GL/glxext.h>
enum { enum {

View File

@ -41,7 +41,9 @@
#include <QtGui/private/qtguiglobal_p.h> #include <QtGui/private/qtguiglobal_p.h>
#include <QtCore/QStandardPaths> #include <QtCore/QStandardPaths>
#include <QtCore/QProcess> #if QT_CONFIG(process)
# include <QtCore/QProcess>
#endif
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QtCore/QDebug> #include <QtCore/QDebug>
@ -121,7 +123,7 @@ static inline bool launch(const QString &launcher, const QUrl &url)
const QString command = launcher + QLatin1Char(' ') + QLatin1String(url.toEncoded()); const QString command = launcher + QLatin1Char(' ') + QLatin1String(url.toEncoded());
if (debug) if (debug)
qDebug("Launching %s", qPrintable(command)); qDebug("Launching %s", qPrintable(command));
#if defined(QT_NO_PROCESS) #if !QT_CONFIG(process)
const bool ok = ::system(qPrintable(command + QLatin1String(" &"))); const bool ok = ::system(qPrintable(command + QLatin1String(" &")));
#else #else
const bool ok = QProcess::startDetached(command); const bool ok = QProcess::startDetached(command);

View File

@ -225,6 +225,8 @@ QVariant QGenericUnixTheme::themeHint(ThemeHint hint) const
} }
case QPlatformTheme::KeyboardScheme: case QPlatformTheme::KeyboardScheme:
return QVariant(int(X11KeyboardScheme)); return QVariant(int(X11KeyboardScheme));
case QPlatformTheme::UiEffects:
return QVariant(int(HoverEffect));
default: default:
break; break;
} }
@ -540,6 +542,8 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
return QVariant(d->singleClick); return QVariant(d->singleClick);
case QPlatformTheme::WheelScrollLines: case QPlatformTheme::WheelScrollLines:
return QVariant(d->wheelScrollLines); return QVariant(d->wheelScrollLines);
case QPlatformTheme::UiEffects:
return QVariant(int(HoverEffect));
default: default:
break; break;
} }

View File

@ -1636,6 +1636,13 @@ void QCocoaWindow::recreateWindowIfNeeded()
[m_nsWindow setContentView:m_view]; [m_nsWindow setContentView:m_view];
[m_view release]; [m_view release];
[m_view setPostsFrameChangedNotifications:YES]; [m_view setPostsFrameChangedNotifications:YES];
// QTBUG-58963
// viewDidChangeFrame() should be called for each window automatically at this point because it is
// registered with Q_NOTIFICATION_HANDLER(NSViewFrameDidChangeNotification);
// The corner case when it's not called and we need to make a manual geometry update is when window's
// size is not specified explicitly but minimumSize is set and matches to the size NSView was created with.
if (QSizeF::fromCGSize(m_view.frame.size) == [QNSView defaultViewSize])
viewDidChangeFrame();
} }
} }

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