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

Conflicts:
	examples/network/network.pro
	mkspecs/features/mac/default_post.prf
	src/corelib/io/qfilesystemengine_win.cpp
	src/corelib/io/qprocess.cpp
	src/corelib/io/qprocess.h
	src/corelib/io/qprocess_p.h
	src/corelib/io/qprocess_unix.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/thread/qmutex.cpp
	src/platformsupport/fontdatabases/windows/windows.pri
	src/plugins/platforms/eglfs/eglfsdeviceintegration.pro
	tests/auto/corelib/io/io.pro

Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
This commit is contained in:
Liang Qi 2017-03-13 09:50:43 +01:00 committed by Ulf Hermann
commit d51c3ecf8e
179 changed files with 988 additions and 837 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

@ -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

@ -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

@ -152,14 +152,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;
@ -267,7 +268,7 @@ static void resolveLibs()
ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW"); ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW");
} }
} }
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(fslibs)
typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD); typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD);
static PtrNetShareEnum ptrNetShareEnum = 0; static PtrNetShareEnum ptrNetShareEnum = 0;
@ -337,7 +338,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) {
@ -347,7 +348,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);
@ -357,7 +358,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;
@ -396,7 +397,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)
@ -629,7 +630,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();
@ -679,7 +680,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) {
@ -1143,7 +1144,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

@ -589,7 +589,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 +630,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

@ -300,7 +300,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[])
{ {
@ -329,7 +329,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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -45,8 +45,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"
} }
}, },
@ -295,13 +294,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"
]
} }
}, },
@ -798,11 +790,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.",
@ -1138,7 +1125,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

@ -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
@ -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

@ -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<quint8, 16> ScanLine;
QVarLengthArray<quint8, 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

@ -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>
@ -530,7 +529,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");
@ -558,7 +557,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);
@ -468,12 +468,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;
@ -1034,7 +1033,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

@ -71,16 +71,16 @@ Q_LOGGING_CATEGORY(qLcEglDevDebug, "qt.qpa.egldeviceintegration")
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String("/egldeviceintegrations"), Qt::CaseInsensitive)) (QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String("/egldeviceintegrations"), Qt::CaseInsensitive))
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) (QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif // QT_NO_LIBRARY #endif // QT_CONFIG(library)
QStringList QEglFSDeviceIntegrationFactory::keys(const QString &pluginPath) QStringList QEglFSDeviceIntegrationFactory::keys(const QString &pluginPath)
{ {
QStringList list; QStringList list;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
if (!pluginPath.isEmpty()) { if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath); QCoreApplication::addLibraryPath(pluginPath);
list = directLoader()->keyMap().values(); list = directLoader()->keyMap().values();
@ -104,7 +104,7 @@ QStringList QEglFSDeviceIntegrationFactory::keys(const QString &pluginPath)
QEglFSDeviceIntegration *QEglFSDeviceIntegrationFactory::create(const QString &key, const QString &pluginPath) QEglFSDeviceIntegration *QEglFSDeviceIntegrationFactory::create(const QString &key, const QString &pluginPath)
{ {
QEglFSDeviceIntegration *integration = Q_NULLPTR; QEglFSDeviceIntegration *integration = Q_NULLPTR;
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
if (!pluginPath.isEmpty()) { if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath); QCoreApplication::addLibraryPath(pluginPath);
integration = qLoadPlugin<QEglFSDeviceIntegration, QEglFSDeviceIntegrationPlugin>(directLoader(), key); integration = qLoadPlugin<QEglFSDeviceIntegration, QEglFSDeviceIntegrationPlugin>(directLoader(), key);

View File

@ -20,8 +20,6 @@ qtHaveModule(input_support-private): \
qtHaveModule(platformcompositor_support-private): \ qtHaveModule(platformcompositor_support-private): \
QT += platformcompositor_support-private QT += platformcompositor_support-private
LIBS += $$QMAKE_LIBS_DYNLOAD
# Avoid X11 header collision, use generic EGL native types # Avoid X11 header collision, use generic EGL native types
DEFINES += QT_EGL_NO_X11 DEFINES += QT_EGL_NO_X11

View File

@ -1,10 +1,5 @@
TARGET = qvnc TARGET = qvnc
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QVncIntegrationPlugin
!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
load(qt_plugin)
QT += \ QT += \
core-private network gui-private \ core-private network gui-private \
service_support-private theme_support-private fb_support-private \ service_support-private theme_support-private fb_support-private \
@ -29,3 +24,8 @@ HEADERS = \
qvncclient.h qvncclient.h
OTHER_FILES += vnc.json OTHER_FILES += vnc.json
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QVncIntegrationPlugin
!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
load(qt_plugin)

View File

@ -50,14 +50,14 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QXcbGlIntegrationFactoryInterface_iid, QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive)) (QXcbGlIntegrationFactoryInterface_iid, QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive))
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QXcbGlIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) (QXcbGlIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif // !QT_NO_LIBRARY #endif // QT_CONFIG(library)
QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath) QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath)
{ {
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
// Try loading the plugin from pluginPath first: // Try loading the plugin from pluginPath first:
if (!pluginPath.isEmpty()) { if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath); QCoreApplication::addLibraryPath(pluginPath);

View File

@ -38,7 +38,9 @@
****************************************************************************/ ****************************************************************************/
#include <QDebug> #include <QDebug>
#if QT_CONFIG(library)
#include <QLibrary> #include <QLibrary>
#endif
#include "qxcbwindow.h" #include "qxcbwindow.h"
#include "qxcbscreen.h" #include "qxcbscreen.h"
@ -54,7 +56,7 @@
#include <QtGlxSupport/private/qglxconvenience_p.h> #include <QtGlxSupport/private/qglxconvenience_p.h>
#include <QtPlatformHeaders/QGLXNativeContext> #include <QtPlatformHeaders/QGLXNativeContext>
#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4) #if !defined(QT_STATIC) && QT_CONFIG(dlopen)
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
@ -564,7 +566,7 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
if (!glXGetProcAddressARB) { if (!glXGetProcAddressARB) {
QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' '); QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' ');
if (glxExt.contains("GLX_ARB_get_proc_address")) { if (glxExt.contains("GLX_ARB_get_proc_address")) {
#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4) #if QT_CONFIG(dlopen)
void *handle = dlopen(NULL, RTLD_LAZY); void *handle = dlopen(NULL, RTLD_LAZY);
if (handle) { if (handle) {
glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB"); glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB");
@ -573,7 +575,7 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
if (!glXGetProcAddressARB) if (!glXGetProcAddressARB)
#endif #endif
{ {
#ifndef QT_NO_LIBRARY #if QT_CONFIG(library)
extern const QString qt_gl_library_name(); extern const QString qt_gl_library_name();
// QLibrary lib(qt_gl_library_name()); // QLibrary lib(qt_gl_library_name());
QLibrary lib(QLatin1String("GL")); QLibrary lib(QLatin1String("GL"));

View File

@ -12,7 +12,7 @@ qtConfig(xcb-glx) {
QMAKE_USE += xcb_glx QMAKE_USE += xcb_glx
} }
LIBS += $$QMAKE_LIBS_DYNLOAD !static:qtConfig(dlopen): QMAKE_USE += libdl
HEADERS += \ HEADERS += \
qxcbglxintegration.h \ qxcbglxintegration.h \

View File

@ -602,7 +602,7 @@ void QXcbClipboard::handleSelectionRequest(xcb_selection_request_event_t *req)
return; return;
} }
xcb_selection_notify_event_t event; Q_DECLARE_XCB_EVENT(event, xcb_selection_notify_event_t);
event.response_type = XCB_SELECTION_NOTIFY; event.response_type = XCB_SELECTION_NOTIFY;
event.requestor = req->requestor; event.requestor = req->requestor;
event.selection = req->selection; event.selection = req->selection;

View File

@ -731,6 +731,19 @@ private:
QXcbConnection *m_connection; QXcbConnection *m_connection;
}; };
template <typename T>
union q_padded_xcb_event {
T event;
char padding[32];
};
// The xcb_send_event() requires all events to have 32 bytes. It calls memcpy() on the
// passed in event. If the passed in event is less than 32 bytes, memcpy() reaches into
// unrelated memory.
#define Q_DECLARE_XCB_EVENT(event_var, event_type) \
q_padded_xcb_event<event_type> store = {}; \
auto &event_var = store.event;
#ifdef Q_XCB_DEBUG #ifdef Q_XCB_DEBUG
template <typename cookie_t> template <typename cookie_t>
cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file, cookie_t q_xcb_call_template(const cookie_t &cookie, QXcbConnection *connection, const char *file,

View File

@ -43,7 +43,9 @@
#include "qxcbimage.h" #include "qxcbimage.h"
#include "qxcbxsettings.h" #include "qxcbxsettings.h"
#if QT_CONFIG(library)
#include <QtCore/QLibrary> #include <QtCore/QLibrary>
#endif
#include <QtGui/QWindow> #include <QtGui/QWindow>
#include <QtGui/QBitmap> #include <QtGui/QBitmap>
#include <QtGui/private/qguiapplication_p.h> #include <QtGui/private/qguiapplication_p.h>
@ -58,7 +60,7 @@ typedef char *(*PtrXcursorLibraryGetTheme)(void *);
typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *); typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *);
typedef int (*PtrXcursorLibraryGetDefaultSize)(void *); typedef int (*PtrXcursorLibraryGetDefaultSize)(void *);
#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) #if defined(XCB_USE_XLIB) && QT_CONFIG(library)
#include <X11/Xlib.h> #include <X11/Xlib.h>
enum { enum {
XCursorShape = CursorShape XCursorShape = CursorShape
@ -306,7 +308,7 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
const char *cursorStr = "cursor"; const char *cursorStr = "cursor";
xcb_open_font(xcb_connection(), cursorFont, strlen(cursorStr), cursorStr); xcb_open_font(xcb_connection(), cursorFont, strlen(cursorStr), cursorStr);
#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) #if defined(XCB_USE_XLIB) && QT_CONFIG(library)
static bool function_ptrs_not_initialized = true; static bool function_ptrs_not_initialized = true;
if (function_ptrs_not_initialized) { if (function_ptrs_not_initialized) {
QLibrary xcursorLib(QLatin1String("Xcursor"), 1); QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
@ -507,7 +509,7 @@ xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
return cursor; return cursor;
} }
#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) #if defined(XCB_USE_XLIB) && QT_CONFIG(library)
bool updateCursorTheme(void *dpy, const QByteArray &theme) { bool updateCursorTheme(void *dpy, const QByteArray &theme) {
if (!ptrXcursorLibraryGetTheme if (!ptrXcursorLibraryGetTheme
|| !ptrXcursorLibrarySetTheme) || !ptrXcursorLibrarySetTheme)
@ -551,7 +553,7 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
} }
return cursor; return cursor;
} }
#endif //XCB_USE_XLIB / QT_NO_LIBRARY #endif // XCB_USE_XLIB / QT_CONFIG(library)
xcb_cursor_t QXcbCursor::createFontCursor(int cshape) xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{ {
@ -560,7 +562,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
xcb_cursor_t cursor = XCB_NONE; xcb_cursor_t cursor = XCB_NONE;
// Try Xcursor first // Try Xcursor first
#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) #if defined(XCB_USE_XLIB) && QT_CONFIG(library)
if (cshape >= 0 && cshape <= Qt::LastCursor) { if (cshape >= 0 && cshape <= Qt::LastCursor) {
void *dpy = connection()->xlib_display(); void *dpy = connection()->xlib_display();
// special case for non-standard dnd-* cursors // special case for non-standard dnd-* cursors

View File

@ -101,7 +101,7 @@ private:
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
CursorHash m_cursorHash; CursorHash m_cursorHash;
#endif #endif
#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY) #if defined(XCB_USE_XLIB) && QT_CONFIG(library)
static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen, static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen,
const QByteArray &name, const QByteArray &name,
const QVariant &property, const QVariant &property,

View File

@ -1163,7 +1163,7 @@ static xcb_window_t findXdndAwareParent(QXcbConnection *c, xcb_window_t window)
void QXcbDrag::handleSelectionRequest(const xcb_selection_request_event_t *event) void QXcbDrag::handleSelectionRequest(const xcb_selection_request_event_t *event)
{ {
xcb_selection_notify_event_t notify; Q_DECLARE_XCB_EVENT(notify, xcb_selection_notify_event_t);
notify.response_type = XCB_SELECTION_NOTIFY; notify.response_type = XCB_SELECTION_NOTIFY;
notify.requestor = event->requestor; notify.requestor = event->requestor;
notify.selection = event->selection; notify.selection = event->selection;

View File

@ -844,7 +844,7 @@ void QXcbWindow::hide()
Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window)); Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window));
// send synthetic UnmapNotify event according to icccm 4.1.4 // send synthetic UnmapNotify event according to icccm 4.1.4
xcb_unmap_notify_event_t event; Q_DECLARE_XCB_EVENT(event, xcb_unmap_notify_event_t);
event.response_type = XCB_UNMAP_NOTIFY; event.response_type = XCB_UNMAP_NOTIFY;
event.event = xcbScreen()->root(); event.event = xcbScreen()->root();
event.window = m_window; event.window = m_window;

View File

@ -1421,13 +1421,17 @@ bool QMYSQLDriver::open(const QString& db,
if (mysql_get_client_version() >= 50503 && mysql_get_server_version(d->mysql) >= 50503) { if (mysql_get_client_version() >= 50503 && mysql_get_server_version(d->mysql) >= 50503) {
// force the communication to be utf8mb4 (only utf8mb4 supports 4-byte characters) // force the communication to be utf8mb4 (only utf8mb4 supports 4-byte characters)
mysql_set_character_set(d->mysql, "utf8mb4"); mysql_set_character_set(d->mysql, "utf8mb4");
} else { #ifndef QT_NO_TEXTCODEC
d->tc = QTextCodec::codecForName("UTF-8");
#endif
} else
{
// force the communication to be utf8 // force the communication to be utf8
mysql_set_character_set(d->mysql, "utf8"); mysql_set_character_set(d->mysql, "utf8");
}
#endif
#ifndef QT_NO_TEXTCODEC #ifndef QT_NO_TEXTCODEC
d->tc = codec(d->mysql); d->tc = codec(d->mysql);
#endif
}
#endif #endif
#if MYSQL_VERSION_ID >= 40108 #if MYSQL_VERSION_ID >= 40108

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