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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -589,7 +589,7 @@ bool QFSFileEnginePrivate::doStat(QFileSystemMetaData::MetaDataFlags flags) cons
bool QFSFileEngine::link(const QString &newName)
{
#if !defined(Q_OS_WINRT)
# if !defined(QT_NO_LIBRARY)
# if QT_CONFIG(library)
bool ret = false;
QString linkName = newName;
@ -630,10 +630,10 @@ bool QFSFileEngine::link(const QString &newName)
CoUninitialize();
return ret;
# else // QT_NO_LIBRARY
# else // QT_CONFIG(library)
Q_UNUSED(newName);
return false;
# endif // QT_NO_LIBRARY
# endif // QT_CONFIG(library)
#else // !Q_OS_WINRT
Q_UNUSED(newName);
Q_UNIMPLEMENTED();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -300,7 +300,7 @@ static inline int qt_safe_close(int fd)
#define QT_CLOSE qt_safe_close
// - VxWorks & iOS/tvOS/watchOS don't have processes
#if !defined(Q_OS_VXWORKS) && !defined(QT_NO_PROCESS)
#if QT_CONFIG(process)
static inline int qt_safe_execve(const char *filename, char *const argv[],
char *const envp[])
{
@ -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));
return ret;
}
#endif // Q_OS_VXWORKS
#endif // QT_CONFIG(process)
#if !defined(_POSIX_MONOTONIC_CLOCK)
# define _POSIX_MONOTONIC_CLOCK -1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2117,8 +2117,8 @@ QList<QLocale> QLocale::matchingLocales(QLocale::Language language,
&& (language == QLocale::AnyLanguage || data->m_language_id == uint(language))) {
if ((script == QLocale::AnyScript || data->m_script_id == uint(script))
&& (country == QLocale::AnyCountry || data->m_country_id == uint(country))) {
QLocale locale(*QLocalePrivate::create(data));
result.append(locale);
result.append(QLocale(*(data->m_language_id == C ? c_private()
: QLocalePrivate::create(data))));
}
++data;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,8 +45,7 @@
"xkb-config-root": "string",
"xkbcommon": { "type": "enum", "values": [ "no", "qt", "system" ] },
"xkbcommon-evdev": "boolean",
"xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] },
"xrender": "boolean"
"xkbcommon-x11": { "type": "enum", "name": "xkbcommon", "values": [ "no", "qt", "system" ] }
}
},
@ -295,13 +294,6 @@
"sources": [
{ "type": "pkgConfig", "args": "xkbcommon xkbcommon-x11 >= 0.4.1" }
]
},
"xrender": {
"label": "XRender",
"test": "x11/xrender",
"sources": [
"-lXrender"
]
}
},
@ -798,11 +790,6 @@
"condition": "tests.xlib",
"output": [ "privateFeature" ]
},
"xrender": {
"label": "Xrender",
"condition": "libs.xrender",
"output": [ "privateFeature", "feature" ]
},
"texthtmlparser": {
"label": "HtmlParser",
"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",
"condition": "features.xcb",
"entries": [
"system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xrender", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system"
"system-xcb", "egl_x11", "xinput2", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xlib", "xkbcommon-system"
]
},
{

View File

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

View File

@ -99,7 +99,7 @@
#include <QtGui/QClipboard>
#endif
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
#include <QtCore/QLibrary>
#endif
@ -1449,7 +1449,7 @@ void QGuiApplicationPrivate::init()
session_manager = new QSessionManager(q, session_id, session_key);
#endif
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
if (qEnvironmentVariableIntValue("QT_LOAD_TESTABILITY") > 0)
loadTestability = true;
@ -1469,7 +1469,7 @@ void QGuiApplicationPrivate::init()
}
#else
Q_UNUSED(loadTestability);
#endif // QT_NO_LIBRARY
#endif // QT_CONFIG(library)
if (layout_direction == Qt::LayoutDirectionAuto || force_reverse)
QGuiApplication::setLayoutDirection(qt_detectRTLLanguage() ? Qt::RightToLeft : Qt::LeftToRight);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,5 @@
TARGET = qvnc
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QVncIntegrationPlugin
!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
load(qt_plugin)
QT += \
core-private network gui-private \
service_support-private theme_support-private fb_support-private \
@ -29,3 +24,8 @@ HEADERS = \
qvncclient.h
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,
(QXcbGlIntegrationFactoryInterface_iid, QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive))
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
(QXcbGlIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif // !QT_NO_LIBRARY
#endif // QT_CONFIG(library)
QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
#if QT_CONFIG(library)
// Try loading the plugin from pluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);

View File

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

View File

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

View File

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

View File

@ -731,6 +731,19 @@ private:
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
template <typename cookie_t>
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 "qxcbxsettings.h"
#if QT_CONFIG(library)
#include <QtCore/QLibrary>
#endif
#include <QtGui/QWindow>
#include <QtGui/QBitmap>
#include <QtGui/private/qguiapplication_p.h>
@ -58,7 +60,7 @@ typedef char *(*PtrXcursorLibraryGetTheme)(void *);
typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *);
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>
enum {
XCursorShape = CursorShape
@ -306,7 +308,7 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
const char *cursorStr = "cursor";
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;
if (function_ptrs_not_initialized) {
QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
@ -507,7 +509,7 @@ xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
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) {
if (!ptrXcursorLibraryGetTheme
|| !ptrXcursorLibrarySetTheme)
@ -551,7 +553,7 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
}
return cursor;
}
#endif //XCB_USE_XLIB / QT_NO_LIBRARY
#endif // XCB_USE_XLIB / QT_CONFIG(library)
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{
@ -560,7 +562,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
xcb_cursor_t cursor = XCB_NONE;
// 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) {
void *dpy = connection()->xlib_display();
// special case for non-standard dnd-* cursors

View File

@ -101,7 +101,7 @@ private:
#ifndef QT_NO_CURSOR
CursorHash m_cursorHash;
#endif
#if defined(XCB_USE_XLIB) && !defined(QT_NO_LIBRARY)
#if defined(XCB_USE_XLIB) && QT_CONFIG(library)
static void cursorThemePropertyChanged(QXcbVirtualDesktop *screen,
const QByteArray &name,
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)
{
xcb_selection_notify_event_t notify;
Q_DECLARE_XCB_EVENT(notify, xcb_selection_notify_event_t);
notify.response_type = XCB_SELECTION_NOTIFY;
notify.requestor = event->requestor;
notify.selection = event->selection;

View File

@ -844,7 +844,7 @@ void QXcbWindow::hide()
Q_XCB_CALL(xcb_unmap_window(xcb_connection(), m_window));
// 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.event = xcbScreen()->root();
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) {
// force the communication to be utf8mb4 (only utf8mb4 supports 4-byte characters)
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
mysql_set_character_set(d->mysql, "utf8");
}
#endif
#ifndef QT_NO_TEXTCODEC
d->tc = codec(d->mysql);
d->tc = codec(d->mysql);
#endif
}
#endif
#if MYSQL_VERSION_ID >= 40108

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