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): \
cont += \
"[EffectiveSourcePaths]" \
"Prefix=$$QT_SOURCE_TREE"
"Prefix=$$[QT_INSTALL_PREFIX/src]"
write_file($$QT_BUILD_TREE/bin/qt.conf, cont)|error()
reload_properties()

View File

@ -38,3 +38,17 @@ macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"
macro.endfloat.HTML = "</div>"
macro.clearfloat.HTML = "<br style=\"clear: both\" />"
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 {
margin: 0px;
}
.video {
margin: 15px 0 0 15px;
}

View File

@ -780,3 +780,23 @@ div.multi-column div {
margin-right: 4em;
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;
}
.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);
QTableView *view = createView(QObject::tr("Relational Table Model"), &model);
QScopedPointer<QTableView> view(createView(QObject::tr("Relational Table Model"), &model));
view->show();
return app.exec();

View File

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

View File

@ -125,7 +125,8 @@ defineTest(qtConfValidateValue) {
defineTest(qtConfCommandline_string) {
opt = $${1}
val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
nextok = $${3}
isEmpty(val):$$nextok: val = $$qtConfGetNextCommandlineArg()
# Note: Arguments which are variable assignments are legit here.
contains(val, "^-.*")|isEmpty(val) {
@ -142,9 +143,10 @@ defineTest(qtConfCommandline_string) {
defineTest(qtConfCommandline_optionalString) {
opt = $${1}
val = $${2}
nextok = $${3}
isEmpty(val) {
v = $$qtConfPeekNextCommandlineArg()
contains(v, "^-.*|[A-Z_]+=.*")|isEmpty(v): \
$$nextok: val = $$qtConfPeekNextCommandlineArg()
contains(val, "^-.*|[A-Z_]+=.*")|isEmpty(val): \
val = "yes"
else: \
val = $$qtConfGetNextCommandlineArg()
@ -160,7 +162,8 @@ defineTest(qtConfCommandline_optionalString) {
defineTest(qtConfCommandline_addString) {
opt = $${1}
val = $${2}
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
nextok = $${3}
isEmpty(val):$$nextok: val = $$qtConfGetNextCommandlineArg()
# Note: Arguments which are variable assignments are legit here.
contains(val, "^-.*")|isEmpty(val) {
@ -236,6 +239,7 @@ defineTest(qtConfParseCommandLine) {
}
# parse out opt and val
nextok = false
contains(c, "^--?enable-(.*)") {
opt = $$replace(c, "^--?enable-(.*)", "\\1")
val = yes
@ -247,10 +251,11 @@ defineTest(qtConfParseCommandLine) {
val = $$replace(c, "^--([^=]+)=(.*)", "\\2")
} else: contains(c, "^--(.*)") {
opt = $$replace(c, "^--(.*)", "\\1")
val = yes
val =
} else: contains(c, "^-(.*)") {
opt = $$replace(c, "^-(.*)", "\\1")
val =
nextok = true
for (cc, allConfigs) {
type = $$eval($${cc}.commandline.options.$${opt})
!isEmpty(type): break()
@ -277,6 +282,7 @@ defineTest(qtConfParseCommandLine) {
contains(c, $$e) {
opt = $$eval($${cc}.commandline.prefix.$${p})
val = $$replace(c, $$e, "\\1")
nextok = true
type = "addString"
break()
}
@ -315,7 +321,7 @@ defineTest(qtConfParseCommandLine) {
error("Command line option '$$c' has unknown type '$$type'.")
# 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}
opfx = $${fpfx}.output.$${2}
condition = $$eval($${opfx}.condition)
!isEmpty(condition):!$$qtConfEvaluate($$condition): \
return()
call = $$eval($${opfx}.type)
isEmpty(call) {
# output is just a string, not an object
@ -1755,11 +1757,8 @@ defineTest(qtConfProcessOneOutput) {
!defined("qtConfOutput_$$call", test): \
error("Undefined type '$$call' in output '$$2' of feature '$$feature'.")
condition = $$eval($${opfx}.condition)
!isEmpty(condition) {
!$$qtConfEvaluate($$condition): \
return(false)
}
!$$qtConfEvaluate($$eval($${opfx}.condition)): \
return()
$${opfx}.feature = $$feature
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.
# Common to GCC, Clang and ICC (and other compilers that masquerade as GCC):
hcleanFLAGS = -Wall -Wextra -Werror \
-Woverloaded-virtual -Wshadow -Wundef \
-Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal \
-Wnon-virtual-dtor -Wpointer-arith -Wformat-security \
-Wno-long-long -Wno-variadic-macros -pedantic-errors

View File

@ -1,7 +1,13 @@
lessThan(QMAKE_XCODE_VERSION, "7.0") {
warning("You need to update Xcode to version 7 or newer to support bitcode")
} else {
release:device {
} else: !macx-xcode {
# 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_CXXFLAGS += -fembed-bitcode
QMAKE_OBJECTIVE_CFLAGS += -fembed-bitcode

View File

@ -1477,13 +1477,20 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QMap<QString, QString> settings;
if (!project->isActiveConfig("no_xcode_development_team")) {
const QList<QVariantMap> teams = provisioningTeams();
if (!teams.isEmpty()) {
// first suitable team we find is the one we'll use by default
settings.insert("DEVELOPMENT_TEAM",
teams.first().value(QLatin1String("teamID")).toString());
QString teamId;
if (!project->isEmpty("QMAKE_DEVELOPMENT_TEAM")) {
teamId = project->first("QMAKE_DEVELOPMENT_TEAM").toQString();
} else {
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("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)

View File

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

View File

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

View File

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

View File

@ -281,7 +281,7 @@ static void notifyAndFreeInfo(Header *header, ProcessInfo *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
@ -289,7 +289,20 @@ static void sigchld_handler(int signum)
* specification at:
* 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) {
/* is this one of our children? */
@ -317,9 +330,8 @@ search_next_child:
waitid(P_ALL, 0, &info, WNOHANG | WNOWAIT | WEXITED);
if (info.si_pid == 0) {
/* 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) {
@ -407,12 +419,6 @@ search_arrays:
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()
@ -457,8 +463,8 @@ static void forkfd_initialize()
struct sigaction action;
memset(&action, 0, sizeof action);
sigemptyset(&action.sa_mask);
action.sa_flags = SA_NOCLDSTOP;
action.sa_handler = sigchld_handler;
action.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
action.sa_sigaction = sigchld_handler;
/* ### RACE CONDITION
* 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 "qtextcodec_p.h"
#include <qlibrary.h>
#include <qdebug.h>
#include <qthreadstorage.h>

View File

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

View File

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

View File

@ -196,6 +196,10 @@ QF16_MAKE_ARITH_OP_INT(*)
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); }
@ -230,6 +234,8 @@ QF16_MAKE_BOOL_OP_INT(==)
QF16_MAKE_BOOL_OP_INT(!=)
#undef QF16_MAKE_BOOL_OP_INT
QT_WARNING_POP
/*!
\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
\sa qConstOverload(), qNonConstOverload()
\sa qConstOverload(), qNonConstOverload(), {Differences between String-Based
and Functor-Based Connections}
*/
/*! \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
\sa qOverload, qNonConstOverload
\sa qOverload, qNonConstOverload, {Differences between String-Based
and Functor-Based Connections}
*/
/*! \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
\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
#include <QtCore/qatomic.h>
#include "qprocess_p.h"
#define FORKFD_NO_SPAWNFD

View File

@ -22,8 +22,6 @@ HEADERS += \
io/qlockfile.h \
io/qlockfile_p.h \
io/qnoncontiguousbytedevice_p.h \
io/qprocess.h \
io/qprocess_p.h \
io/qtextstream.h \
io/qtextstream_p.h \
io/qtemporarydir.h \
@ -72,7 +70,6 @@ SOURCES += \
io/qiodevice.cpp \
io/qlockfile.cpp \
io/qnoncontiguousbytedevice.cpp \
io/qprocess.cpp \
io/qstorageinfo.cpp \
io/qtextstream.cpp \
io/qtemporarydir.cpp \
@ -96,6 +93,19 @@ SOURCES += \
io/qloggingcategory.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 {
SOURCES += io/qfsfileengine_win.cpp
SOURCES += io/qlockfile_win.cpp
@ -112,7 +122,6 @@ win32 {
io/qwinoverlappedionotifier_p.h
SOURCES += \
io/qprocess_win.cpp \
io/qsettings_win.cpp \
io/qstandardpaths_win.cpp \
io/qstorageinfo_win.cpp \
@ -132,7 +141,6 @@ win32 {
io/qfsfileengine_unix.cpp \
io/qfilesystemengine_unix.cpp \
io/qlockfile_unix.cpp \
io/qprocess_unix.cpp \
io/qfilesystemiterator_unix.cpp
!integrity:!uikit {

View File

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

View File

@ -108,6 +108,20 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
{
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).
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)
{
#if !defined(Q_OS_WINRT)
# if !defined(QT_NO_LIBRARY)
# if QT_CONFIG(library)
bool ret = false;
QString linkName = newName;
@ -630,10 +644,10 @@ bool QFSFileEngine::link(const QString &newName)
CoUninitialize();
return ret;
# else // QT_NO_LIBRARY
# else // QT_CONFIG(library)
Q_UNUSED(newName);
return false;
# endif // QT_NO_LIBRARY
# endif // QT_CONFIG(library)
#else // !Q_OS_WINRT
Q_UNUSED(newName);
Q_UNIMPLEMENTED();

View File

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

View File

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

View File

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

View File

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

View File

@ -62,8 +62,6 @@
QT_BEGIN_NAMESPACE
#if QT_CONFIG(processenvironment)
QProcessEnvironment QProcessEnvironment::systemEnvironment()
{
QProcessEnvironment env;
@ -86,8 +84,6 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment()
return env;
}
#endif // QT_CONFIG(processenvironment)
#if QT_CONFIG(process)
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;
}
#endif // QT_NO_PROCESS
#endif // QT_CONFIG(process)
QT_END_NAMESPACE

View File

@ -156,4 +156,4 @@ private:
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
entities in your model. This method is responsible for moving
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
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
// - 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[],
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));
return ret;
}
#endif // Q_OS_VXWORKS
#endif // QT_CONFIG(process)
#if !defined(_POSIX_MONOTONIC_CLOCK)
# define _POSIX_MONOTONIC_CLOCK -1

View File

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

View File

@ -141,12 +141,12 @@ public:
static QString applicationFilePath();
static qint64 applicationPid();
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
static void setLibraryPaths(const QStringList &);
static QStringList libraryPaths();
static void addLibraryPath(const QString &);
static void removeLibraryPath(const QString &);
#endif // QT_NO_LIBRARY
#endif // QT_CONFIG(library)
#ifndef QT_NO_TRANSLATION
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
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,
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
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_) {}
};
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) {
if (container.data)
*reinterpret_cast<U*>(container.data) = value;
*reinterpret_cast<U *>(container.data) = std::forward<T>(value);
}
template<typename T>
void operator,(T, const ApplyReturnValue<void> &) {}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -98,6 +98,12 @@ bool ResultIteratorBase::canIncrementVectorIndex() const
ResultStoreBase::ResultStoreBase()
: 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)
{
m_filterMode = enable;

View File

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

View File

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

View File

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

View File

@ -40,7 +40,9 @@
#include "qharfbuzz_p.h"
#include "qunicodetables_p.h"
#if QT_CONFIG(library)
#include "qlibrary.h"
#endif
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))()
{
#ifdef QT_NO_LIBRARY
#if !QT_CONFIG(library)
Q_UNUSED(library);
Q_UNUSED(version);
Q_UNUSED(symbol);

View File

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

View File

@ -972,7 +972,7 @@ QLocale::NumberOptions QLocale::numberOptions() 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))) {
if ((script == QLocale::AnyScript || data->m_script_id == uint(script))
&& (country == QLocale::AnyCountry || data->m_country_id == uint(country))) {
QLocale locale(*QLocalePrivate::create(data));
result.append(locale);
result.append(QLocale(*(data->m_language_id == C ? c_private()
: QLocalePrivate::create(data))));
}
++data;
}

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include "qglobal.h"
#include "qlibrary.h"
#include "qdebug.h"
#include "qlocale_p.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
{ return w == 0. && h == 0.; }
Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const Q_DECL_NOTHROW
{ return w <= 0. || h <= 0.; }
QT_WARNING_POP
Q_DECL_CONSTEXPR inline bool QRectF::isValid() const Q_DECL_NOTHROW
{ 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 = { };
#endif
/*!
\macro QT_RESTRICTED_CAST_FROM_ASCII
@ -9794,9 +9796,7 @@ QStringRef QStringRef::left(int n) const
*/
QStringRef QString::leftRef(int n) const
{
if (uint(n) >= uint(d->size))
n = d->size;
return QStringRef(this, 0, n);
return QStringRef(this).left(n);
}
/*!
@ -9833,9 +9833,7 @@ QStringRef QStringRef::right(int n) const
*/
QStringRef QString::rightRef(int n) const
{
if (uint(n) >= uint(d->size))
n = d->size;
return QStringRef(this, d->size - n, n);
return QStringRef(this).right(n);
}
/*!
@ -9894,19 +9892,7 @@ QStringRef QStringRef::mid(int pos, int n) const
*/
QStringRef QString::midRef(int position, int n) const
{
using namespace QtPrivate;
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();
return QStringRef(this).mid(position, n);
}
/*!

View File

@ -795,10 +795,13 @@ public:
NSString *toNSString() const Q_DECL_NS_RETURNS_AUTORELEASED;
#endif
// compatibility
#if QT_DEPRECATED_SINCE(5, 9)
struct Null { };
QT_DEPRECATED_X("use QString()")
static const Null null;
inline QString(const Null &): d(Data::sharedNull()) {}
inline QString &operator=(const Null &) { *this = QString(); return *this; }
#endif
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
{ return indexOf(c, 0, cs) != -1; }
#if QT_DEPRECATED_SINCE(5, 9)
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(); }
QT_DEPRECATED_X("use QString::isNull()")
inline bool operator==(const QString &s, QString::Null) { return s.isNull(); }
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(); }
QT_DEPRECATED_X("use !QString::isNull()")
inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
#endif
inline bool operator==(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
{ 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");
int offset = std::distance(d->begin(), before);
const auto offset = std::distance(d->begin(), before);
if (n != 0) {
const T copy(t);
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(aend), "QVector::erase", "The specified iterator argument 'aend' is invalid");
const int itemsToErase = aend - abegin;
const auto itemsToErase = aend - abegin;
if (!itemsToErase)
return abegin;
@ -737,7 +737,7 @@ typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
Q_ASSERT(aend <= d->end());
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 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),
(d->size - itemsToErase - itemsUntouched) * sizeof(T));
}
d->size -= itemsToErase;
d->size -= int(itemsToErase);
}
return d->begin() + itemsUntouched;
}

View File

@ -73,7 +73,7 @@ public:
static bool isNameChar(const QChar c);
static bool isLetter(const QChar c);
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);
private:

View File

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

View File

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

View File

@ -46,8 +46,7 @@
"xkb-config-root": "string",
"xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] },
"xkbcommon-evdev": "boolean",
"xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] },
"xrender": "boolean"
"xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] }
}
},
@ -304,13 +303,6 @@
"sources": [
{ "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" }
]
},
"xrender": {
"label": "XRender",
"test": "x11/xrender",
"sources": [
"-lXrender"
]
}
},
@ -812,11 +804,6 @@
"condition": "tests.xlib",
"output": [ "privateFeature" ]
},
"xrender": {
"label": "Xrender",
"condition": "libs.xrender",
"output": [ "privateFeature", "feature" ]
},
"texthtmlparser": {
"label": "HtmlParser",
"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",
"condition": "features.xcb",
"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 {
//Insertion failed we released the new allocated key
cacheKeys.remove(key);
releaseKey(cacheKey);
}
return success;
}
@ -355,9 +354,6 @@ QPixmapCache::Key QPMCache::insert(const QPixmap &pixmap, int cost)
theid = startTimer(flush_time);
t = false;
}
} else {
//Insertion failed we released the key and return an invalid one
releaseKey(cacheKey);
}
return cacheKey;
}
@ -377,9 +373,6 @@ bool QPMCache::replace(const QPixmapCache::Key &key, const QPixmap &pixmap, int
t = false;
}
const_cast<QPixmapCache::Key&>(key) = cacheKey;
} else {
//Insertion failed we released the key
releaseKey(cacheKey);
}
return success;
}

View File

@ -852,6 +852,9 @@ static bool read_xpm_header(
#endif
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;
}

View File

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

View File

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

View File

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

View File

@ -212,6 +212,9 @@ private:
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);
inline QMatrix4x4::QMatrix4x4
@ -1093,6 +1096,8 @@ inline void QMatrix4x4::viewport(const QRectF &rect)
viewport(rect.x(), rect.y(), rect.width(), rect.height());
}
QT_WARNING_POP
#ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QMatrix4x4 &m);
#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) {}
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
inline bool QQuaternion::isNull() const
{
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;
}
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::y() const { return yp; }
inline float QQuaternion::z() const { return zp; }
@ -277,11 +285,6 @@ inline QQuaternion &QQuaternion::operator/=(float divisor)
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)
{
return !operator==(q1, q2);

View File

@ -204,6 +204,9 @@ inline QVector2D &QVector2D::operator/=(const QVector2D &vector)
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)
{
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;
}
QT_WARNING_POP
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;
}
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)
{
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;
}
QT_WARNING_POP
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;
}
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)
{
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;
}
QT_WARNING_POP
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 <qwindow.h>
#include <qlibrary.h>
#include <qimage.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
\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
image, the dotted line represents \a boundingRect as calculated by the
function, and the dashed line represents \a rectangle:

View File

@ -64,26 +64,14 @@ class QRgba64 {
#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) { }
#endif
public:
#ifdef Q_COMPILER_CONSTEXPR
Q_ALWAYS_INLINE Q_DECL_CONSTEXPR QRgba64() : rgba(0) { }
#endif
QRgba64() = default;
Q_DECL_CONSTEXPR static
QRgba64 fromRgba64(quint64 c)
{
#ifdef Q_COMPILER_CONSTEXPR
return QRgba64(c);
#else
QRgba64 rgba64;
rgba64.rgba = c;
return rgba64;
#endif
}
Q_DECL_CONSTEXPR static
QRgba64 fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)

View File

@ -291,6 +291,10 @@ inline qreal QTransform::dy() const
return affine._dy;
}
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
inline QTransform &QTransform::operator*=(qreal num)
{
if (num == 1.)
@ -348,6 +352,8 @@ inline QTransform &QTransform::operator-=(qreal num)
return *this;
}
QT_WARNING_POP
inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
{
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)
{
Q_ASSERT(indexCount != 0);
Q_ASSERT(height <= 128);
QVarLengthArray<quint16, 16> scans[128];
typedef QVarLengthArray<quint16, 16> ScanLine;
QVarLengthArray<ScanLine, 128> scans(height);
int first = 0;
for (int i = 1; i < indexCount; ++i) {
quint32 idx1 = indices[i - 1];

View File

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

View File

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

View File

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

View File

@ -575,6 +575,7 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
{
QSslCipher ciph;
switch (cipher) {
// Sorted as in CipherSuite.h (and groupped by their RFC)
case SSL_RSA_WITH_NULL_MD5:
ciph.d->name = QLatin1String("NULL-MD5");
ciph.d->protocol = QSsl::SslV3;
@ -592,38 +593,21 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
ciph.d->protocol = QSsl::SslV3;
break;
case TLS_RSA_WITH_3DES_EDE_CBC_SHA:
ciph.d->name = QLatin1String("DES-CBC3-SHA");
break;
// TLS addenda using AES, per RFC 3268
case TLS_RSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("AES128-SHA");
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:
ciph.d->name = QLatin1String("DHE-RSA-AES128-SHA");
break;
case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
ciph.d->name = QLatin1String("DHE-RSA-AES128-SHA256");
case TLS_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("AES256-SHA");
break;
case TLS_DHE_RSA_WITH_AES_256_CBC_SHA:
ciph.d->name = QLatin1String("DHE-RSA-AES256-SHA");
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:
ciph.d->name = QLatin1String("ECDH-ECDSA-NULL-SHA");
break;
@ -636,38 +620,9 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES128-SHA");
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:
ciph.d->name = QLatin1String("ECDH-ECDSA-AES256-SHA");
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:
ciph.d->name = QLatin1String("ECDHE-ECDSA-NULL-SHA");
break;
@ -680,21 +635,29 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSLCipherSuite(SSLCipherSui
case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES128-SHA");
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:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES256-SHA");
break;
case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:
ciph.d->name = QLatin1String("ECDHE-ECDSA-AES256-SHA384");
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-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;
case TLS_ECDHE_RSA_WITH_NULL_SHA:
ciph.d->name = QLatin1String("ECDHE-RSA-NULL-SHA");
break;
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;
case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_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:
ciph.d->name = QLatin1String("ECDHE-RSA-AES128-SHA");
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:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA");
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:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-SHA384");
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:
ciph.d->name = QLatin1String("ECDHE-RSA-AES256-GCM-SHA384");
break;
default:
return ciph;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,7 +41,9 @@
#include <QtGui/private/qtguiglobal_p.h>
#include <QtCore/QStandardPaths>
#include <QtCore/QProcess>
#if QT_CONFIG(process)
# include <QtCore/QProcess>
#endif
#include <QtCore/QUrl>
#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());
if (debug)
qDebug("Launching %s", qPrintable(command));
#if defined(QT_NO_PROCESS)
#if !QT_CONFIG(process)
const bool ok = ::system(qPrintable(command + QLatin1String(" &")));
#else
const bool ok = QProcess::startDetached(command);

View File

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

View File

@ -1636,6 +1636,13 @@ void QCocoaWindow::recreateWindowIfNeeded()
[m_nsWindow setContentView:m_view];
[m_view release];
[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