Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/dev
This commit is contained in:
commit
eecc5fc52c
@ -934,6 +934,8 @@ foreach my $lib (@modules_to_sync) {
|
||||
foreach my $subdir (@subdirs) {
|
||||
if (opendir DIR, $subdir) {
|
||||
foreach my $t (sort { $b cmp $a } readdir(DIR)) {
|
||||
next if ($t =~ /\.pri$/);
|
||||
next if ($t =~ /^qt[a-z0-9]+-config(_p)?\.h$/);
|
||||
my $file = "$subdir/$t";
|
||||
if(-d $file) {
|
||||
push @subdirs, $file unless($t eq "." || $t eq "..");
|
||||
@ -984,6 +986,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
#calc files and "copy" them
|
||||
foreach my $subdir (@subdirs) {
|
||||
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
|
||||
@headers = grep(!/^qt[a-z0-9]+-config(_p)?\.h$/, @headers);
|
||||
if (defined $inject_headers{$subdir}) {
|
||||
foreach my $if (@{$inject_headers{$subdir}}) {
|
||||
@headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously
|
||||
|
48
configure
vendored
48
configure
vendored
@ -753,21 +753,6 @@ while [ "$#" -gt 0 ]; do
|
||||
opensource)
|
||||
COMMERCIAL_USER="no"
|
||||
;;
|
||||
feature-*)
|
||||
FEATURE=`echo $VAR | sed 's,^[^-]*-\([^-]*\),\1,' | tr 'abcdefghijklmnopqrstuvwxyz-' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
|
||||
if grep "^Feature: *${FEATURE} *\$" "$relpath"/src/corelib/global/qfeatures.txt >/dev/null 2>&1; then
|
||||
F=`echo $VAR | sed 's,^[^-]*-\([^-]*\),\1,'`
|
||||
if [ "$VAL" = "no" ]; then
|
||||
F="no-$F"
|
||||
elif [ "$VAL" != "yes" ] && [ "$VAL" != "unknown" ]; then
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
CFG_FEATURES="$CFG_FEATURES $F"
|
||||
else
|
||||
echo "ERROR: Unknown feature $FEATURE"
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
confirm-license)
|
||||
if [ "$VAL" = "yes" ]; then
|
||||
OPT_CONFIRM_LICENSE="$VAL"
|
||||
@ -1894,7 +1879,6 @@ fi
|
||||
|
||||
cat > "$outpath/config.tests/configure.cfg" <<EOF
|
||||
# Feature defaults set by configure command line
|
||||
config.input.extra_features = $CFG_FEATURES
|
||||
config.input.qt_edition = $Edition
|
||||
config.input.qt_licheck = $Licheck
|
||||
config.input.qt_release_date = $ReleaseDate
|
||||
@ -1911,31 +1895,15 @@ done
|
||||
set +f
|
||||
IFS=$SAVED_IFS
|
||||
|
||||
# redirect qmake's output to a dummy Makefile
|
||||
$CFG_QMAKE_PATH -o Makefile.cfg -qtconf "$QTCONFFILE" $relpath/configure.pri -- "$@" || exit 101
|
||||
rm Makefile.cfg
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# give feedback on configuration
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [ -n "$PLATFORM_NOTES" ]; then
|
||||
echo
|
||||
echo "Platform notes:"
|
||||
echo "$PLATFORM_NOTES"
|
||||
else
|
||||
echo
|
||||
fi
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# build makefiles based on the configuration
|
||||
# configure and build top-level makefile
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [ -n "$CFG_TOPLEVEL" ]; then
|
||||
cd ..
|
||||
fi
|
||||
|
||||
"$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" "$relpathMangled" || exit
|
||||
"$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" "$relpathMangled" -- "$@" || exit
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# finally save the executed command to another script
|
||||
@ -1955,6 +1923,18 @@ if [ $CFG_REDO = no ]; then
|
||||
chmod +x config.status
|
||||
fi
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# final notes for the user
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [ -n "$PLATFORM_NOTES" ]; then
|
||||
echo
|
||||
echo "Platform notes:"
|
||||
echo "$PLATFORM_NOTES"
|
||||
else
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ -n "$PREFIX_COMPLAINTS" ]; then
|
||||
echo
|
||||
echo "$PREFIX_COMPLAINTS"
|
||||
|
1992
configure.json
1992
configure.json
File diff suppressed because it is too large
Load Diff
309
configure.pri
309
configure.pri
@ -66,7 +66,7 @@ defineReplace(qtConfFunc_crossCompile) {
|
||||
|
||||
defineTest(qtConfTest_architecture) {
|
||||
!qtConfTest_compile($${1}): \
|
||||
error("Could not determine $$eval($${1}.description). See config.log for details.")
|
||||
error("Could not determine $$eval($${1}.label). See config.log for details.")
|
||||
|
||||
test = $$eval($${1}.test)
|
||||
test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR/$$test)
|
||||
@ -77,13 +77,13 @@ defineTest(qtConfTest_architecture) {
|
||||
else: android:exists($$test_out_dir/libarch.so): \
|
||||
content = $$cat($$test_out_dir/libarch.so, blob)
|
||||
else: \
|
||||
error("$$eval($${1}.description) detection binary not found.")
|
||||
error("$$eval($${1}.label) detection binary not found.")
|
||||
|
||||
arch_magic = ".*==Qt=magic=Qt== Architecture:([^\\0]*).*"
|
||||
subarch_magic = ".*==Qt=magic=Qt== Sub-architecture:([^\\0]*).*"
|
||||
|
||||
!contains(content, $$arch_magic)|!contains(content, $$subarch_magic): \
|
||||
error("$$eval($${1}.description) detection binary does not contain expected data.")
|
||||
error("$$eval($${1}.label) detection binary does not contain expected data.")
|
||||
|
||||
$${1}.arch = $$replace(content, $$arch_magic, "\\1")
|
||||
$${1}.subarch = $$replace(content, $$subarch_magic, "\\1")
|
||||
@ -195,34 +195,10 @@ defineTest(qtConfTest_detectPkgConfig) {
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_neon) {
|
||||
contains(config.tests.architecture.subarch, "neon"): return(true)
|
||||
contains($${currentConfig}.tests.architecture.subarch, "neon"): return(true)
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_skipModules) {
|
||||
$${1}.cache = -
|
||||
export($${1}.cache)
|
||||
|
||||
skip =
|
||||
uikit {
|
||||
skip += qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples
|
||||
!ios: skip += qtscript
|
||||
}
|
||||
|
||||
for (m, config.input.skip) {
|
||||
# normalize the command line input
|
||||
m ~= s/^(qt)?/qt/
|
||||
!exists($$_PRO_FILE_PWD_/../$$m) {
|
||||
qtConfAddError("-skip command line argument called with non-existent module '$$m'.")
|
||||
return(false)
|
||||
}
|
||||
skip += $$m
|
||||
}
|
||||
$${1}.value = $$unique(skip)
|
||||
export($${1}.value)
|
||||
return(true)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_buildParts) {
|
||||
parts = $$config.input.make
|
||||
isEmpty(parts) {
|
||||
@ -246,16 +222,6 @@ defineTest(qtConfTest_buildParts) {
|
||||
return(true)
|
||||
}
|
||||
|
||||
defineTest(qtConfLibrary_openssl) {
|
||||
libs = $$getenv("OPENSSL_LIBS")
|
||||
!isEmpty(libs) {
|
||||
$${1}.libs = $$libs
|
||||
export($${1}.libs)
|
||||
return(true)
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_checkCompiler) {
|
||||
contains(QMAKE_CXX, ".*clang.*") {
|
||||
qtRunLoggedCommand("$$QMAKE_CXX -v 2>&1", versionstr)|return(false)
|
||||
@ -281,8 +247,11 @@ defineTest(qtConfTest_checkCompiler) {
|
||||
$${1}.compilerId = "icc"
|
||||
$${1}.compilerVersion = $$replace(version, "icpc version ([0-9.]+).*", "\\1")
|
||||
} else: msvc {
|
||||
qtRunLoggedCommand("$$QMAKE_CXX /? 2>&1", version)|return(false)
|
||||
version = "$$version"
|
||||
$${1}.compilerDescription = "MSVC"
|
||||
$${1}.compilerId = "cl"
|
||||
$${1}.compilerVersion = $$replace(version, "^.*Compiler Version ([0-9.]+) for.*$", "\\1")
|
||||
} else {
|
||||
return(false)
|
||||
}
|
||||
@ -295,162 +264,6 @@ defineTest(qtConfTest_checkCompiler) {
|
||||
return(true)
|
||||
}
|
||||
|
||||
defineReplace(filterLibraryPath) {
|
||||
str = $${1}
|
||||
for (l, QMAKE_DEFAULT_LIBDIRS): \
|
||||
str -= "-L$$l"
|
||||
|
||||
return($$str)
|
||||
}
|
||||
|
||||
defineTest(qtConfLibrary_psqlConfig) {
|
||||
pg_config = $$config.input.psql_config
|
||||
isEmpty(pg_config): \
|
||||
pg_config = $$qtConfFindInPath("pg_config")
|
||||
!win32:!isEmpty(pg_config) {
|
||||
qtRunLoggedCommand("$$pg_config --libdir", libdir)|return(false)
|
||||
qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false)
|
||||
libdir -= $$QMAKE_DEFAULT_LIBDIRS
|
||||
libs =
|
||||
!isEmpty(libdir): libs += "-L$$libdir"
|
||||
libs += "-lpq"
|
||||
$${1}.libs = "$$val_escape(libs)"
|
||||
includedir -= $$QMAKE_DEFAULT_INCDIRS
|
||||
$${1}.includedir = "$$val_escape(includedir)"
|
||||
!isEmpty(includedir): \
|
||||
$${1}.cflags = "-I$$val_escape(includedir)"
|
||||
export($${1}.libs)
|
||||
export($${1}.includedir)
|
||||
export($${1}.cflags)
|
||||
return(true)
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfLibrary_psqlEnv) {
|
||||
# Respect PSQL_LIBS if set
|
||||
PSQL_LIBS = $$getenv(PSQL_LIBS)
|
||||
!isEmpty(PSQL_LIBS) {
|
||||
$${1}.libs = $$PSQL_LIBS
|
||||
export($${1}.libs)
|
||||
}
|
||||
return(true)
|
||||
}
|
||||
|
||||
defineTest(qtConfLibrary_mysqlConfig) {
|
||||
mysql_config = $$config.input.mysql_config
|
||||
isEmpty(mysql_config): \
|
||||
mysql_config = $$qtConfFindInPath("mysql_config")
|
||||
!isEmpty(mysql_config) {
|
||||
qtRunLoggedCommand("$$mysql_config --version", version)|return(false)
|
||||
version = $$split(version, '.')
|
||||
version = $$first(version)
|
||||
isEmpty(version)|lessThan(version, 4): return(false)]
|
||||
|
||||
# query is either --libs or --libs_r
|
||||
query = $$eval($${1}.query)
|
||||
qtRunLoggedCommand("$$mysql_config $$query", libs)|return(false)
|
||||
qtRunLoggedCommand("$$mysql_config --include", includedir)|return(false)
|
||||
eval(libs = $$libs)
|
||||
libs = $$filterLibraryPath($$libs)
|
||||
# -rdynamic should not be returned by mysql_config, but is on RHEL 6.6
|
||||
libs -= -rdynamic
|
||||
$${1}.libs = "$$val_escape(libs)"
|
||||
eval(includedir = $$includedir)
|
||||
includedir ~= s/^-I//g
|
||||
includedir -= $$QMAKE_DEFAULT_INCDIRS
|
||||
$${1}.includedir = "$$val_escape(includedir)"
|
||||
!isEmpty(includedir): \
|
||||
$${1}.cflags = "-I$$val_escape(includedir)"
|
||||
export($${1}.libs)
|
||||
export($${1}.includedir)
|
||||
export($${1}.cflags)
|
||||
return(true)
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfLibrary_sybaseEnv) {
|
||||
libs =
|
||||
sybase = $$getenv(SYBASE)
|
||||
!isEmpty(sybase): \
|
||||
libs += "-L$${sybase}/lib"
|
||||
libs += $$getenv(SYBASE_LIBS)
|
||||
!isEmpty(libs) {
|
||||
$${1}.libs = "$$val_escape(libs)"
|
||||
export($${1}.libs)
|
||||
}
|
||||
return(true)
|
||||
}
|
||||
|
||||
# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc').
|
||||
# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
|
||||
# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
|
||||
# the Windows SDK. Checking for the header is not sufficient, since it
|
||||
# is also present in MinGW.
|
||||
defineTest(qtConfTest_directX) {
|
||||
dxdir = $$getenv("DXSDK_DIR")
|
||||
!isEmpty(dxdir) {
|
||||
EXTRA_INCLUDEPATH += $$dxdir/include
|
||||
arch = $$qtConfEvaluate("tests.architecture.arch")
|
||||
equals(arch, x86_64): \
|
||||
EXTRA_LIBDIR += $$dxdir/lib/x64
|
||||
else: \
|
||||
EXTRA_LIBDIR += $$dxdir/lib/x86
|
||||
EXTRA_PATH += $$dxdir/Utilities/bin/x86
|
||||
}
|
||||
|
||||
$$qtConfEvaluate("features.sse2") {
|
||||
ky = $$size($${1}.files._KEYS_)
|
||||
$${1}.files._KEYS_ += $$ky
|
||||
# Not present on MinGW-32
|
||||
$${1}.files.$${ky} = "intrin.h"
|
||||
}
|
||||
|
||||
qtConfTest_files($${1}): return(true)
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_xkbConfigRoot) {
|
||||
qtConfTest_getPkgConfigVariable($${1}): return(true)
|
||||
|
||||
for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) {
|
||||
exists($$dir) {
|
||||
$${1}.value = $$dir
|
||||
export($${1}.value)
|
||||
$${1}.cache += value
|
||||
export($${1}.cache)
|
||||
return(true)
|
||||
}
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_qpaDefaultPlatform) {
|
||||
name =
|
||||
!isEmpty(config.input.qpa_default_platform): name = $$config.input.qpa_default_platform
|
||||
else: !isEmpty(QT_QPA_DEFAULT_PLATFORM): name = $$QT_QPA_DEFAULT_PLATFORM
|
||||
else: winrt: name = winrt
|
||||
else: win32: name = windows
|
||||
else: android: name = android
|
||||
else: osx: name = cocoa
|
||||
else: ios: name = ios
|
||||
else: qnx: name = qnx
|
||||
else: integrity: name = integrityfb
|
||||
else: name = xcb
|
||||
|
||||
$${1}.value = $$name
|
||||
$${1}.plugin = q$$name
|
||||
$${1}.name = "\"$$name\""
|
||||
export($${1}.value)
|
||||
export($${1}.plugin)
|
||||
export($${1}.name)
|
||||
$${1}.cache += value plugin name
|
||||
export($${1}.cache)
|
||||
return(true)
|
||||
}
|
||||
|
||||
|
||||
# custom outputs
|
||||
|
||||
defineTest(qtConfOutput_shared) {
|
||||
@ -488,27 +301,16 @@ defineTest(qtConfOutput_architecture) {
|
||||
"QT_ARCH = $$arch"
|
||||
}
|
||||
|
||||
config.output.publicPro += $$publicPro
|
||||
export(config.output.publicPro)
|
||||
config.output.privatePro += $$privatePro
|
||||
export(config.output.privatePro)
|
||||
$${currentConfig}.output.publicPro += $$publicPro
|
||||
export($${currentConfig}.output.publicPro)
|
||||
$${currentConfig}.output.privatePro += $$privatePro
|
||||
export($${currentConfig}.output.privatePro)
|
||||
|
||||
# setup QT_ARCH variable used by qtConfEvaluate
|
||||
QT_ARCH = $$arch
|
||||
export(QT_ARCH)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_styles) {
|
||||
!$${2}: return()
|
||||
|
||||
style = $$replace($${1}.feature, "style-", "")
|
||||
qtConfOutputVar(append, "privatePro", "styles", $$style)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_sqldriver) {
|
||||
$${2}: qtConfOutputVar(append, "privatePro", "sql-drivers", $$eval($${1}.feature))
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_qreal) {
|
||||
qreal = $$config.input.qreal
|
||||
isEmpty(qreal): qreal = "double"
|
||||
@ -523,15 +325,15 @@ defineTest(qtConfOutput_qreal) {
|
||||
defineTest(qtConfOutput_pkgConfig) {
|
||||
!$${2}: return()
|
||||
|
||||
PKG_CONFIG = $$eval(config.tests.pkg-config.pkgConfig)
|
||||
PKG_CONFIG = $$eval($${currentConfig}.tests.pkg-config.pkgConfig)
|
||||
export(PKG_CONFIG)
|
||||
# this method also exports PKG_CONFIG_(LIB|SYSROOT)DIR, so that tests using pkgConfig will work correctly
|
||||
PKG_CONFIG_SYSROOT_DIR = $$eval(config.tests.pkg-config.pkgConfigSysrootDir)
|
||||
PKG_CONFIG_SYSROOT_DIR = $$eval($${currentConfig}.tests.pkg-config.pkgConfigSysrootDir)
|
||||
!isEmpty(PKG_CONFIG_SYSROOT_DIR) {
|
||||
qtConfOutputVar(assign, "publicPro", "PKG_CONFIG_SYSROOT_DIR", $$PKG_CONFIG_SYSROOT_DIR)
|
||||
export(PKG_CONFIG_SYSROOT_DIR)
|
||||
}
|
||||
PKG_CONFIG_LIBDIR = $$eval(config.tests.pkg-config.pkgConfigLibdir)
|
||||
PKG_CONFIG_LIBDIR = $$eval($${currentConfig}.tests.pkg-config.pkgConfigLibdir)
|
||||
!isEmpty(PKG_CONFIG_LIBDIR) {
|
||||
qtConfOutputVar(assign, "publicPro", "PKG_CONFIG_LIBDIR", $$PKG_CONFIG_LIBDIR)
|
||||
export(PKG_CONFIG_LIBDIR)
|
||||
@ -561,59 +363,22 @@ defineTest(qtConfOutput_debugAndRelease) {
|
||||
defineTest(qtConfOutput_compilerVersion) {
|
||||
!$${2}: return()
|
||||
|
||||
name = $$upper($$config.tests.compiler.compilerId)
|
||||
version = $$config.tests.compiler.compilerVersion
|
||||
name = $$upper($$eval($${currentConfig}.tests.compiler.compilerId))
|
||||
version = $$eval($${currentConfig}.tests.compiler.compilerVersion)
|
||||
major = $$section(version, '.', 0, 0)
|
||||
minor = $$section(version, '.', 1, 1)
|
||||
patch = $$section(version, '.', 2, 2)
|
||||
isEmpty(minor): minor = 0
|
||||
isEmpty(patch): patch = 0
|
||||
|
||||
config.output.publicPro += \
|
||||
$${currentConfig}.output.publicPro += \
|
||||
"QT_$${name}_MAJOR_VERSION = $$major" \
|
||||
"QT_$${name}_MINOR_VERSION = $$minor" \
|
||||
"QT_$${name}_PATCH_VERSION = $$patch"
|
||||
|
||||
export(config.output.publicPro)
|
||||
export($${currentConfig}.output.publicPro)
|
||||
}
|
||||
|
||||
# should go away when qfeatures.txt is ported
|
||||
defineTest(qtConfOutput_extraFeatures) {
|
||||
isEmpty(config.input.extra_features): return()
|
||||
|
||||
# write to qconfig.pri
|
||||
config.output.publicPro += "$${LITERAL_HASH}ifndef QT_BOOTSTRAPPED"
|
||||
for (f, config.input.extra_features) {
|
||||
feature = $$replace(f, "^no-", "")
|
||||
FEATURE = $$upper($$replace(feature, -, _))
|
||||
contains(f, "^no-.*") {
|
||||
config.output.publicPro += \
|
||||
"$${LITERAL_HASH}ifndef QT_NO_$$FEATURE" \
|
||||
"$${LITERAL_HASH}define QT_NO_$$FEATURE" \
|
||||
"$${LITERAL_HASH}endif"
|
||||
} else {
|
||||
config.output.publicPro += \
|
||||
"$${LITERAL_HASH}if defined(QT_$$FEATURE) && defined(QT_NO_$$FEATURE)" \
|
||||
"$${LITERAL_HASH}undef QT_$$FEATURE" \
|
||||
"$${LITERAL_HASH}elif !defined(QT_$$FEATURE) && !defined(QT_NO_$$FEATURE)" \
|
||||
"$${LITERAL_HASH}define QT_$$FEATURE" \
|
||||
"$${LITERAL_HASH}endif"
|
||||
}
|
||||
}
|
||||
config.output.publicPro += "$${LITERAL_HASH}endif"
|
||||
export(config.output.publicPro)
|
||||
|
||||
# write to qmodule.pri
|
||||
disabled_features =
|
||||
for (f, config.input.extra_features) {
|
||||
feature = $$replace(f, "^no-", "")
|
||||
FEATURE = $$upper($$replace(feature, -, _))
|
||||
contains(f, "^no-.*"): disabled_features += $$FEATURE
|
||||
}
|
||||
!isEmpty(disabled_features): qtConfOutputVar(assign, "privatePro", QT_NO_DEFINES, $$disabled_features)
|
||||
}
|
||||
|
||||
|
||||
defineTest(qtConfOutput_compilerFlags) {
|
||||
# this output also exports the variables locally, so that subsequent compiler tests can use them
|
||||
|
||||
@ -650,8 +415,8 @@ defineTest(qtConfOutput_compilerFlags) {
|
||||
output += "EXTRA_FRAMEWORKPATH += $$val_escape(config.input.fpaths)"
|
||||
}
|
||||
|
||||
config.output.privatePro += $$output
|
||||
export(config.output.privatePro)
|
||||
$${currentConfig}.output.privatePro += $$output
|
||||
export($${currentConfig}.output.privatePro)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_gccSysroot) {
|
||||
@ -671,21 +436,21 @@ defineTest(qtConfOutput_gccSysroot) {
|
||||
" QMAKE_CXXFLAGS += --sysroot=\$\$[QT_SYSROOT]" \
|
||||
" QMAKE_LFLAGS += --sysroot=\$\$[QT_SYSROOT]" \
|
||||
"}"
|
||||
config.output.publicPro += $$output
|
||||
export(config.output.publicPro)
|
||||
$${currentConfig}.output.publicPro += $$output
|
||||
export($${currentConfig}.output.publicPro)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_qmakeArgs) {
|
||||
!$${2}: return()
|
||||
|
||||
config.output.privatePro = "!host_build {"
|
||||
$${currentConfig}.output.privatePro = "!host_build {"
|
||||
for (a, config.input.qmakeArgs) {
|
||||
config.output.privatePro += " $$a"
|
||||
$${currentConfig}.output.privatePro += " $$a"
|
||||
EXTRA_QMAKE_ARGS += $$system_quote($$a)
|
||||
}
|
||||
config.output.privatePro += "}"
|
||||
$${currentConfig}.output.privatePro += "}"
|
||||
export(EXTRA_QMAKE_ARGS)
|
||||
export(config.output.privatePro)
|
||||
export($${currentConfig}.output.privatePro)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutputPostProcess_publicPro) {
|
||||
@ -707,8 +472,8 @@ defineTest(qtConfOutputPostProcess_publicPro) {
|
||||
"QT_RELEASE_DATE = $$config.input.qt_release_date"
|
||||
}
|
||||
|
||||
config.output.publicPro += $$output
|
||||
export(config.output.publicPro)
|
||||
$${currentConfig}.output.publicPro += $$output
|
||||
export($${currentConfig}.output.publicPro)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutputPostProcess_publicHeader) {
|
||||
@ -730,8 +495,8 @@ defineTest(qtConfOutputPostProcess_publicHeader) {
|
||||
!isEmpty(config.input.qt_libinfix): \
|
||||
output += "$${LITERAL_HASH}define QT_LIBINFIX \"$$eval(config.input.qt_libinfix)\""
|
||||
|
||||
config.output.publicHeader += $$output
|
||||
export(config.output.publicHeader)
|
||||
$${currentConfig}.output.publicHeader += $$output
|
||||
export($${currentConfig}.output.publicHeader)
|
||||
}
|
||||
|
||||
|
||||
@ -749,7 +514,7 @@ defineTest(qtConfReport_buildTypeAndConfig) {
|
||||
qtConfAddReport("Building for: $$qtConfEvaluate('tests.architecture.arch')")
|
||||
}
|
||||
qtConfAddReport()
|
||||
qtConfAddReport("Configuration: $$config.output.privatePro.append.CONFIG $$config.output.publicPro.append.QT_CONFIG")
|
||||
qtConfAddReport("Configuration: $$eval($${currentConfig}.output.privatePro.append.CONFIG) $$eval($${currentConfig}.output.publicPro.append.QT_CONFIG)")
|
||||
qtConfAddReport()
|
||||
}
|
||||
|
||||
@ -776,10 +541,10 @@ defineTest(qtConfReport_buildMode) {
|
||||
# ensure pristine environment for configuration
|
||||
discard_from($$[QT_HOST_DATA/get]/mkspecs/qconfig.pri)
|
||||
discard_from($$[QT_HOST_DATA/get]/mkspecs/qmodule.pri)
|
||||
# ... and cause them to be reloaded afterwards
|
||||
QMAKE_POST_CONFIGURE += \
|
||||
"include(\$\$[QT_HOST_DATA/get]/mkspecs/qconfig.pri)" \
|
||||
"include(\$\$[QT_HOST_DATA/get]/mkspecs/qmodule.pri)"
|
||||
|
||||
# load and process input from configure
|
||||
exists("$$OUT_PWD/config.tests/configure.cfg") {
|
||||
include("$$OUT_PWD/config.tests/configure.cfg")
|
||||
}
|
||||
|
||||
load(qt_configure)
|
||||
# load and process input from configure.sh/.exe
|
||||
include($$shadowed($$PWD)/config.tests/configure.cfg)
|
||||
|
@ -1,10 +1,10 @@
|
||||
requires(qtHaveModule(gui))
|
||||
|
||||
TEMPLATE = subdirs
|
||||
QT_FOR_CONFIG += gui
|
||||
CONFIG += no_docs_target
|
||||
|
||||
SUBDIRS += analogclock
|
||||
SUBDIRS += rasterwindow
|
||||
qtConfig(opengl(es2)?) {
|
||||
qtConfig(opengl): \
|
||||
SUBDIRS += openglwindow
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
requires(qtHaveModule(network))
|
||||
|
||||
TEMPLATE = subdirs
|
||||
QT_FOR_CONFIG += network-private
|
||||
SUBDIRS = \
|
||||
download \
|
||||
downloadmanager
|
||||
@ -18,8 +19,7 @@ qtHaveModule(widgets) {
|
||||
multicastreceiver \
|
||||
multicastsender
|
||||
|
||||
load(qfeatures)
|
||||
!contains(QT_DISABLED_FEATURES, bearermanagement) {
|
||||
qtConfig(bearermanagement) {
|
||||
# no QProcess
|
||||
!vxworks:!qnx:!winrt:!integrity:!uikit: SUBDIRS += network-chat
|
||||
|
||||
|
@ -16,8 +16,7 @@ SUBDIRS = \
|
||||
|
||||
contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= i18n
|
||||
|
||||
load(qfeatures)
|
||||
contains(QT_DISABLED_FEATURES, library) {
|
||||
!qtConfig(library) {
|
||||
SUBDIRS -= \
|
||||
echoplugin \
|
||||
plugandpaint
|
||||
|
@ -6,7 +6,6 @@ QMAKE_PLATFORM += android
|
||||
include(linux.conf)
|
||||
include(gcc-base-unix.conf)
|
||||
|
||||
DEFINES += QT_NO_PRINTER QT_NO_PRINTDIALOG
|
||||
QT_QPA_DEFAULT_PLATFORM = minimal
|
||||
|
||||
NDK_ROOT = $$(ANDROID_NDK_ROOT)
|
||||
|
@ -6,6 +6,6 @@ QMAKE_PLATFORM += uikit
|
||||
CONFIG += bitcode reduce_exports shallow_bundle no_qt_rpath
|
||||
|
||||
INCLUDEPATH += $$PWD/uikit
|
||||
DEFINES += DARWIN_NO_CARBON QT_NO_PRINTER QT_NO_PRINTDIALOG
|
||||
DEFINES += DARWIN_NO_CARBON
|
||||
|
||||
include(mac.conf)
|
||||
|
@ -10,8 +10,7 @@ MAKEFILE_GENERATOR = MSBUILD
|
||||
QMAKE_COMPILER = msvc
|
||||
QMAKE_PLATFORM = winrt win32
|
||||
CONFIG = package_manifest $$CONFIG incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target rtti
|
||||
DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN \
|
||||
QT_NO_PRINTER QT_NO_PRINTDIALOG # TODO: Remove when printing is re-enabled
|
||||
DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT Q_BYTE_ORDER=Q_LITTLE_ENDIAN
|
||||
|
||||
DEPLOYMENT_PLUGIN += qwinrt
|
||||
|
||||
|
17
mkspecs/devices/linux-colibri-vf-g++/qmake.conf
Normal file
17
mkspecs/devices/linux-colibri-vf-g++/qmake.conf
Normal file
@ -0,0 +1,17 @@
|
||||
#
|
||||
# qmake configuration for the NXP Colibri VFxx boards
|
||||
#
|
||||
|
||||
include(../common/linux_device_pre.conf)
|
||||
|
||||
VFXX_CFLAGS = -march=armv7-a -mtune=cortex-a5 -mfpu=neon
|
||||
QMAKE_CFLAGS += $$VFXX_CFLAGS
|
||||
QMAKE_CXXFLAGS += $$VFXX_CFLAGS
|
||||
|
||||
QT_QPA_DEFAULT_PLATFORM = linuxfb
|
||||
|
||||
DISTRO_OPTS += hard-float
|
||||
|
||||
include(../common/linux_arm_device_post.conf)
|
||||
|
||||
load(qt_config)
|
40
mkspecs/devices/linux-colibri-vf-g++/qplatformdefs.h
Normal file
40
mkspecs/devices/linux-colibri-vf-g++/qplatformdefs.h
Normal file
@ -0,0 +1,40 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec 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 "../../linux-g++/qplatformdefs.h"
|
@ -1,5 +1,7 @@
|
||||
load(configure_base)
|
||||
|
||||
isEmpty(QMAKE_CONFIG_TESTS_DIR): QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests
|
||||
|
||||
# Try to build the test project in $$QMAKE_CONFIG_TESTS_DIR/$$1
|
||||
# ($$_PRO_FILE_PWD_/config.tests/$$1 by default).
|
||||
#
|
||||
|
@ -43,8 +43,6 @@ defineTest(qtRunLoggedCommand) {
|
||||
return(true)
|
||||
}
|
||||
|
||||
isEmpty(QMAKE_CONFIG_TESTS_DIR): QMAKE_CONFIG_TESTS_DIR = $$_PRO_FILE_PWD_/config.tests
|
||||
|
||||
# Ensure that a cache is present. If none was found on startup, this will create
|
||||
# one in the build directory of the project which loads this feature.
|
||||
cache()
|
||||
|
@ -69,6 +69,7 @@ for (dep, dependentmodules): \
|
||||
mod_deps += $$cmakeModuleName($$dep)
|
||||
dependentmodules = $$join(mod_deps, ";")
|
||||
|
||||
QT_FOR_CONFIG += gui-private
|
||||
qtConfig(angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
|
||||
!qtConfig(egl): CMAKE_GL_DEFINES += -DNO_EGL=True
|
||||
|
||||
|
@ -24,12 +24,6 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
|
||||
QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
|
||||
QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
|
||||
|
||||
!equals(MAKEFILE_GENERATOR, XCODE) {
|
||||
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
|
||||
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
|
||||
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH
|
||||
}
|
||||
|
||||
sysrootified =
|
||||
for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
|
||||
QMAKE_INCDIR_OPENGL = $$sysrootified
|
||||
@ -56,20 +50,72 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
|
||||
|
||||
!equals(MAKEFILE_GENERATOR, XCODE) {
|
||||
uikit:!host_build {
|
||||
simulator: \
|
||||
version_identifier = $$simulator.deployment_identifier
|
||||
else: \
|
||||
version_identifier = $$device.deployment_identifier
|
||||
ios: deployment_target = $$QMAKE_IOS_DEPLOYMENT_TARGET
|
||||
tvos: deployment_target = $$QMAKE_TVOS_DEPLOYMENT_TARGET
|
||||
watchos: deployment_target = $$QMAKE_WATCHOS_DEPLOYMENT_TARGET
|
||||
|
||||
!simulator|simulator_and_device: device_archs = $$QMAKE_APPLE_DEVICE_ARCHS
|
||||
simulator: simulator_archs = $$QMAKE_APPLE_SIMULATOR_ARCHS
|
||||
archs = $$device_archs $$simulator_archs
|
||||
|
||||
QMAKE_XARCH_CFLAGS =
|
||||
QMAKE_XARCH_LFLAGS =
|
||||
QMAKE_EXTRA_VARIABLES += QMAKE_XARCH_CFLAGS QMAKE_XARCH_LFLAGS
|
||||
|
||||
single_arch {
|
||||
device_archs = $$first(device_archs)
|
||||
simulator_archs = $$first(simulator_archs)
|
||||
archs = $$first(archs)
|
||||
}
|
||||
|
||||
for(arch, archs) {
|
||||
contains(simulator_archs, $$arch) {
|
||||
sdk = $$simulator.sdk
|
||||
version_identifier = $$simulator.deployment_identifier
|
||||
} else {
|
||||
sdk = $$device.sdk
|
||||
version_identifier = $$device.deployment_identifier
|
||||
}
|
||||
|
||||
version_min_flags = \
|
||||
-Xarch_$${arch} \
|
||||
-m$${version_identifier}-version-min=$$deployment_target
|
||||
QMAKE_XARCH_CFLAGS_$${arch} = $$version_min_flags \
|
||||
-Xarch_$${arch} \
|
||||
-isysroot$$xcodeSDKInfo(Path, $$sdk)
|
||||
QMAKE_XARCH_LFLAGS_$${arch} = $$version_min_flags \
|
||||
-Xarch_$${arch} \
|
||||
-Wl,-syslibroot,$$xcodeSDKInfo(Path, $$sdk)
|
||||
|
||||
QMAKE_XARCH_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
|
||||
QMAKE_XARCH_LFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS_$${arch})
|
||||
|
||||
QMAKE_EXTRA_VARIABLES += \
|
||||
QMAKE_XARCH_CFLAGS_$${arch} \
|
||||
QMAKE_XARCH_LFLAGS_$${arch}
|
||||
}
|
||||
|
||||
QMAKE_CFLAGS_USE_PRECOMPILE =
|
||||
for(arch, archs) {
|
||||
QMAKE_CFLAGS_USE_PRECOMPILE += \
|
||||
-Xarch_$${arch} \
|
||||
-include${QMAKE_PCH_OUTPUT_$${arch}}
|
||||
}
|
||||
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
|
||||
QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
|
||||
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
|
||||
|
||||
QMAKE_PCH_OUTPUT_EXT = _${QMAKE_PCH_ARCH}$${QMAKE_PCH_OUTPUT_EXT}
|
||||
} else: osx {
|
||||
version_identifier = macosx
|
||||
deployment_target = $$QMAKE_MACOSX_DEPLOYMENT_TARGET
|
||||
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
|
||||
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH $$version_min_flag
|
||||
}
|
||||
|
||||
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
|
||||
QMAKE_CFLAGS += $$version_min_flag
|
||||
QMAKE_CXXFLAGS += $$version_min_flag
|
||||
QMAKE_LFLAGS += $$version_min_flag
|
||||
QMAKE_CFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
|
||||
QMAKE_CXXFLAGS += $(EXPORT_QMAKE_XARCH_CFLAGS)
|
||||
QMAKE_LFLAGS += $(EXPORT_QMAKE_XARCH_LFLAGS)
|
||||
}
|
||||
|
@ -25,8 +25,9 @@ win32:count(MOC_INCLUDEPATH, 40, >) {
|
||||
}
|
||||
|
||||
# QNX's compiler sets "gcc" config, but does not support the -dM option;
|
||||
# iOS builds are multi-arch, so this feature cannot possibly work.
|
||||
if(gcc|intel_icl|msvc):!rim_qcc:!ios {
|
||||
# UIKit builds are always multi-arch due to simulator_and_device (unless
|
||||
# -sdk is used) so this feature cannot possibly work.
|
||||
if(gcc|intel_icl|msvc):!rim_qcc:!uikit {
|
||||
moc_predefs.CONFIG = no_link
|
||||
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
|
@ -1,4 +0,0 @@
|
||||
# This file needs to be loaded explicitly, as the evaluation is relatively
|
||||
# expensive, and not many projects will actually need it.
|
||||
QMAKE_QT_FEATURES = $$[QT_HOST_DATA/get]/mkspecs/qfeatures.pri
|
||||
include($$QMAKE_QT_FEATURES) | error("Failed to load $$QMAKE_QT_FEATURES")
|
@ -95,3 +95,26 @@ defineTest(qtNomakeTools) {
|
||||
export($${d}.CONFIG)
|
||||
}
|
||||
}
|
||||
|
||||
# This overloads the same function from qt_functions.prf.
|
||||
# This is not in qt_module.prf, as that gets loaded too late.
|
||||
defineTest(qtConfig) {
|
||||
modules = $$QT $$QT_PRIVATE $$QT_FOR_PRIVATE $$QT_FOR_CONFIG
|
||||
modules ~= s,-private$,_private,g
|
||||
modules = $$resolve_depends(modules, "QT.", ".depends")
|
||||
isEmpty(MODULE): \
|
||||
MODULE = $$section($$list($$basename(_PRO_FILE_)), ., 0, 0)
|
||||
exists($$OUT_PWD/qt$${MODULE}-config.pri) {
|
||||
include($$OUT_PWD/qt$${MODULE}-config.pri)
|
||||
modules += $${MODULE} $${MODULE}_private
|
||||
}
|
||||
modules += global global_private
|
||||
modules = $$reverse(modules)
|
||||
for (module, modules) {
|
||||
contains(QT.$${module}.enabled_features, $$1): \
|
||||
return(true)
|
||||
contains(QT.$${module}.disabled_features, $$1): \
|
||||
return(false)
|
||||
}
|
||||
error("Could not find feature $${1}.")
|
||||
}
|
||||
|
@ -68,12 +68,12 @@ warnings_are_errors:warning_clean {
|
||||
# If the module declares that it has does its clean-up of warnings, enable -Werror.
|
||||
# This setting is compiler-dependent anyway because it depends on the version of the
|
||||
# compiler.
|
||||
clang:!uikit {
|
||||
# Apple clang 4.0-4.2,5.0-5.1,6.0-6.4
|
||||
clang {
|
||||
# Apple clang 4.0-4.2,5.0-5.1,6.0-6.4,7.0-7.3
|
||||
# Regular clang 3.3-3.9
|
||||
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
|
||||
reg_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
|
||||
contains(apple_ver, "4\\.[012]|5\\.[01]|6\\.[01234]")|contains(reg_ver, "3\\.[3-9]") {
|
||||
contains(apple_ver, "4\\.[012]|5\\.[01]|6\\.[01234]|7\\.[0123]")|contains(reg_ver, "3\\.[3-9]") {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR
|
||||
}
|
||||
} else:intel_icc:linux {
|
||||
|
@ -1,8 +1,3 @@
|
||||
CONFIG -= qt debug_and_release
|
||||
load(configure_base)
|
||||
|
||||
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
|
||||
QMAKE_CONFIG_CACHE_USE = all
|
||||
|
||||
QT_CONFIGURE_REPORT =
|
||||
QT_CONFIGURE_NOTES =
|
||||
@ -36,8 +31,8 @@ defineTest(qtConfAddError) {
|
||||
defineTest(qtConfCommandlineSetInput) {
|
||||
arg = $${1}
|
||||
val = $${2}
|
||||
!isEmpty(config.commandline.options.$${arg}.name): \
|
||||
arg = $$eval(config.commandline.options.$${arg}.name)
|
||||
!isEmpty($${currentConfig}.commandline.options.$${arg}.name): \
|
||||
arg = $$eval($${currentConfig}.commandline.options.$${arg}.name)
|
||||
|
||||
config.input.$$arg = $$val
|
||||
export(config.input.$$arg)
|
||||
@ -74,7 +69,7 @@ defineTest(qtConfCommandline_void) {
|
||||
return()
|
||||
}
|
||||
|
||||
val = $$eval(config.commandline.options.$${opt}.value)
|
||||
val = $$eval($${currentConfig}.commandline.options.$${opt}.value)
|
||||
isEmpty(val): val = yes
|
||||
|
||||
qtConfCommandlineSetInput($$opt, $$val)
|
||||
@ -86,11 +81,11 @@ defineTest(qtConfCommandline_enum) {
|
||||
isEmpty(val): val = yes
|
||||
|
||||
# validate and map value
|
||||
mapped = $$eval(config.commandline.options.$${opt}.values.$${val})
|
||||
mapped = $$eval($${currentConfig}.commandline.options.$${opt}.values.$${val})
|
||||
isEmpty(mapped) {
|
||||
# just a list of allowed values
|
||||
for (i, config.commandline.options.$${opt}.values._KEYS_) {
|
||||
equals(config.commandline.options.$${opt}.values.$${i}, $$val) {
|
||||
for (i, $${currentConfig}.commandline.options.$${opt}.values._KEYS_) {
|
||||
equals($${currentConfig}.commandline.options.$${opt}.values.$${i}, $$val) {
|
||||
mapped = $$val
|
||||
break()
|
||||
}
|
||||
@ -108,12 +103,12 @@ defineTest(qtConfValidateValue) {
|
||||
opt = $${1}
|
||||
val = $${2}
|
||||
|
||||
validValues = $$eval(config.commandline.options.$${opt}.values._KEYS_)
|
||||
validValues = $$eval($${currentConfig}.commandline.options.$${opt}.values._KEYS_)
|
||||
isEmpty(validValues): \
|
||||
return(true)
|
||||
|
||||
for (i, validValues) {
|
||||
equals(config.commandline.options.$${opt}.values.$${i}, $$val): \
|
||||
equals($${currentConfig}.commandline.options.$${opt}.values.$${i}, $$val): \
|
||||
return(true)
|
||||
}
|
||||
|
||||
@ -169,20 +164,24 @@ defineTest(qtConfCommandline_addString) {
|
||||
!qtConfValidateValue($$opt, $$val): \
|
||||
return()
|
||||
|
||||
!isEmpty(config.commandline.options.$${opt}.name): \
|
||||
opt = $$eval(config.commandline.options.$${opt}.name)
|
||||
!isEmpty($${currentConfig}.commandline.options.$${opt}.name): \
|
||||
opt = $$eval($${currentConfig}.commandline.options.$${opt}.name)
|
||||
|
||||
config.input.$$opt += $$val
|
||||
export(config.input.$$opt)
|
||||
}
|
||||
|
||||
defineTest(qtConfParseCommandLine) {
|
||||
custom = $$config.commandline.custom
|
||||
customCall =
|
||||
!isEmpty(custom) {
|
||||
customCall = qtConfCommandline_$$custom
|
||||
!defined($$customCall, test): \
|
||||
error("Custom command line callback '$$custom' is undefined.")
|
||||
customCalls =
|
||||
for (cc, allConfigs) {
|
||||
custom = $$eval($${cc}.commandline.custom)
|
||||
|
||||
!isEmpty(custom) {
|
||||
customCall = qtConfCommandline_$$custom
|
||||
!defined($$customCall, test): \
|
||||
error("Custom command line callback '$$custom' is undefined.")
|
||||
customCalls += $$customCall
|
||||
}
|
||||
}
|
||||
|
||||
for (ever) {
|
||||
@ -212,15 +211,24 @@ defineTest(qtConfParseCommandLine) {
|
||||
next()
|
||||
}
|
||||
|
||||
!isEmpty(customCall) {
|
||||
$${customCall}($$c): \
|
||||
next()
|
||||
didCustomCall = false
|
||||
for (customCall, customCalls) {
|
||||
$${customCall}($$c) {
|
||||
didCustomCall = true
|
||||
break()
|
||||
}
|
||||
}
|
||||
$$didCustomCall: \
|
||||
next()
|
||||
|
||||
contains(c, "([A-Z_]+)=(.*)") {
|
||||
opt = $$replace(c, "^([A-Z_]+)=(.*)", "\\1")
|
||||
val = $$replace(c, "^([A-Z_]+)=(.*)", "\\2")
|
||||
var = $$eval(config.commandline.assignments.$${opt})
|
||||
for (cc, allConfigs) {
|
||||
var = $$eval($${cc}.commandline.assignments.$${opt})
|
||||
!isEmpty(var): \
|
||||
break()
|
||||
}
|
||||
isEmpty(var) {
|
||||
qtConfAddError("Assigning unknown variable '$$opt' on command line.")
|
||||
return()
|
||||
@ -254,25 +262,43 @@ defineTest(qtConfParseCommandLine) {
|
||||
return()
|
||||
}
|
||||
|
||||
type = $$eval(config.commandline.options.$${opt})
|
||||
isEmpty(type): \
|
||||
type = $$eval(config.commandline.options.$${opt}.type)
|
||||
isEmpty(type) {
|
||||
# no match in the regular options, try matching the prefixes
|
||||
for (p, config.commandline.prefix._KEYS_) {
|
||||
e = "^-$${p}(.*)"
|
||||
contains(c, $$e) {
|
||||
opt = $$eval(config.commandline.prefix.$${p})
|
||||
val = $$replace(c, $$e, "\\1")
|
||||
type = "addString"
|
||||
break()
|
||||
for (cc, allConfigs) {
|
||||
type = $$eval($${cc}.commandline.options.$${opt})
|
||||
isEmpty(type): \
|
||||
type = $$eval($${cc}.commandline.options.$${opt}.type)
|
||||
isEmpty(type) {
|
||||
# no match in the regular options, try matching the prefixes
|
||||
for (p, $${cc}.commandline.prefix._KEYS_) {
|
||||
e = "^-$${p}(.*)"
|
||||
contains(c, $$e) {
|
||||
opt = $$eval($${cc}.commandline.prefix.$${p})
|
||||
val = $$replace(c, $$e, "\\1")
|
||||
type = "addString"
|
||||
break()
|
||||
}
|
||||
}
|
||||
}
|
||||
!isEmpty(type) {
|
||||
currentConfig = $$cc
|
||||
break()
|
||||
}
|
||||
}
|
||||
# handle builtin [-no]-feature-xxx
|
||||
isEmpty(type):contains(opt, "feature-(.*)") {
|
||||
# simply skip for now
|
||||
next()
|
||||
opt ~= s,^feature-,,
|
||||
found = false
|
||||
for (cc, allConfigs) {
|
||||
contains($${cc}.features._KEYS_, $$opt) {
|
||||
found = true
|
||||
break()
|
||||
}
|
||||
}
|
||||
!$$found {
|
||||
qtConfAddError("Enabling/Disabling unknown feature '$$opt'.")
|
||||
return()
|
||||
}
|
||||
# this is a boolean enabling/disabling the corresponding feature
|
||||
type = boolean
|
||||
}
|
||||
|
||||
isEmpty(type) {
|
||||
@ -368,8 +394,8 @@ defineReplace(qtConfPrepareArgs) {
|
||||
}
|
||||
|
||||
defineTest(qtConfSetupLibraries) {
|
||||
for (l, config.libraries._KEYS_) {
|
||||
lpfx = config.libraries.$${l}
|
||||
for (l, $${currentConfig}.libraries._KEYS_) {
|
||||
lpfx = $${currentConfig}.libraries.$${l}
|
||||
# 'export' may be omitted, in which case it falls back to the library's name
|
||||
!defined($${lpfx}.export, var) {
|
||||
$${lpfx}.export = $$l
|
||||
@ -396,8 +422,8 @@ defineTest(qtConfSetupLibraries) {
|
||||
}
|
||||
|
||||
# reverse mapping for assignments on command line.
|
||||
for (a, config.commandline.assignments._KEYS_) {
|
||||
apfx = config.commandline.assignments.$${a}
|
||||
for (a, $${currentConfig}.commandline.assignments._KEYS_) {
|
||||
apfx = $${currentConfig}.commandline.assignments.$${a}
|
||||
ra = config.commandline.rev_assignments.$$eval($$apfx)
|
||||
$$ra = $$a
|
||||
export($$ra)
|
||||
@ -487,12 +513,13 @@ defineTest(qtConfLibrary_pkgConfig) {
|
||||
return(false)
|
||||
|
||||
qtRunLoggedCommand("$$pkg_config --modversion $$args", version)|return(false)
|
||||
qtRunLoggedCommand("$$pkg_config --libs $$args", $${1}.libs)|return(false)
|
||||
qtRunLoggedCommand("$$pkg_config --libs-only-L --libs-only-l $$args", $${1}.libs)|return(false)
|
||||
qtRunLoggedCommand("$$pkg_config --cflags $$args", $${1}.cflags)|return(false)
|
||||
qtRunLoggedCommand("$$pkg_config --cflags-only-I $$args", includes)|return(false)
|
||||
eval(includes = $$includes)
|
||||
includes ~= s/^-I//g
|
||||
$${1}.includedir = "$$val_escape(includes)"
|
||||
version ~= s/[^0-9.].*$//
|
||||
$${1}.version = $$first(version)
|
||||
export($${1}.libs)
|
||||
export($${1}.cflags)
|
||||
@ -569,10 +596,12 @@ defineTest(qtConfExportLibrary) {
|
||||
qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_MINOR, $$member(version, 1))
|
||||
qtConfOutputVar(assign, $$output, QMAKE_$${NAME}_VERSION_PATCH, $$member(version, 2))
|
||||
}
|
||||
!isEmpty($${currentConfig}.module): \
|
||||
qtConfExtendVar($$output, "QT.$${currentModule}_private.libraries", $$2)
|
||||
}
|
||||
|
||||
defineTest(qtConfHandleLibrary) {
|
||||
lpfx = config.libraries.$$1
|
||||
lpfx = $${currentConfig}.libraries.$$1
|
||||
defined($${lpfx}.result, var): return()
|
||||
|
||||
qtConfEnsureTestTypeDeps("library")
|
||||
@ -646,10 +675,10 @@ defineTest(qtConfTest_library) {
|
||||
|
||||
defineTest(qtConfTestPrepare_compile) {
|
||||
for (u, $$list($$eval($${1}.use))) {
|
||||
!contains(config.libraries._KEYS_, $$u): \
|
||||
!contains($${currentConfig}.libraries._KEYS_, $$u): \
|
||||
error("Test $$1 tries to use undeclared library '$$u'")
|
||||
qtConfHandleLibrary($$u)
|
||||
lpfx = config.libraries.$${u}
|
||||
lpfx = $${currentConfig}.libraries.$${u}
|
||||
isEmpty($${lpfx}.source): \
|
||||
return(false)
|
||||
$${1}.literal_args += $$qtConfLibraryArgs($${lpfx}.sources.$$eval($${lpfx}.source))
|
||||
@ -760,17 +789,17 @@ defineTest(logn) {
|
||||
}
|
||||
|
||||
defineTest(qtLogTestIntro) {
|
||||
description = $$eval($${1}.description)
|
||||
isEmpty(description): return()
|
||||
label = $$eval($${1}.label)
|
||||
isEmpty(label): return()
|
||||
|
||||
msg = "Checking for $${description}... "
|
||||
msg = "Checking for $${label}... "
|
||||
log($$msg)
|
||||
$$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)")
|
||||
write_file($$QMAKE_CONFIG_LOG, msg, append)
|
||||
}
|
||||
|
||||
defineTest(qtLogTestResult) {
|
||||
isEmpty($${1}.description): return()
|
||||
isEmpty($${1}.label): return()
|
||||
|
||||
!isEmpty($${1}.log) {
|
||||
field = $$eval($${1}.log)
|
||||
@ -819,12 +848,12 @@ defineTest(qtConfIsBoolean) {
|
||||
}
|
||||
|
||||
defineTest(qtConfSetupTestTypeDeps) {
|
||||
for (tt, config.testTypeDependencies._KEYS_) {
|
||||
for (tt, $${currentConfig}.testTypeDependencies._KEYS_) {
|
||||
!defined(qtConfTest_$${tt}, test): \
|
||||
error("Declaring dependency for undefined test type '$$tt'.")
|
||||
for (f, config.testTypeDependencies.$${tt}._KEYS_) {
|
||||
feature = $$eval(config.testTypeDependencies.$${tt}.$${f})
|
||||
isEmpty(config.features.$${feature}._KEYS_): \
|
||||
for (f, $${currentConfig}.testTypeDependencies.$${tt}._KEYS_) {
|
||||
feature = $$eval($${currentConfig}.testTypeDependencies.$${tt}.$${f})
|
||||
isEmpty($${currentConfig}.features.$${feature}._KEYS_): \
|
||||
error("Test type '$$tt' depends on undefined feature '$$feature'.")
|
||||
}
|
||||
}
|
||||
@ -833,31 +862,31 @@ defineTest(qtConfSetupTestTypeDeps) {
|
||||
# the call to another one. The former representation is more natural
|
||||
# (and concise) to write, while the latter is more efficient to process.
|
||||
# Hence, this function inverts the mapping.
|
||||
for (tt, config.testTypeAliases._KEYS_) {
|
||||
for (tt, $${currentConfig}.testTypeAliases._KEYS_) {
|
||||
!defined(qtConfTest_$${tt}, test): \
|
||||
error("Aliasing undefined test type '$$tt'.")
|
||||
for (tta, config.testTypeAliases.$${tt}._KEYS_) {
|
||||
type = $$eval(config.testTypeAliases.$${tt}.$${tta})
|
||||
for (tta, $${currentConfig}.testTypeAliases.$${tt}._KEYS_) {
|
||||
type = $$eval($${currentConfig}.testTypeAliases.$${tt}.$${tta})
|
||||
!defined(qtConfTest_$${type}, test): \
|
||||
error("Aliasing '$$tt' to undefined test type '$$type'.")
|
||||
config.testTypeForwards.$${type} += $$tt
|
||||
export(config.testTypeForwards.$${type})
|
||||
$${currentConfig}.testTypeForwards.$${type} += $$tt
|
||||
export($${currentConfig}.testTypeForwards.$${type})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defineTest(qtConfEnsureTestTypeDeps) {
|
||||
depsn = config.testTypeDependencies.$${1}._KEYS_
|
||||
depsn = $${currentConfig}.testTypeDependencies.$${1}._KEYS_
|
||||
!isEmpty($$depsn) {
|
||||
for (dep, $$depsn) {
|
||||
feature = $$eval(config.testTypeDependencies.$${1}.$${dep})
|
||||
feature = $$eval($${currentConfig}.testTypeDependencies.$${1}.$${dep})
|
||||
!qtConfCheckFeature($$feature): \
|
||||
error("Test type '$$1' depends on non-emitted feature $${feature}.")
|
||||
}
|
||||
$$depsn =
|
||||
export($$depsn)
|
||||
}
|
||||
fwdsn = config.testTypeForwards.$${1}
|
||||
fwdsn = $${currentConfig}.testTypeForwards.$${1}
|
||||
!isEmpty($$fwdsn) {
|
||||
for (fwd, $$fwdsn): \
|
||||
qtConfEnsureTestTypeDeps($$fwd)
|
||||
@ -867,7 +896,7 @@ defineTest(qtConfEnsureTestTypeDeps) {
|
||||
}
|
||||
|
||||
defineTest(qtRunSingleTest) {
|
||||
tpfx = config.tests.$${1}
|
||||
tpfx = $${currentConfig}.tests.$${1}
|
||||
defined($${tpfx}.result, var): \
|
||||
return()
|
||||
|
||||
@ -944,10 +973,10 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
||||
var = $$section(e, ".", 2, -1)
|
||||
isEmpty(var): \
|
||||
var = result
|
||||
!contains(config.tests._KEYS_, $$test): \
|
||||
!contains($${currentConfig}.tests._KEYS_, $$test): \
|
||||
error("Unknown test object $${test} in expression '$${1}'.")
|
||||
qtRunSingleTest($$test)
|
||||
result = $$eval(config.tests.$${test}.$${var})
|
||||
result = $$eval($${currentConfig}.tests.$${test}.$${var})
|
||||
} else: contains(e, "^libs\..*") {
|
||||
!qt_conf_tests_allowed: \
|
||||
error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.")
|
||||
@ -955,22 +984,36 @@ defineReplace(qtConfEvaluateSingleExpression) {
|
||||
var = $$section(e, ".", 2, -1)
|
||||
isEmpty(var): \
|
||||
var = result
|
||||
!contains(config.libraries._KEYS_, $$lib): \
|
||||
!contains($${currentConfig}.libraries._KEYS_, $$lib): \
|
||||
error("Unknown library object $${lib} in expression '$${1}'.")
|
||||
qtConfHandleLibrary($$lib)
|
||||
!defined(config.libraries.$${lib}.$${var}, var): \
|
||||
var = sources.$$eval(config.libraries.$${lib}.$${source}).$$var
|
||||
result = $$eval(config.libraries.$${lib}.$${var})
|
||||
!defined($${currentConfig}.libraries.$${lib}.$${var}, var): \
|
||||
var = sources.$$eval($${currentConfig}.libraries.$${lib}.$${source}).$$var
|
||||
result = $$eval($${currentConfig}.libraries.$${lib}.$${var})
|
||||
} else: contains(e, "^features\..*") {
|
||||
feature = $$section(e, ".", 1, 1)
|
||||
var = $$section(e, ".", 2, -1)
|
||||
isEmpty(var): \
|
||||
var = available
|
||||
!contains(config.features._KEYS_, $$feature): \
|
||||
!contains($${currentConfig}.features._KEYS_, $$feature) {
|
||||
# this is basically a copy of what qtConfig() in qt_build_config.prf
|
||||
# does, but we produce a nicer error message.
|
||||
for (module, QMAKE_CONFIG_DEPS) {
|
||||
contains(QT.$${module}.enabled_features, $$feature): \
|
||||
result = true
|
||||
else: contains(QT.$${module}.disabled_features, $$feature): \
|
||||
result = false
|
||||
else: \
|
||||
next()
|
||||
!equals(var, available): \
|
||||
error("Expression '$$1' is accessing field '$$var' of non-local feature $${feature}.")
|
||||
return($$result)
|
||||
}
|
||||
error("Unknown feature object $${feature} in expression '$${1}'.")
|
||||
}
|
||||
!qtConfCheckFeature($$feature): \
|
||||
error("Expression '$$1' is accessing non-emitted feature $${feature}.")
|
||||
result = $$eval(config.features.$${feature}.$${var})
|
||||
result = $$eval($${currentConfig}.features.$${feature}.$${var})
|
||||
} else: contains(e, "^config\..*") {
|
||||
var = $$replace(e, "^config\.", "")
|
||||
result = false
|
||||
@ -1058,7 +1101,7 @@ defineReplace(qtConfEvaluateSubExpression) {
|
||||
}
|
||||
|
||||
defineReplace(qtIsFeatureEnabled) {
|
||||
enable = $$eval(config.features.$${1}.enable)
|
||||
enable = $$eval($${currentConfig}.features.$${1}.enable)
|
||||
!isEmpty(enable) {
|
||||
$$qtConfEvaluate($$enable): \
|
||||
return(true)
|
||||
@ -1071,7 +1114,7 @@ defineReplace(qtIsFeatureEnabled) {
|
||||
}
|
||||
|
||||
defineReplace(qtIsFeatureDisabled) {
|
||||
disable = $$eval(config.features.$${1}.disable)
|
||||
disable = $$eval($${currentConfig}.features.$${1}.disable)
|
||||
!isEmpty(disable) {
|
||||
$$qtConfEvaluate($$disable): \
|
||||
return(true)
|
||||
@ -1099,7 +1142,7 @@ defineReplace(qtConfCheckSingleCondition) {
|
||||
}
|
||||
|
||||
defineTest(qtConfCheckFeature) {
|
||||
fpfx = config.features.$${1}
|
||||
fpfx = $${currentConfig}.features.$${1}
|
||||
|
||||
available = $$eval($${fpfx}.available)
|
||||
!isEmpty(available): return(true)
|
||||
@ -1137,7 +1180,7 @@ defineTest(qtConfCheckFeature) {
|
||||
$${fpfx}.available = $$result
|
||||
export($${fpfx}.available)
|
||||
|
||||
for (i, config.features.$${feature}.output._KEYS_): \
|
||||
for (i, $${currentConfig}.features.$${feature}.output._KEYS_): \
|
||||
qtConfProcessOneOutput($$feature, $$i)
|
||||
|
||||
return(true)
|
||||
@ -1145,7 +1188,7 @@ defineTest(qtConfCheckFeature) {
|
||||
|
||||
|
||||
defineTest(qtConfProcessFeatures) {
|
||||
for (feature, config.features._KEYS_): \
|
||||
for (feature, $${currentConfig}.features._KEYS_): \
|
||||
qtConfCheckFeature($$feature)
|
||||
}
|
||||
|
||||
@ -1166,8 +1209,8 @@ defineTest(qtConfReportPadded) {
|
||||
defineReplace(qtConfCollectFeatures) {
|
||||
l =
|
||||
for (feature, $$list($${1})) {
|
||||
$$eval(config.features.$${feature}.available): \
|
||||
l += $$eval(config.features.$${feature}.description)
|
||||
$$eval($${currentConfig}.features.$${feature}.available): \
|
||||
l += $$eval($${currentConfig}.features.$${feature}.label)
|
||||
}
|
||||
|
||||
isEmpty(l): return("<none>")
|
||||
@ -1180,10 +1223,10 @@ defineTest(qtConfReport_featureList) {
|
||||
|
||||
defineReplace(qtConfFindFirstAvailableFeature) {
|
||||
for (feature, $$list($${1})) {
|
||||
isEmpty(config.features.$${feature}._KEYS_): \
|
||||
isEmpty($${currentConfig}.features.$${feature}._KEYS_): \
|
||||
error("Asking for a report on undefined feature $${2}.")
|
||||
$$eval(config.features.$${feature}.available): \
|
||||
return($$eval(config.features.$${feature}.description))
|
||||
$$eval($${currentConfig}.features.$${feature}.available): \
|
||||
return($$eval($${currentConfig}.features.$${feature}.label))
|
||||
}
|
||||
|
||||
return("<none>")
|
||||
@ -1194,14 +1237,14 @@ defineTest(qtConfReport_firstAvailableFeature) {
|
||||
}
|
||||
|
||||
defineTest(qtConfReport_feature) {
|
||||
!contains(config.features._KEYS_, $$2): \
|
||||
!contains($${currentConfig}.features._KEYS_, $$2): \
|
||||
error("Asking for a report on undefined feature $${2}.")
|
||||
|
||||
# hide report for not emitted features
|
||||
isEmpty(config.features.$${2}.available): \
|
||||
isEmpty($${currentConfig}.features.$${2}.available): \
|
||||
return()
|
||||
|
||||
$$eval(config.features.$${2}.available) {
|
||||
$$eval($${currentConfig}.features.$${2}.available) {
|
||||
result = "yes"
|
||||
!isEmpty(3): result = "$${3}"
|
||||
} else {
|
||||
@ -1209,7 +1252,7 @@ defineTest(qtConfReport_feature) {
|
||||
!isEmpty(4): result = "$${4}"
|
||||
}
|
||||
|
||||
text = $$eval(config.features.$${2}.description)
|
||||
text = $$eval($${currentConfig}.features.$${2}.label)
|
||||
|
||||
qtConfReportPadded($${1}$$text, $$result)
|
||||
}
|
||||
@ -1269,17 +1312,15 @@ defineTest(qtConfCreateReportRecurse) {
|
||||
}
|
||||
|
||||
defineTest(qtConfProcessEarlyChecks) {
|
||||
qtConfCreateReportRecurse(config.earlyReport, false)
|
||||
qtConfCheckErrors()
|
||||
qtConfCreateReportRecurse($${currentConfig}.earlyReport, false)
|
||||
}
|
||||
|
||||
|
||||
defineTest(qtConfCreateReport) {
|
||||
qtConfCreateReportRecurse(config.report, false)
|
||||
qtConfCreateReportRecurse($${currentConfig}.report, false)
|
||||
}
|
||||
|
||||
defineTest(qtConfCreateSummary) {
|
||||
qtConfCreateReportRecurse(config.summary, "")
|
||||
qtConfCreateReportRecurse($${currentConfig}.summary, "")
|
||||
}
|
||||
|
||||
defineTest(qtConfPrintReport) {
|
||||
@ -1321,15 +1362,6 @@ defineTest(qtConfCheckErrors) {
|
||||
# output generation
|
||||
#
|
||||
|
||||
defineReplace(qtConfOutputSelectProFile) {
|
||||
!isEmpty($${1}.public) {
|
||||
$$eval($${1}.public): \
|
||||
return(publicPro)
|
||||
}
|
||||
return(privatePro)
|
||||
}
|
||||
|
||||
|
||||
# qtConfOutputVar(modifier, output, name, value)
|
||||
defineTest(qtConfOutputVar) {
|
||||
modifier = $$1
|
||||
@ -1337,35 +1369,53 @@ defineTest(qtConfOutputVar) {
|
||||
name = $$3
|
||||
value = $$val_escape(4)
|
||||
|
||||
!isEmpty(config.output.$${output}.assign.$${name}): \
|
||||
defined($${currentConfig}.output.$${output}.assign.$${name}, var): \
|
||||
error("Trying to overwrite assigned variable '$$name' in '$$output' using modifier '$$modifier'.")
|
||||
|
||||
equals(modifier, assign) {
|
||||
!isEmpty(config.output.$${output}.append.$${name})|!isEmpty(config.output.$${output}.remove.$${name}): \
|
||||
!isEmpty($${currentConfig}.output.$${output}.append.$${name})|!isEmpty($${currentConfig}.output.$${output}.remove.$${name}): \
|
||||
error("Trying to assign variable '$$name' in '$$output', which has already appended or removed parts.")
|
||||
config.output.$${output}.assign.$${name} = $$value
|
||||
$${currentConfig}.output.$${output}.assign.$${name} = $$value
|
||||
} else: equals(modifier, append) {
|
||||
contains(config.output.$${output}.remove.$${name}, $$value): \
|
||||
contains($${currentConfig}.output.$${output}.remove.$${name}, $$value): \
|
||||
error("Trying to append removed '$$value' to variable '$$name' in '$$output'.")
|
||||
config.output.$${output}.append.$${name} += $$value
|
||||
$${currentConfig}.output.$${output}.append.$${name} += $$value
|
||||
} else: equals(modifier, remove) {
|
||||
contains(config.output.$${output}.append.$${name}, $$value): \
|
||||
contains($${currentConfig}.output.$${output}.append.$${name}, $$value): \
|
||||
error("Trying to remove appended '$$value' to variable '$$name' in '$$output'.")
|
||||
config.output.$${output}.remove.$${name} += $$value
|
||||
$${currentConfig}.output.$${output}.remove.$${name} += $$value
|
||||
} else {
|
||||
error("Invalid modifier '$$modifier' passed to qtConfOutputVar.")
|
||||
}
|
||||
config.output.$${output}.$${modifier}._KEYS_ *= $${name}
|
||||
export(config.output.$${output}.$${modifier}.$${name})
|
||||
export(config.output.$${output}.$${modifier}._KEYS_)
|
||||
$${currentConfig}.output.$${output}.$${modifier}._KEYS_ *= $${name}
|
||||
export($${currentConfig}.output.$${output}.$${modifier}.$${name})
|
||||
export($${currentConfig}.output.$${output}.$${modifier}._KEYS_)
|
||||
}
|
||||
|
||||
# qtConfExtendVar(output, name, value)
|
||||
defineTest(qtConfExtendVar) {
|
||||
output = $$1
|
||||
name = $$2
|
||||
value = $$val_escape(3)
|
||||
|
||||
!defined($${currentConfig}.output.$${output}.assign.$${name}, var): \
|
||||
error("Trying to extend undefined variable '$$name' in '$$output'.")
|
||||
|
||||
$${currentConfig}.output.$${output}.assign.$${name} += $$value
|
||||
export($${currentConfig}.output.$${output}.assign.$${name})
|
||||
}
|
||||
|
||||
defineTest(qtConfOutputVarHelper) {
|
||||
!isEmpty($${2}.public):$$eval($${2}.public) {
|
||||
output = "publicPro"
|
||||
} else {
|
||||
output = "privatePro"
|
||||
}
|
||||
|
||||
negative = $$eval($${2}.negative)
|
||||
isEmpty(negative): negative = false
|
||||
equals(3, $$negative): return()
|
||||
|
||||
output = $$qtConfOutputSelectProFile($${2})
|
||||
name = $$eval($${2}.name)
|
||||
isEmpty(name): \
|
||||
error("Output type 'var$$title($$1)' used in feature '$$eval($${2}.feature)' without a 'name' entry.")
|
||||
@ -1374,6 +1424,8 @@ defineTest(qtConfOutputVarHelper) {
|
||||
!isEmpty($${2}.eval):$$qtConfEvaluate($$eval($${2}.eval)): \
|
||||
eval(value = $$value)
|
||||
qtConfOutputVar($$1, $$output, $$name, $$value)
|
||||
equals(output, "publicPro"):!isEmpty($${currentConfig}.module): \
|
||||
qtConfExtendVar($$output, "QT.$${currentModule}.exports", $$name)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_varAssign) {
|
||||
@ -1391,6 +1443,8 @@ defineTest(qtConfOutput_varRemove) {
|
||||
defineTest(qtConfOutputConfigVar) {
|
||||
pro = $$3
|
||||
var = $$4
|
||||
modular = $$5
|
||||
|
||||
negative = $$eval($${1}.negative)
|
||||
isEmpty(negative): negative = false
|
||||
equals(2, $$negative): return()
|
||||
@ -1401,26 +1455,31 @@ defineTest(qtConfOutputConfigVar) {
|
||||
$$negative: val = no-$$val
|
||||
}
|
||||
|
||||
qtConfOutputVar(append, $$pro, $$var, $$val)
|
||||
isEmpty($${currentConfig}.module)|!$$modular: \
|
||||
qtConfOutputVar(append, $$pro, $$var, $$val)
|
||||
else: \
|
||||
qtConfExtendVar($$pro, "QT.$${currentModule}.$$var", $$val)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_publicQtConfig) {
|
||||
qtConfOutputConfigVar($$1, $$2, "publicPro", "QT_CONFIG")
|
||||
qtConfOutputConfigVar($$1, $$2, "publicPro", "QT_CONFIG", true)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_publicConfig) {
|
||||
qtConfOutputConfigVar($$1, $$2, "publicPro", "CONFIG")
|
||||
!isEmpty($${currentConfig}.module): \
|
||||
error("Cannot use output type 'publicConfig' in module-local feature '$$eval($${1}.feature)'.")
|
||||
qtConfOutputConfigVar($$1, $$2, "publicPro", "CONFIG", false)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_privateConfig) {
|
||||
qtConfOutputConfigVar($$1, $$2, "privatePro", "CONFIG")
|
||||
qtConfOutputConfigVar($$1, $$2, "privatePro", "CONFIG", false)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutputSetDefine) {
|
||||
config.output.$${1}.$${2} = $${3}
|
||||
config.output.$${1}._KEYS_ *= $${2}
|
||||
export(config.output.$${1}.$${2})
|
||||
export(config.output.$${1}._KEYS_)
|
||||
$${currentConfig}.output.$${1}.$${2} = $${3}
|
||||
$${currentConfig}.output.$${1}._KEYS_ *= $${2}
|
||||
export($${currentConfig}.output.$${1}.$${2})
|
||||
export($${currentConfig}.output.$${1}._KEYS_)
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_define) {
|
||||
@ -1443,13 +1502,35 @@ defineTest(qtConfOutput_feature) {
|
||||
name = $$eval($${1}.feature)
|
||||
|
||||
$${2} {
|
||||
qtConfOutputVar(append, "publicPro", "QT_CONFIG", $$name)
|
||||
isEmpty($${currentConfig}.module): \
|
||||
qtConfOutputVar(append, "publicPro", "QT_CONFIG", $$name)
|
||||
else: \
|
||||
qtConfExtendVar("publicPro", "QT.$${currentModule}.QT_CONFIG", $$name)
|
||||
} else {
|
||||
f = $$upper($$replace(name, -, _))
|
||||
qtConfOutputSetDefine("publicHeader", "QT_NO_$$f")
|
||||
}
|
||||
}
|
||||
|
||||
defineTest(qtConfSetModuleName) {
|
||||
currentModule = $$eval($${currentConfig}.module)
|
||||
isEmpty(currentModule): \
|
||||
currentModule = global
|
||||
export(currentModule)
|
||||
}
|
||||
|
||||
defineTest(qtConfSetupModuleOutputs) {
|
||||
qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.enabled_features", )
|
||||
qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.disabled_features", )
|
||||
qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}_private.enabled_features", )
|
||||
qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}_private.disabled_features", )
|
||||
!isEmpty($${currentConfig}.module) {
|
||||
qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.QT_CONFIG", )
|
||||
qtConfOutputVar(assign, "publicPro", "QT.$${currentModule}.exports", )
|
||||
qtConfOutputVar(assign, "privatePro", "QT.$${currentModule}_private.libraries", )
|
||||
}
|
||||
}
|
||||
|
||||
defineTest(qtConfOutput_publicFeature) {
|
||||
name = "$$eval($${1}.name)"
|
||||
isEmpty(name): \
|
||||
@ -1457,10 +1538,14 @@ defineTest(qtConfOutput_publicFeature) {
|
||||
feature = $$replace(name, [-+.], _)
|
||||
|
||||
$${2} {
|
||||
qtConfOutputVar(append, "publicPro", "QT.global.enabled_features", $$name)
|
||||
qtConfExtendVar("publicPro", "QT.$${currentModule}.enabled_features", $$name)
|
||||
QT.$${currentModule}.enabled_features += $$name
|
||||
export(QT.$${currentModule}.enabled_features)
|
||||
qtConfOutputSetDefine("publicHeader", "QT_FEATURE_$$feature", 1)
|
||||
} else {
|
||||
qtConfOutputVar(append, "publicPro", "QT.global.disabled_features", $$name)
|
||||
qtConfExtendVar("publicPro", "QT.$${currentModule}.disabled_features", $$name)
|
||||
QT.$${currentModule}.disabled_features += $$name
|
||||
export(QT.$${currentModule}.disabled_features)
|
||||
qtConfOutputSetDefine("publicHeader", "QT_FEATURE_$$feature", -1)
|
||||
}
|
||||
}
|
||||
@ -1475,17 +1560,21 @@ defineTest(qtConfOutput_privateFeature) {
|
||||
feature = $$replace(name, [-+.], _)
|
||||
|
||||
$${2} {
|
||||
qtConfOutputVar(append, "privatePro", "QT.global.enabled_features", $$name)
|
||||
qtConfExtendVar("privatePro", "QT.$${currentModule}_private.enabled_features", $$name)
|
||||
QT.$${currentModule}_private.enabled_features += $$name
|
||||
export(QT.$${currentModule}_private.enabled_features)
|
||||
qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", 1)
|
||||
} else {
|
||||
qtConfOutputVar(append, "privatePro", "QT.global.disabled_features", $$name)
|
||||
qtConfExtendVar("privatePro", "QT.$${currentModule}_private.disabled_features", $$name)
|
||||
QT.$${currentModule}_private.disabled_features += $$name
|
||||
export(QT.$${currentModule}_private.disabled_features)
|
||||
qtConfOutputSetDefine("privateHeader", "QT_FEATURE_$$feature", -1)
|
||||
}
|
||||
}
|
||||
|
||||
defineTest(qtConfProcessOneOutput) {
|
||||
feature = $${1}
|
||||
fpfx = config.features.$${feature}
|
||||
fpfx = $${currentConfig}.features.$${feature}
|
||||
opfx = $${fpfx}.output.$${2}
|
||||
|
||||
condition = $$eval($${opfx}.condition)
|
||||
@ -1511,64 +1600,167 @@ defineTest(qtConfProcessOneOutput) {
|
||||
}
|
||||
|
||||
defineTest(qtConfProcessOutput) {
|
||||
!contains($${currentConfig}._KEYS_, "features"): \
|
||||
return()
|
||||
|
||||
basedir = $$shadowed($$eval($${currentConfig}.dir))
|
||||
module = $$eval($${currentConfig}.module)
|
||||
|
||||
# write it to the output files
|
||||
for (type, config.files._KEYS_) {
|
||||
file = $$OUT_PWD/$$eval(config.files.$${type})
|
||||
isEmpty($${currentConfig}.files._KEYS_) {
|
||||
# set defaults that should work for most Qt modules
|
||||
isEmpty(module): \
|
||||
error("Neither module nor files section specified in configuration file.")
|
||||
|
||||
$${currentConfig}.files._KEYS_ = publicPro privatePro publicHeader privateHeader
|
||||
$${currentConfig}.files.publicPro = qt$${module}-config.pri
|
||||
$${currentConfig}.files.privatePro = qt$${module}-config.pri # sic!
|
||||
$${currentConfig}.files.publicHeader = qt$${module}-config.h
|
||||
$${currentConfig}.files.privateHeader = qt$${module}-config_p.h
|
||||
}
|
||||
|
||||
for (type, $${currentConfig}.files._KEYS_) {
|
||||
contains(type, ".*Pro") {
|
||||
for (k, config.output.$${type}.assign._KEYS_): \
|
||||
config.output.$$type += "$$k = $$eval(config.output.$${type}.assign.$$k)"
|
||||
for (k, config.output.$${type}.remove._KEYS_): \
|
||||
config.output.$$type += "$$k -= $$eval(config.output.$${type}.remove.$$k)"
|
||||
for (k, config.output.$${type}.append._KEYS_): \
|
||||
config.output.$$type += "$$k += $$eval(config.output.$${type}.append.$$k)"
|
||||
for (k, $${currentConfig}.output.$${type}.assign._KEYS_): \
|
||||
$${currentConfig}.output.$$type += "$$k = $$eval($${currentConfig}.output.$${type}.assign.$$k)"
|
||||
for (k, $${currentConfig}.output.$${type}.remove._KEYS_): \
|
||||
$${currentConfig}.output.$$type += "$$k -= $$eval($${currentConfig}.output.$${type}.remove.$$k)"
|
||||
for (k, $${currentConfig}.output.$${type}.append._KEYS_): \
|
||||
$${currentConfig}.output.$$type += "$$k += $$eval($${currentConfig}.output.$${type}.append.$$k)"
|
||||
} else {
|
||||
for (define, config.output.$${type}._KEYS_) {
|
||||
value = $$eval(config.output.$${type}.$${define})
|
||||
config.output.$$type += "$${LITERAL_HASH}define $$define $$value"
|
||||
for (define, $${currentConfig}.output.$${type}._KEYS_) {
|
||||
value = $$eval($${currentConfig}.output.$${type}.$${define})
|
||||
$${currentConfig}.output.$$type += "$${LITERAL_HASH}define $$define $$value"
|
||||
}
|
||||
}
|
||||
defined(qtConfOutputPostProcess_$${type}, test): \
|
||||
qtConfOutputPostProcess_$${type}()
|
||||
|
||||
write_file($$file, config.output.$${type})|error()
|
||||
ppScope =
|
||||
!isEmpty(module): ppScope = $${module}_
|
||||
defined(qtConfOutputPostProcess_$${ppScope}$${type}, test): \
|
||||
qtConfOutputPostProcess_$${ppScope}$${type}()
|
||||
|
||||
file = $$eval($${currentConfig}.files.$${type})
|
||||
fileCont.$$file += $$eval($${currentConfig}.output.$${type})
|
||||
fileCont._KEYS_ *= $$file
|
||||
}
|
||||
|
||||
for (file, fileCont._KEYS_): \
|
||||
write_file($$basedir/$$file, fileCont.$$file)|error()
|
||||
}
|
||||
|
||||
#
|
||||
# tie it all together
|
||||
#
|
||||
|
||||
defineTest(qtConfigure) {
|
||||
cfgs =
|
||||
isEmpty(_QMAKE_SUPER_CACHE_)|equals(OUT_PWD, $$dirname(_QMAKE_SUPER_CACHE_)) {
|
||||
c = $$basename(_PRO_FILE_PWD_)
|
||||
config.$${c}.dir = $$_PRO_FILE_PWD_
|
||||
cfgs += $$c
|
||||
!isEmpty(_QMAKE_SUPER_CACHE_) {
|
||||
for (s, SUBDIRS) {
|
||||
config.$${s}.dir = $$_PRO_FILE_PWD_/$${s}
|
||||
cfgs += $$s
|
||||
}
|
||||
}
|
||||
}
|
||||
configsToProcess =
|
||||
for (c, cfgs) {
|
||||
s = $$eval(config.$${c}.dir)
|
||||
exists($$s/configure.json): \
|
||||
configsToProcess += $$c
|
||||
}
|
||||
isEmpty(configsToProcess): \
|
||||
return()
|
||||
|
||||
load(configure_base)
|
||||
|
||||
QMAKE_POST_CONFIGURE =
|
||||
allConfigs =
|
||||
for(ever) {
|
||||
isEmpty(configsToProcess): \
|
||||
break()
|
||||
|
||||
currentConfig = config.$$take_first(configsToProcess)
|
||||
thisDir = $$eval($${currentConfig}.dir)
|
||||
jsonFile = $$thisDir/configure.json
|
||||
priFile = $$thisDir/configure.pri
|
||||
|
||||
allConfigs += $$currentConfig
|
||||
|
||||
# load configuration data
|
||||
configure_data = $$cat($${1}, blob)
|
||||
!parseJson(configure_data, config): \
|
||||
error("Invalid or non-existent file $${1}.")
|
||||
configure_data = $$cat($$jsonFile, blob)
|
||||
!parseJson(configure_data, $$currentConfig): \
|
||||
error("Invalid or non-existent file $${jsonFile}.")
|
||||
exists($$priFile): \
|
||||
!include($$priFile): error()
|
||||
|
||||
# prepend all subconfigs to files to keep a depth first search order
|
||||
subconfigs =
|
||||
for(n, $${currentConfig}.subconfigs._KEYS_) {
|
||||
subconfig = $$eval($${currentConfig}.subconfigs.$${n})
|
||||
name = $$basename(subconfig)
|
||||
config.$${name}.dir = $$thisDir/$$subconfig
|
||||
subconfigs += $$name
|
||||
}
|
||||
configsToProcess = $$subconfigs $$configsToProcess
|
||||
}
|
||||
|
||||
for (currentConfig, allConfigs): \
|
||||
qtConfSetupLibraries()
|
||||
qtConfSetupTestTypeDeps()
|
||||
|
||||
qtConfParseCommandLine()
|
||||
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
||||
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
|
||||
else: \
|
||||
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
|
||||
QMAKE_CONFIG_CACHE_USE = all
|
||||
|
||||
!equals(QMAKE_CONFIG_CACHE_USE, none) {
|
||||
include($$QMAKE_CONFIG_CACHE, , true)
|
||||
# this crudely determines when to discard the cache. this also catches the case
|
||||
# of no cache being there in the first place.
|
||||
!equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]): \
|
||||
QMAKE_CONFIG_CACHE_USE = none
|
||||
}
|
||||
equals(QMAKE_CONFIG_CACHE_USE, none) {
|
||||
cont = \
|
||||
"cache.platform = $$[QMAKE_SPEC]" \
|
||||
"cache.xplatform = $$[QMAKE_XSPEC]"
|
||||
write_file($$QMAKE_CONFIG_CACHE, cont)
|
||||
}
|
||||
qtConfParseCommandLine()
|
||||
|
||||
!equals(QMAKE_CONFIG_CACHE_USE, none) {
|
||||
include($$QMAKE_CONFIG_CACHE, , true)
|
||||
# this crudely determines when to discard the cache. this also catches the case
|
||||
# of no cache being there in the first place.
|
||||
!equals(cache.platform, $$[QMAKE_SPEC])|!equals(cache.xplatform, $$[QMAKE_XSPEC]): \
|
||||
QMAKE_CONFIG_CACHE_USE = none
|
||||
}
|
||||
equals(QMAKE_CONFIG_CACHE_USE, none) {
|
||||
cont = \
|
||||
"cache.platform = $$[QMAKE_SPEC]" \
|
||||
"cache.xplatform = $$[QMAKE_XSPEC]"
|
||||
write_file($$QMAKE_CONFIG_CACHE, cont)
|
||||
}
|
||||
|
||||
for (currentConfig, allConfigs) {
|
||||
qtConfSetModuleName()
|
||||
qtConfSetupModuleOutputs()
|
||||
# do early checks, mainly to validate the command line
|
||||
qtConfProcessEarlyChecks()
|
||||
}
|
||||
qtConfCheckErrors()
|
||||
|
||||
CONFIG += qt_conf_tests_allowed
|
||||
logn()
|
||||
logn("Running configuration tests...")
|
||||
CONFIG += qt_conf_tests_allowed
|
||||
logn()
|
||||
logn("Running configuration tests...")
|
||||
|
||||
for (currentConfig, allConfigs) {
|
||||
tdir = $$eval($${currentConfig}.testDir)
|
||||
isEmpty(tdir): tdir = config.tests
|
||||
QMAKE_CONFIG_TESTS_DIR = $$absolute_path($$tdir, $$eval($${currentConfig}.dir))
|
||||
|
||||
qtConfSetModuleName()
|
||||
|
||||
qtConfSetupTestTypeDeps()
|
||||
|
||||
# correctly setup dependencies
|
||||
QMAKE_CONFIG_DEPS = global global_private
|
||||
!isEmpty($${currentConfig}.module) {
|
||||
for (d, $${currentConfig}.depends._KEYS_) {
|
||||
dep = $$replace($${currentConfig}.depends.$$d, -private$, _private)
|
||||
dep *= $$replace(dep, _private$, )
|
||||
QMAKE_CONFIG_DEPS += $$dep
|
||||
}
|
||||
}
|
||||
|
||||
# process all features
|
||||
qtConfProcessFeatures()
|
||||
@ -1577,14 +1769,15 @@ defineTest(qtConfigure) {
|
||||
qtConfProcessOutput()
|
||||
qtConfCreateReport()
|
||||
qtConfCreateSummary()
|
||||
|
||||
logn("Done running configuration tests.")
|
||||
logn()
|
||||
}
|
||||
|
||||
qtConfigure($$_PRO_FILE_PWD_/configure.json)
|
||||
# these come from the pri files loaded above.
|
||||
for (p, QMAKE_POST_CONFIGURE): \
|
||||
eval($$p)
|
||||
|
||||
logn("Done running configuration tests.")
|
||||
logn()
|
||||
|
||||
logn("Configure summary:")
|
||||
logn()
|
||||
|
||||
qtConfPrintReport()
|
||||
|
@ -1,10 +1,6 @@
|
||||
|
||||
defineReplace(qtPlatformTargetSuffix) {
|
||||
uikit:CONFIG(simulator, simulator|device): \
|
||||
suffix = _$${simulator.sdk}
|
||||
else: \
|
||||
suffix =
|
||||
|
||||
suffix =
|
||||
CONFIG(debug, debug|release) {
|
||||
!debug_and_release|build_pass {
|
||||
mac: return($${suffix}_debug)
|
||||
@ -306,10 +302,16 @@ defineTest(prepareRecursiveTarget) {
|
||||
}
|
||||
|
||||
defineTest(qtConfig) {
|
||||
contains(QT.global.enabled_features, $$1): \
|
||||
return(true)
|
||||
contains(QT.global.disabled_features, $$1): \
|
||||
return(false)
|
||||
|
||||
modules = $$QT $$QT_PRIVATE $$QT_FOR_CONFIG
|
||||
modules ~= s,-private$,_private,g
|
||||
modules = $$resolve_depends(modules, "QT.", ".depends")
|
||||
modules += global global_private
|
||||
modules = $$reverse(modules)
|
||||
for (module, modules) {
|
||||
contains(QT.$${module}.enabled_features, $$1): \
|
||||
return(true)
|
||||
contains(QT.$${module}.disabled_features, $$1): \
|
||||
return(false)
|
||||
}
|
||||
error("Could not find feature $${1}.")
|
||||
}
|
||||
|
@ -119,8 +119,7 @@ lib_bundle {
|
||||
QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.lib
|
||||
}
|
||||
!build_all| \
|
||||
if(if(!debug_and_release|CONFIG(release, debug|release)): \
|
||||
if(!simulator_and_device|CONFIG(device, simulator|device))) {
|
||||
if(if(!debug_and_release|CONFIG(release, debug|release))) {
|
||||
FRAMEWORK_HEADERS.version = Versions
|
||||
FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES
|
||||
FRAMEWORK_HEADERS.path = Headers
|
||||
|
@ -106,6 +106,16 @@ alien_syncqt: return()
|
||||
|
||||
MODULE_INC_OUTDIR = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME
|
||||
|
||||
exists($$OUT_PWD/qt$${MODULE}-config.h) {
|
||||
fwd_rel = $$relative_path($$OUT_PWD, $$MODULE_INC_OUTDIR)
|
||||
SYNCQT.INJECTIONS += \
|
||||
$$fwd_rel/qt$${MODULE}-config.h:qt$${MODULE}-config.h \
|
||||
$$fwd_rel/qt$${MODULE}-config_p.h:$$MODULE_VERSION/$$MODULE_INCNAME/private/qt$${MODULE}-config_p.h
|
||||
inst_rel = $$relative_path($$OUT_PWD, $$_PRO_FILE_PWD_)
|
||||
SYNCQT.HEADER_FILES += $$inst_rel/qt$${MODULE}-config.h
|
||||
SYNCQT.PRIVATE_HEADER_FILES += $$inst_rel/qt$${MODULE}-config_p.h
|
||||
}
|
||||
|
||||
for (injection, SYNCQT.INJECTIONS) {
|
||||
injects = $$split(injection, :)
|
||||
dst_hdr = $$absolute_path($$member(injects, 0), $$MODULE_INC_OUTDIR)
|
||||
|
@ -35,6 +35,41 @@ else: \
|
||||
MODULE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE_ID}.pri
|
||||
MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
|
||||
|
||||
exists($$OUT_PWD/qt$${MODULE}-config.pri): \
|
||||
include($$OUT_PWD/qt$${MODULE}-config.pri)
|
||||
|
||||
defineReplace(qtGetFeaturesForModule) {
|
||||
enabled = $$unique(QT.$${1}.enabled_features)
|
||||
disabled = $$unique(QT.$${1}.disabled_features)
|
||||
result = \
|
||||
"QT.$${1}.enabled_features =$$join(enabled, " ", " ")" \
|
||||
"QT.$${1}.disabled_features =$$join(disabled, " ", " ")"
|
||||
return($$result)
|
||||
}
|
||||
|
||||
defineReplace(qtGetExportsForModule) {
|
||||
result =
|
||||
for (var, QT.$${1}.exports): \
|
||||
result += "$$var = $$val_escape($$var)"
|
||||
return($$result)
|
||||
}
|
||||
|
||||
defineReplace(qtExportLibsForModule) {
|
||||
result =
|
||||
for (lib, QT.$${1}.libraries) {
|
||||
NAME = $$upper($$lib)
|
||||
vars = \
|
||||
QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \
|
||||
QMAKE_CFLAGS_$$NAME QMAKE_INCDIR_$$NAME QMAKE_$${NAME}_VERSION \
|
||||
QMAKE_$${NAME}_VERSION_MAJOR QMAKE_$${NAME}_VERSION_MINOR QMAKE_$${NAME}_VERSION_PATCH
|
||||
for (var, vars) {
|
||||
!isEmpty($$var): \
|
||||
result += "$$var = $$val_escape($$var)"
|
||||
}
|
||||
}
|
||||
return($$result)
|
||||
}
|
||||
|
||||
!build_pass {
|
||||
|
||||
# Create a module .pri file
|
||||
@ -102,6 +137,9 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
|
||||
"QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \
|
||||
$$module_config \
|
||||
"QT.$${MODULE_ID}.DEFINES = $$val_escape(MODULE_DEFINES)" \
|
||||
$$qtGetFeaturesForModule($$MODULE_ID) \
|
||||
$$qtGetExportsForModule($$MODULE_ID) \
|
||||
"QT_CONFIG +=$$join(QT.$${MODULE_ID}.QT_CONFIG, " ", " ")" \
|
||||
"" \
|
||||
"QT_MODULES += $$MODULE"
|
||||
winrt: MODULE_PRI_CONT += \
|
||||
@ -126,7 +164,10 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
|
||||
"QT.$${MODULE}_private.includes = $$MODULE_PRIVATE_INCLUDES" \
|
||||
"QT.$${MODULE}_private.frameworks =" \
|
||||
"QT.$${MODULE}_private.depends = $$private_deps" \
|
||||
"QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")"
|
||||
"QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")" \
|
||||
$$qtGetFeaturesForModule($${MODULE}_private) \
|
||||
"" \
|
||||
$$qtExportLibsForModule($${MODULE}_private)
|
||||
write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error()
|
||||
}
|
||||
MODULE_PRI_FILES = $$MODULE_PRI $$MODULE_PRIVATE_PRI
|
||||
|
@ -12,6 +12,8 @@
|
||||
# Ensure that each module has a .qmake.cache when properly qmake'd.
|
||||
cache()
|
||||
|
||||
load(qt_configure)
|
||||
|
||||
load(qt_build_config)
|
||||
|
||||
TEMPLATE = subdirs
|
||||
@ -74,6 +76,7 @@ QT_BUILD_PARTS -= libs tools examples tests
|
||||
|
||||
QMAKE_DISTCLEAN += \
|
||||
.qmake.cache \
|
||||
config.cache \
|
||||
config.log \
|
||||
mkspecs/modules/*.pri \
|
||||
mkspecs/modules-inst/*.pri
|
||||
|
@ -181,6 +181,11 @@ isEmpty(BUILDS)|build_pass {
|
||||
|
||||
builtin_testdata {
|
||||
ALL_TESTDATA = $$TESTDATA $$GENERATED_TESTDATA
|
||||
|
||||
# BLACKLIST needs to be added to the testdata
|
||||
BLACKLISTPATH = $$_PRO_FILE_PWD_/BLACKLIST
|
||||
exists($$BLACKLISTPATH): ALL_TESTDATA *= $$BLACKLISTPATH
|
||||
|
||||
# RESOURCES does not support wildcards (for good reasons)
|
||||
for(td, ALL_TESTDATA): \
|
||||
testdata.files += $$files($$absolute_path($$td, $$_PRO_FILE_PWD_))
|
||||
|
@ -19,10 +19,13 @@ equals(TEMPLATE, app):qt {
|
||||
load(default_post)
|
||||
|
||||
macx-xcode {
|
||||
ios:isEmpty(QMAKE_APPLE_TARGETED_DEVICE_FAMILY):!isEmpty(QMAKE_IOS_TARGETED_DEVICE_FAMILY) {
|
||||
warning("QMAKE_IOS_TARGETED_DEVICE_FAMILY is deprecated; use QMAKE_APPLE_TARGETED_DEVICE_FAMILY")
|
||||
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
|
||||
}
|
||||
|
||||
device_family.name = TARGETED_DEVICE_FAMILY
|
||||
ios: device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
|
||||
tvos: device_family.value = $$QMAKE_TVOS_TARGETED_DEVICE_FAMILY
|
||||
watchos: device_family.value = $$QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY
|
||||
device_family.value = $$QMAKE_APPLE_TARGETED_DEVICE_FAMILY
|
||||
QMAKE_MAC_XCODE_SETTINGS += device_family
|
||||
|
||||
ios {
|
||||
@ -68,21 +71,10 @@ macx-xcode {
|
||||
macx-xcode {
|
||||
arch_device.name = "ARCHS[sdk=$${device.sdk}*]"
|
||||
arch_simulator.name = "ARCHS[sdk=$${simulator.sdk}*]"
|
||||
ios {
|
||||
arch_device.value = $$QMAKE_IOS_DEVICE_ARCHS
|
||||
arch_simulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS
|
||||
QMAKE_XCODE_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS $$QMAKE_IOS_SIMULATOR_ARCHS
|
||||
}
|
||||
tvos {
|
||||
arch_device.value = $$QMAKE_TVOS_DEVICE_ARCHS
|
||||
arch_simulator.value = $$QMAKE_TVOS_SIMULATOR_ARCHS
|
||||
QMAKE_XCODE_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS $$QMAKE_TVOS_SIMULATOR_ARCHS
|
||||
}
|
||||
watchos {
|
||||
arch_device.value = $$QMAKE_WATCHOS_DEVICE_ARCHS
|
||||
arch_simulator.value = $$QMAKE_WATCHOS_SIMULATOR_ARCHS
|
||||
QMAKE_XCODE_ARCHS = $$QMAKE_WATCHOS_DEVICE_ARCHS $$QMAKE_WATCHOS_SIMULATOR_ARCHS
|
||||
}
|
||||
|
||||
arch_device.value = $$QMAKE_APPLE_DEVICE_ARCHS
|
||||
arch_simulator.value = $$QMAKE_APPLE_SIMULATOR_ARCHS
|
||||
QMAKE_XCODE_ARCHS = $$QMAKE_APPLE_DEVICE_ARCHS $$QMAKE_APPLE_SIMULATOR_ARCHS
|
||||
|
||||
QMAKE_MAC_XCODE_SETTINGS += arch_device arch_simulator
|
||||
|
||||
@ -91,16 +83,9 @@ macx-xcode {
|
||||
only_active_arch.build = debug
|
||||
QMAKE_MAC_XCODE_SETTINGS += only_active_arch
|
||||
} else {
|
||||
# Be more specific about which architecture we're targeting
|
||||
contains(QT_ARCH, arm.*) {
|
||||
ios: VALID_ARCHS = $$QMAKE_IOS_DEVICE_ARCHS
|
||||
tvos: VALID_ARCHS = $$QMAKE_TVOS_DEVICE_ARCHS
|
||||
watchos: VALID_ARCHS = $$QMAKE_WATCHOS_DEVICE_ARCHS
|
||||
} else {
|
||||
ios: VALID_ARCHS = $$QMAKE_IOS_SIMULATOR_ARCHS
|
||||
tvos: VALID_ARCHS = $$QMAKE_TVOS_SIMULATOR_ARCHS
|
||||
watchos: VALID_ARCHS = $$QMAKE_WATCHOS_SIMULATOR_ARCHS
|
||||
}
|
||||
VALID_ARCHS =
|
||||
!simulator|simulator_and_device: VALID_ARCHS += $$QMAKE_APPLE_DEVICE_ARCHS
|
||||
simulator: VALID_ARCHS += $$QMAKE_APPLE_SIMULATOR_ARCHS
|
||||
|
||||
single_arch: VALID_ARCHS = $$first(VALID_ARCHS)
|
||||
|
||||
@ -114,4 +99,6 @@ macx-xcode {
|
||||
QMAKE_CFLAGS += $$arch_flags
|
||||
QMAKE_CXXFLAGS += $$arch_flags
|
||||
QMAKE_LFLAGS += $$arch_flags
|
||||
|
||||
QMAKE_PCH_ARCHS = $$VALID_ARCHS
|
||||
}
|
||||
|
@ -1,31 +1,22 @@
|
||||
|
||||
load(default_pre)
|
||||
|
||||
# In case Qt was built for a specific SDK
|
||||
!isEmpty(QT_VERSION):!qtConfig(simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
|
||||
CONFIG += simulator $${simulator.sdk}
|
||||
!isEmpty(QT_VERSION) {
|
||||
qtConfig(simulator_and_device)|contains(QMAKE_MAC_SDK, ^$${device.sdk}.*): \
|
||||
CONFIG += device $${device.sdk}
|
||||
qtConfig(simulator_and_device)|contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
|
||||
CONFIG += simulator $${simulator.sdk}
|
||||
|
||||
qtConfig(simulator_and_device) {
|
||||
# For a simulator_and_device build all the config tests
|
||||
# are based on the device's ARM SDK, but we know that the simulator
|
||||
# is Intel and that we support SSE/SSE2.
|
||||
QT_CPU_FEATURES.$$QT_ARCH += sse sse2
|
||||
CONFIG += sse sse2
|
||||
DEFINES += QT_COMPILER_SUPPORTS_SSE2
|
||||
}
|
||||
}
|
||||
|
||||
# Check for supported Xcode versions
|
||||
lessThan(QMAKE_XCODE_VERSION, "4.3"): \
|
||||
error("This mkspec requires Xcode 4.3 or later")
|
||||
|
||||
build_pass:simulator {
|
||||
# For a simulator_and_device build all the config tests
|
||||
# are based on the iPhoneOS/WatchOS ARM SDK, but we know that the simulator
|
||||
# is i386 and that we support SSE/SSE2.
|
||||
QT_ARCH = i386
|
||||
QT_CPU_FEATURES.i386 = sse sse2
|
||||
DEFINES += QT_COMPILER_SUPPORTS_SSE2
|
||||
CONFIG -= neon
|
||||
CONFIG += sse sse2
|
||||
}
|
||||
build_pass:appletvsimulator {
|
||||
# For a simulator_and_device build all the config tests
|
||||
# are based on the AppleTVOS ARM SDK, but we know that the simulator
|
||||
# is x64 and that we support SSE/SSE2.
|
||||
QT_ARCH = x64
|
||||
QT_CPU_FEATURES.x64 = sse sse2
|
||||
DEFINES += QT_COMPILER_SUPPORTS_SSE2
|
||||
CONFIG -= neon
|
||||
CONFIG += sse sse2
|
||||
}
|
||||
|
@ -1,68 +1,11 @@
|
||||
|
||||
xcodebuild {
|
||||
# Xcode project files always support both Debug and Release configurations
|
||||
# and iOS device and simulator targets, so we make sure the wrapper-makefile
|
||||
# and device and simulator targets, so we make sure the wrapper-makefile
|
||||
# also does.
|
||||
CONFIG += debug_and_release simulator_and_device
|
||||
}
|
||||
|
||||
load(resolve_config)
|
||||
|
||||
# Legacy exclusive build configurations for backwards compatibility
|
||||
CONFIG($${device.CONFIG}, $${device.CONFIG}|$${simulator.CONFIG}): \
|
||||
CONFIG += device
|
||||
else: CONFIG($${simulator.CONFIG}, $${device.CONFIG}|$${simulator.CONFIG}): \
|
||||
CONFIG += simulator
|
||||
|
||||
CONFIG(simulator, simulator|device): \
|
||||
CONFIG -= device $${device.CONFIG}
|
||||
else: \
|
||||
CONFIG -= simulator $${simulator.CONFIG}
|
||||
|
||||
macx-xcode {
|
||||
# There is no way to genereate Xcode projects that are limited to either
|
||||
# simulator or device builds, so simulator_and_device is always
|
||||
# effectivly active, even if the user disabled it explicitly.
|
||||
# The Xcode generator doesn't support multiple BUILDS though (exclusive
|
||||
# builds), so we have to manually set up the simulator suffix.
|
||||
library_suffix_simulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=$${simulator.sdk}*]"
|
||||
library_suffix_simulator.value = "_$${simulator.sdk}$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})"
|
||||
QMAKE_MAC_XCODE_SETTINGS += library_suffix_simulator
|
||||
CONFIG *= xcode_dynamic_library_suffix
|
||||
} else {
|
||||
addExclusiveBuilds(simulator, device)
|
||||
}
|
||||
|
||||
equals(TEMPLATE, subdirs) {
|
||||
# Prevent recursion into host_builds
|
||||
for(subdir, SUBDIRS) {
|
||||
contains($${subdir}.CONFIG, host_build) {
|
||||
$${subdir}.CONFIG += no_$${simulator.target}_target no_$${device.target}_target
|
||||
|
||||
# Other targets which we do want to recurse into may depend on this target,
|
||||
# for example corelib depends on moc, rcc, bootstrap, etc, and other libs
|
||||
# may depend on host-tools that are needed to build the lib, so we resolve
|
||||
# the final target name and redirect it to the base target, so that the
|
||||
# dependency chain is not broken for the other targets.
|
||||
|
||||
!isEmpty($${subdir}.target) {
|
||||
target = $$eval($${subdir}.target)
|
||||
} else {
|
||||
!isEmpty($${subdir}.file): \
|
||||
file = $$eval($${subdir}.file)
|
||||
else: !isEmpty($${subdir}.subdir): \
|
||||
file = $$eval($${subdir}.subdir)
|
||||
else: \
|
||||
file = $$subdir
|
||||
|
||||
target = sub-$$file
|
||||
}
|
||||
|
||||
target ~= s,[^a-zA-Z0-9_],-,
|
||||
|
||||
$${target}-$${simulator.target}.depends = $$target
|
||||
$${target}-$${device.target}.depends = $$target
|
||||
QMAKE_EXTRA_TARGETS += $${target}-$${simulator.target} $${target}-$${device.target}
|
||||
}
|
||||
}
|
||||
}
|
||||
!macx-xcode:xcodebuild: addExclusiveBuilds(simulator, device)
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
include(../common/ghs-integrity-armv7.conf)
|
||||
|
||||
DEFINES += QT_NO_CLIPBOARD
|
||||
DEFINES += QT_STATICPLUGIN
|
||||
|
||||
QTPLUGIN.platforms += qeglfs qeglfs-viv-integration
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
include(../common/ghs-integrity-armv7.conf)
|
||||
|
||||
DEFINES += QT_NO_CLIPBOARD
|
||||
DEFINES += QT_STATICPLUGIN
|
||||
|
||||
QTPLUGIN.platforms += integrityfb
|
||||
|
@ -5,7 +5,6 @@
|
||||
include(../common/ghs-integrity-x86.conf)
|
||||
|
||||
QMAKE_CFLAGS += -cpu=Corei
|
||||
DEFINES += QT_NO_CLIPBOARD
|
||||
DEFINES += QT_STATICPLUGIN
|
||||
|
||||
QTPLUGIN.platforms += integrityfb
|
||||
|
@ -5,10 +5,10 @@
|
||||
QMAKE_IOS_DEPLOYMENT_TARGET = 7.0
|
||||
|
||||
# Universal target (iPhone and iPad)
|
||||
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2
|
||||
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2
|
||||
|
||||
QMAKE_IOS_DEVICE_ARCHS = armv7 arm64
|
||||
QMAKE_IOS_SIMULATOR_ARCHS = i386 x86_64
|
||||
QMAKE_APPLE_DEVICE_ARCHS = armv7 arm64
|
||||
QMAKE_APPLE_SIMULATOR_ARCHS = i386 x86_64
|
||||
|
||||
include(../common/ios.conf)
|
||||
include(../common/gcc-base-mac.conf)
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
QMAKE_TVOS_DEPLOYMENT_TARGET = 9.1
|
||||
|
||||
QMAKE_TVOS_TARGETED_DEVICE_FAMILY = 3
|
||||
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 3
|
||||
|
||||
QMAKE_TVOS_DEVICE_ARCHS = arm64
|
||||
QMAKE_TVOS_SIMULATOR_ARCHS = x86_64
|
||||
QMAKE_APPLE_DEVICE_ARCHS = arm64
|
||||
QMAKE_APPLE_SIMULATOR_ARCHS = x86_64
|
||||
|
||||
include(../common/tvos.conf)
|
||||
include(../common/gcc-base-mac.conf)
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
QMAKE_WATCHOS_DEPLOYMENT_TARGET = 2.2
|
||||
|
||||
QMAKE_WATCHOS_TARGETED_DEVICE_FAMILY = 4
|
||||
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 4
|
||||
|
||||
QMAKE_WATCHOS_DEVICE_ARCHS = armv7k
|
||||
QMAKE_WATCHOS_SIMULATOR_ARCHS = i386
|
||||
QMAKE_APPLE_DEVICE_ARCHS = armv7k
|
||||
QMAKE_APPLE_SIMULATOR_ARCHS = i386
|
||||
|
||||
include(../common/watchos.conf)
|
||||
include(../common/gcc-base-mac.conf)
|
||||
|
@ -2,7 +2,7 @@
|
||||
# qmake configuration for qnx aarch64le systems
|
||||
#
|
||||
|
||||
DEFINES += QT_NO_CLIPBOARD _FORTIFY_SOURCE=2
|
||||
DEFINES += _FORTIFY_SOURCE=2
|
||||
|
||||
QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now
|
||||
|
||||
|
@ -3,5 +3,3 @@
|
||||
#
|
||||
|
||||
include(../common/qcc-base-qnx-armle-v7.conf)
|
||||
|
||||
DEFINES += QT_NO_CLIPBOARD
|
||||
|
@ -2,8 +2,6 @@
|
||||
# qmake configuration for qnx x86-64 systems
|
||||
#
|
||||
|
||||
DEFINES += QT_NO_CLIPBOARD
|
||||
|
||||
QMAKE_LFLAGS_SHLIB += -Wl,-z,relro -Wl,-z,now
|
||||
|
||||
include(../common/qcc-base-qnx-x86-64.conf)
|
||||
|
@ -3,5 +3,3 @@
|
||||
#
|
||||
|
||||
include(../common/qcc-base-qnx-x86.conf)
|
||||
|
||||
DEFINES += QT_NO_CLIPBOARD
|
||||
|
@ -911,9 +911,10 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
|
||||
|
||||
debug_msg(2, "findMocs: %s", file->file.local().toLatin1().constData());
|
||||
int line_count = 1;
|
||||
bool ignore[2] = { false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET
|
||||
bool ignore[3] = { false, false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE
|
||||
/* qmake ignore Q_GADGET */
|
||||
/* qmake ignore Q_OBJECT */
|
||||
/* qmake ignore Q_NAMESPACE */
|
||||
for(int x = 0; x < buffer_len; x++) {
|
||||
#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count)
|
||||
x = SKIP_BSNL(x);
|
||||
@ -946,6 +947,12 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
|
||||
file->file.real().toLatin1().constData(), line_count);
|
||||
x += 20;
|
||||
ignore[1] = true;
|
||||
} else if (buffer_len >= (x + 23) &&
|
||||
!strncmp(buffer + x + 1, "make ignore Q_NAMESPACE", 23)) {
|
||||
debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_NAMESPACE\"",
|
||||
file->file.real().toLatin1().constData(), line_count);
|
||||
x += 23;
|
||||
ignore[2] = true;
|
||||
}
|
||||
} else if (buffer[x] == '*') {
|
||||
extralines = 0;
|
||||
@ -973,8 +980,8 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
|
||||
int morelines = 0;
|
||||
int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &morelines);
|
||||
if (buffer[y] == 'Q') {
|
||||
static const char interesting[][9] = { "Q_OBJECT", "Q_GADGET" };
|
||||
for (int interest = 0; interest < 2; ++interest) {
|
||||
static const char interesting[][12] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE"};
|
||||
for (int interest = 0; interest < 3; ++interest) {
|
||||
if (ignore[interest])
|
||||
continue;
|
||||
|
||||
|
@ -194,6 +194,18 @@ UnixMakefileGenerator::init()
|
||||
if (!language.isEmpty()) {
|
||||
pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"),
|
||||
escapeFilePath(pchBaseName + language + headerSuffix));
|
||||
const ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
|
||||
for (const ProString &arch : pchArchs) {
|
||||
QString suffix = headerSuffix;
|
||||
suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
|
||||
if (project->isActiveConfig("clang_pch_style")
|
||||
&& (suffix.endsWith(QLatin1String(".pch"))
|
||||
|| suffix.endsWith(QLatin1String(".gch")))) {
|
||||
suffix.chop(4); // must omit header suffix for -include to recognize the PCH
|
||||
}
|
||||
pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_") + arch + QLatin1Char('}'),
|
||||
escapeFilePath(pchBaseName + language + suffix));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,9 +363,17 @@ QStringList
|
||||
if (!file.endsWith(extension.toQString()))
|
||||
continue;
|
||||
|
||||
QString precompiledHeader = header_prefix + language + header_suffix;
|
||||
if (!ret.contains(precompiledHeader))
|
||||
ret += precompiledHeader;
|
||||
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
|
||||
if (pchArchs.isEmpty())
|
||||
pchArchs << ProString(); // normal single-arch PCH
|
||||
for (const ProString &arch : qAsConst(pchArchs)) {
|
||||
QString suffix = header_suffix;
|
||||
if (!arch.isEmpty())
|
||||
suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
|
||||
QString precompiledHeader = header_prefix + language + suffix;
|
||||
if (!ret.contains(precompiledHeader))
|
||||
ret += precompiledHeader;
|
||||
}
|
||||
|
||||
goto foundPrecompiledDependency;
|
||||
}
|
||||
|
@ -1021,7 +1021,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if (language.isEmpty())
|
||||
continue;
|
||||
|
||||
precomp_files += precomph_out_dir + header_prefix + language + header_suffix;
|
||||
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
|
||||
if (pchArchs.isEmpty())
|
||||
pchArchs << ProString(); // normal single-arch PCH
|
||||
for (const ProString &arch : qAsConst(pchArchs)) {
|
||||
auto suffix = header_suffix.toQString();
|
||||
if (!arch.isEmpty())
|
||||
suffix.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
|
||||
precomp_files += precomph_out_dir + header_prefix + language + suffix;
|
||||
}
|
||||
}
|
||||
}
|
||||
t << "-$(DEL_FILE) " << escapeFilePaths(precomp_files).join(' ') << "\n\t";
|
||||
@ -1077,6 +1085,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
QString pchInput = project->first("PRECOMPILED_HEADER").toQString();
|
||||
t << "###### Precompiled headers\n";
|
||||
for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) {
|
||||
QString pchOutputDir;
|
||||
QString pchFlags = var(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE"));
|
||||
if(pchFlags.isEmpty())
|
||||
continue;
|
||||
@ -1087,6 +1096,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
else
|
||||
cflags += " $(CXXFLAGS)";
|
||||
|
||||
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
|
||||
if (pchArchs.isEmpty())
|
||||
pchArchs << ProString(); // normal single-arch PCH
|
||||
ProString pchBaseName = project->first("QMAKE_ORIG_TARGET");
|
||||
ProString pchOutput;
|
||||
if(!project->isEmpty("PRECOMPILED_DIR"))
|
||||
@ -1113,30 +1125,47 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
ProString header_suffix = project->isActiveConfig("clang_pch_style")
|
||||
? project->first("QMAKE_PCH_OUTPUT_EXT") : "";
|
||||
pchOutput += Option::dir_sep;
|
||||
QString pchOutputDir = pchOutput.toQString();
|
||||
pchOutputDir = pchOutput.toQString();
|
||||
|
||||
QString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler)).toQString();
|
||||
if (language.isEmpty())
|
||||
continue;
|
||||
|
||||
pchOutput += header_prefix + language + header_suffix;
|
||||
|
||||
t << escapeDependencyPath(pchOutput) << ": " << escapeDependencyPath(pchInput) << ' '
|
||||
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
|
||||
<< "\n\t" << mkdir_p_asstring(pchOutputDir);
|
||||
}
|
||||
pchFlags.replace(QLatin1String("${QMAKE_PCH_INPUT}"), escapeFilePath(pchInput))
|
||||
.replace(QLatin1String("${QMAKE_PCH_OUTPUT_BASE}"), escapeFilePath(pchBaseName.toQString()))
|
||||
.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchOutput.toQString()));
|
||||
.replace(QLatin1String("${QMAKE_PCH_OUTPUT_BASE}"), escapeFilePath(pchBaseName.toQString()));
|
||||
for (const ProString &arch : qAsConst(pchArchs)) {
|
||||
auto pchArchOutput = pchOutput.toQString();
|
||||
if (!arch.isEmpty())
|
||||
pchArchOutput.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
|
||||
|
||||
QString compilerExecutable;
|
||||
if (compiler == "C" || compiler == "OBJC")
|
||||
compilerExecutable = "$(CC)";
|
||||
else
|
||||
compilerExecutable = "$(CXX)";
|
||||
if (!project->isActiveConfig("icc_pch_style")) {
|
||||
const auto pchFilePath_d = escapeDependencyPath(pchArchOutput);
|
||||
if (!arch.isEmpty()) {
|
||||
t << pchFilePath_d << ": " << "EXPORT_ARCH_ARGS = -arch " << arch << "\n\n";
|
||||
t << pchFilePath_d << ": "
|
||||
<< "EXPORT_QMAKE_XARCH_CFLAGS = $(EXPORT_QMAKE_XARCH_CFLAGS_" << arch << ")" << "\n\n";
|
||||
t << pchFilePath_d << ": "
|
||||
<< "EXPORT_QMAKE_XARCH_LFLAGS = $(EXPORT_QMAKE_XARCH_LFLAGS_" << arch << ")" << "\n\n";
|
||||
}
|
||||
t << pchFilePath_d << ": " << escapeDependencyPath(pchInput) << ' '
|
||||
<< escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t")
|
||||
<< "\n\t" << mkdir_p_asstring(pchOutputDir);
|
||||
}
|
||||
|
||||
// compile command
|
||||
t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchFlags << endl << endl;
|
||||
auto pchArchFlags = pchFlags;
|
||||
pchArchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchArchOutput));
|
||||
|
||||
QString compilerExecutable;
|
||||
if (compiler == "C" || compiler == "OBJC")
|
||||
compilerExecutable = "$(CC)";
|
||||
else
|
||||
compilerExecutable = "$(CXX)";
|
||||
|
||||
// compile command
|
||||
t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << endl << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include <qhash.h>
|
||||
#include <quuid.h>
|
||||
#include <stdlib.h>
|
||||
#include <qlinkedlist.h>
|
||||
|
||||
//#define DEBUG_SOLUTION_GEN
|
||||
|
||||
|
83
qtbase.pro
83
qtbase.pro
@ -24,7 +24,6 @@ DISTCLEAN_DEPS += qmake-clean
|
||||
# config.status (and configure.cache, which is the same for Windows)
|
||||
# are omitted for convenience of rebuilds.
|
||||
QMAKE_DISTCLEAN += \
|
||||
config.cache \
|
||||
config.summary \
|
||||
config.tests/.qmake.cache \
|
||||
mkspecs/qconfig.pri \
|
||||
@ -76,90 +75,10 @@ prefix_build|!equals(PWD, $$OUT_PWD) {
|
||||
|
||||
}
|
||||
|
||||
# Generate qfeatures.h
|
||||
features =
|
||||
lines = $$cat("src/corelib/global/qfeatures.txt", lines)
|
||||
for (line, lines) {
|
||||
t = $$replace(line, "^Feature: (\\S+)\\s*$", "\\1")
|
||||
!isEqual(t, $$line) {
|
||||
feature = $$t
|
||||
features += $$t
|
||||
} else {
|
||||
t = $$replace(line, "^Requires: (.*)$", "\\1")
|
||||
!isEqual(t, $$line) {
|
||||
features.$${feature}.depends = $$replace(t, \\s+$, )
|
||||
} else {
|
||||
t = $$replace(line, "^Name: (.*)$", "\\1")
|
||||
!isEqual(t, $$line) {
|
||||
features.$${feature}.name = $$replace(t, \\s+$, )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
features = $$sort_depends(features, features.)
|
||||
features = $$reverse(features)
|
||||
FEATURES_H = \
|
||||
"/*" \
|
||||
" * All feature dependencies." \
|
||||
" *" \
|
||||
" * This list is generated by qmake from <qtbase>/src/corelib/global/qfeatures.txt" \
|
||||
" */"
|
||||
FEATURES_PRI =
|
||||
for (ft, features) {
|
||||
!isEmpty(features.$${ft}.depends) {
|
||||
FEATURES_H += \
|
||||
"$${LITERAL_HASH}if !defined(QT_NO_$$ft) && ($$join($$list($$split(features.$${ft}.depends)), ") || defined(QT_NO_", "defined(QT_NO_", ")"))" \
|
||||
"$${LITERAL_HASH} define QT_NO_$$ft" \
|
||||
"$${LITERAL_HASH}endif"
|
||||
FEATURES_PRI += \
|
||||
"contains(QT_DISABLED_FEATURES, "$$lower($$join($$list($$replace(features.$${ft}.depends, _, -)), "|"))"): \\" \
|
||||
" QT_DISABLED_FEATURES += $$lower($$replace(ft, _, -))"
|
||||
}
|
||||
}
|
||||
write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error()
|
||||
# Create forwarding header
|
||||
FWD_FEATURES_H = \
|
||||
'$${LITERAL_HASH}include "../../src/corelib/global/qfeatures.h"'
|
||||
write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error()
|
||||
|
||||
no_features =
|
||||
lines = $$cat($$OUT_PWD/src/corelib/global/qconfig.h, lines)
|
||||
for (line, lines) {
|
||||
# We ignore all defines that don't follow the #ifndef + indent pattern.
|
||||
# This makes it possible to have unchecked defines which are no features.
|
||||
t = $$replace(line, "^$${LITERAL_HASH} define QT_NO_(\\S+)\\s*$", "\\1")
|
||||
!isEqual(t, $$line) {
|
||||
isEmpty(features.$${t}.name): \
|
||||
error("qconfig.h disables unknown feature $$t")
|
||||
no_features += $$t
|
||||
}
|
||||
}
|
||||
for (def, QT_NO_DEFINES) {
|
||||
!isEmpty(features.$${def}.name): \
|
||||
no_features += $$def
|
||||
}
|
||||
no_features = $$unique(no_features)
|
||||
|
||||
# Don't simply add these to QT_CONFIG, as then one might expect them to be there without load(qfeatures).
|
||||
# And we don't want to do that automatically, as the dynamic dependency resolution is somewhat expensive.
|
||||
FEATURES_PRI = \
|
||||
"$${LITERAL_HASH} Features disabled by configure:" \
|
||||
"QT_DISABLED_FEATURES =$$lower($$join($$list($$replace(no_features, _, -)), " ", " "))" \
|
||||
"$$escape_expand(\\n)$${LITERAL_HASH} Dependencies derived from <qtbase>/src/corelib/global/qfeatures.txt:" \
|
||||
$$FEATURES_PRI \
|
||||
"QT_DISABLED_FEATURES = \$\$unique(QT_DISABLED_FEATURES)"
|
||||
write_file($$OUT_PWD/mkspecs/qfeatures.pri, FEATURES_PRI)|error()
|
||||
|
||||
# Files created by us
|
||||
QMAKE_DISTCLEAN += \
|
||||
src/corelib/global/qfeatures.h \
|
||||
include/QtCore/qfeatures.h \
|
||||
mkspecs/qfeatures.pri
|
||||
|
||||
#mkspecs
|
||||
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
|
||||
mkspecs.files = \
|
||||
$$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$OUT_PWD/mkspecs/qfeatures.pri \
|
||||
$$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri \
|
||||
$$OUT_PWD/mkspecs/qdevice.pri $$OUT_PWD/mkspecs/qhost.pri \
|
||||
$$files($$PWD/mkspecs/*)
|
||||
mkspecs.files -= $$PWD/mkspecs/modules $$PWD/mkspecs/modules-inst
|
||||
|
2
src/3rdparty/freetype/freetype.pro
vendored
2
src/3rdparty/freetype/freetype.pro
vendored
@ -68,6 +68,8 @@ DEFINES += FT2_BUILD_LIBRARY
|
||||
DEFINES += FT_CONFIG_OPTION_SYSTEM_ZLIB
|
||||
include(../zlib_dependency.pri)
|
||||
|
||||
QT_FOR_CONFIG += gui-private
|
||||
include(../../gui/qtgui-config.pri)
|
||||
DEFINES += FT_CONFIG_OPTION_USE_PNG
|
||||
include($$PWD/../png_dependency.pri)
|
||||
|
||||
|
6
src/3rdparty/pcre_dependency.pri
vendored
6
src/3rdparty/pcre_dependency.pri
vendored
@ -1,7 +1,7 @@
|
||||
pcre {
|
||||
qtConfig(system-pcre) {
|
||||
QMAKE_USE_PRIVATE += pcre
|
||||
} else {
|
||||
win32: DEFINES += PCRE_STATIC
|
||||
INCLUDEPATH += $$PWD/pcre
|
||||
LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -lqtpcre$$qtPlatformTargetSuffix()
|
||||
} else {
|
||||
QMAKE_USE_PRIVATE += pcre
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
# static builds should still link ANGLE dynamically when dynamic GL is enabled
|
||||
include(../../../gui/qtgui-config.pri)
|
||||
static:qtConfig(dynamicgl) {
|
||||
CONFIG -= static
|
||||
CONFIG += shared
|
||||
|
@ -1,4 +1,5 @@
|
||||
CONFIG += static
|
||||
include(../../../../gui/qtgui-config.pri)
|
||||
qtConfig(dynamicgl): CONFIG += not_installed
|
||||
include(../../config.pri)
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
CONFIG += static
|
||||
include(../../../gui/qtgui-config.pri)
|
||||
qtConfig(dynamicgl): CONFIG += not_installed
|
||||
include(../config.pri)
|
||||
|
||||
|
611
src/corelib/configure.json
Normal file
611
src/corelib/configure.json
Normal file
@ -0,0 +1,611 @@
|
||||
{
|
||||
"module": "core",
|
||||
"testDir": "../../config.tests",
|
||||
|
||||
"commandline": {
|
||||
"options": {
|
||||
"doubleconversion": { "type": "enum", "values": [ "no", "qt", "system" ] },
|
||||
"eventfd": "boolean",
|
||||
"glib": "boolean",
|
||||
"iconv": { "type": "enum", "values": [ "no", "yes", "posix", "sun", "gnu" ] },
|
||||
"icu": "boolean",
|
||||
"inotify": "boolean",
|
||||
"journald": "boolean",
|
||||
"pcre": { "type": "enum", "values": [ "qt", "system" ] },
|
||||
"posix-ipc": { "type": "boolean", "name": "ipc_posix" },
|
||||
"pps": { "type": "boolean", "name": "qqnx_pps" },
|
||||
"slog2": "boolean",
|
||||
"syslog": "boolean"
|
||||
}
|
||||
},
|
||||
|
||||
"libraries": {
|
||||
"doubleconversion": {
|
||||
"label": "DoubleConversion",
|
||||
"test": "unix/doubleconversion",
|
||||
"sources": [
|
||||
"-ldouble-conversion"
|
||||
]
|
||||
},
|
||||
"glib": {
|
||||
"label": "GLib",
|
||||
"test": "unix/glib",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" }
|
||||
]
|
||||
},
|
||||
"gnu_iconv": {
|
||||
"label": "GNU libiconv",
|
||||
"export": "iconv",
|
||||
"test": "unix/gnu-libiconv",
|
||||
"sources": [
|
||||
"-liconv"
|
||||
]
|
||||
},
|
||||
"icu": {
|
||||
"label": "ICU",
|
||||
"export": "",
|
||||
"test": "unix/icu",
|
||||
"sources": [
|
||||
{
|
||||
"builds": {
|
||||
"debug": "-lsicuind -lsicuucd -lsicudtd",
|
||||
"release": "-lsicuin -lsicuuc -lsicudt"
|
||||
},
|
||||
"condition": "config.win32 && !features.shared"
|
||||
},
|
||||
{ "libs": "-licuin -licuuc -licudt", "condition": "config.win32 && features.shared" },
|
||||
{ "libs": "-licui18n -licuuc -licudata", "condition": "!config.win32" }
|
||||
]
|
||||
},
|
||||
"journald": {
|
||||
"label": "journald",
|
||||
"test": "unix/journald",
|
||||
"export": "",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "libsystemd" },
|
||||
{ "type": "pkgConfig", "args": "libsystemd-journal" }
|
||||
]
|
||||
},
|
||||
"libatomic": {
|
||||
"label": "64 bit atomics in libatomic",
|
||||
"test": "common/atomic64",
|
||||
"sources": [
|
||||
"-latomic"
|
||||
]
|
||||
},
|
||||
"libdl": {
|
||||
"label": "dlopen() in libdl",
|
||||
"export": "",
|
||||
"test": "unix/dlopen",
|
||||
"sources": [
|
||||
"-ldl"
|
||||
]
|
||||
},
|
||||
"pcre": {
|
||||
"label": "PCRE",
|
||||
"test": "unix/pcre",
|
||||
"sources": [
|
||||
"-lpcre16"
|
||||
]
|
||||
},
|
||||
"pps": {
|
||||
"label": "PPS",
|
||||
"test": "unix/pps",
|
||||
"sources": [
|
||||
"-lpps"
|
||||
]
|
||||
},
|
||||
"slog2": {
|
||||
"label": "slog2",
|
||||
"test": "unix/slog2",
|
||||
"export": "",
|
||||
"sources": [
|
||||
"-lslog2"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"tests": {
|
||||
"atomic64": {
|
||||
"label": "64 bit atomics",
|
||||
"type": "compile",
|
||||
"test": "common/atomic64"
|
||||
},
|
||||
"atomicfptr": {
|
||||
"label": "working std::atomic for function pointers",
|
||||
"type": "compile",
|
||||
"test": "common/atomicfptr"
|
||||
},
|
||||
"clock-gettime": {
|
||||
"label": "clock_gettime()",
|
||||
"type": "compile",
|
||||
"test": "unix/clock-gettime"
|
||||
},
|
||||
"clock-monotonic": {
|
||||
"label": "POSIX monotonic clock",
|
||||
"type": "compile",
|
||||
"test": "unix/clock-monotonic"
|
||||
},
|
||||
"cloexec": {
|
||||
"label": "O_CLOEXEC",
|
||||
"type": "compile",
|
||||
"test": "unix/cloexec"
|
||||
},
|
||||
"dlopen": {
|
||||
"label": "dlopen() in libc",
|
||||
"type": "compile",
|
||||
"test": "unix/dlopen"
|
||||
},
|
||||
"eventfd": {
|
||||
"label": "eventfd",
|
||||
"type": "compile",
|
||||
"test": "unix/eventfd"
|
||||
},
|
||||
"posix-iconv": {
|
||||
"label": "POSIX iconv",
|
||||
"type": "compile",
|
||||
"test": "unix/iconv"
|
||||
},
|
||||
"sun-iconv": {
|
||||
"label": "SUN libiconv",
|
||||
"type": "compile",
|
||||
"test": "unix/sun-libiconv"
|
||||
},
|
||||
"inotify": {
|
||||
"label": "inotify",
|
||||
"type": "compile",
|
||||
"test": "unix/inotify"
|
||||
},
|
||||
"ipc_sysv": {
|
||||
"label": "SysV IPC",
|
||||
"type": "compile",
|
||||
"test": "unix/ipc_sysv"
|
||||
},
|
||||
"ipc_posix": {
|
||||
"label": "POSIX IPC",
|
||||
"type": "compile",
|
||||
"test": "unix/ipc_posix"
|
||||
},
|
||||
"journald": {
|
||||
"label": "journald",
|
||||
"type": "compile",
|
||||
"test": "unix/journald"
|
||||
},
|
||||
"ppoll": {
|
||||
"label": "ppoll()",
|
||||
"type": "compile",
|
||||
"test": "unix/ppoll"
|
||||
},
|
||||
"pollts": {
|
||||
"label": "pollts()",
|
||||
"type": "compile",
|
||||
"test": "unix/pollts"
|
||||
},
|
||||
"poll": {
|
||||
"label": "poll()",
|
||||
"type": "compile",
|
||||
"test": "unix/poll"
|
||||
},
|
||||
"syslog": {
|
||||
"label": "syslog",
|
||||
"type": "compile",
|
||||
"test": "unix/syslog"
|
||||
},
|
||||
"xlocalescanprint": {
|
||||
"label": "xlocale.h (or equivalents)",
|
||||
"type": "compile",
|
||||
"test": "common/xlocalescanprint"
|
||||
}
|
||||
},
|
||||
|
||||
"features": {
|
||||
"clock-gettime": {
|
||||
"label": "clock_gettime()",
|
||||
"condition": "tests.clock-gettime",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"clock-monotonic": {
|
||||
"label": "POSIX monotonic clock",
|
||||
"condition": "features.clock-gettime && tests.clock-monotonic",
|
||||
"output": [ "feature" ]
|
||||
},
|
||||
"dlopen": {
|
||||
"label": "dlopen()",
|
||||
"condition": "tests.dlopen || libs.libdl",
|
||||
"output": [ { "type": "define", "negative": true, "name": "QT_NO_DYNAMIC_LIBRARY" } ]
|
||||
},
|
||||
"libdl": {
|
||||
"label": "dlopen() in libdl",
|
||||
"condition": "!tests.dlopen && libs.libdl",
|
||||
"output": [ { "type": "privateConfig", "negative": true } ]
|
||||
},
|
||||
"doubleconversion": {
|
||||
"label": "DoubleConversion",
|
||||
"output": [ "privateFeature", "feature" ]
|
||||
},
|
||||
"system-doubleconversion": {
|
||||
"label": " Using system DoubleConversion",
|
||||
"enable": "input.doubleconversion == 'system'",
|
||||
"disable": "input.doubleconversion == 'qt'",
|
||||
"condition": "features.doubleconversion && libs.doubleconversion",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"eventfd": {
|
||||
"label": "eventfd",
|
||||
"condition": "tests.eventfd",
|
||||
"output": [ "feature" ]
|
||||
},
|
||||
"glib": {
|
||||
"label": "GLib",
|
||||
"autoDetect": "!config.win32",
|
||||
"condition": "libs.glib",
|
||||
"output": [ "privateFeature", "feature" ]
|
||||
},
|
||||
"iconv": {
|
||||
"label": "iconv",
|
||||
"purpose": "Provides internationalization on Unix.",
|
||||
"section": "Internationalization",
|
||||
"condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv",
|
||||
"output": [ "privateFeature", "feature" ]
|
||||
},
|
||||
"posix-libiconv": {
|
||||
"label": "POSIX iconv",
|
||||
"enable": "input.iconv == 'posix'",
|
||||
"disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'",
|
||||
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv"
|
||||
},
|
||||
"sun-libiconv": {
|
||||
"label": "SUN iconv",
|
||||
"enable": "input.iconv == 'sun'",
|
||||
"disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'",
|
||||
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv",
|
||||
"output": [ "privateFeature", "publicQtConfig" ]
|
||||
},
|
||||
"gnu-libiconv": {
|
||||
"label": "GNU iconv",
|
||||
"enable": "input.iconv == 'gnu'",
|
||||
"disable": "input.iconv == 'posix' || input.iconv == 'sun' || input.iconv == 'no'",
|
||||
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && !features.sun-libiconv && libs.gnu_iconv",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"icu": {
|
||||
"label": "ICU",
|
||||
"autoDetect": "!config.win32",
|
||||
"condition": "libs.icu",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"inotify": {
|
||||
"label": "inotify",
|
||||
"condition": "tests.inotify",
|
||||
"output": [ "privateFeature", "feature" ]
|
||||
},
|
||||
"ipc_posix": {
|
||||
"label": "Using POSIX IPC",
|
||||
"autoDetect": "!config.win32",
|
||||
"condition": "!tests.ipc_sysv && tests.ipc_posix",
|
||||
"output": [ { "type": "define", "name": "QT_POSIX_IPC" } ]
|
||||
},
|
||||
"journald": {
|
||||
"label": "journald",
|
||||
"autoDetect": false,
|
||||
"condition": "libs.journald",
|
||||
"output": [ "privateConfig" ]
|
||||
},
|
||||
"std-atomic64": {
|
||||
"label": "64 bit atomic operations",
|
||||
"condition": "tests.atomic64 || libs.libatomic",
|
||||
"output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ]
|
||||
},
|
||||
"libatomic": {
|
||||
"label": "64 bit atomic operations in libatomic",
|
||||
"condition": "!tests.atomic64 && libs.libatomic",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"mimetype": {
|
||||
"label": "Mimetype handling",
|
||||
"purpose": "Provides MIME type handling.",
|
||||
"section": "Utilities",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"system-pcre": {
|
||||
"label": "Using system PCRE",
|
||||
"disable": "input.pcre == 'qt'",
|
||||
"enable": "input.pcre == 'system'",
|
||||
"condition": "libs.pcre",
|
||||
"output": [
|
||||
"privateFeature",
|
||||
{ "type": "privateConfig", "negative": true, "name": "pcre" }
|
||||
]
|
||||
},
|
||||
"poll_ppoll": {
|
||||
"label": "Native ppoll()",
|
||||
"emitIf": "!config.win32",
|
||||
"condition": "tests.ppoll",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"poll_pollts": {
|
||||
"label": "Native pollts()",
|
||||
"emitIf": "!config.win32",
|
||||
"condition": "!features.poll_ppoll && tests.pollts",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"poll_poll": {
|
||||
"label": "Native poll()",
|
||||
"emitIf": "!config.win32",
|
||||
"condition": "!features.poll_ppoll && !features.poll_pollts && tests.poll",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"poll_select": {
|
||||
"label": "Emulated poll()",
|
||||
"emitIf": "!config.win32",
|
||||
"condition": "!features.poll_ppoll && !features.poll_pollts && !features.poll_poll",
|
||||
"output": [
|
||||
"privateFeature",
|
||||
{ "type": "define", "name": "QT_NO_NATIVE_POLL" }
|
||||
]
|
||||
},
|
||||
"qqnx_pps": {
|
||||
"label": "PPS",
|
||||
"emitIf": "config.qnx",
|
||||
"condition": "libs.pps",
|
||||
"output": [ "privateConfig" ]
|
||||
},
|
||||
"qeventtransition": {
|
||||
"label": "QEventTransition class",
|
||||
"output": [ "publicFeature" ]
|
||||
},
|
||||
"sharedmemory": {
|
||||
"label": "Enable QSharedMemory",
|
||||
"condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
|
||||
"output": [ { "type": "define", "negative": true, "name": "QT_NO_SHAREDMEMORY" } ]
|
||||
},
|
||||
"slog2": {
|
||||
"label": "slog2",
|
||||
"condition": "libs.slog2",
|
||||
"emitIf": "config.qnx",
|
||||
"output": [ "privateConfig" ]
|
||||
},
|
||||
"syslog": {
|
||||
"label": "syslog",
|
||||
"autoDetect": false,
|
||||
"condition": "tests.syslog",
|
||||
"output": [ "privateConfig" ]
|
||||
},
|
||||
"systemsemaphore": {
|
||||
"label": "Enable QSystemSemaphore",
|
||||
"condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
|
||||
"output": [ { "type": "define", "negative": true, "name": "QT_NO_SYSTEMSEMAPHORE" } ]
|
||||
},
|
||||
"threadsafe-cloexec": {
|
||||
"label": "Threadsafe pipe creation",
|
||||
"condition": "tests.cloexec",
|
||||
"output": [
|
||||
"publicQtConfig",
|
||||
{ "type": "define", "name": "QT_THREADSAFE_CLOEXEC", "value": 1 }
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"label": "Properties",
|
||||
"purpose": "Supports scripting Qt-based applications.",
|
||||
"section": "Kernel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"regularexpression": {
|
||||
"label": "QRegularExpression",
|
||||
"purpose": "Provides an API to Perl-compatible regular expressions.",
|
||||
"section": "Kernel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"sharedmemory": {
|
||||
"label": "QSharedMemory",
|
||||
"purpose": "Provides access to a shared memory segment.",
|
||||
"section": "Kernel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"systemsemaphore": {
|
||||
"label": "QSystemSemaphore",
|
||||
"purpose": "Provides a general counting system semaphore.",
|
||||
"section": "Kernel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"xmlstream": {
|
||||
"label": "XML Streaming APIs",
|
||||
"purpose": "Provides a simple streaming API for XML.",
|
||||
"section": "Kernel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"xmlstreamreader": {
|
||||
"label": "QXmlStreamReader",
|
||||
"purpose": "Provides a well-formed XML parser with a simple streaming API.",
|
||||
"section": "Kernel",
|
||||
"condition": "features.xmlstream",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"xmlstreamwriter": {
|
||||
"label": "QXmlStreamWriter",
|
||||
"purpose": "Provides a XML writer with a simple streaming API.",
|
||||
"section": "Kernel",
|
||||
"condition": "features.xmlstream",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"textdate": {
|
||||
"label": "Text Date",
|
||||
"purpose": "Supports month and day names in dates.",
|
||||
"section": "Data structures",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"datestring": {
|
||||
"label": "QDate/QTime/QDateTime",
|
||||
"purpose": "Provides convertion between dates and strings.",
|
||||
"section": "Data structures",
|
||||
"condition": "features.textdate",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"process": {
|
||||
"label": "QProcess",
|
||||
"purpose": "Supports external process invocation.",
|
||||
"section": "File I/O",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"temporaryfile": {
|
||||
"label": "QTemporaryFile",
|
||||
"purpose": "Provides an I/O device that operates on temporary files.",
|
||||
"section": "File I/O",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"library": {
|
||||
"label": "QLibrary",
|
||||
"purpose": "Provides a wrapper for dynamically loaded libraries.",
|
||||
"section": "File I/O",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"settings": {
|
||||
"label": "QSettings",
|
||||
"purpose": "Provides persistent application settings.",
|
||||
"section": "File I/O",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"filesystemwatcher": {
|
||||
"label": "QFileSystemWatcher",
|
||||
"purpose": "Provides an interface for monitoring files and directories for modifications.",
|
||||
"section": "File I/O",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"filesystemiterator": {
|
||||
"label": "QFileSystemIterator",
|
||||
"purpose": "Provides fast file system iteration.",
|
||||
"section": "File I/O",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"itemmodel": {
|
||||
"label": "Qt Item Model",
|
||||
"purpose": "Provides the item model for item views",
|
||||
"section": "ItemViews",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"proxymodel": {
|
||||
"label": "QAbstractProxyModel",
|
||||
"purpose": "Supports processing of data passed between another model and a view.",
|
||||
"section": "ItemViews",
|
||||
"condition": "features.itemmodel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"sortfilterproxymodel": {
|
||||
"label": "QSortFilterProxyModel",
|
||||
"purpose": "Supports sorting and filtering of data passed between another model and a view.",
|
||||
"section": "ItemViews",
|
||||
"condition": "features.proxymodel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"identityproxymodel": {
|
||||
"label": "QIdentityProxyModel",
|
||||
"purpose": "Supports proxying a source model unmodified.",
|
||||
"section": "ItemViews",
|
||||
"condition": "features.proxymodel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"stringlistmodel": {
|
||||
"label": "QStringListModel",
|
||||
"purpose": "Provides a model that supplies strings to views.",
|
||||
"section": "ItemViews",
|
||||
"condition": "features.itemmodel",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"translation": {
|
||||
"label": "Translation",
|
||||
"purpose": "Supports translations using QObject::tr().",
|
||||
"section": "Internationalization",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"textcodec": {
|
||||
"label": "QTextCodec",
|
||||
"purpose": "Supports conversions between text encodings.",
|
||||
"section": "Internationalization",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"codecs": {
|
||||
"label": "Codecs",
|
||||
"purpose": "Supports non-unicode text conversions.",
|
||||
"section": "Internationalization",
|
||||
"condition": "features.textcodec",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"big_codecs": {
|
||||
"label": "Big Codecs",
|
||||
"purpose": "Supports big codecs, e.g. CJK.",
|
||||
"section": "Internationalization",
|
||||
"condition": "features.textcodec",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"animation": {
|
||||
"label": "Animation",
|
||||
"purpose": "Provides a framework for animations.",
|
||||
"section": "Utilities",
|
||||
"condition": "features.properties",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"statemachine": {
|
||||
"label": "State machine",
|
||||
"purpose": "Provides hierarchical finite state machines.",
|
||||
"section": "Utilities",
|
||||
"condition": "features.properties",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"gestures": {
|
||||
"label": "Gesture",
|
||||
"purpose": "Provides a framework for gestures.",
|
||||
"section": "Utilities",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
}
|
||||
},
|
||||
|
||||
"report": [
|
||||
{
|
||||
"type": "note",
|
||||
"condition": "features.journald || features.syslog || (config.qnx && features.slog2)",
|
||||
"message": "journald, syslog or slog2 integration is enabled.
|
||||
If your users intend to develop applications against this build,
|
||||
ensure that the IDEs they use either set QT_LOGGING_TO_CONSOLE to 1
|
||||
or are able to read the logged output from journald, syslog or slog2."
|
||||
},
|
||||
{
|
||||
"type": "error",
|
||||
"condition": "input.doubleconversion == 'no' && !tests.xlocalescanprint",
|
||||
"message": "Your C library does not provide sscanf_l or snprintf_l.
|
||||
You need to use libdouble-conversion for double/string conversion."
|
||||
},
|
||||
{
|
||||
"type": "error",
|
||||
"condition": "!tests.atomicfptr",
|
||||
"message": "detected a std::atomic implementation that fails for function pointers.
|
||||
Please apply the patch corresponding to your Standard Library vendor, found in
|
||||
qtbase/config.tests/common/atomicfptr"
|
||||
}
|
||||
],
|
||||
|
||||
"summary": [
|
||||
{
|
||||
"section": "Qt Core",
|
||||
"entries": [
|
||||
"doubleconversion",
|
||||
"system-doubleconversion",
|
||||
"glib",
|
||||
"iconv",
|
||||
"icu",
|
||||
{
|
||||
"section": "Logging backends",
|
||||
"entries": [
|
||||
"journald", "syslog", "slog2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "feature",
|
||||
"args": "qqnx_pps",
|
||||
"condition": "config.qnx"
|
||||
},
|
||||
"system-pcre"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -31,8 +31,6 @@ ANDROID_PERMISSIONS = \
|
||||
# OpenBSD 6.0 will include environ in libc.
|
||||
freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF =
|
||||
|
||||
load(qfeatures)
|
||||
|
||||
include(animation/animation.pri)
|
||||
include(arch/arch.pri)
|
||||
include(global/global.pri)
|
||||
@ -100,6 +98,7 @@ cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion
|
||||
|
||||
load(cmake_functions)
|
||||
|
||||
##### This requires fixing, so that the feature system works with cmake as well
|
||||
CMAKE_DISABLED_FEATURES = $$join(QT_DISABLED_FEATURES, "$$escape_expand(\\n) ")
|
||||
|
||||
CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA/src], $$[QT_INSTALL_PREFIX])
|
||||
|
@ -942,7 +942,8 @@
|
||||
# endif /* VC 11 */
|
||||
# if _MSC_VER >= 1800
|
||||
/* C++11 features in VC12 = VC2013 */
|
||||
# define Q_COMPILER_DEFAULT_MEMBERS
|
||||
/* Implemented, but can't be used on move special members */
|
||||
/* # define Q_COMPILER_DEFAULT_MEMBERS */
|
||||
# define Q_COMPILER_DELETE_MEMBERS
|
||||
# define Q_COMPILER_DELEGATING_CONSTRUCTORS
|
||||
# define Q_COMPILER_EXPLICIT_CONVERSIONS
|
||||
@ -960,6 +961,7 @@
|
||||
# endif /* VC 12 SP 2 RC */
|
||||
# if _MSC_VER >= 1900
|
||||
/* C++11 features in VC14 = VC2015 */
|
||||
# define Q_COMPILER_DEFAULT_MEMBERS
|
||||
# define Q_COMPILER_ALIGNAS
|
||||
# define Q_COMPILER_ALIGNOF
|
||||
// Partial support, insufficient for Qt
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
#include <QtCore/qconfig.h>
|
||||
#include <QtCore/qfeatures.h>
|
||||
#include <QtCore/qtcore-config.h>
|
||||
#endif
|
||||
|
||||
// The QT_SUPPORTS macro is deprecated. Don't use it in new code.
|
||||
@ -943,10 +943,11 @@ template <typename T>
|
||||
class QForeachContainer {
|
||||
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
|
||||
public:
|
||||
inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
|
||||
QForeachContainer(const T &t) : c(t) {}
|
||||
QForeachContainer(T &&t) : c(std::move(t)) {}
|
||||
const T c;
|
||||
typename T::const_iterator i, e;
|
||||
int control;
|
||||
typename T::const_iterator i = c.begin(), e = c.end();
|
||||
int control = 1;
|
||||
};
|
||||
|
||||
// Explanation of the control word:
|
||||
|
@ -50,6 +50,7 @@
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
#include <QtCore/private/qconfig_p.h>
|
||||
#include <QtCore/private/qtcore-config_p.h>
|
||||
#endif
|
||||
|
||||
#define QT_LIBRARY_VERSION(lib) QT_LIBRARY_VERSION_##lib
|
||||
|
@ -616,10 +616,10 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
|
||||
#if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS)
|
||||
QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration());
|
||||
if (!settings.isNull()) {
|
||||
QString key = QLatin1String(platformsSection);
|
||||
key += QLatin1Char('/');
|
||||
key += platformName;
|
||||
key += QLatin1String("Arguments");
|
||||
const QString key = QLatin1String(platformsSection)
|
||||
+ QLatin1Char('/')
|
||||
+ platformName
|
||||
+ QLatin1String("Arguments");
|
||||
return settings->value(key).toStringList();
|
||||
}
|
||||
#endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS
|
||||
|
@ -2651,6 +2651,7 @@ QTextStream &QTextStream::operator<<(const char *string)
|
||||
{
|
||||
Q_D(QTextStream);
|
||||
CHECK_VALID_STREAM(*this);
|
||||
// ### Qt6: consider changing to UTF-8
|
||||
d->putString(QLatin1String(string));
|
||||
return *this;
|
||||
}
|
||||
|
@ -303,13 +303,14 @@ char *qstrncpy(char *dst, const char *src, uint len)
|
||||
{
|
||||
if (!src || !dst)
|
||||
return 0;
|
||||
if (len > 0) {
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
strncpy_s(dst, len, src, len-1);
|
||||
strncpy_s(dst, len, src, len - 1);
|
||||
#else
|
||||
strncpy(dst, src, len);
|
||||
strncpy(dst, src, len);
|
||||
#endif
|
||||
if (len > 0)
|
||||
dst[len-1] = '\0';
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
||||
#include <wrl.h>
|
||||
#include <windows.foundation.h>
|
||||
#include <windows.foundation.collections.h>
|
||||
#include <windows.globalization.h>
|
||||
#include <windows.system.userprofile.h>
|
||||
#endif // Q_OS_WINRT
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -70,6 +70,7 @@ static QString winIso3116CtryName(LCID id = LOCALE_USER_DEFAULT);
|
||||
using namespace Microsoft::WRL;
|
||||
using namespace Microsoft::WRL::Wrappers;
|
||||
using namespace ABI::Windows::Foundation;
|
||||
using namespace ABI::Windows::System::UserProfile;
|
||||
|
||||
static QByteArray getWinLocaleName(LPWSTR id = LOCALE_NAME_USER_DEFAULT);
|
||||
static const char *winLangCodeToIsoName(int code);
|
||||
@ -624,16 +625,17 @@ QVariant QSystemLocalePrivate::uiLanguages()
|
||||
return result;
|
||||
#else // !Q_OS_WINRT
|
||||
QStringList result;
|
||||
ComPtr<ABI::Windows::Globalization::IApplicationLanguagesStatics> appLanguagesStatics;
|
||||
if (FAILED(GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Globalization_ApplicationLanguages).Get(), &appLanguagesStatics))) {
|
||||
|
||||
ComPtr<IGlobalizationPreferencesStatics> preferences;
|
||||
HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences).Get(), &preferences);
|
||||
if (FAILED(hr)) {
|
||||
qWarning("Could not obtain ApplicationLanguagesStatic");
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
ComPtr<ABI::Windows::Foundation::Collections::IVectorView<HSTRING> > languageList;
|
||||
// Languages is a ranked list of "long names" (e.g. en-US) of preferred languages, which matches
|
||||
// languages from the manifest with languages from the user's system.
|
||||
HRESULT hr = appLanguagesStatics->get_Languages(&languageList);
|
||||
// Languages is a ranked list of "long names" (e.g. en-US) of preferred languages
|
||||
hr = preferences->get_Languages(&languageList);
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
unsigned int size;
|
||||
hr = languageList->get_Size(&size);
|
||||
@ -648,36 +650,6 @@ QVariant QSystemLocalePrivate::uiLanguages()
|
||||
result << QString::fromWCharArray(rawString, length);
|
||||
}
|
||||
|
||||
// ManifestLanguages covers all languages given in the manifest and uses short names (like "en").
|
||||
hr = appLanguagesStatics->get_ManifestLanguages(&languageList);
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
hr = languageList->get_Size(&size);
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
for (unsigned int i = 0; i < size; ++i) {
|
||||
HString language;
|
||||
hr = languageList->GetAt(i, language.GetAddressOf());
|
||||
Q_ASSERT_SUCCEEDED(hr);
|
||||
UINT32 length;
|
||||
PCWSTR rawString = language.GetRawBuffer(&length);
|
||||
const QString qLanguage = QString::fromWCharArray(rawString, length);
|
||||
bool found = false;
|
||||
// Since ApplicationLanguages:::Languages uses long names, we compare the "pre-dash" part of
|
||||
// the language and filter it out, if it is already covered by a more specialized form.
|
||||
for (const QString &lang : qAsConst(result)) {
|
||||
int dashIndex = lang.indexOf('-');
|
||||
// There will not be any long name after the first short name was found, so we can stop.
|
||||
if (dashIndex == -1)
|
||||
break;
|
||||
|
||||
if (lang.leftRef(dashIndex) == qLanguage) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
result << qLanguage;
|
||||
}
|
||||
|
||||
return result;
|
||||
#endif // Q_OS_WINRT
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ qtConfig(icu) {
|
||||
SOURCES += tools/qcollator_posix.cpp
|
||||
}
|
||||
|
||||
!contains(QT_DISABLED_FEATURES, regularexpression) {
|
||||
qtConfig(regularexpression) {
|
||||
include($$PWD/../../3rdparty/pcre_dependency.pri)
|
||||
|
||||
HEADERS += tools/qregularexpression.h
|
||||
|
1095
src/gui/configure.json
Normal file
1095
src/gui/configure.json
Normal file
File diff suppressed because it is too large
Load Diff
67
src/gui/configure.pri
Normal file
67
src/gui/configure.pri
Normal file
@ -0,0 +1,67 @@
|
||||
# custom tests
|
||||
|
||||
# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc').
|
||||
# Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the
|
||||
# DXSDK_DIR variable. Starting with Windows Kit 8, it is included in
|
||||
# the Windows SDK. Checking for the header is not sufficient, since it
|
||||
# is also present in MinGW.
|
||||
defineTest(qtConfTest_directX) {
|
||||
dxdir = $$getenv("DXSDK_DIR")
|
||||
!isEmpty(dxdir) {
|
||||
EXTRA_INCLUDEPATH += $$dxdir/include
|
||||
equals(QT_ARCH, x86_64): \
|
||||
EXTRA_LIBDIR += $$dxdir/lib/x64
|
||||
else: \
|
||||
EXTRA_LIBDIR += $$dxdir/lib/x86
|
||||
EXTRA_PATH += $$dxdir/Utilities/bin/x86
|
||||
}
|
||||
|
||||
$$qtConfEvaluate("features.sse2") {
|
||||
ky = $$size($${1}.files._KEYS_)
|
||||
$${1}.files._KEYS_ += $$ky
|
||||
# Not present on MinGW-32
|
||||
$${1}.files.$${ky} = "intrin.h"
|
||||
}
|
||||
|
||||
qtConfTest_files($${1}): return(true)
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_xkbConfigRoot) {
|
||||
qtConfTest_getPkgConfigVariable($${1}): return(true)
|
||||
|
||||
for (dir, $$list("/usr/share/X11/xkb", "/usr/local/share/X11/xkb")) {
|
||||
exists($$dir) {
|
||||
$${1}.value = $$dir
|
||||
export($${1}.value)
|
||||
$${1}.cache += value
|
||||
export($${1}.cache)
|
||||
return(true)
|
||||
}
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_qpaDefaultPlatform) {
|
||||
name =
|
||||
!isEmpty(config.input.qpa_default_platform): name = $$config.input.qpa_default_platform
|
||||
else: !isEmpty(QT_QPA_DEFAULT_PLATFORM): name = $$QT_QPA_DEFAULT_PLATFORM
|
||||
else: winrt: name = winrt
|
||||
else: win32: name = windows
|
||||
else: android: name = android
|
||||
else: macos: name = cocoa
|
||||
else: ios: name = ios
|
||||
else: qnx: name = qnx
|
||||
else: integrity: name = integrityfb
|
||||
else: name = xcb
|
||||
|
||||
$${1}.value = $$name
|
||||
$${1}.plugin = q$$name
|
||||
$${1}.name = "\"$$name\""
|
||||
export($${1}.value)
|
||||
export($${1}.plugin)
|
||||
export($${1}.name)
|
||||
$${1}.cache += value plugin name
|
||||
export($${1}.cache)
|
||||
return(true)
|
||||
}
|
@ -47,6 +47,8 @@
|
||||
#include "private/qiconloader_p.h"
|
||||
#include "qpainter.h"
|
||||
#include "qfileinfo.h"
|
||||
#include <qmimedatabase.h>
|
||||
#include <qmimetype.h>
|
||||
#include "qpixmapcache.h"
|
||||
#include "qvariant.h"
|
||||
#include "qcache.h"
|
||||
@ -839,8 +841,11 @@ QPixmap QIcon::pixmap(QWindow *window, const QSize &size, Mode mode, State state
|
||||
qreal devicePixelRatio = qt_effective_device_pixel_ratio(window);
|
||||
|
||||
// Handle the simple normal-dpi case:
|
||||
if (!(devicePixelRatio > 1.0))
|
||||
return d->engine->pixmap(size, mode, state);
|
||||
if (!(devicePixelRatio > 1.0)) {
|
||||
QPixmap pixmap = d->engine->pixmap(size, mode, state);
|
||||
pixmap.setDevicePixelRatio(1.0);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
// Try get a pixmap that is big enough to be displayed at device pixel resolution.
|
||||
QPixmap pixmap = d->engine->pixmap(size * devicePixelRatio, mode, state);
|
||||
@ -976,6 +981,18 @@ void QIcon::addPixmap(const QPixmap &pixmap, Mode mode, State state)
|
||||
d->engine->addPixmap(pixmap, mode, state);
|
||||
}
|
||||
|
||||
static QIconEngine *iconEngineFromSuffix(const QString &fileName, const QString &suffix)
|
||||
{
|
||||
if (!suffix.isEmpty()) {
|
||||
const int index = loader()->indexOf(suffix);
|
||||
if (index != -1) {
|
||||
if (QIconEnginePlugin *factory = qobject_cast<QIconEnginePlugin*>(loader()->instance(index))) {
|
||||
return factory->create(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*! Adds an image from the file with the given \a fileName to the
|
||||
icon, as a specialization for \a size, \a mode and \a state. The
|
||||
@ -1013,25 +1030,15 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State
|
||||
return;
|
||||
detach();
|
||||
if (!d) {
|
||||
|
||||
QFileInfo info(fileName);
|
||||
QString suffix = info.suffix();
|
||||
if (!suffix.isEmpty()) {
|
||||
// first try version 2 engines..
|
||||
const int index = loader()->indexOf(suffix);
|
||||
if (index != -1) {
|
||||
if (QIconEnginePlugin *factory = qobject_cast<QIconEnginePlugin*>(loader()->instance(index))) {
|
||||
if (QIconEngine *engine = factory->create(fileName)) {
|
||||
d = new QIconPrivate;
|
||||
d->engine = engine;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// ...then fall back to the default engine
|
||||
if (!d) {
|
||||
d = new QIconPrivate;
|
||||
d->engine = new QPixmapIconEngine;
|
||||
}
|
||||
QIconEngine *engine = iconEngineFromSuffix(fileName, info.suffix());
|
||||
#ifndef QT_NO_MIMETYPE
|
||||
if (!engine)
|
||||
engine = iconEngineFromSuffix(fileName, QMimeDatabase().mimeTypeForFile(info).preferredSuffix());
|
||||
#endif // !QT_NO_MIMETYPE
|
||||
d = new QIconPrivate;
|
||||
d->engine = engine ? engine : new QPixmapIconEngine;
|
||||
}
|
||||
|
||||
d->engine->addFile(fileName, size, mode, state);
|
||||
|
@ -199,7 +199,7 @@ private:
|
||||
QIconCacheGtkReader::QIconCacheGtkReader(const QString &dirName)
|
||||
: m_isValid(false)
|
||||
{
|
||||
QFileInfo info(dirName + QLatin1Literal("/icon-theme.cache"));
|
||||
QFileInfo info(dirName + QLatin1String("/icon-theme.cache"));
|
||||
if (!info.exists() || info.lastModified() < QFileInfo(dirName).lastModified())
|
||||
return;
|
||||
m_file.setFileName(info.absoluteFilePath());
|
||||
|
@ -41,6 +41,7 @@
|
||||
#define QTGUIGLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtGui/qtgui-config.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -53,5 +53,6 @@
|
||||
|
||||
#include <QtGui/qtguiglobal.h>
|
||||
#include <QtCore/private/qglobal_p.h>
|
||||
#include <QtGui/private/qtgui-config_p.h>
|
||||
|
||||
#endif // QTGUIGLOBAL_P_H
|
||||
|
@ -2195,6 +2195,9 @@ void QWindowPrivate::deliverUpdateRequest()
|
||||
*/
|
||||
void QWindow::requestUpdate()
|
||||
{
|
||||
Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(),
|
||||
"QWindow", "Updates can only be scheduled from the GUI (main) thread");
|
||||
|
||||
Q_D(QWindow);
|
||||
if (d->updateRequestPending || !d->platformWindow)
|
||||
return;
|
||||
|
@ -126,8 +126,14 @@ public:
|
||||
QPoint globalPosition() const {
|
||||
Q_Q(const QWindow);
|
||||
QPoint offset = q->position();
|
||||
for (const QWindow *p = q->parent(); p; p = p->parent())
|
||||
offset += p->position();
|
||||
for (const QWindow *p = q->parent(); p; p = p->parent()) {
|
||||
if (p->type() != Qt::ForeignWindow) {
|
||||
offset += p->position();
|
||||
} else { // QTBUG-43252, mapToGlobal() for foreign children.
|
||||
offset += p->mapToGlobal(QPoint(0, 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
@ -95,14 +95,15 @@ typedef void* GLeglImageOES;
|
||||
// applications cannot target ES 3. Therefore QOpenGLFunctions and
|
||||
// friends do everything dynamically and never rely on these macros.
|
||||
|
||||
# ifndef GL_GLEXT_PROTOTYPES
|
||||
# define GL_GLEXT_PROTOTYPES
|
||||
# endif
|
||||
|
||||
# if defined(QT_OPENGL_ES_3_1)
|
||||
# include <GLES3/gl31.h>
|
||||
# elif defined(QT_OPENGL_ES_3)
|
||||
# include <GLES3/gl3.h>
|
||||
# else
|
||||
# ifndef GL_GLEXT_PROTOTYPES
|
||||
# define GL_GLEXT_PROTOTYPES
|
||||
# endif
|
||||
# include <GLES2/gl2.h>
|
||||
#endif
|
||||
|
||||
|
@ -1283,11 +1283,11 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ
|
||||
? context->hasExtension(QByteArrayLiteral("GL_EXT_read_format_bgra"))
|
||||
: context->hasExtension(QByteArrayLiteral("GL_EXT_bgra"));
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
const char *renderer = reinterpret_cast<const char *>(funcs->glGetString(GL_RENDERER));
|
||||
const char *ver = reinterpret_cast<const char *>(funcs->glGetString(GL_VERSION));
|
||||
|
||||
// Blacklist GPU chipsets that have problems with their BGRA support.
|
||||
#ifndef Q_OS_IOS
|
||||
const bool blackListed = (qstrcmp(renderer, "PowerVR Rogue G6200") == 0
|
||||
&& ::strstr(ver, "1.3") != 0) ||
|
||||
(qstrcmp(renderer, "Mali-T760") == 0
|
||||
|
@ -63,7 +63,6 @@ SOURCES += \
|
||||
painting/qblittable.cpp \
|
||||
painting/qbrush.cpp \
|
||||
painting/qcolor.cpp \
|
||||
painting/qcolor_p.cpp \
|
||||
painting/qcompositionfunctions.cpp \
|
||||
painting/qcosmeticstroker.cpp \
|
||||
painting/qcssutil.cpp \
|
||||
|
@ -43,12 +43,335 @@
|
||||
#include "qdatastream.h"
|
||||
#include "qvariant.h"
|
||||
#include "qdebug.h"
|
||||
#include "private/qtools_p.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*!
|
||||
\internal
|
||||
If s[0..1] is a valid hex number, returns its integer value,
|
||||
otherwise returns -1.
|
||||
*/
|
||||
static inline int hex2int(const char *s)
|
||||
{
|
||||
const int hi = QtMiscUtils::fromHex(s[0]);
|
||||
if (hi < 0)
|
||||
return -1;
|
||||
const int lo = QtMiscUtils::fromHex(s[1]);
|
||||
if (lo < 0)
|
||||
return -1;
|
||||
return (hi << 4) | lo;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
If s is a valid hex digit, returns its integer value,
|
||||
multiplied by 0x11, otherwise returns -1.
|
||||
*/
|
||||
static inline int hex2int(char s)
|
||||
{
|
||||
const int h = QtMiscUtils::fromHex(s);
|
||||
return h < 0 ? h : (h << 4) | h;
|
||||
}
|
||||
|
||||
bool qt_get_hex_rgb(const char *name, QRgb *rgb)
|
||||
{
|
||||
if (name[0] != '#')
|
||||
return false;
|
||||
name++;
|
||||
int len = qstrlen(name);
|
||||
int a, r, g, b;
|
||||
a = 255;
|
||||
if (len == 12) {
|
||||
r = hex2int(name);
|
||||
g = hex2int(name + 4);
|
||||
b = hex2int(name + 8);
|
||||
} else if (len == 9) {
|
||||
r = hex2int(name);
|
||||
g = hex2int(name + 3);
|
||||
b = hex2int(name + 6);
|
||||
} else if (len == 8) {
|
||||
a = hex2int(name);
|
||||
r = hex2int(name + 2);
|
||||
g = hex2int(name + 4);
|
||||
b = hex2int(name + 6);
|
||||
} else if (len == 6) {
|
||||
r = hex2int(name);
|
||||
g = hex2int(name + 2);
|
||||
b = hex2int(name + 4);
|
||||
} else if (len == 3) {
|
||||
r = hex2int(name[0]);
|
||||
g = hex2int(name[1]);
|
||||
b = hex2int(name[2]);
|
||||
} else {
|
||||
r = g = b = -1;
|
||||
}
|
||||
if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) {
|
||||
*rgb = 0;
|
||||
return false;
|
||||
}
|
||||
*rgb = qRgba(r, g ,b, a);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
|
||||
{
|
||||
if (len > 13)
|
||||
return false;
|
||||
char tmp[16];
|
||||
for (int i = 0; i < len; ++i)
|
||||
tmp[i] = str[i].toLatin1();
|
||||
tmp[len] = 0;
|
||||
return qt_get_hex_rgb(tmp, rgb);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_COLORNAMES
|
||||
|
||||
/*
|
||||
CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0))
|
||||
*/
|
||||
|
||||
#ifdef rgb
|
||||
# undef rgb
|
||||
#endif
|
||||
#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
|
||||
|
||||
static const struct RGBData {
|
||||
const char name[21];
|
||||
uint value;
|
||||
} rgbTbl[] = {
|
||||
{ "aliceblue", rgb(240, 248, 255) },
|
||||
{ "antiquewhite", rgb(250, 235, 215) },
|
||||
{ "aqua", rgb( 0, 255, 255) },
|
||||
{ "aquamarine", rgb(127, 255, 212) },
|
||||
{ "azure", rgb(240, 255, 255) },
|
||||
{ "beige", rgb(245, 245, 220) },
|
||||
{ "bisque", rgb(255, 228, 196) },
|
||||
{ "black", rgb( 0, 0, 0) },
|
||||
{ "blanchedalmond", rgb(255, 235, 205) },
|
||||
{ "blue", rgb( 0, 0, 255) },
|
||||
{ "blueviolet", rgb(138, 43, 226) },
|
||||
{ "brown", rgb(165, 42, 42) },
|
||||
{ "burlywood", rgb(222, 184, 135) },
|
||||
{ "cadetblue", rgb( 95, 158, 160) },
|
||||
{ "chartreuse", rgb(127, 255, 0) },
|
||||
{ "chocolate", rgb(210, 105, 30) },
|
||||
{ "coral", rgb(255, 127, 80) },
|
||||
{ "cornflowerblue", rgb(100, 149, 237) },
|
||||
{ "cornsilk", rgb(255, 248, 220) },
|
||||
{ "crimson", rgb(220, 20, 60) },
|
||||
{ "cyan", rgb( 0, 255, 255) },
|
||||
{ "darkblue", rgb( 0, 0, 139) },
|
||||
{ "darkcyan", rgb( 0, 139, 139) },
|
||||
{ "darkgoldenrod", rgb(184, 134, 11) },
|
||||
{ "darkgray", rgb(169, 169, 169) },
|
||||
{ "darkgreen", rgb( 0, 100, 0) },
|
||||
{ "darkgrey", rgb(169, 169, 169) },
|
||||
{ "darkkhaki", rgb(189, 183, 107) },
|
||||
{ "darkmagenta", rgb(139, 0, 139) },
|
||||
{ "darkolivegreen", rgb( 85, 107, 47) },
|
||||
{ "darkorange", rgb(255, 140, 0) },
|
||||
{ "darkorchid", rgb(153, 50, 204) },
|
||||
{ "darkred", rgb(139, 0, 0) },
|
||||
{ "darksalmon", rgb(233, 150, 122) },
|
||||
{ "darkseagreen", rgb(143, 188, 143) },
|
||||
{ "darkslateblue", rgb( 72, 61, 139) },
|
||||
{ "darkslategray", rgb( 47, 79, 79) },
|
||||
{ "darkslategrey", rgb( 47, 79, 79) },
|
||||
{ "darkturquoise", rgb( 0, 206, 209) },
|
||||
{ "darkviolet", rgb(148, 0, 211) },
|
||||
{ "deeppink", rgb(255, 20, 147) },
|
||||
{ "deepskyblue", rgb( 0, 191, 255) },
|
||||
{ "dimgray", rgb(105, 105, 105) },
|
||||
{ "dimgrey", rgb(105, 105, 105) },
|
||||
{ "dodgerblue", rgb( 30, 144, 255) },
|
||||
{ "firebrick", rgb(178, 34, 34) },
|
||||
{ "floralwhite", rgb(255, 250, 240) },
|
||||
{ "forestgreen", rgb( 34, 139, 34) },
|
||||
{ "fuchsia", rgb(255, 0, 255) },
|
||||
{ "gainsboro", rgb(220, 220, 220) },
|
||||
{ "ghostwhite", rgb(248, 248, 255) },
|
||||
{ "gold", rgb(255, 215, 0) },
|
||||
{ "goldenrod", rgb(218, 165, 32) },
|
||||
{ "gray", rgb(128, 128, 128) },
|
||||
{ "green", rgb( 0, 128, 0) },
|
||||
{ "greenyellow", rgb(173, 255, 47) },
|
||||
{ "grey", rgb(128, 128, 128) },
|
||||
{ "honeydew", rgb(240, 255, 240) },
|
||||
{ "hotpink", rgb(255, 105, 180) },
|
||||
{ "indianred", rgb(205, 92, 92) },
|
||||
{ "indigo", rgb( 75, 0, 130) },
|
||||
{ "ivory", rgb(255, 255, 240) },
|
||||
{ "khaki", rgb(240, 230, 140) },
|
||||
{ "lavender", rgb(230, 230, 250) },
|
||||
{ "lavenderblush", rgb(255, 240, 245) },
|
||||
{ "lawngreen", rgb(124, 252, 0) },
|
||||
{ "lemonchiffon", rgb(255, 250, 205) },
|
||||
{ "lightblue", rgb(173, 216, 230) },
|
||||
{ "lightcoral", rgb(240, 128, 128) },
|
||||
{ "lightcyan", rgb(224, 255, 255) },
|
||||
{ "lightgoldenrodyellow", rgb(250, 250, 210) },
|
||||
{ "lightgray", rgb(211, 211, 211) },
|
||||
{ "lightgreen", rgb(144, 238, 144) },
|
||||
{ "lightgrey", rgb(211, 211, 211) },
|
||||
{ "lightpink", rgb(255, 182, 193) },
|
||||
{ "lightsalmon", rgb(255, 160, 122) },
|
||||
{ "lightseagreen", rgb( 32, 178, 170) },
|
||||
{ "lightskyblue", rgb(135, 206, 250) },
|
||||
{ "lightslategray", rgb(119, 136, 153) },
|
||||
{ "lightslategrey", rgb(119, 136, 153) },
|
||||
{ "lightsteelblue", rgb(176, 196, 222) },
|
||||
{ "lightyellow", rgb(255, 255, 224) },
|
||||
{ "lime", rgb( 0, 255, 0) },
|
||||
{ "limegreen", rgb( 50, 205, 50) },
|
||||
{ "linen", rgb(250, 240, 230) },
|
||||
{ "magenta", rgb(255, 0, 255) },
|
||||
{ "maroon", rgb(128, 0, 0) },
|
||||
{ "mediumaquamarine", rgb(102, 205, 170) },
|
||||
{ "mediumblue", rgb( 0, 0, 205) },
|
||||
{ "mediumorchid", rgb(186, 85, 211) },
|
||||
{ "mediumpurple", rgb(147, 112, 219) },
|
||||
{ "mediumseagreen", rgb( 60, 179, 113) },
|
||||
{ "mediumslateblue", rgb(123, 104, 238) },
|
||||
{ "mediumspringgreen", rgb( 0, 250, 154) },
|
||||
{ "mediumturquoise", rgb( 72, 209, 204) },
|
||||
{ "mediumvioletred", rgb(199, 21, 133) },
|
||||
{ "midnightblue", rgb( 25, 25, 112) },
|
||||
{ "mintcream", rgb(245, 255, 250) },
|
||||
{ "mistyrose", rgb(255, 228, 225) },
|
||||
{ "moccasin", rgb(255, 228, 181) },
|
||||
{ "navajowhite", rgb(255, 222, 173) },
|
||||
{ "navy", rgb( 0, 0, 128) },
|
||||
{ "oldlace", rgb(253, 245, 230) },
|
||||
{ "olive", rgb(128, 128, 0) },
|
||||
{ "olivedrab", rgb(107, 142, 35) },
|
||||
{ "orange", rgb(255, 165, 0) },
|
||||
{ "orangered", rgb(255, 69, 0) },
|
||||
{ "orchid", rgb(218, 112, 214) },
|
||||
{ "palegoldenrod", rgb(238, 232, 170) },
|
||||
{ "palegreen", rgb(152, 251, 152) },
|
||||
{ "paleturquoise", rgb(175, 238, 238) },
|
||||
{ "palevioletred", rgb(219, 112, 147) },
|
||||
{ "papayawhip", rgb(255, 239, 213) },
|
||||
{ "peachpuff", rgb(255, 218, 185) },
|
||||
{ "peru", rgb(205, 133, 63) },
|
||||
{ "pink", rgb(255, 192, 203) },
|
||||
{ "plum", rgb(221, 160, 221) },
|
||||
{ "powderblue", rgb(176, 224, 230) },
|
||||
{ "purple", rgb(128, 0, 128) },
|
||||
{ "red", rgb(255, 0, 0) },
|
||||
{ "rosybrown", rgb(188, 143, 143) },
|
||||
{ "royalblue", rgb( 65, 105, 225) },
|
||||
{ "saddlebrown", rgb(139, 69, 19) },
|
||||
{ "salmon", rgb(250, 128, 114) },
|
||||
{ "sandybrown", rgb(244, 164, 96) },
|
||||
{ "seagreen", rgb( 46, 139, 87) },
|
||||
{ "seashell", rgb(255, 245, 238) },
|
||||
{ "sienna", rgb(160, 82, 45) },
|
||||
{ "silver", rgb(192, 192, 192) },
|
||||
{ "skyblue", rgb(135, 206, 235) },
|
||||
{ "slateblue", rgb(106, 90, 205) },
|
||||
{ "slategray", rgb(112, 128, 144) },
|
||||
{ "slategrey", rgb(112, 128, 144) },
|
||||
{ "snow", rgb(255, 250, 250) },
|
||||
{ "springgreen", rgb( 0, 255, 127) },
|
||||
{ "steelblue", rgb( 70, 130, 180) },
|
||||
{ "tan", rgb(210, 180, 140) },
|
||||
{ "teal", rgb( 0, 128, 128) },
|
||||
{ "thistle", rgb(216, 191, 216) },
|
||||
{ "tomato", rgb(255, 99, 71) },
|
||||
{ "transparent", 0 },
|
||||
{ "turquoise", rgb( 64, 224, 208) },
|
||||
{ "violet", rgb(238, 130, 238) },
|
||||
{ "wheat", rgb(245, 222, 179) },
|
||||
{ "white", rgb(255, 255, 255) },
|
||||
{ "whitesmoke", rgb(245, 245, 245) },
|
||||
{ "yellow", rgb(255, 255, 0) },
|
||||
{ "yellowgreen", rgb(154, 205, 50) }
|
||||
};
|
||||
|
||||
static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData);
|
||||
|
||||
#undef rgb
|
||||
|
||||
#if defined(Q_CC_MSVC) && _MSC_VER < 1600
|
||||
inline bool operator<(const RGBData &data1, const RGBData &data2)
|
||||
{ return qstrcmp(data1.name, data2.name) < 0; }
|
||||
#endif
|
||||
|
||||
inline bool operator<(const char *name, const RGBData &data)
|
||||
{ return qstrcmp(name, data.name) < 0; }
|
||||
inline bool operator<(const RGBData &data, const char *name)
|
||||
{ return qstrcmp(data.name, name) < 0; }
|
||||
|
||||
static bool get_named_rgb(const char *name_no_space, QRgb *rgb)
|
||||
{
|
||||
const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space);
|
||||
if ((r != rgbTbl + rgbTblSize) && !(name_no_space < *r)) {
|
||||
*rgb = r->value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool qt_get_named_rgb(const char *name, QRgb* rgb)
|
||||
{
|
||||
int len = int(strlen(name));
|
||||
if (len > 255)
|
||||
return false;
|
||||
char name_no_space[256];
|
||||
int pos = 0;
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (name[i] != '\t' && name[i] != ' ')
|
||||
name_no_space[pos++] = QChar::toLower(name[i]);
|
||||
}
|
||||
name_no_space[pos] = 0;
|
||||
|
||||
return get_named_rgb(name_no_space, rgb);
|
||||
}
|
||||
|
||||
bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb)
|
||||
{
|
||||
if (len > 255)
|
||||
return false;
|
||||
char name_no_space[256];
|
||||
int pos = 0;
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (name[i] != QLatin1Char('\t') && name[i] != QLatin1Char(' '))
|
||||
name_no_space[pos++] = name[i].toLower().toLatin1();
|
||||
}
|
||||
name_no_space[pos] = 0;
|
||||
return get_named_rgb(name_no_space, rgb);
|
||||
}
|
||||
|
||||
QStringList qt_get_colornames()
|
||||
{
|
||||
int i = 0;
|
||||
QStringList lst;
|
||||
lst.reserve(rgbTblSize);
|
||||
for (i = 0; i < rgbTblSize; i++)
|
||||
lst << QLatin1String(rgbTbl[i].name);
|
||||
return lst;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
bool qt_get_named_rgb(const char *, QRgb*)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList qt_get_colornames()
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
#endif // QT_NO_COLORNAMES
|
||||
|
||||
/*!
|
||||
\class QColor
|
||||
\brief The QColor class provides colors based on RGB, HSV or CMYK values.
|
||||
|
@ -1,369 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the QtGui module 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 "qglobal.h"
|
||||
#include "qrgb.h"
|
||||
#include "qstringlist.h"
|
||||
#include "private/qtools_p.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*!
|
||||
\internal
|
||||
If s[0..1] is a valid hex number, returns its integer value,
|
||||
otherwise returns -1.
|
||||
*/
|
||||
static inline int hex2int(const char *s)
|
||||
{
|
||||
const int hi = QtMiscUtils::fromHex(s[0]);
|
||||
if (hi < 0)
|
||||
return -1;
|
||||
const int lo = QtMiscUtils::fromHex(s[1]);
|
||||
if (lo < 0)
|
||||
return -1;
|
||||
return (hi << 4) | lo;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
If s is a valid hex digit, returns its integer value,
|
||||
multiplied by 0x11, otherwise returns -1.
|
||||
*/
|
||||
static inline int hex2int(char s)
|
||||
{
|
||||
const int h = QtMiscUtils::fromHex(s);
|
||||
return h < 0 ? h : (h << 4) | h;
|
||||
}
|
||||
|
||||
bool qt_get_hex_rgb(const char *name, QRgb *rgb)
|
||||
{
|
||||
if(name[0] != '#')
|
||||
return false;
|
||||
name++;
|
||||
int len = qstrlen(name);
|
||||
int a, r, g, b;
|
||||
a = 255;
|
||||
if (len == 12) {
|
||||
r = hex2int(name);
|
||||
g = hex2int(name + 4);
|
||||
b = hex2int(name + 8);
|
||||
} else if (len == 9) {
|
||||
r = hex2int(name);
|
||||
g = hex2int(name + 3);
|
||||
b = hex2int(name + 6);
|
||||
} else if (len == 8) {
|
||||
a = hex2int(name);
|
||||
r = hex2int(name + 2);
|
||||
g = hex2int(name + 4);
|
||||
b = hex2int(name + 6);
|
||||
} else if (len == 6) {
|
||||
r = hex2int(name);
|
||||
g = hex2int(name + 2);
|
||||
b = hex2int(name + 4);
|
||||
} else if (len == 3) {
|
||||
r = hex2int(name[0]);
|
||||
g = hex2int(name[1]);
|
||||
b = hex2int(name[2]);
|
||||
} else {
|
||||
r = g = b = -1;
|
||||
}
|
||||
if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) {
|
||||
*rgb = 0;
|
||||
return false;
|
||||
}
|
||||
*rgb = qRgba(r, g ,b, a);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool qt_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
|
||||
{
|
||||
if (len > 13)
|
||||
return false;
|
||||
char tmp[16];
|
||||
for(int i = 0; i < len; ++i)
|
||||
tmp[i] = str[i].toLatin1();
|
||||
tmp[len] = 0;
|
||||
return qt_get_hex_rgb(tmp, rgb);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_COLORNAMES
|
||||
|
||||
/*
|
||||
CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0))
|
||||
*/
|
||||
|
||||
#ifdef rgb
|
||||
# undef rgb
|
||||
#endif
|
||||
#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
|
||||
|
||||
static const struct RGBData {
|
||||
const char name[21];
|
||||
uint value;
|
||||
} rgbTbl[] = {
|
||||
{ "aliceblue", rgb(240, 248, 255) },
|
||||
{ "antiquewhite", rgb(250, 235, 215) },
|
||||
{ "aqua", rgb( 0, 255, 255) },
|
||||
{ "aquamarine", rgb(127, 255, 212) },
|
||||
{ "azure", rgb(240, 255, 255) },
|
||||
{ "beige", rgb(245, 245, 220) },
|
||||
{ "bisque", rgb(255, 228, 196) },
|
||||
{ "black", rgb( 0, 0, 0) },
|
||||
{ "blanchedalmond", rgb(255, 235, 205) },
|
||||
{ "blue", rgb( 0, 0, 255) },
|
||||
{ "blueviolet", rgb(138, 43, 226) },
|
||||
{ "brown", rgb(165, 42, 42) },
|
||||
{ "burlywood", rgb(222, 184, 135) },
|
||||
{ "cadetblue", rgb( 95, 158, 160) },
|
||||
{ "chartreuse", rgb(127, 255, 0) },
|
||||
{ "chocolate", rgb(210, 105, 30) },
|
||||
{ "coral", rgb(255, 127, 80) },
|
||||
{ "cornflowerblue", rgb(100, 149, 237) },
|
||||
{ "cornsilk", rgb(255, 248, 220) },
|
||||
{ "crimson", rgb(220, 20, 60) },
|
||||
{ "cyan", rgb( 0, 255, 255) },
|
||||
{ "darkblue", rgb( 0, 0, 139) },
|
||||
{ "darkcyan", rgb( 0, 139, 139) },
|
||||
{ "darkgoldenrod", rgb(184, 134, 11) },
|
||||
{ "darkgray", rgb(169, 169, 169) },
|
||||
{ "darkgreen", rgb( 0, 100, 0) },
|
||||
{ "darkgrey", rgb(169, 169, 169) },
|
||||
{ "darkkhaki", rgb(189, 183, 107) },
|
||||
{ "darkmagenta", rgb(139, 0, 139) },
|
||||
{ "darkolivegreen", rgb( 85, 107, 47) },
|
||||
{ "darkorange", rgb(255, 140, 0) },
|
||||
{ "darkorchid", rgb(153, 50, 204) },
|
||||
{ "darkred", rgb(139, 0, 0) },
|
||||
{ "darksalmon", rgb(233, 150, 122) },
|
||||
{ "darkseagreen", rgb(143, 188, 143) },
|
||||
{ "darkslateblue", rgb( 72, 61, 139) },
|
||||
{ "darkslategray", rgb( 47, 79, 79) },
|
||||
{ "darkslategrey", rgb( 47, 79, 79) },
|
||||
{ "darkturquoise", rgb( 0, 206, 209) },
|
||||
{ "darkviolet", rgb(148, 0, 211) },
|
||||
{ "deeppink", rgb(255, 20, 147) },
|
||||
{ "deepskyblue", rgb( 0, 191, 255) },
|
||||
{ "dimgray", rgb(105, 105, 105) },
|
||||
{ "dimgrey", rgb(105, 105, 105) },
|
||||
{ "dodgerblue", rgb( 30, 144, 255) },
|
||||
{ "firebrick", rgb(178, 34, 34) },
|
||||
{ "floralwhite", rgb(255, 250, 240) },
|
||||
{ "forestgreen", rgb( 34, 139, 34) },
|
||||
{ "fuchsia", rgb(255, 0, 255) },
|
||||
{ "gainsboro", rgb(220, 220, 220) },
|
||||
{ "ghostwhite", rgb(248, 248, 255) },
|
||||
{ "gold", rgb(255, 215, 0) },
|
||||
{ "goldenrod", rgb(218, 165, 32) },
|
||||
{ "gray", rgb(128, 128, 128) },
|
||||
{ "green", rgb( 0, 128, 0) },
|
||||
{ "greenyellow", rgb(173, 255, 47) },
|
||||
{ "grey", rgb(128, 128, 128) },
|
||||
{ "honeydew", rgb(240, 255, 240) },
|
||||
{ "hotpink", rgb(255, 105, 180) },
|
||||
{ "indianred", rgb(205, 92, 92) },
|
||||
{ "indigo", rgb( 75, 0, 130) },
|
||||
{ "ivory", rgb(255, 255, 240) },
|
||||
{ "khaki", rgb(240, 230, 140) },
|
||||
{ "lavender", rgb(230, 230, 250) },
|
||||
{ "lavenderblush", rgb(255, 240, 245) },
|
||||
{ "lawngreen", rgb(124, 252, 0) },
|
||||
{ "lemonchiffon", rgb(255, 250, 205) },
|
||||
{ "lightblue", rgb(173, 216, 230) },
|
||||
{ "lightcoral", rgb(240, 128, 128) },
|
||||
{ "lightcyan", rgb(224, 255, 255) },
|
||||
{ "lightgoldenrodyellow", rgb(250, 250, 210) },
|
||||
{ "lightgray", rgb(211, 211, 211) },
|
||||
{ "lightgreen", rgb(144, 238, 144) },
|
||||
{ "lightgrey", rgb(211, 211, 211) },
|
||||
{ "lightpink", rgb(255, 182, 193) },
|
||||
{ "lightsalmon", rgb(255, 160, 122) },
|
||||
{ "lightseagreen", rgb( 32, 178, 170) },
|
||||
{ "lightskyblue", rgb(135, 206, 250) },
|
||||
{ "lightslategray", rgb(119, 136, 153) },
|
||||
{ "lightslategrey", rgb(119, 136, 153) },
|
||||
{ "lightsteelblue", rgb(176, 196, 222) },
|
||||
{ "lightyellow", rgb(255, 255, 224) },
|
||||
{ "lime", rgb( 0, 255, 0) },
|
||||
{ "limegreen", rgb( 50, 205, 50) },
|
||||
{ "linen", rgb(250, 240, 230) },
|
||||
{ "magenta", rgb(255, 0, 255) },
|
||||
{ "maroon", rgb(128, 0, 0) },
|
||||
{ "mediumaquamarine", rgb(102, 205, 170) },
|
||||
{ "mediumblue", rgb( 0, 0, 205) },
|
||||
{ "mediumorchid", rgb(186, 85, 211) },
|
||||
{ "mediumpurple", rgb(147, 112, 219) },
|
||||
{ "mediumseagreen", rgb( 60, 179, 113) },
|
||||
{ "mediumslateblue", rgb(123, 104, 238) },
|
||||
{ "mediumspringgreen", rgb( 0, 250, 154) },
|
||||
{ "mediumturquoise", rgb( 72, 209, 204) },
|
||||
{ "mediumvioletred", rgb(199, 21, 133) },
|
||||
{ "midnightblue", rgb( 25, 25, 112) },
|
||||
{ "mintcream", rgb(245, 255, 250) },
|
||||
{ "mistyrose", rgb(255, 228, 225) },
|
||||
{ "moccasin", rgb(255, 228, 181) },
|
||||
{ "navajowhite", rgb(255, 222, 173) },
|
||||
{ "navy", rgb( 0, 0, 128) },
|
||||
{ "oldlace", rgb(253, 245, 230) },
|
||||
{ "olive", rgb(128, 128, 0) },
|
||||
{ "olivedrab", rgb(107, 142, 35) },
|
||||
{ "orange", rgb(255, 165, 0) },
|
||||
{ "orangered", rgb(255, 69, 0) },
|
||||
{ "orchid", rgb(218, 112, 214) },
|
||||
{ "palegoldenrod", rgb(238, 232, 170) },
|
||||
{ "palegreen", rgb(152, 251, 152) },
|
||||
{ "paleturquoise", rgb(175, 238, 238) },
|
||||
{ "palevioletred", rgb(219, 112, 147) },
|
||||
{ "papayawhip", rgb(255, 239, 213) },
|
||||
{ "peachpuff", rgb(255, 218, 185) },
|
||||
{ "peru", rgb(205, 133, 63) },
|
||||
{ "pink", rgb(255, 192, 203) },
|
||||
{ "plum", rgb(221, 160, 221) },
|
||||
{ "powderblue", rgb(176, 224, 230) },
|
||||
{ "purple", rgb(128, 0, 128) },
|
||||
{ "red", rgb(255, 0, 0) },
|
||||
{ "rosybrown", rgb(188, 143, 143) },
|
||||
{ "royalblue", rgb( 65, 105, 225) },
|
||||
{ "saddlebrown", rgb(139, 69, 19) },
|
||||
{ "salmon", rgb(250, 128, 114) },
|
||||
{ "sandybrown", rgb(244, 164, 96) },
|
||||
{ "seagreen", rgb( 46, 139, 87) },
|
||||
{ "seashell", rgb(255, 245, 238) },
|
||||
{ "sienna", rgb(160, 82, 45) },
|
||||
{ "silver", rgb(192, 192, 192) },
|
||||
{ "skyblue", rgb(135, 206, 235) },
|
||||
{ "slateblue", rgb(106, 90, 205) },
|
||||
{ "slategray", rgb(112, 128, 144) },
|
||||
{ "slategrey", rgb(112, 128, 144) },
|
||||
{ "snow", rgb(255, 250, 250) },
|
||||
{ "springgreen", rgb( 0, 255, 127) },
|
||||
{ "steelblue", rgb( 70, 130, 180) },
|
||||
{ "tan", rgb(210, 180, 140) },
|
||||
{ "teal", rgb( 0, 128, 128) },
|
||||
{ "thistle", rgb(216, 191, 216) },
|
||||
{ "tomato", rgb(255, 99, 71) },
|
||||
{ "transparent", 0 },
|
||||
{ "turquoise", rgb( 64, 224, 208) },
|
||||
{ "violet", rgb(238, 130, 238) },
|
||||
{ "wheat", rgb(245, 222, 179) },
|
||||
{ "white", rgb(255, 255, 255) },
|
||||
{ "whitesmoke", rgb(245, 245, 245) },
|
||||
{ "yellow", rgb(255, 255, 0) },
|
||||
{ "yellowgreen", rgb(154, 205, 50) }
|
||||
};
|
||||
|
||||
static const int rgbTblSize = sizeof(rgbTbl) / sizeof(RGBData);
|
||||
|
||||
#undef rgb
|
||||
|
||||
#if defined(Q_CC_MSVC) && _MSC_VER < 1600
|
||||
inline bool operator<(const RGBData &data1, const RGBData &data2)
|
||||
{ return qstrcmp(data1.name, data2.name) < 0; }
|
||||
#endif
|
||||
|
||||
inline bool operator<(const char *name, const RGBData &data)
|
||||
{ return qstrcmp(name, data.name) < 0; }
|
||||
inline bool operator<(const RGBData &data, const char *name)
|
||||
{ return qstrcmp(data.name, name) < 0; }
|
||||
|
||||
static bool get_named_rgb(const char *name_no_space, QRgb *rgb)
|
||||
{
|
||||
const RGBData *r = std::lower_bound(rgbTbl, rgbTbl + rgbTblSize, name_no_space);
|
||||
if ((r != rgbTbl + rgbTblSize) && !(name_no_space < *r)) {
|
||||
*rgb = r->value;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool qt_get_named_rgb(const char *name, QRgb* rgb)
|
||||
{
|
||||
int len = int(strlen(name));
|
||||
if(len > 255)
|
||||
return false;
|
||||
char name_no_space[256];
|
||||
int pos = 0;
|
||||
for(int i = 0; i < len; i++) {
|
||||
if(name[i] != '\t' && name[i] != ' ')
|
||||
name_no_space[pos++] = QChar::toLower(name[i]);
|
||||
}
|
||||
name_no_space[pos] = 0;
|
||||
|
||||
return get_named_rgb(name_no_space, rgb);
|
||||
}
|
||||
|
||||
bool qt_get_named_rgb(const QChar *name, int len, QRgb *rgb)
|
||||
{
|
||||
if(len > 255)
|
||||
return false;
|
||||
char name_no_space[256];
|
||||
int pos = 0;
|
||||
for(int i = 0; i < len; i++) {
|
||||
if(name[i] != QLatin1Char('\t') && name[i] != QLatin1Char(' '))
|
||||
name_no_space[pos++] = name[i].toLower().toLatin1();
|
||||
}
|
||||
name_no_space[pos] = 0;
|
||||
return get_named_rgb(name_no_space, rgb);
|
||||
}
|
||||
|
||||
QStringList qt_get_colornames()
|
||||
{
|
||||
int i = 0;
|
||||
QStringList lst;
|
||||
lst.reserve(rgbTblSize);
|
||||
for (i = 0; i < rgbTblSize; i++)
|
||||
lst << QLatin1String(rgbTbl[i].name);
|
||||
return lst;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
bool qt_get_named_rgb(const char *, QRgb*)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList qt_get_colornames()
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
#endif // QT_NO_COLORNAMES
|
||||
|
||||
QT_END_NAMESPACE
|
@ -2176,7 +2176,8 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
fetchTransformedBilinear_pixelBounds<blendType>(image_height, image_y1, image_y2, y1, y2);
|
||||
const uint *s1 = (const uint *)data->texture.scanLine(y1);
|
||||
const uint *s2 = (const uint *)data->texture.scanLine(y2);
|
||||
int disty = ((fy & 0x0000ffff) + 0x0800) >> 12;
|
||||
const int disty8 = (fy & 0x0000ffff) >> 8;
|
||||
const int disty4 = (disty8 + 0x08) >> 4;
|
||||
|
||||
if (blendType != BlendTransformedBilinearTiled) {
|
||||
#define BILINEAR_DOWNSCALE_BOUNDS_PROLOG \
|
||||
@ -2188,12 +2189,9 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2); \
|
||||
if (x1 != x2) \
|
||||
break; \
|
||||
uint tl = s1[x1]; \
|
||||
uint tr = s1[x2]; \
|
||||
uint bl = s2[x1]; \
|
||||
uint br = s2[x2]; \
|
||||
int distx = ((fx & 0x0000ffff) + 0x0800) >> 12; \
|
||||
*b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty); \
|
||||
uint top = s1[x1]; \
|
||||
uint bot = s2[x1]; \
|
||||
*b = INTERPOLATE_PIXEL_256(top, 256 - disty8, bot, disty8); \
|
||||
fx += fdx; \
|
||||
++b; \
|
||||
} \
|
||||
@ -2209,7 +2207,7 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
|
||||
const __m128i colorMask = _mm_set1_epi32(0x00ff00ff);
|
||||
const __m128i v_256 = _mm_set1_epi16(256);
|
||||
const __m128i v_disty = _mm_set1_epi16(disty);
|
||||
const __m128i v_disty = _mm_set1_epi16(disty4);
|
||||
const __m128i v_fdx = _mm_set1_epi32(fdx*4);
|
||||
const __m128i v_fx_r = _mm_set1_epi32(0x8);
|
||||
__m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
|
||||
@ -2241,18 +2239,14 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
const int16x8_t colorMask = vdupq_n_s16(0x00ff);
|
||||
const int16x8_t invColorMask = vmvnq_s16(colorMask);
|
||||
const int16x8_t v_256 = vdupq_n_s16(256);
|
||||
const int16x8_t v_disty = vdupq_n_s16(disty);
|
||||
const int16x8_t v_disty = vdupq_n_s16(disty4);
|
||||
const int16x8_t v_disty_ = vshlq_n_s16(v_disty, 4);
|
||||
int32x4_t v_fdx = vdupq_n_s32(fdx*4);
|
||||
|
||||
int32x4_t v_fx = vmovq_n_s32(fx);
|
||||
fx += fdx;
|
||||
v_fx = vsetq_lane_s32(fx, v_fx, 1);
|
||||
fx += fdx;
|
||||
v_fx = vsetq_lane_s32(fx, v_fx, 2);
|
||||
fx += fdx;
|
||||
v_fx = vsetq_lane_s32(fx, v_fx, 3);
|
||||
fx += fdx;
|
||||
v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
|
||||
v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
|
||||
v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
|
||||
|
||||
const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
|
||||
const int32x4_t v_fx_r = vdupq_n_s32(0x0800);
|
||||
@ -2260,18 +2254,20 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
while (b < boundedEnd) {
|
||||
uint32x4x2_t v_top, v_bot;
|
||||
|
||||
int32x4_t v_fx_shifted = vshrq_n_s32(v_fx, 16);
|
||||
|
||||
int x1 = vgetq_lane_s32(v_fx_shifted, 0);
|
||||
int x1 = (fx >> 16);
|
||||
fx += fdx;
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 0);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 0);
|
||||
x1 = vgetq_lane_s32(v_fx_shifted, 1);
|
||||
x1 = (fx >> 16);
|
||||
fx += fdx;
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 1);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 1);
|
||||
x1 = vgetq_lane_s32(v_fx_shifted, 2);
|
||||
x1 = (fx >> 16);
|
||||
fx += fdx;
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 2);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 2);
|
||||
x1 = vgetq_lane_s32(v_fx_shifted, 3);
|
||||
x1 = (fx >> 16);
|
||||
fx += fdx;
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 3);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 3);
|
||||
|
||||
@ -2286,7 +2282,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
b+=4;
|
||||
v_fx = vaddq_s32(v_fx, v_fdx);
|
||||
}
|
||||
fx = vgetq_lane_s32(v_fx, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -2298,8 +2293,14 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
uint tr = s1[x2];
|
||||
uint bl = s2[x1];
|
||||
uint br = s2[x2];
|
||||
int distx = ((fx & 0x0000ffff) + 0x0800) >> 12;
|
||||
*b = interpolate_4_pixels_16(tl, tr, bl, br, distx, disty);
|
||||
#if defined(__SSE2__) || defined(__ARM_NEON__)
|
||||
// The optimized interpolate_4_pixels are faster than interpolate_4_pixels_16.
|
||||
int distx8 = (fx & 0x0000ffff) >> 8;
|
||||
*b = interpolate_4_pixels(tl, tr, bl, br, distx8, disty8);
|
||||
#else
|
||||
int distx4 = ((fx & 0x0000ffff) + 0x0800) >> 12;
|
||||
*b = interpolate_4_pixels_16(tl, tr, bl, br, distx4, disty4);
|
||||
#endif
|
||||
fx += fdx;
|
||||
++b;
|
||||
}
|
||||
@ -2436,16 +2437,12 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
|
||||
int32x4_t v_fx = vmovq_n_s32(fx);
|
||||
int32x4_t v_fy = vmovq_n_s32(fy);
|
||||
fx += fdx; fy += fdy;
|
||||
v_fx = vsetq_lane_s32(fx, v_fx, 1);
|
||||
v_fy = vsetq_lane_s32(fy, v_fy, 1);
|
||||
fx += fdx; fy += fdy;
|
||||
v_fx = vsetq_lane_s32(fx, v_fx, 2);
|
||||
v_fy = vsetq_lane_s32(fy, v_fy, 2);
|
||||
fx += fdx; fy += fdy;
|
||||
v_fx = vsetq_lane_s32(fx, v_fx, 3);
|
||||
v_fy = vsetq_lane_s32(fy, v_fy, 3);
|
||||
fx += fdx; fy += fdy;
|
||||
v_fx = vsetq_lane_s32(fx + fdx, v_fx, 1);
|
||||
v_fy = vsetq_lane_s32(fy + fdy, v_fy, 1);
|
||||
v_fx = vsetq_lane_s32(fx + fdx * 2, v_fx, 2);
|
||||
v_fy = vsetq_lane_s32(fy + fdy * 2, v_fy, 2);
|
||||
v_fx = vsetq_lane_s32(fx + fdx * 3, v_fx, 3);
|
||||
v_fy = vsetq_lane_s32(fy + fdy * 3, v_fy, 3);
|
||||
|
||||
const int32x4_t v_ffff_mask = vdupq_n_s32(0x0000ffff);
|
||||
const int32x4_t v_round = vdupq_n_s32(0x0800);
|
||||
@ -2453,33 +2450,33 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
while (b < boundedEnd) {
|
||||
uint32x4x2_t v_top, v_bot;
|
||||
|
||||
int32x4_t v_fx_shifted, v_fy_shifted;
|
||||
v_fx_shifted = vshrq_n_s32(v_fx, 16);
|
||||
v_fy_shifted = vshrq_n_s32(v_fy, 16);
|
||||
|
||||
int x1 = vgetq_lane_s32(v_fx_shifted, 0);
|
||||
int y1 = vgetq_lane_s32(v_fy_shifted, 0);
|
||||
int x1 = (fx >> 16);
|
||||
int y1 = (fy >> 16);
|
||||
fx += fdx; fy += fdy;
|
||||
const uchar *sl = textureData + bytesPerLine * y1;
|
||||
const uint *s1 = reinterpret_cast<const uint *>(sl);
|
||||
const uint *s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 0);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 0);
|
||||
x1 = vgetq_lane_s32(v_fx_shifted, 1);
|
||||
y1 = vgetq_lane_s32(v_fy_shifted, 1);
|
||||
x1 = (fx >> 16);
|
||||
y1 = (fy >> 16);
|
||||
fx += fdx; fy += fdy;
|
||||
sl = textureData + bytesPerLine * y1;
|
||||
s1 = reinterpret_cast<const uint *>(sl);
|
||||
s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 1);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 1);
|
||||
x1 = vgetq_lane_s32(v_fx_shifted, 2);
|
||||
y1 = vgetq_lane_s32(v_fy_shifted, 2);
|
||||
x1 = (fx >> 16);
|
||||
y1 = (fy >> 16);
|
||||
fx += fdx; fy += fdy;
|
||||
sl = textureData + bytesPerLine * y1;
|
||||
s1 = reinterpret_cast<const uint *>(sl);
|
||||
s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
|
||||
v_top = vld2q_lane_u32(s1 + x1, v_top, 2);
|
||||
v_bot = vld2q_lane_u32(s2 + x1, v_bot, 2);
|
||||
x1 = vgetq_lane_s32(v_fx_shifted, 3);
|
||||
y1 = vgetq_lane_s32(v_fy_shifted, 3);
|
||||
x1 = (fx >> 16);
|
||||
y1 = (fy >> 16);
|
||||
fx += fdx; fy += fdy;
|
||||
sl = textureData + bytesPerLine * y1;
|
||||
s1 = reinterpret_cast<const uint *>(sl);
|
||||
s2 = reinterpret_cast<const uint *>(sl + bytesPerLine);
|
||||
@ -2501,8 +2498,6 @@ static const uint * QT_FASTCALL fetchTransformedBilinearARGB32PM(uint *buffer, c
|
||||
v_fx = vaddq_s32(v_fx, v_fdx);
|
||||
v_fy = vaddq_s32(v_fy, v_fdy);
|
||||
}
|
||||
fx = vgetq_lane_s32(v_fx, 0);
|
||||
fy = vgetq_lane_s32(v_fy, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -2980,10 +2975,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
|
||||
fetchTransformedBilinear_pixelBounds<blendType>(image_width, image_x1, image_x2, x1, x2);
|
||||
if (x1 != x2)
|
||||
break;
|
||||
sbuf1[i * 2 + 0] = ((const uint*)s1)[x1];
|
||||
sbuf1[i * 2 + 1] = ((const uint*)s1)[x2];
|
||||
sbuf2[i * 2 + 0] = ((const uint*)s2)[x1];
|
||||
sbuf2[i * 2 + 1] = ((const uint*)s2)[x2];
|
||||
sbuf1[i * 2 + 0] = sbuf1[i * 2 + 1] = ((const uint*)s1)[x1];
|
||||
sbuf2[i * 2 + 0] = sbuf2[i * 2 + 1] = ((const uint*)s2)[x1];
|
||||
fx += fdx;
|
||||
}
|
||||
int fastLen;
|
||||
@ -3102,6 +3095,16 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
|
||||
fx += fdx;
|
||||
fy += fdy;
|
||||
}
|
||||
int fastLen = len;
|
||||
if (fdx > 0)
|
||||
fastLen = qMin(fastLen, int((qint64(image_x2) * fixed_scale - fx) / fdx));
|
||||
else if (fdx < 0)
|
||||
fastLen = qMin(fastLen, int((qint64(image_x1) * fixed_scale - fx) / fdx));
|
||||
if (fdy > 0)
|
||||
fastLen = qMin(fastLen, int((qint64(image_y2) * fixed_scale - fy) / fdy));
|
||||
else if (fdy < 0)
|
||||
fastLen = qMin(fastLen, int((qint64(image_y1) * fixed_scale - fy) / fdy));
|
||||
fastLen -= 3;
|
||||
|
||||
const __m128i v_fdx = _mm_set1_epi32(fdx*4);
|
||||
const __m128i v_fdy = _mm_set1_epi32(fdy*4);
|
||||
@ -3111,15 +3114,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
|
||||
const uchar *s1 = data->texture.imageData;
|
||||
const uchar *s2 = s1 + bytesPerLine;
|
||||
const __m128i vbpl = _mm_shufflelo_epi16(_mm_cvtsi32_si128(bytesPerLine/4), _MM_SHUFFLE(0, 0, 0, 0));
|
||||
for (; i < len-3; i+=4) {
|
||||
if (fdx > 0 && (short)_mm_extract_epi16(v_fx, 7) >= image_x2)
|
||||
break;
|
||||
if (fdx < 0 && (short)_mm_extract_epi16(v_fx, 7) < image_x1)
|
||||
break;
|
||||
if (fdy > 0 && (short)_mm_extract_epi16(v_fy, 7) >= image_y2)
|
||||
break;
|
||||
if (fdy < 0 && (short)_mm_extract_epi16(v_fy, 7) < image_y1)
|
||||
break;
|
||||
for (; i < fastLen; i += 4) {
|
||||
const __m128i vy = _mm_packs_epi32(_mm_srai_epi32(v_fy, 16), _mm_setzero_si128());
|
||||
__m128i voffset = _mm_unpacklo_epi16(_mm_mullo_epi16(vy, vbpl), _mm_mulhi_epu16(vy, vbpl));
|
||||
voffset = _mm_add_epi32(voffset, _mm_srli_epi32(v_fx, 16));
|
||||
@ -5555,17 +5550,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
|
||||
blend_src_generic, // ARGB32
|
||||
blend_transformed_argb, // ARGB32_Premultiplied
|
||||
blend_transformed_rgb565,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic, // ARGB8565_Premultiplied
|
||||
blend_src_generic, // RGB666
|
||||
blend_src_generic, // ARGB6666_Premultiplied
|
||||
blend_src_generic, // RGB555
|
||||
blend_src_generic, // ARGB8555_Premultiplied
|
||||
blend_src_generic, // RGB888
|
||||
blend_src_generic, // RGB444
|
||||
blend_src_generic, // ARGB4444_Premultiplied
|
||||
blend_src_generic, // RGBX8888
|
||||
blend_src_generic, // RGBA8888
|
||||
blend_src_generic, // RGBA8888_Premultiplied
|
||||
blend_src_generic_rgb64,
|
||||
blend_src_generic_rgb64,
|
||||
blend_src_generic_rgb64,
|
||||
@ -5583,16 +5578,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
|
||||
blend_src_generic, // ARGB32
|
||||
blend_transformed_tiled_argb, // ARGB32_Premultiplied
|
||||
blend_transformed_tiled_rgb565,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic, // ARGB8565_Premultiplied
|
||||
blend_src_generic, // RGB666
|
||||
blend_src_generic, // ARGB6666_Premultiplied
|
||||
blend_src_generic, // RGB555
|
||||
blend_src_generic, // ARGB8555_Premultiplied
|
||||
blend_src_generic, // RGB888
|
||||
blend_src_generic, // RGB444
|
||||
blend_src_generic, // ARGB4444_Premultiplied
|
||||
blend_src_generic, // RGBX8888
|
||||
blend_src_generic, // RGBA8888
|
||||
blend_src_generic, // RGBA8888_Premultiplied
|
||||
blend_src_generic_rgb64,
|
||||
blend_src_generic_rgb64,
|
||||
blend_src_generic_rgb64,
|
||||
@ -5610,17 +5606,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats
|
||||
blend_src_generic, // ARGB32
|
||||
blend_src_generic, // ARGB32_Premultiplied
|
||||
blend_transformed_bilinear_rgb565,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic,
|
||||
blend_src_generic, // ARGB8565_Premultiplied
|
||||
blend_src_generic, // RGB666
|
||||
blend_src_generic, // ARGB6666_Premultiplied
|
||||
blend_src_generic, // RGB555
|
||||
blend_src_generic, // ARGB8555_Premultiplied
|
||||
blend_src_generic, // RGB888
|
||||
blend_src_generic, // RGB444
|
||||
blend_src_generic, // ARGB4444_Premultiplied
|
||||
blend_src_generic, // RGBX8888
|
||||
blend_src_generic, // RGBA8888
|
||||
blend_src_generic, // RGBA8888_Premultiplied
|
||||
blend_src_generic_rgb64,
|
||||
blend_src_generic_rgb64,
|
||||
blend_src_generic_rgb64,
|
||||
|
@ -636,6 +636,22 @@ static Q_ALWAYS_INLINE uint BYTE_MUL(uint x, uint a) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src)
|
||||
{
|
||||
if (src >= 0xff000000)
|
||||
dst = src;
|
||||
else if (src != 0)
|
||||
dst = src + BYTE_MUL(dst, qAlpha(~src));
|
||||
}
|
||||
|
||||
static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src, const int const_alpha)
|
||||
{
|
||||
if (src != 0) {
|
||||
const quint32 s = BYTE_MUL(src, const_alpha);
|
||||
dst = s + BYTE_MUL(dst, qAlpha(~s));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__SSE2__)
|
||||
static Q_ALWAYS_INLINE uint interpolate_4_pixels_sse2(__m128i vt, __m128i vb, uint distx, uint disty)
|
||||
{
|
||||
|
@ -45,15 +45,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
inline static void blend_pixel(quint32 &dst, const quint32 src)
|
||||
{
|
||||
if (src >= 0xff000000)
|
||||
dst = src;
|
||||
else if (src != 0)
|
||||
dst = src + BYTE_MUL(dst, qAlpha(~src));
|
||||
}
|
||||
|
||||
|
||||
/* The instruction palignr uses direct arguments, so we have to generate the code fo the different
|
||||
shift (4, 8, 12). Checking the alignment inside the loop is unfortunatelly way too slow.
|
||||
*/
|
||||
|
@ -171,11 +171,7 @@ QT_BEGIN_NAMESPACE
|
||||
\
|
||||
/* First, get dst aligned. */ \
|
||||
ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \
|
||||
uint s = src[x]; \
|
||||
if (s >= 0xff000000) \
|
||||
dst[x] = s; \
|
||||
else if (s != 0) \
|
||||
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
|
||||
blend_pixel(dst[x], src[x]); \
|
||||
} \
|
||||
\
|
||||
for (; x < length-3; x += 4) { \
|
||||
@ -183,11 +179,7 @@ QT_BEGIN_NAMESPACE
|
||||
BLEND_SOURCE_OVER_ARGB32_SSE2_helper(dst, srcVector, nullVector, half, one, colorMask, alphaMask) \
|
||||
} \
|
||||
for (; x < length; ++x) { \
|
||||
uint s = src[x]; \
|
||||
if (s >= 0xff000000) \
|
||||
dst[x] = s; \
|
||||
else if (s != 0) \
|
||||
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
|
||||
blend_pixel(dst[x], src[x]); \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -207,11 +199,7 @@ QT_BEGIN_NAMESPACE
|
||||
int x = 0; \
|
||||
\
|
||||
ALIGNMENT_PROLOGUE_16BYTES(dst, x, length) { \
|
||||
quint32 s = src[x]; \
|
||||
if (s != 0) { \
|
||||
s = BYTE_MUL(s, const_alpha); \
|
||||
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
|
||||
} \
|
||||
blend_pixel(dst[x], src[x], const_alpha); \
|
||||
} \
|
||||
\
|
||||
for (; x < length-3; x += 4) { \
|
||||
@ -232,11 +220,7 @@ QT_BEGIN_NAMESPACE
|
||||
} \
|
||||
} \
|
||||
for (; x < length; ++x) { \
|
||||
quint32 s = src[x]; \
|
||||
if (s != 0) { \
|
||||
s = BYTE_MUL(s, const_alpha); \
|
||||
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); \
|
||||
} \
|
||||
blend_pixel(dst[x], src[x], const_alpha); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
@ -663,11 +663,8 @@ struct QtFontDesc
|
||||
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
|
||||
{
|
||||
fontDef->family = desc.family->name;
|
||||
if (! desc.foundry->name.isEmpty() && desc.family->count > 1) {
|
||||
fontDef->family += QString::fromLatin1(" [");
|
||||
fontDef->family += desc.foundry->name;
|
||||
fontDef->family += QLatin1Char(']');
|
||||
}
|
||||
if (! desc.foundry->name.isEmpty() && desc.family->count > 1)
|
||||
fontDef->family += QLatin1String(" [") + desc.foundry->name + QLatin1Char(']');
|
||||
|
||||
if (desc.style->smoothScalable
|
||||
|| QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()
|
||||
@ -842,9 +839,13 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFo
|
||||
return retList;
|
||||
}
|
||||
|
||||
static void initializeDb();
|
||||
|
||||
static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
|
||||
{
|
||||
QFontDatabasePrivate *db = privateDb();
|
||||
if (!db->count)
|
||||
initializeDb();
|
||||
|
||||
const FallbacksCacheKey cacheKey = { family, style, styleHint, script };
|
||||
|
||||
|
@ -395,10 +395,8 @@ void QPlatformFontDatabase::releaseHandle(void *handle)
|
||||
QString QPlatformFontDatabase::fontDir() const
|
||||
{
|
||||
QString fontpath = QString::fromLocal8Bit(qgetenv("QT_QPA_FONTDIR"));
|
||||
if (fontpath.isEmpty()) {
|
||||
fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
|
||||
fontpath += QLatin1String("/fonts");
|
||||
}
|
||||
if (fontpath.isEmpty())
|
||||
fontpath = QLibraryInfo::location(QLibraryInfo::LibrariesPath) + QLatin1String("/fonts");
|
||||
|
||||
return fontpath;
|
||||
}
|
||||
|
@ -61,10 +61,10 @@ static QString resolveFileName(QString fileName, QUrl *url, qreal targetDevicePi
|
||||
// Also, QFile{Info}::exists works only on filepaths (not urls)
|
||||
|
||||
if (url->isValid()) {
|
||||
if (url->scheme() == QLatin1Literal("qrc")) {
|
||||
if (url->scheme() == QLatin1String("qrc")) {
|
||||
fileName = fileName.right(fileName.length() - 3);
|
||||
}
|
||||
else if (url->scheme() == QLatin1Literal("file")) {
|
||||
else if (url->scheme() == QLatin1String("file")) {
|
||||
fileName = url->toLocalFile();
|
||||
}
|
||||
}
|
||||
|
274
src/network/configure.json
Normal file
274
src/network/configure.json
Normal file
@ -0,0 +1,274 @@
|
||||
{
|
||||
"module": "network",
|
||||
"depends": [
|
||||
"core"
|
||||
],
|
||||
"testDir": "../../config.tests",
|
||||
|
||||
"commandline": {
|
||||
"assignments": {
|
||||
"OPENSSL_LIBS": "openssl.libs",
|
||||
"OPENSSL_LIBS_DEBUG": "openssl.libs.debug",
|
||||
"OPENSSL_LIBS_RELEASE": "openssl.libs.release",
|
||||
"OPENSSL_PATH": "openssl.prefix"
|
||||
},
|
||||
"options": {
|
||||
"libproxy": "boolean",
|
||||
"openssl": { "type": "optionalString", "values": [ "no", "yes", "linked", "runtime" ] },
|
||||
"openssl-linked": { "type": "void", "name": "openssl", "value": "linked" },
|
||||
"openssl-runtime": { "type": "void", "name": "openssl", "value": "runtime" },
|
||||
"sctp": "boolean",
|
||||
"securetransport": "boolean",
|
||||
"ssl": "boolean",
|
||||
"system-proxies": "boolean"
|
||||
}
|
||||
},
|
||||
|
||||
"libraries": {
|
||||
"corewlan": {
|
||||
"label": "CoreWLan",
|
||||
"export": "",
|
||||
"test": "mac/corewlan",
|
||||
"sources": [
|
||||
"-framework CoreWLAN -framework Foundation"
|
||||
]
|
||||
},
|
||||
"network": {
|
||||
"export": "",
|
||||
"sources": [
|
||||
{ "type": "makeSpec", "spec": "NETWORK" }
|
||||
]
|
||||
},
|
||||
"libproxy": {
|
||||
"label": "libproxy",
|
||||
"test": "common/libproxy",
|
||||
"sources": [
|
||||
"-lproxy"
|
||||
]
|
||||
},
|
||||
"openssl": {
|
||||
"label": "OpenSSL Libraries",
|
||||
"export": "",
|
||||
"sources": [
|
||||
{ "type": "openssl" },
|
||||
{
|
||||
"comment": "placeholder for OPENSSL_LIBS{,_{DEBUG,RELEASE}}",
|
||||
"libs": "",
|
||||
"builds": {
|
||||
"debug": "",
|
||||
"release": ""
|
||||
},
|
||||
"condition": "config.win32 && !features.shared"
|
||||
},
|
||||
{ "libs": "-lssleay32 -llibeay32", "condition": "config.win32 && features.shared" },
|
||||
{ "libs": "-lssl -lcrypto", "condition": "!config.win32" }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
"tests": {
|
||||
"getaddrinfo": {
|
||||
"label": "getaddrinfo()",
|
||||
"type": "compile",
|
||||
"test": "unix/getaddrinfo",
|
||||
"use": "network"
|
||||
},
|
||||
"getifaddrs": {
|
||||
"label": "getifaddrs()",
|
||||
"type": "compile",
|
||||
"test": "unix/getifaddrs",
|
||||
"use": "network"
|
||||
},
|
||||
"ipv6ifname": {
|
||||
"label": "IPv6 ifname",
|
||||
"type": "compile",
|
||||
"test": "unix/ipv6ifname",
|
||||
"use": "network"
|
||||
},
|
||||
"openssl": {
|
||||
"label": "OpenSSL",
|
||||
"type": "compile",
|
||||
"test": "unix/openssl"
|
||||
},
|
||||
"sctp": {
|
||||
"label": "SCTP support",
|
||||
"type": "compile",
|
||||
"test": "unix/sctp",
|
||||
"use": "network"
|
||||
}
|
||||
},
|
||||
|
||||
"features": {
|
||||
"corewlan": {
|
||||
"label": "CoreWLan",
|
||||
"condition": "libs.corewlan",
|
||||
"emitIf": "config.darwin",
|
||||
"output": [ "feature", "privateFeature" ]
|
||||
},
|
||||
"getaddrinfo": {
|
||||
"label": "getaddrinfo()",
|
||||
"condition": "tests.getaddrinfo",
|
||||
"output": [ "feature" ]
|
||||
},
|
||||
"getifaddrs": {
|
||||
"label": "getifaddrs()",
|
||||
"condition": "tests.getifaddrs",
|
||||
"output": [ "feature" ]
|
||||
},
|
||||
"ipv6ifname": {
|
||||
"label": "IPv6 ifname",
|
||||
"condition": "tests.ipv6ifname",
|
||||
"output": [ "feature" ]
|
||||
},
|
||||
"libproxy": {
|
||||
"label": "libproxy",
|
||||
"autoDetect": false,
|
||||
"condition": "libs.libproxy",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"openssl": {
|
||||
"label": "OpenSSL",
|
||||
"enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'",
|
||||
"disable": "input.openssl == 'no' || input.ssl == 'no'",
|
||||
"autoDetect": "!config.winrt",
|
||||
"condition": "!features.securetransport && tests.openssl",
|
||||
"output": [
|
||||
"privateFeature",
|
||||
{ "type": "publicQtConfig", "condition": "!features.openssl-linked" },
|
||||
{ "type": "define", "negative": true, "name": "QT_NO_OPENSSL" }
|
||||
]
|
||||
},
|
||||
"openssl-linked": {
|
||||
"label": " Qt directly linked to OpenSSL",
|
||||
"enable": "input.openssl == 'linked'",
|
||||
"disable": "input.openssl != 'linked'",
|
||||
"condition": "features.openssl && libs.openssl",
|
||||
"output": [
|
||||
"privateFeature",
|
||||
{ "type": "varAssign", "name": "OPENSSL_LIBS", "value": "libs.openssl.libs", "eval": "true" },
|
||||
{ "type": "varAssign", "name": "OPENSSL_LIBS_DEBUG", "value": "libs.openssl.builds.debug.libs",
|
||||
"eval": "true", "condition": "config.win32" },
|
||||
{ "type": "varAssign", "name": "OPENSSL_LIBS_RELEASE", "value": "libs.openssl.builds.release.libs",
|
||||
"eval": "true", "condition": "config.win32" },
|
||||
{ "type": "define", "name": "QT_LINKED_OPENSSL" }
|
||||
]
|
||||
},
|
||||
"securetransport": {
|
||||
"label": "SecureTransport",
|
||||
"disable": "input.securetransport == 'no' || input.ssl == 'no'",
|
||||
"condition": "config.darwin && (input.openssl == '' || input.openssl == 'no')",
|
||||
"output": [
|
||||
"privateFeature",
|
||||
{ "type": "define", "name": "QT_SECURETRANSPORT" }
|
||||
]
|
||||
},
|
||||
"ssl": {
|
||||
"label": "SSL",
|
||||
"condition": "config.winrt || features.securetransport || features.openssl",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"sctp": {
|
||||
"label": "SCTP",
|
||||
"autoDetect": false,
|
||||
"condition": "tests.sctp",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"system-proxies": {
|
||||
"label": "Use system proxies",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"ftp": {
|
||||
"label": "FTP",
|
||||
"purpose": "Provides support for the File Transfer Protocol in QNetworkAccessManager.",
|
||||
"section": "Networking",
|
||||
"condition": "features.textdate",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"http": {
|
||||
"label": "HTTP",
|
||||
"purpose": "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager.",
|
||||
"section": "Networking",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"udpsocket": {
|
||||
"label": "QUdpSocket",
|
||||
"purpose": "Provides access to UDP sockets.",
|
||||
"section": "Networking",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"networkproxy": {
|
||||
"label": "QNetworkProxy",
|
||||
"purpose": "Provides network proxy support.",
|
||||
"section": "Networking",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"socks5": {
|
||||
"label": "SOCKS5",
|
||||
"purpose": "Provides SOCKS5 support in QNetworkProxy.",
|
||||
"section": "Networking",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"networkinterface": {
|
||||
"label": "QNetworkInterface",
|
||||
"purpose": "Supports enumerating a host's IP addresses and network interfaces.",
|
||||
"section": "Networking",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"networkdiskcache": {
|
||||
"label": "QNetworkDiskCache",
|
||||
"purpose": "Provides a disk cache for network resources.",
|
||||
"section": "Networking",
|
||||
"condition": "features.temporaryfile",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"bearermanagement": {
|
||||
"label": "Bearer management",
|
||||
"purpose": "Provides bearer management for the network stack.",
|
||||
"section": "Networking",
|
||||
"condition": "features.library && features.networkinterface && features.properties",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"localserver": {
|
||||
"label": "QLocalServer",
|
||||
"purpose": "Provides a local socket based server.",
|
||||
"section": "Networking",
|
||||
"condition": "features.temporaryfile",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
}
|
||||
},
|
||||
|
||||
"report": [
|
||||
{
|
||||
"type": "note",
|
||||
"condition": "features.openssl-linked && libs.openssl.source != 0
|
||||
&& input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''",
|
||||
"message": "When linking against OpenSSL, you can override the default
|
||||
library names through OPENSSL_LIBS.
|
||||
For example:
|
||||
OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
|
||||
}
|
||||
],
|
||||
|
||||
"summary": [
|
||||
{
|
||||
"section": "Qt Network",
|
||||
"entries": [
|
||||
{
|
||||
"type": "feature",
|
||||
"args": "corewlan",
|
||||
"condition": "config.darwin"
|
||||
},
|
||||
"getaddrinfo", "getifaddrs", "ipv6ifname", "libproxy",
|
||||
{
|
||||
"type": "feature",
|
||||
"args": "securetransport",
|
||||
"condition": "config.darwin"
|
||||
},
|
||||
"openssl",
|
||||
"openssl-linked",
|
||||
"sctp",
|
||||
"system-proxies"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
12
src/network/configure.pri
Normal file
12
src/network/configure.pri
Normal file
@ -0,0 +1,12 @@
|
||||
# custom tests
|
||||
|
||||
defineTest(qtConfLibrary_openssl) {
|
||||
libs = $$getenv("OPENSSL_LIBS")
|
||||
!isEmpty(libs) {
|
||||
$${1}.libs = $$libs
|
||||
export($${1}.libs)
|
||||
return(true)
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
|
@ -180,31 +180,23 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict)
|
||||
return QNetworkProxy(proxyType, hostName, port, user, password);
|
||||
}
|
||||
|
||||
const char * cfurlErrorDescription(SInt32 errorCode)
|
||||
namespace {
|
||||
struct PACInfo {
|
||||
QCFType<CFArrayRef> proxies;
|
||||
QCFType<CFErrorRef> error;
|
||||
bool done = false;
|
||||
};
|
||||
|
||||
void proxyAutoConfigCallback(void *client, CFArrayRef proxylist, CFErrorRef error)
|
||||
{
|
||||
switch (errorCode) {
|
||||
case kCFURLUnknownError:
|
||||
return "Unknown Error";
|
||||
case kCFURLUnknownSchemeError:
|
||||
return "Unknown Scheme";
|
||||
case kCFURLResourceNotFoundError:
|
||||
return "Resource Not Found";
|
||||
case kCFURLResourceAccessViolationError:
|
||||
return "Resource Access Violation";
|
||||
case kCFURLRemoteHostUnavailableError:
|
||||
return "Remote Host Unavailable";
|
||||
case kCFURLImproperArgumentsError:
|
||||
return "Improper Arguments";
|
||||
case kCFURLUnknownPropertyKeyError:
|
||||
return "Unknown Property Key";
|
||||
case kCFURLPropertyKeyUnavailableError:
|
||||
return "Property Key Unavailable";
|
||||
case kCFURLTimeoutError:
|
||||
return "Timeout";
|
||||
default:
|
||||
return "Really Unknown Error";
|
||||
}
|
||||
PACInfo *info = reinterpret_cast<PACInfo *>(reinterpret_cast<CFStreamClientContext *>(client)->info);
|
||||
info->done = true;
|
||||
if (proxylist)
|
||||
CFRetain(proxylist);
|
||||
info->proxies = proxylist;
|
||||
info->error = error;
|
||||
}
|
||||
} // anon namespace
|
||||
|
||||
QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
|
||||
{
|
||||
@ -240,23 +232,6 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
|
||||
qWarning("Invalid PAC URL \"%s\"", qPrintable(QCFString::toQString(cfPacLocation)));
|
||||
return result;
|
||||
}
|
||||
SInt32 errorCode;
|
||||
if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, pacUrl, &pacData, NULL, NULL, &errorCode)) {
|
||||
QString pacLocation = QCFString::toQString(cfPacLocation);
|
||||
qWarning("Unable to get the PAC script at \"%s\" (%s)", qPrintable(pacLocation), cfurlErrorDescription(errorCode));
|
||||
return result;
|
||||
}
|
||||
if (!pacData) {
|
||||
qWarning("\"%s\" returned an empty PAC script", qPrintable(QCFString::toQString(cfPacLocation)));
|
||||
return result;
|
||||
}
|
||||
QCFType<CFStringRef> pacScript = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, pacData, kCFStringEncodingISOLatin1);
|
||||
if (!pacScript) {
|
||||
// This should never happen, but the documentation says it may return NULL if there was a problem creating the object.
|
||||
QString pacLocation = QCFString::toQString(cfPacLocation);
|
||||
qWarning("Unable to read the PAC script at \"%s\"", qPrintable(pacLocation));
|
||||
return result;
|
||||
}
|
||||
|
||||
QByteArray encodedURL = query.url().toEncoded(); // converted to UTF-8
|
||||
if (encodedURL.isEmpty()) {
|
||||
@ -268,18 +243,31 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query)
|
||||
return result; // URL creation problem, abort
|
||||
}
|
||||
|
||||
QCFType<CFErrorRef> pacError;
|
||||
QCFType<CFArrayRef> proxies = CFNetworkCopyProxiesForAutoConfigurationScript(pacScript, targetURL, &pacError);
|
||||
if (!proxies) {
|
||||
CFStreamClientContext pacCtx;
|
||||
pacCtx.version = 0;
|
||||
PACInfo pacInfo;
|
||||
pacCtx.info = &pacInfo;
|
||||
pacCtx.retain = NULL;
|
||||
pacCtx.release = NULL;
|
||||
pacCtx.copyDescription = NULL;
|
||||
|
||||
static CFStringRef pacRunLoopMode = CFSTR("qtPACRunLoopMode");
|
||||
|
||||
QCFType<CFRunLoopSourceRef> pacRunLoopSource = CFNetworkExecuteProxyAutoConfigurationURL(pacUrl, targetURL, &proxyAutoConfigCallback, &pacCtx);
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), pacRunLoopSource, pacRunLoopMode);
|
||||
while (!pacInfo.done)
|
||||
CFRunLoopRunInMode(pacRunLoopMode, 1000, /*returnAfterSourceHandled*/ true);
|
||||
|
||||
if (!pacInfo.proxies) {
|
||||
QString pacLocation = QCFString::toQString(cfPacLocation);
|
||||
QCFType<CFStringRef> pacErrorDescription = CFErrorCopyDescription(pacError);
|
||||
QCFType<CFStringRef> pacErrorDescription = CFErrorCopyDescription(pacInfo.error);
|
||||
qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QCFString::toQString(pacErrorDescription)));
|
||||
return result;
|
||||
}
|
||||
|
||||
CFIndex size = CFArrayGetCount(proxies);
|
||||
CFIndex size = CFArrayGetCount(pacInfo.proxies);
|
||||
for (CFIndex i = 0; i < size; ++i) {
|
||||
CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(proxies, i);
|
||||
CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(pacInfo.proxies, i);
|
||||
result << proxyFromDictionary(proxy);
|
||||
}
|
||||
return result;
|
||||
|
@ -41,6 +41,7 @@
|
||||
#define QTNETWORKGLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtNetwork/qtnetwork-config.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -53,5 +53,6 @@
|
||||
|
||||
#include <QtNetwork/qtnetworkglobal.h>
|
||||
#include <QtCore/private/qglobal_p.h>
|
||||
#include <QtNetwork/private/qtnetwork-config_p.h>
|
||||
|
||||
#endif // QTNETWORKGLOBAL_P_H
|
||||
|
@ -1306,10 +1306,12 @@ HRESULT QNativeSocketEnginePrivate::handleConnectOpFinished(IAsyncAction *action
|
||||
if (socketType != QAbstractSocket::TcpSocket)
|
||||
return S_OK;
|
||||
|
||||
#ifndef QT_NO_SSL
|
||||
// Delay the reader so that the SSL socket can upgrade
|
||||
if (sslSocket)
|
||||
QObject::connect(qobject_cast<QSslSocket *>(sslSocket), &QSslSocket::encrypted, q, &QNativeSocketEngine::establishRead);
|
||||
else
|
||||
#endif
|
||||
q->establishRead();
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -111,7 +111,7 @@
|
||||
\value EmailAddress The email address associated with the certificate
|
||||
*/
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtNetwork/qtnetworkglobal.h>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#include "qsslsocket_openssl_symbols_p.h"
|
||||
#endif
|
||||
|
@ -75,8 +75,11 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format)
|
||||
|
||||
QVector<NSOpenGLPixelFormatAttribute> attrs;
|
||||
|
||||
if (format.swapBehavior() != QSurfaceFormat::SingleBuffer)
|
||||
if (format.swapBehavior() == QSurfaceFormat::DoubleBuffer
|
||||
|| format.swapBehavior() == QSurfaceFormat::DefaultSwapBehavior)
|
||||
attrs.append(NSOpenGLPFADoubleBuffer);
|
||||
else if (format.swapBehavior() == QSurfaceFormat::TripleBuffer)
|
||||
attrs.append(NSOpenGLPFATripleBuffer);
|
||||
|
||||
if (format.profile() == QSurfaceFormat::CoreProfile
|
||||
&& ((format.majorVersion() == 3 && format.minorVersion() >= 2)
|
||||
|
@ -51,6 +51,7 @@
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtGui/private/qtguiglobal_p.h>
|
||||
#include <QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -504,7 +504,7 @@ static void populateFromPattern(FcPattern *pattern)
|
||||
|
||||
void QFontconfigDatabase::populateFontDatabase()
|
||||
{
|
||||
FcInitReinitialize();
|
||||
FcInit();
|
||||
FcFontSet *fonts;
|
||||
|
||||
{
|
||||
@ -568,6 +568,12 @@ void QFontconfigDatabase::populateFontDatabase()
|
||||
// QApplication::setFont(font);
|
||||
}
|
||||
|
||||
void QFontconfigDatabase::invalidate()
|
||||
{
|
||||
// Clear app fonts.
|
||||
FcConfigAppFontClear(0);
|
||||
}
|
||||
|
||||
QFontEngineMulti *QFontconfigDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script)
|
||||
{
|
||||
return new QFontEngineMultiFontConfig(fontEngine, script);
|
||||
|
@ -62,6 +62,7 @@ class QFontconfigDatabase : public QBasicFontDatabase
|
||||
{
|
||||
public:
|
||||
void populateFontDatabase() Q_DECL_OVERRIDE;
|
||||
void invalidate() Q_DECL_OVERRIDE;
|
||||
QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) Q_DECL_OVERRIDE;
|
||||
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) Q_DECL_OVERRIDE;
|
||||
QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) Q_DECL_OVERRIDE;
|
||||
|
@ -51,6 +51,7 @@
|
||||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtGui/private/qtguiglobal_p.h>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
|
@ -73,8 +73,7 @@ QPixmap QAbstractFileIconEngine::pixmap(const QSize &size, QIcon::Mode mode,
|
||||
if (key.isEmpty())
|
||||
return filePixmap(size, mode, state);
|
||||
|
||||
key += QLatin1Char('_');
|
||||
key += QString::number(size.width());
|
||||
key += QLatin1Char('_') + QString::number(size.width());
|
||||
|
||||
QPixmap result;
|
||||
if (!QPixmapCache::find(key, result)) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
TEMPLATE = subdirs
|
||||
QT_FOR_CONFIG += network-private
|
||||
|
||||
!android:linux*:qtHaveModule(dbus) {
|
||||
SUBDIRS += generic
|
||||
|
@ -93,9 +93,9 @@ void QConnmanEngine::initialize()
|
||||
connect(connmanManager,SIGNAL(servicesReady(QStringList)),this,SLOT(servicesReady(QStringList)));
|
||||
connect(connmanManager,SIGNAL(scanFinished(bool)),this,SLOT(finishedScan(bool)));
|
||||
|
||||
foreach (const QString &servPath, connmanManager->getServices()) {
|
||||
const auto servPaths = connmanManager->getServices();
|
||||
for (const QString &servPath : servPaths)
|
||||
addServiceConfiguration(servPath);
|
||||
}
|
||||
Q_EMIT updateCompleted();
|
||||
}
|
||||
|
||||
@ -115,9 +115,8 @@ void QConnmanEngine::changedModem()
|
||||
void QConnmanEngine::servicesReady(const QStringList &list)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
foreach (const QString &servPath, list) {
|
||||
for (const QString &servPath : list)
|
||||
addServiceConfiguration(servPath);
|
||||
}
|
||||
|
||||
Q_EMIT updateCompleted();
|
||||
}
|
||||
@ -329,7 +328,8 @@ QNetworkSessionPrivate *QConnmanEngine::createSessionBackend()
|
||||
QNetworkConfigurationPrivatePointer QConnmanEngine::defaultConfiguration()
|
||||
{
|
||||
const QMutexLocker locker(&mutex);
|
||||
Q_FOREACH (const QString &servPath, connmanManager->getServices()) {
|
||||
const auto servPaths = connmanManager->getServices();
|
||||
for (const QString &servPath : servPaths) {
|
||||
if (connmanServiceInterfaces.contains(servPath)) {
|
||||
if (accessPointConfigurations.contains(servPath))
|
||||
return accessPointConfigurations.value(servPath);
|
||||
@ -461,7 +461,8 @@ QNetworkConfiguration::BearerType QConnmanEngine::ofonoTechToBearerType(const QS
|
||||
|
||||
bool QConnmanEngine::isRoamingAllowed(const QString &context)
|
||||
{
|
||||
foreach (const QString &dcPath, ofonoContextManager->contexts()) {
|
||||
const auto dcPaths = ofonoContextManager->contexts();
|
||||
for (const QString &dcPath : dcPaths) {
|
||||
if (dcPath.contains(context.section("_",-1))) {
|
||||
return ofonoContextManager->roamingAllowed();
|
||||
}
|
||||
@ -557,7 +558,8 @@ bool QConnmanEngine::requiresPolling() const
|
||||
|
||||
void QConnmanEngine::reEvaluateCellular()
|
||||
{
|
||||
Q_FOREACH (const QString &servicePath, connmanManager->getServices()) {
|
||||
const auto servicePaths = connmanManager->getServices();
|
||||
for (const QString &servicePath : servicePaths) {
|
||||
if (servicePath.contains("cellular") && accessPointConfigurations.contains(servicePath)) {
|
||||
configurationChange(connmanServiceInterfaces.value(servicePath));
|
||||
}
|
||||
|
@ -144,10 +144,9 @@ void QConnmanManagerInterface::servicesReply(QDBusPendingCallWatcher *call)
|
||||
qDebug() << serv_reply.error().message();
|
||||
} else {
|
||||
servicesList.clear(); //connman list changes order
|
||||
ConnmanMap connmanobj;
|
||||
Q_FOREACH (connmanobj, serv_reply.value()) {
|
||||
const ConnmanMapList connmanobjs = serv_reply.value();
|
||||
for (const ConnmanMap &connmanobj : connmanobjs)
|
||||
servicesList << connmanobj.objectPath.path();
|
||||
}
|
||||
Q_EMIT servicesReady(servicesList);
|
||||
}
|
||||
call->deleteLater();
|
||||
@ -181,7 +180,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal)
|
||||
void QConnmanManagerInterface::onServicesChanged(const ConnmanMapList &changed, const QList<QDBusObjectPath> &removed)
|
||||
{
|
||||
servicesList.clear(); //connman list changes order
|
||||
Q_FOREACH (const ConnmanMap &connmanobj, changed) {
|
||||
for (const ConnmanMap &connmanobj : changed) {
|
||||
const QString svcPath(connmanobj.objectPath.path());
|
||||
servicesList << svcPath;
|
||||
}
|
||||
@ -225,7 +224,8 @@ QStringList QConnmanManagerInterface::getTechnologies()
|
||||
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetTechnologies"));
|
||||
reply.waitForFinished();
|
||||
if (!reply.isError()) {
|
||||
Q_FOREACH (const ConnmanMap &map, reply.value()) {
|
||||
const ConnmanMapList maps = reply.value();
|
||||
for (const ConnmanMap &map : maps) {
|
||||
if (!technologiesMap.contains(map.objectPath.path())) {
|
||||
technologyAdded(map.objectPath, map.propertyMap);
|
||||
}
|
||||
@ -241,9 +241,9 @@ QStringList QConnmanManagerInterface::getServices()
|
||||
QDBusPendingReply<ConnmanMapList> reply = call(QLatin1String("GetServices"));
|
||||
reply.waitForFinished();
|
||||
if (!reply.isError()) {
|
||||
Q_FOREACH (const ConnmanMap &map, reply.value()) {
|
||||
const ConnmanMapList maps = reply.value();
|
||||
for (const ConnmanMap &map : maps)
|
||||
servicesList << map.objectPath.path();
|
||||
}
|
||||
}
|
||||
}
|
||||
return servicesList;
|
||||
|
@ -103,9 +103,9 @@ QStringList QOfonoManagerInterface::getModems()
|
||||
QDBusPendingReply<PathPropertiesList> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList);
|
||||
reply.waitForFinished();
|
||||
if (!reply.isError()) {
|
||||
foreach (const ObjectPathProperties &modem, reply.value()) {
|
||||
const auto modems = reply.value();
|
||||
for (const ObjectPathProperties &modem : modems)
|
||||
modemList << modem.path.path();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,8 +114,8 @@ QStringList QOfonoManagerInterface::getModems()
|
||||
|
||||
QString QOfonoManagerInterface::currentModem()
|
||||
{
|
||||
QStringList modems = getModems();
|
||||
foreach (const QString &modem, modems) {
|
||||
const QStringList modems = getModems();
|
||||
for (const QString &modem : modems) {
|
||||
QOfonoModemInterface device(modem);
|
||||
if (device.isPowered() && device.isOnline()
|
||||
&& device.interfaces().contains(QStringLiteral("org.ofono.NetworkRegistration")))
|
||||
@ -266,9 +266,9 @@ QStringList QOfonoDataConnectionManagerInterface::contexts()
|
||||
QDBusPendingReply<PathPropertiesList > reply = call(QLatin1String("GetContexts"));
|
||||
reply.waitForFinished();
|
||||
if (!reply.isError()) {
|
||||
foreach (const ObjectPathProperties &context, reply.value()) {
|
||||
const auto contexts = reply.value();
|
||||
for (const ObjectPathProperties &context : contexts)
|
||||
contextList << context.path.path();
|
||||
}
|
||||
}
|
||||
}
|
||||
return contextList;
|
||||
|
@ -127,7 +127,8 @@ void QNetworkManagerEngine::setupConfigurations()
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
// Get active connections.
|
||||
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
||||
const auto acPaths = managerInterface->activeConnections();
|
||||
for (const QDBusObjectPath &acPath : acPaths) {
|
||||
|
||||
if (activeConnectionsList.contains(acPath.path()))
|
||||
continue;
|
||||
@ -144,8 +145,10 @@ void QNetworkManagerEngine::setupConfigurations()
|
||||
connectionInterfaces.insert(activeConnection->connection().path(),device.networkInterface());
|
||||
}
|
||||
}
|
||||
|
||||
// Get connections.
|
||||
foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
|
||||
const auto settingsPaths = systemSettings->listConnections();
|
||||
for (const QDBusObjectPath &settingsPath : settingsPaths) {
|
||||
locker.unlock();
|
||||
if (!hasIdentifier(settingsPath.path()))
|
||||
newConnection(settingsPath, systemSettings); //add system connection configs
|
||||
@ -189,21 +192,13 @@ void QNetworkManagerEngine::connectToId(const QString &id)
|
||||
if (isConnectionActive(settingsPath))
|
||||
return;
|
||||
|
||||
QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
if (i.value()->deviceType() == DEVICE_TYPE_ETHERNET &&
|
||||
connectionType == DEVICE_TYPE_ETHERNET) {
|
||||
dbusDevicePath = i.key();
|
||||
break;
|
||||
} else if (i.value()->deviceType() == DEVICE_TYPE_WIFI &&
|
||||
connectionType == DEVICE_TYPE_WIFI) {
|
||||
dbusDevicePath = i.key();
|
||||
break;
|
||||
} else if (i.value()->deviceType() == DEVICE_TYPE_MODEM &&
|
||||
connectionType == DEVICE_TYPE_MODEM) {
|
||||
dbusDevicePath = i.key();
|
||||
break;
|
||||
for (auto i = interfaceDevices.cbegin(), end = interfaceDevices.cend(); i != end; ++i) {
|
||||
const auto type = i.value()->deviceType();
|
||||
if (type == DEVICE_TYPE_ETHERNET || type == DEVICE_TYPE_WIFI || type == DEVICE_TYPE_MODEM) {
|
||||
if (type == connectionType) {
|
||||
dbusDevicePath = i.key();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,9 +225,7 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id)
|
||||
return;
|
||||
}
|
||||
|
||||
QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = activeConnectionsList.cbegin(), end = activeConnectionsList.cend(); i != end; ++i) {
|
||||
if (id == i.value()->connection().path() && accessPointConfigurations.contains(id)) {
|
||||
managerInterface->deactivateConnection(QDBusObjectPath(i.key()));
|
||||
break;
|
||||
@ -243,11 +236,8 @@ void QNetworkManagerEngine::disconnectFromId(const QString &id)
|
||||
void QNetworkManagerEngine::requestUpdate()
|
||||
{
|
||||
if (managerInterface && managerInterface->wirelessEnabled()) {
|
||||
QHashIterator<QString, QNetworkManagerInterfaceDeviceWireless *> i(wirelessDevices);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
i.value()->requestScan();
|
||||
}
|
||||
for (auto *wirelessDevice : qAsConst(wirelessDevices))
|
||||
wirelessDevice->requestScan();
|
||||
}
|
||||
QMetaObject::invokeMethod(this, "updateCompleted", Qt::QueuedConnection);
|
||||
}
|
||||
@ -255,20 +245,17 @@ void QNetworkManagerEngine::requestUpdate()
|
||||
void QNetworkManagerEngine::interfacePropertiesChanged(const QMap<QString, QVariant> &properties)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
QMapIterator<QString, QVariant> i(properties);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
|
||||
for (auto i = properties.cbegin(), end = properties.cend(); i != end; ++i) {
|
||||
if (i.key() == QLatin1String("ActiveConnections")) {
|
||||
// Active connections changed, update configurations.
|
||||
|
||||
QList<QDBusObjectPath> activeConnections =
|
||||
qdbus_cast<QList<QDBusObjectPath> >(i.value().value<QDBusArgument>());
|
||||
const auto activeConnections = qdbus_cast<QList<QDBusObjectPath> >(i.value().value<QDBusArgument>());
|
||||
|
||||
QStringList identifiers = accessPointConfigurations.keys();
|
||||
QStringList priorActiveConnections = activeConnectionsList.keys();
|
||||
|
||||
foreach (const QDBusObjectPath &acPath, activeConnections) {
|
||||
for (const QDBusObjectPath &acPath : activeConnections) {
|
||||
priorActiveConnections.removeOne(acPath.path());
|
||||
QNetworkManagerConnectionActive *activeConnection =
|
||||
activeConnectionsList.value(acPath.path());
|
||||
@ -399,7 +386,8 @@ void QNetworkManagerEngine::wiredCarrierChanged(bool carrier)
|
||||
if (!deviceWired)
|
||||
return;
|
||||
QMutexLocker locker(&mutex);
|
||||
foreach (const QDBusObjectPath &settingsPath, systemSettings->listConnections()) {
|
||||
const auto settingsPaths = systemSettings->listConnections();
|
||||
for (const QDBusObjectPath &settingsPath : settingsPaths) {
|
||||
for (int i = 0; i < connections.count(); ++i) {
|
||||
QNetworkManagerSettingsConnection *connection = connections.at(i);
|
||||
if (connection->getType() == DEVICE_TYPE_ETHERNET
|
||||
@ -477,12 +465,9 @@ void QNetworkManagerEngine::newConnection(const QDBusObjectPath &path,
|
||||
cpPriv->state |= QNetworkConfiguration::Active;
|
||||
|
||||
if (deviceType == DEVICE_TYPE_ETHERNET) {
|
||||
QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
if (i.value()->deviceType() == deviceType) {
|
||||
QNetworkManagerInterfaceDeviceWired *wiredDevice
|
||||
= wiredDevices.value(i.value()->path());
|
||||
for (const auto *interfaceDevice : interfaceDevices) {
|
||||
if (interfaceDevice->deviceType() == deviceType) {
|
||||
auto *wiredDevice = wiredDevices.value(interfaceDevice->path());
|
||||
if (wiredDevice && wiredDevice->carrier()) {
|
||||
cpPriv->state |= QNetworkConfiguration::Discovered;
|
||||
}
|
||||
@ -559,7 +544,8 @@ void QNetworkManagerEngine::updateConnection()
|
||||
QNetworkConfigurationPrivate *cpPriv = parseConnection(settingsPath, connection->getSettings());
|
||||
|
||||
// Check if connection is active.
|
||||
foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
|
||||
const auto acPaths = managerInterface->activeConnections();
|
||||
for (const QDBusObjectPath &acPath : acPaths) {
|
||||
QNetworkManagerConnectionActive activeConnection(acPath.path());
|
||||
|
||||
if (activeConnection.connection().path() == settingsPath &&
|
||||
@ -635,7 +621,8 @@ QNetworkConfigurationPrivate *QNetworkManagerEngine::parseConnection(const QStri
|
||||
if (connectionType == QLatin1String("802-3-ethernet")) {
|
||||
cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
|
||||
|
||||
foreach (const QDBusObjectPath &devicePath, managerInterface->getDevices()) {
|
||||
const auto devicePaths = managerInterface->getDevices();
|
||||
for (const QDBusObjectPath &devicePath : devicePaths) {
|
||||
QNetworkManagerInterfaceDevice device(devicePath.path(),this);
|
||||
if (device.deviceType() == DEVICE_TYPE_ETHERNET) {
|
||||
QNetworkManagerInterfaceDeviceWired *wiredDevice = wiredDevices.value(device.path());
|
||||
@ -729,9 +716,7 @@ QNetworkSession::State QNetworkManagerEngine::sessionStateForId(const QString &i
|
||||
if (!ptr->isValid)
|
||||
return QNetworkSession::Invalid;
|
||||
|
||||
foreach (const QString &acPath, activeConnectionsList.keys()) {
|
||||
QNetworkManagerConnectionActive *activeConnection = activeConnectionsList.value(acPath);
|
||||
|
||||
for (QNetworkManagerConnectionActive *activeConnection : activeConnectionsList) {
|
||||
const QString identifier = activeConnection->connection().path();
|
||||
|
||||
if (id == identifier) {
|
||||
@ -932,7 +917,8 @@ void QNetworkManagerEngine::ofonoRegistered(const QString &)
|
||||
}
|
||||
ofonoManager = new QOfonoManagerInterface(this);
|
||||
if (ofonoManager && ofonoManager->isValid()) {
|
||||
Q_FOREACH (const QString &modem, ofonoManager->getModems()) {
|
||||
const auto modems = ofonoManager->getModems();
|
||||
for (const QString &modem : modems) {
|
||||
QOfonoDataConnectionManagerInterface *ofonoContextManager
|
||||
= new QOfonoDataConnectionManagerInterface(modem,this);
|
||||
ofonoContextManagers.insert(modem, ofonoContextManager);
|
||||
|
@ -54,7 +54,8 @@ static QBearerEngineImpl *getEngineFromId(const QString &id)
|
||||
{
|
||||
QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
|
||||
|
||||
foreach (QBearerEngine *engine, priv->engines()) {
|
||||
const auto engines = priv->engines();
|
||||
for (QBearerEngine *engine : engines) {
|
||||
QBearerEngineImpl *engineImpl = qobject_cast<QBearerEngineImpl *>(engine);
|
||||
if (engineImpl && engineImpl->hasIdentifier(id))
|
||||
return engineImpl;
|
||||
@ -306,7 +307,8 @@ void QNetworkSessionPrivateImpl::updateStateFromServiceNetwork()
|
||||
{
|
||||
QNetworkSession::State oldState = state;
|
||||
|
||||
foreach (const QNetworkConfiguration &config, serviceConfig.children()) {
|
||||
const auto configs = serviceConfig.children();
|
||||
for (const QNetworkConfiguration &config : configs) {
|
||||
if ((config.state() & QNetworkConfiguration::Active) != QNetworkConfiguration::Active)
|
||||
continue;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
load(qfeatures)
|
||||
QT_FOR_CONFIG += gui-private network-private
|
||||
|
||||
qtConfig(evdev) {
|
||||
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet
|
||||
@ -10,7 +9,7 @@ qtConfig(tslib) {
|
||||
SUBDIRS += tslib
|
||||
}
|
||||
|
||||
!contains(QT_DISABLED_FEATURES, udpsocket) {
|
||||
qtConfig(udpsocket) {
|
||||
SUBDIRS += tuiotouch
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user