Merge remote-tracking branch 'gerrit/release' into stable

Conflicts:
	configure
	mkspecs/features/qt_module_headers.prf
	mkspecs/features/qt_tool.prf
	src/angle/angle.pro
	src/tools/bootstrap/bootstrap.pro
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
This commit is contained in:
Samuel Rødal 2013-03-21 08:18:12 +01:00 committed by Oswald Buddenhagen
commit 2ab9b747fc
37 changed files with 366 additions and 305 deletions

View File

@ -83,9 +83,6 @@ our $quoted_basedir;
# Make sure we use Windows line endings for chomp and friends on Windows. # Make sure we use Windows line endings for chomp and friends on Windows.
$INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys"); $INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys");
my $mkspecsdir = dirname(dirname($0));
normalizePath(\$mkspecsdir) if (defined $mkspecsdir);
# will be defined based on the modules sync.profile # will be defined based on the modules sync.profile
our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %explicitheaders, %deprecatedheaders); our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %explicitheaders, %deprecatedheaders);
our @qpa_headers = (); our @qpa_headers = ();
@ -103,6 +100,7 @@ my $copy_headers = 0;
my $create_uic_class_map = 0; my $create_uic_class_map = 0;
my $create_private_headers = 1; my $create_private_headers = 1;
my $minimal = 0; my $minimal = 0;
my $module_version = 0;
my @modules_to_sync ; my @modules_to_sync ;
$force_relative = 1 if ( -d "/System/Library/Frameworks" ); $force_relative = 1 if ( -d "/System/Library/Frameworks" );
@ -128,7 +126,7 @@ sub showUsage
print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n"; print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n";
print " -minimal Do not create CamelCase headers (default: " . ($minimal ? "yes" : "no") . ")\n"; print " -minimal Do not create CamelCase headers (default: " . ($minimal ? "yes" : "no") . ")\n";
print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n"; print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n";
print " -mkspecsdir <PATH> Set the path to the mkspecs (detected: " . (defined $mkspecsdir ? $mkspecsdir : "-none-") . ")\n"; print " -version <VERSION> Specify the module's version (default: detect from qglobal.h)\n";
print " -quiet Only report problems, not activity (same as -verbose 0)\n"; print " -quiet Only report problems, not activity (same as -verbose 0)\n";
print " -v, -verbose <level> Sets the verbosity level (max. 4) (default: $verbose_level)\n"; print " -v, -verbose <level> Sets the verbosity level (max. 4) (default: $verbose_level)\n";
print " The short form increases the level by +1\n"; print " The short form increases the level by +1\n";
@ -662,8 +660,8 @@ while ( @ARGV ) {
} elsif($arg eq "-private") { } elsif($arg eq "-private") {
$var = "create_private_headers"; $var = "create_private_headers";
$val = "yes"; $val = "yes";
} elsif($arg eq "-mkspecsdir") { } elsif($arg eq "-version") {
$var = "mkspecsdir"; $var = "version";
$val = shift @ARGV; $val = shift @ARGV;
} elsif($arg =~/^-/) { } elsif($arg =~/^-/) {
print "Unknown option: $arg\n\n" if(!$var); print "Unknown option: $arg\n\n" if(!$var);
@ -739,12 +737,11 @@ while ( @ARGV ) {
push @modules_to_sync, $module; push @modules_to_sync, $module;
$moduleheaders{$module} = $headerdir; $moduleheaders{$module} = $headerdir;
$create_uic_class_map = 0; $create_uic_class_map = 0;
} elsif ($var eq "mkspecsdir") { } elsif ($var eq "version") {
if($val) { if($val) {
$mkspecsdir = $val; $module_version = $val;
normalizePath(\$mkspecsdir);
} else { } else {
die "The -mkspecsdir option requires an argument"; die "The -version option requires an argument";
} }
} elsif ($var eq "output") { } elsif ($var eq "output") {
my $outdir = $val; my $outdir = $val;
@ -759,11 +756,6 @@ while ( @ARGV ) {
} }
} }
die "Cannot automatically detect/use provided path to QtBase's build directory!\n" .
"QTDIR detected/provided: " . (defined $mkspecsdir ? $mkspecsdir : "-none-") . "\n" .
"Please use the -mkspecsdir option to provide the correct path.\nsyncqt failed"
if (!$mkspecsdir || !-d $mkspecsdir);
# if we have no $basedir we cannot be sure which sources you want, so die # if we have no $basedir we cannot be sure which sources you want, so die
die "Could not find any sync.profile for your module!\nPass <module directory> to syncqt to sync your header files.\nsyncqt failed" if (!$basedir); die "Could not find any sync.profile for your module!\nPass <module directory> to syncqt to sync your header files.\nsyncqt failed" if (!$basedir);
@ -784,12 +776,12 @@ my %allmoduleheadersprivate = map { $_ => 1 } @allmoduleheadersprivate;
$isunix = checkUnix; #cache checkUnix $isunix = checkUnix; #cache checkUnix
my $qt_version = fileContents($mkspecsdir."/qconfig.pri"); if (!$module_version) {
if (length($qt_version)) { my $filco = fileContents($basedir."/src/corelib/global/qglobal.h");
$qt_version =~ s,.*^QT_VERSION[ \t]*=[ \t]*(\S+).*,$1,sm; if ($filco !~ m,.*^#[ \t]*define[ \t]+QT_VERSION_STR[ \t]+"([^"]+)".*,sm) {
} else { die "Cannot determine Qt/Module version. Use -version.\n";
$qt_version = fileContents($basedir."/src/corelib/global/qglobal.h"); }
$qt_version =~ s,.*^#[ \t]*define[ \t]+QT_VERSION_STR[ \t]+"([^"]+)".*,$1,sm; $module_version = $1;
} }
foreach my $lib (@modules_to_sync) { foreach my $lib (@modules_to_sync) {
die "No such module: $lib" unless(defined $modules{$lib}); die "No such module: $lib" unless(defined $modules{$lib});
@ -798,11 +790,6 @@ foreach my $lib (@modules_to_sync) {
my @dirs = split(/;/, $modules{$lib}); my @dirs = split(/;/, $modules{$lib});
my $dir = $dirs[0]; my $dir = $dirs[0];
my $project = $dir;
$project =~ s,/([^/]+)$,/$1/$1.pro,;
my $module_version = fileContents($project);
$module_version = $qt_version unless ($module_version =~ s,.*^VERSION[ \t]*=[ \t]*(\S+).*,$1,sm);
my $pathtoheaders = ""; my $pathtoheaders = "";
$pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib}); $pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib});

42
configure vendored
View File

@ -1196,18 +1196,10 @@ while [ "$#" -gt 0 ]; do
VAL=`echo $1 | sed 's,-R,,'` VAL=`echo $1 | sed 's,-R,,'`
fi fi
;; ;;
-largefile) -l) # -lfoo is handled differently
VAR="largefile"
VAL="yes"
;;
-l?*|-l)
VAR="add_link" VAR="add_link"
if [ "$1" = "-l" ]; then shift
shift VAL="$1"
VAL="$1"
else
VAL=`echo $1 | sed 's,-l,,'`
fi
;; ;;
-F?*|-F) -F?*|-F)
VAR="add_fpath" VAR="add_fpath"
@ -1218,14 +1210,10 @@ while [ "$#" -gt 0 ]; do
VAL=`echo $1 | sed 's,-F,,'` VAL=`echo $1 | sed 's,-F,,'`
fi fi
;; ;;
-fw?*|-fw) -fw) # -fwfoo is handled differently
VAR="add_framework" VAR="add_framework"
if [ "$1" = "-fw" ]; then shift
shift VAL="$1"
VAL="$1"
else
VAL=`echo $1 | sed 's,-fw,,'`
fi
;; ;;
-W*) -W*)
VAR="add_warn" VAR="add_warn"
@ -1504,7 +1492,7 @@ while [ "$#" -gt 0 ]; do
device-option) device-option)
DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"` DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"`
DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"` DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
DeviceVar set $DEV_VAR $DEV_VAL DeviceVar set $DEV_VAR "$DEV_VAL"
;; ;;
qpa) qpa)
QT_QPA_DEFAULT_PLATFORM="$VAL" QT_QPA_DEFAULT_PLATFORM="$VAL"
@ -2240,6 +2228,16 @@ while [ "$#" -gt 0 ]; do
android-toolchain-version) android-toolchain-version)
CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION="$VAL" CFG_DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION="$VAL"
;; ;;
l*) # -lfoo
L_FLAGS="$L_FLAGS -l\"${VAR#l}\""
;;
fw*) # -fwfoo
if [ "$BUILD_ON_MAC" = "yes" ]; then
L_FLAGS="$L_FLAGS -framework \"${VAR#fw}\""
else
UNKNOWN_OPT=yes
fi
;;
*) *)
UNKNOWN_OPT=yes UNKNOWN_OPT=yes
;; ;;
@ -2351,7 +2349,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
if [ -x "$relpath/bin/syncqt" ]; then if [ -x "$relpath/bin/syncqt" ]; then
mkdir -p "$outpath/bin" mkdir -p "$outpath/bin"
echo "#!/bin/sh" >"$outpath/bin/syncqt" echo "#!/bin/sh" >"$outpath/bin/syncqt"
echo "perl \"$relpath/bin/syncqt\" -mkspecsdir \"$outpath/mkspecs\" \"\$@\"" >>"$outpath/bin/syncqt" echo "perl \"$relpath/bin/syncqt\" \"\$@\"" >>"$outpath/bin/syncqt"
chmod 755 "$outpath/bin/syncqt" chmod 755 "$outpath/bin/syncqt"
fi fi
@ -3855,7 +3853,7 @@ setBootstrapVariable()
# build qmake # build qmake
if true; then ###[ '!' -f "$outpath/bin/qmake" ]; if true; then ###[ '!' -f "$outpath/bin/qmake" ];
echo "Creating qmake. Please wait..." echo "Creating qmake..."
mkdir -p "$outpath/qmake" || exit mkdir -p "$outpath/qmake" || exit
# fix makefiles # fix makefiles
@ -4000,6 +3998,8 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
(cd "$outpath/qmake"; "$MAKE") || exit 2 (cd "$outpath/qmake"; "$MAKE") || exit 2
fi # Build qmake fi # Build qmake
echo "Running configuration tests..."
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# create a qt.conf for the Qt build tree itself # create a qt.conf for the Qt build tree itself
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@ -7,8 +7,8 @@ QMAKE_COPY_DIR = $$QMAKE_COPY -R
QMAKE_MOVE = mv -f QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d QMAKE_CHK_EXISTS = test -e %1 ||
QMAKE_CHK_FILE_EXISTS = test -f QMAKE_CHK_DIR_EXISTS = test -d # legacy
QMAKE_CHK_EXISTS_GLUE = "|| " QMAKE_MKDIR = mkdir -p # legacy
QMAKE_MKDIR = mkdir -p QMAKE_MKDIR_CMD = test -d %1 || mkdir -p %1
QMAKE_STREAM_EDITOR = sed QMAKE_STREAM_EDITOR = sed

View File

@ -5,10 +5,10 @@ QMAKE_COPY_DIR = xcopy /s /q /y /i
QMAKE_MOVE = move QMAKE_MOVE = move
QMAKE_DEL_FILE = del QMAKE_DEL_FILE = del
QMAKE_DEL_DIR = rmdir QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = if not exist QMAKE_CHK_EXISTS = if not exist %1
QMAKE_CHK_FILE_EXISTS = if not exist QMAKE_CHK_DIR_EXISTS = if not exist # legacy
QMAKE_CHK_EXISTS_GLUE = QMAKE_MKDIR = mkdir # legacy
QMAKE_MKDIR = mkdir QMAKE_MKDIR_CMD = if not exist %1 mkdir %1 & if not exist %1 exit 1
# xcopy copies the contained files if source is a directory. Deal with it. # xcopy copies the contained files if source is a directory. Deal with it.
CONFIG += copy_dir_files CONFIG += copy_dir_files

View File

@ -25,7 +25,7 @@ qml1_target: \
else: \ else: \
instbase = $$[QT_INSTALL_QML] instbase = $$[QT_INSTALL_QML]
!prefix_build { !force_independent {
# These bizarre rules copy the files to the qtbase build directory # These bizarre rules copy the files to the qtbase build directory
defineReplace(qmlModStripSrcDir) { defineReplace(qmlModStripSrcDir) {

View File

@ -20,10 +20,11 @@
debug(1, "Not loading qmodule.pri twice") debug(1, "Not loading qmodule.pri twice")
} }
# force_independent can be set externally. prefix_build not.
!exists($$[QT_HOST_DATA]/.qmake.cache): \ !exists($$[QT_HOST_DATA]/.qmake.cache): \
CONFIG += prefix_build CONFIG += prefix_build force_independent
!build_pass:!isEmpty(_QMAKE_SUPER_CACHE_):prefix_build { !build_pass:!isEmpty(_QMAKE_SUPER_CACHE_):force_independent {
# When doing a -prefix build of top-level qt5/qt.pro, we need to announce # When doing a -prefix build of top-level qt5/qt.pro, we need to announce
# this repo's module pris' location to the other repos. # this repo's module pris' location to the other repos.
isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$shadowed($$dirname(_QMAKE_CONF_)) isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$shadowed($$dirname(_QMAKE_CONF_))

View File

@ -26,7 +26,7 @@ defineTest(addInstallFiles) {
} }
probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples) probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
!isEmpty(probase):!contains(probase, ^\\..*) { !isEmpty(probase):!contains(probase, ^\\..*):!isEmpty(_QMAKE_CACHE_) {
for(ex, EXAMPLE_FILES): \ for(ex, EXAMPLE_FILES): \
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_)) sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
for(res, RESOURCES) { for(res, RESOURCES) {

View File

@ -236,13 +236,10 @@ defineTest(qtAddToolEnv) {
defineTest(qtAddTargetEnv) { defineTest(qtAddTargetEnv) {
deps = $$replace(QT, -private$, ) deps = $$replace(QT, -private$, )
deps = $$resolve_depends(deps, "QT.") deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
!isEmpty(deps) { !isEmpty(deps) {
for(dep, deps) { for(dep, deps): \
deppath += $$shell_path($$eval(QT.$${dep}.libs)) deppath += $$shell_path($$eval(QT.$${dep}.libs))
for(rpath, QT.$${dep}.rpath_link): \
deppath += $$shell_path($$rpath)
}
equals(QMAKE_HOST.os, Windows) { equals(QMAKE_HOST.os, Windows) {
deppath.name = PATH deppath.name = PATH
} else:contains(QMAKE_HOST.os, Linux|FreeBSD) { } else:contains(QMAKE_HOST.os, Linux|FreeBSD) {

View File

@ -133,7 +133,7 @@ unix|win32-g++* {
!isEmpty(_QMAKE_SUPER_CACHE_): \ !isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]* rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \ else: \
rplbase = $$MODULE_QMAKE_OUTDIR rplbase = $$MODULE_BASE_OUTDIR
include_replace.match = $$rplbase/include include_replace.match = $$rplbase/include
include_replace.replace = $$[QT_INSTALL_HEADERS/raw] include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
lib_replace.match = $$rplbase/lib lib_replace.match = $$rplbase/lib

View File

@ -18,10 +18,9 @@ load(qt_build_paths)
} else { } else {
contains(QT_CONFIG, private_tests): \ # -developer-build contains(QT_CONFIG, private_tests): \ # -developer-build
QMAKE_SYNCQT += -check-includes QMAKE_SYNCQT += -check-includes
QMAKE_SYNCQT += -module $$MODULE_INCNAME QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION
} }
QMAKE_SYNCQT += \ QMAKE_SYNCQT += \
-mkspecsdir $$[QT_HOST_DATA/get]/mkspecs \
-outdir $$MODULE_BASE_OUTDIR $$MODULE_BASE_DIR -outdir $$MODULE_BASE_OUTDIR $$MODULE_BASE_DIR
!silent: message($$QMAKE_SYNCQT) !silent: message($$QMAKE_SYNCQT)
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT") system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")

View File

@ -11,7 +11,7 @@
load(qt_build_paths) load(qt_build_paths)
MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri
prefix_build: \ force_independent: \
MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri
else: \ else: \
MODULE_PRI = $$MODULE_FWD_PRI MODULE_PRI = $$MODULE_FWD_PRI
@ -71,11 +71,11 @@ else: \
$$module_config \ $$module_config \
"QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting "QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting
"" \ "" \
"QT_CONFIG += $$MODULE" # this is obsolete, but some code still depends on it "QT_MODULES += $$MODULE"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
MODULE_PRI_FILES = $$MODULE_PRI MODULE_PRI_FILES = $$MODULE_PRI
prefix_build { force_independent {
# Create a forwarding module .pri file # Create a forwarding module .pri file
MODULE_FWD_PRI_CONT = \ MODULE_FWD_PRI_CONT = \
@ -113,7 +113,7 @@ else: \
includes private_includes bins libs libexecs plugins imports qml \ includes private_includes bins libs libexecs plugins imports qml \
rpath_link rpath_link_private \ rpath_link rpath_link_private \
)):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient) )):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient)
cache(QT_CONFIG, transient) cache(QT_MODULES, transient)
} # !build_pass } # !build_pass

View File

@ -57,7 +57,7 @@ unix|win32-g++* {
!isEmpty(_QMAKE_SUPER_CACHE_): \ !isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]* rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \ else: \
rplbase = $$MODULE_QMAKE_OUTDIR rplbase = $$MODULE_BASE_OUTDIR
lib_replace.match = $$rplbase/lib lib_replace.match = $$rplbase/lib
lib_replace.replace = $$[QT_INSTALL_LIBS/raw] lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
QMAKE_PRL_INSTALL_REPLACE += lib_replace QMAKE_PRL_INSTALL_REPLACE += lib_replace

View File

@ -37,8 +37,7 @@ load(qt_common)
# If we are doing a prefix build, create a "module" pri which enables # If we are doing a prefix build, create a "module" pri which enables
# qtPrepareTool() to work with the non-installed build. # qtPrepareTool() to work with the non-installed build.
# Non-bootstrapped tools always need this because of the environment setup. # Non-bootstrapped tools always need this because of the environment setup.
!build_pass:if(!host_build|!force_bootstrap|prefix_build) { !build_pass:if(!host_build|!force_bootstrap|force_independent) {
isEmpty(MODULE):MODULE = $$TARGET isEmpty(MODULE):MODULE = $$TARGET
MODULE_DEPENDS = $$replace(QT, -private$, ) MODULE_DEPENDS = $$replace(QT, -private$, )

View File

@ -137,6 +137,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
QList<ProjectBuilderSubDirs*> pb_subdirs; QList<ProjectBuilderSubDirs*> pb_subdirs;
pb_subdirs.append(new ProjectBuilderSubDirs(project, QString(), false)); pb_subdirs.append(new ProjectBuilderSubDirs(project, QString(), false));
QString oldpwd = qmake_getpwd(); QString oldpwd = qmake_getpwd();
QString oldoutpwd = Option::output_dir;
QMap<QString, ProStringList> groups; QMap<QString, ProStringList> groups;
for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) { for(int pb_subdir = 0; pb_subdir < pb_subdirs.size(); ++pb_subdir) {
ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir]; ProjectBuilderSubDirs *pb = pb_subdirs[pb_subdir];
@ -173,6 +174,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
if(!qmake_setpwd(dir)) if(!qmake_setpwd(dir))
fprintf(stderr, "Cannot find directory: %s\n", dir.toLatin1().constData()); fprintf(stderr, "Cannot find directory: %s\n", dir.toLatin1().constData());
} }
Option::output_dir = Option::globals->shadowedPath(QDir::cleanPath(fi.absoluteFilePath()));
if(tmp_proj.read(fn)) { if(tmp_proj.read(fn)) {
if(tmp_proj.first("TEMPLATE") == "subdirs") { if(tmp_proj.first("TEMPLATE") == "subdirs") {
QMakeProject *pp = new QMakeProject(&tmp_proj); QMakeProject *pp = new QMakeProject(&tmp_proj);
@ -190,13 +192,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
bool in_root = true; bool in_root = true;
QString name = qmake_getpwd(); QString name = qmake_getpwd();
if(project->isActiveConfig("flat")) { if(project->isActiveConfig("flat")) {
QString flat_file = fileFixify(name, oldpwd, Option::output_dir, FileFixifyRelative); QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
if(flat_file.indexOf(Option::dir_sep) != -1) { if(flat_file.indexOf(Option::dir_sep) != -1) {
QStringList dirs = flat_file.split(Option::dir_sep); QStringList dirs = flat_file.split(Option::dir_sep);
name = dirs.back(); name = dirs.back();
} }
} else { } else {
QString flat_file = fileFixify(name, oldpwd, Option::output_dir, FileFixifyRelative); QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) { if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) {
QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP"); QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP");
QStringList dirs = flat_file.split(Option::dir_sep); QStringList dirs = flat_file.split(Option::dir_sep);
@ -278,6 +280,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
} }
nextfile: nextfile:
qmake_setpwd(oldpwd); qmake_setpwd(oldpwd);
Option::output_dir = oldoutpwd;
} }
} }
} }

View File

@ -92,18 +92,8 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const
QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const
{ {
QString ret = "@" + chkdir + " "; QString edir = escape ? escapeFilePath(dir) : dir;
if(escape) return "@" + makedir.arg(edir);
ret += escapeFilePath(dir);
else
ret += dir;
ret += " " + chkglue + "$(MKDIR) ";
if(escape)
ret += escapeFilePath(dir);
else
ret += dir;
ret += " ";
return ret;
} }
bool MakefileGenerator::mkdir(const QString &in_path) const bool MakefileGenerator::mkdir(const QString &in_path) const
@ -440,13 +430,17 @@ MakefileGenerator::init()
if (v["TARGET"].isEmpty()) if (v["TARGET"].isEmpty())
warn_msg(WarnLogic, "TARGET is empty"); warn_msg(WarnLogic, "TARGET is empty");
chkdir = v["QMAKE_CHK_DIR_EXISTS"].join(' '); makedir = v["QMAKE_MKDIR_CMD"].join(' ');
chkfile = v["QMAKE_CHK_FILE_EXISTS"].join(' '); chkexists = v["QMAKE_CHK_EXISTS"].join(' ');
if (chkfile.isEmpty()) // Backwards compat with Qt4 specs if (makedir.isEmpty()) { // Backwards compat with Qt < 5.0.2 specs
chkfile = isWindowsShell() ? "if not exist" : "test -f"; if (isWindowsShell()) {
chkglue = v["QMAKE_CHK_EXISTS_GLUE"].join(' '); makedir = "if not exist %1 mkdir %1 & if not exist %1 exit 1";
if (chkglue.isEmpty()) // Backwards compat with Qt4 specs chkexists = "if not exist %1";
chkglue = isWindowsShell() ? "" : "|| "; } else {
makedir = "test -d %1 || mkdir -p %1";
chkexists = "test -e %1 ||";
}
}
if (v["QMAKE_LINK_O_FLAG"].isEmpty()) if (v["QMAKE_LINK_O_FLAG"].isEmpty())
v["QMAKE_LINK_O_FLAG"].append("-o "); v["QMAKE_LINK_O_FLAG"].append("-o ");
@ -2401,8 +2395,8 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t,
if (!in.isEmpty()) { if (!in.isEmpty()) {
if (!in_directory.isEmpty()) if (!in_directory.isEmpty())
t << "\n\t" << mkdir_p_asstring(out_directory); t << "\n\t" << mkdir_p_asstring(out_directory);
pfx = "( " + chkfile + " " + out + " " + chkglue pfx = "( " + chkexists.arg(out) +
+ "$(QMAKE) " + in + buildArgs() + " -o " + out + " $(QMAKE) " + in + buildArgs() + " -o " + out
+ " ) && "; + " ) && ";
} }
writeSubMakeCall(t, out_directory_cdin + pfx, makefilein); writeSubMakeCall(t, out_directory_cdin + pfx, makefilein);

View File

@ -81,7 +81,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo
QString spec; QString spec;
bool init_opath_already, init_already, no_io; bool init_opath_already, init_already, no_io;
QHash<QString, bool> init_compiler_already; QHash<QString, bool> init_compiler_already;
QString chkdir, chkfile, chkglue; QString makedir, chkexists;
QString build_args(const QString &outdir=QString()); QString build_args(const QString &outdir=QString());
//internal caches //internal caches

View File

@ -385,18 +385,16 @@ SubdirsMetaMakefileGenerator::write()
const QString &output_name = Option::output.fileName(); const QString &output_name = Option::output.fileName();
for(int i = 0; ret && i < subs.count(); i++) { for(int i = 0; ret && i < subs.count(); i++) {
const Subdir *sub = subs.at(i); const Subdir *sub = subs.at(i);
qmake_setpwd(subs.at(i)->input_dir); qmake_setpwd(sub->input_dir);
Option::output_dir = QFileInfo(subs.at(i)->output_dir).absoluteFilePath(); Option::output_dir = QFileInfo(sub->output_dir).absoluteFilePath();
if(Option::output_dir.at(Option::output_dir.length()-1) != QLatin1Char('/')) Option::output.setFileName(sub->output_file);
Option::output_dir += QLatin1Char('/');
Option::output.setFileName(subs.at(i)->output_file);
if(i != subs.count()-1) { if(i != subs.count()-1) {
for (int ind = 0; ind < sub->indent; ++ind) for (int ind = 0; ind < sub->indent; ++ind)
printf(" "); printf(" ");
printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+ printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+
Option::output.fileName()).toLatin1().constData()); Option::output.fileName()).toLatin1().constData());
} }
if (!(ret = subs.at(i)->makefile->write())) if (!(ret = sub->makefile->write()))
break; break;
//restore because I'm paranoid //restore because I'm paranoid
qmake_setpwd(pwd); qmake_setpwd(pwd);

View File

@ -434,18 +434,21 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
projLookup.insert(profileKey, fi.absoluteFilePath()); projLookup.insert(profileKey, fi.absoluteFilePath());
} }
QString oldpwd = qmake_getpwd(); QString oldpwd = qmake_getpwd();
QString oldoutpwd = Option::output_dir;
QMakeProject tmp_proj; QMakeProject tmp_proj;
QString dir = fi.absolutePath(), fn = fi.fileName(); QString dir = fi.absolutePath(), fn = fi.fileName();
if (!dir.isEmpty()) { if (!dir.isEmpty()) {
if (!qmake_setpwd(dir)) if (!qmake_setpwd(dir))
fprintf(stderr, "Cannot find directory: %s", dir.toLatin1().constData()); fprintf(stderr, "Cannot find directory: %s", dir.toLatin1().constData());
} }
Option::output_dir = Option::globals->shadowedPath(QDir::cleanPath(fi.absoluteFilePath()));
if (tmp_proj.read(fn)) { if (tmp_proj.read(fn)) {
// Check if all requirements are fulfilled // Check if all requirements are fulfilled
if (!tmp_proj.isEmpty("QMAKE_FAILED_REQUIREMENTS")) { if (!tmp_proj.isEmpty("QMAKE_FAILED_REQUIREMENTS")) {
fprintf(stderr, "Project file(%s) not added to Solution because all requirements not met:\n\t%s\n", fprintf(stderr, "Project file(%s) not added to Solution because all requirements not met:\n\t%s\n",
fn.toLatin1().constData(), tmp_proj.values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData()); fn.toLatin1().constData(), tmp_proj.values("QMAKE_FAILED_REQUIREMENTS").join(" ").toLatin1().constData());
qmake_setpwd(oldpwd); qmake_setpwd(oldpwd);
Option::output_dir = oldoutpwd;
continue; continue;
} }
if (tmp_proj.first("TEMPLATE") == "vcsubdirs") { if (tmp_proj.first("TEMPLATE") == "vcsubdirs") {
@ -460,13 +463,10 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
// and to be able to extract all the dependencies // and to be able to extract all the dependencies
Option::QMAKE_MODE old_mode = Option::qmake_mode; Option::QMAKE_MODE old_mode = Option::qmake_mode;
Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING; Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
QString old_output_dir = Option::output_dir;
Option::output_dir = QFileInfo(fileFixify(dir, qmake_getpwd(), Option::output_dir)).canonicalFilePath();
VcprojGenerator tmp_vcproj; VcprojGenerator tmp_vcproj;
tmp_vcproj.setNoIO(true); tmp_vcproj.setNoIO(true);
tmp_vcproj.setProjectFile(&tmp_proj); tmp_vcproj.setProjectFile(&tmp_proj);
Option::qmake_mode = old_mode; Option::qmake_mode = old_mode;
Option::output_dir = old_output_dir;
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj // We assume project filename is [QMAKE_PROJECT_NAME].vcproj
QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION")); QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION"));
@ -578,6 +578,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
} }
nextfile: nextfile:
qmake_setpwd(oldpwd); qmake_setpwd(oldpwd);
Option::output_dir = oldoutpwd;
} }
} }
} }

View File

@ -1062,7 +1062,7 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
forever { forever {
QString superfile = superdir + QLatin1String("/.qmake.super"); QString superfile = superdir + QLatin1String("/.qmake.super");
if (IoUtils::exists(superfile)) { if (IoUtils::exists(superfile)) {
m_superfile = superfile; m_superfile = QDir::cleanPath(superfile);
break; break;
} }
QFileInfo qdfi(superdir); QFileInfo qdfi(superdir);
@ -1099,8 +1099,8 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
} else { } else {
m_buildRoot = QFileInfo(cachefile).path(); m_buildRoot = QFileInfo(cachefile).path();
} }
m_conffile = conffile; m_conffile = QDir::cleanPath(conffile);
m_cachefile = cachefile; m_cachefile = QDir::cleanPath(cachefile);
} }
no_cache: no_cache:

View File

@ -97,15 +97,8 @@ int runQMake(int argc, char **argv)
} }
QString oldpwd = qmake_getpwd(); QString oldpwd = qmake_getpwd();
#ifdef Q_OS_WIN
if(!(oldpwd.length() == 3 && oldpwd[0].isLetter() && oldpwd.endsWith(":/")))
#endif
{
if(!oldpwd.endsWith(QLatin1Char('/')))
oldpwd += QLatin1Char('/');
}
Option::output_dir = oldpwd; //for now this is the output dir
Option::output_dir = oldpwd; //for now this is the output dir
if(Option::output.fileName() != "-") { if(Option::output.fileName() != "-") {
QFileInfo fi(Option::output); QFileInfo fi(Option::output);
QString dir; QString dir;
@ -124,7 +117,7 @@ int runQMake(int argc, char **argv)
if(!dir.isNull() && dir != ".") if(!dir.isNull() && dir != ".")
Option::output_dir = dir; Option::output_dir = dir;
if(QDir::isRelativePath(Option::output_dir)) if(QDir::isRelativePath(Option::output_dir))
Option::output_dir.prepend(oldpwd); Option::output_dir.prepend(oldpwd + QLatin1Char('/'));
Option::output_dir = QDir::cleanPath(Option::output_dir); Option::output_dir = QDir::cleanPath(Option::output_dir);
} }

View File

@ -6,5 +6,5 @@ SUBDIRS += src
# 2) If we made a 'QtANGLE' module, the include directory would be flattened which won't work since # 2) If we made a 'QtANGLE' module, the include directory would be flattened which won't work since
# we need to support "#include <GLES2/gl2.h>" # we need to support "#include <GLES2/gl2.h>"
CONFIG += minimal_syncqt CONFIG += minimal_syncqt
QMAKE_SYNCQT_OPTIONS = -module KHR -module EGL -module GLES2 QMAKE_SYNCQT_OPTIONS = -module KHR -module EGL -module GLES2 -version none
load(qt_module_headers) load(qt_module_headers)

View File

@ -1940,9 +1940,10 @@ inline T qVariantToHelper(const QVariant::Private &d, const HandlersManager &han
/*! /*!
\fn QStringList QVariant::toStringList() const \fn QStringList QVariant::toStringList() const
Returns the variant as a QStringList if the variant has type() Returns the variant as a QStringList if the variant has userType()
StringList, \l String, or \l List of a type that can be converted \l QMetaType::QStringList, \l QMetaType::QString, or
to QString; otherwise returns an empty list. \l QMetaType::QVariantList of a type that can be converted to QString;
otherwise returns an empty list.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -1952,10 +1953,12 @@ QStringList QVariant::toStringList() const
} }
/*! /*!
Returns the variant as a QString if the variant has type() \l Returns the variant as a QString if the variant has userType() \l
String, \l Bool, \l ByteArray, \l Char, \l Date, \l DateTime, \l QMetaType::QString, \l QMetaType::Bool, \l QMetaType::QByteArray,
Double, \l Int, \l LongLong, \l StringList, \l Time, \l UInt, or \l QMetaType::QChar, \l QMetaType::QDate, \l QMetaType::QDateTime,
\l ULongLong; otherwise returns an empty string. \l QMetaType::Double, \l QMetaType::Int, \l QMetaType::LongLong,
\l QMetaType::QStringList, \l QMetaType::QTime, \l QMetaType::UInt, or
\l QMetaType::ULongLong; otherwise returns an empty string.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -1966,7 +1969,7 @@ QString QVariant::toString() const
/*! /*!
Returns the variant as a QMap<QString, QVariant> if the variant Returns the variant as a QMap<QString, QVariant> if the variant
has type() \l Map; otherwise returns an empty map. has type() \l QMetaType::QVariantMap; otherwise returns an empty map.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -1977,7 +1980,7 @@ QVariantMap QVariant::toMap() const
/*! /*!
Returns the variant as a QHash<QString, QVariant> if the variant Returns the variant as a QHash<QString, QVariant> if the variant
has type() \l Hash; otherwise returns an empty map. has type() \l QMetaType::QVariantHash; otherwise returns an empty map.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -1989,11 +1992,12 @@ QVariantHash QVariant::toHash() const
/*! /*!
\fn QDate QVariant::toDate() const \fn QDate QVariant::toDate() const
Returns the variant as a QDate if the variant has type() \l Date, Returns the variant as a QDate if the variant has userType()
\l DateTime, or \l String; otherwise returns an invalid date. \l QMetaType::QDate, \l QMetaType::QDateTime, or \l QMetaType::QString;
otherwise returns an invalid date.
If the type() is \l String, an invalid date will be returned if the If the type() is \l QMetaType::QString, an invalid date will be returned if
string cannot be parsed as a Qt::ISODate format date. the string cannot be parsed as a Qt::ISODate format date.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2005,10 +2009,11 @@ QDate QVariant::toDate() const
/*! /*!
\fn QTime QVariant::toTime() const \fn QTime QVariant::toTime() const
Returns the variant as a QTime if the variant has type() \l Time, Returns the variant as a QTime if the variant has userType()
\l DateTime, or \l String; otherwise returns an invalid time. \l QMetaType::QTime, \l QMetaType::QDateTime, or \l QMetaType::QString;
otherwise returns an invalid time.
If the type() is \l String, an invalid time will be returned if If the type() is \l QMetaType::QString, an invalid time will be returned if
the string cannot be parsed as a Qt::ISODate format time. the string cannot be parsed as a Qt::ISODate format time.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2021,12 +2026,12 @@ QTime QVariant::toTime() const
/*! /*!
\fn QDateTime QVariant::toDateTime() const \fn QDateTime QVariant::toDateTime() const
Returns the variant as a QDateTime if the variant has type() \l Returns the variant as a QDateTime if the variant has userType()
DateTime, \l Date, or \l String; otherwise returns an invalid \l QMetaType::QDateTime, \l QMetaType::QDate, or \l QMetaType::QString;
date/time. otherwise returns an invalid date/time.
If the type() is \l String, an invalid date/time will be returned If the type() is \l QMetaType::QString, an invalid date/time will be
if the string cannot be parsed as a Qt::ISODate format date/time. returned if the string cannot be parsed as a Qt::ISODate format date/time.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2039,8 +2044,8 @@ QDateTime QVariant::toDateTime() const
\since 4.7 \since 4.7
\fn QEasingCurve QVariant::toEasingCurve() const \fn QEasingCurve QVariant::toEasingCurve() const
Returns the variant as a QEasingCurve if the variant has type() \l Returns the variant as a QEasingCurve if the variant has userType()
EasingCurve; otherwise returns a default easing curve. \l QMetaType::QEasingCurve; otherwise returns a default easing curve.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2054,9 +2059,9 @@ QEasingCurve QVariant::toEasingCurve() const
/*! /*!
\fn QByteArray QVariant::toByteArray() const \fn QByteArray QVariant::toByteArray() const
Returns the variant as a QByteArray if the variant has type() \l Returns the variant as a QByteArray if the variant has userType()
ByteArray or \l String (converted using QString::fromUtf8()); \l QMetaType::QByteArray or \l QMetaType::QString (converted using
otherwise returns an empty byte array. QString::fromUtf8()); otherwise returns an empty byte array.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2069,8 +2074,9 @@ QByteArray QVariant::toByteArray() const
/*! /*!
\fn QPoint QVariant::toPoint() const \fn QPoint QVariant::toPoint() const
Returns the variant as a QPoint if the variant has type() Returns the variant as a QPoint if the variant has userType()
\l Point or \l PointF; otherwise returns a null QPoint. \l QMetaType::QPointF or \l QMetaType::QPointF; otherwise returns a null
QPoint.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2082,8 +2088,8 @@ QPoint QVariant::toPoint() const
/*! /*!
\fn QRect QVariant::toRect() const \fn QRect QVariant::toRect() const
Returns the variant as a QRect if the variant has type() \l Rect; Returns the variant as a QRect if the variant has userType()
otherwise returns an invalid QRect. \l QMetaType::QRect; otherwise returns an invalid QRect.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2095,8 +2101,8 @@ QRect QVariant::toRect() const
/*! /*!
\fn QSize QVariant::toSize() const \fn QSize QVariant::toSize() const
Returns the variant as a QSize if the variant has type() \l Size; Returns the variant as a QSize if the variant has userType()
otherwise returns an invalid QSize. \l QMetaType::QSize; otherwise returns an invalid QSize.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2108,8 +2114,8 @@ QSize QVariant::toSize() const
/*! /*!
\fn QSizeF QVariant::toSizeF() const \fn QSizeF QVariant::toSizeF() const
Returns the variant as a QSizeF if the variant has type() \l Returns the variant as a QSizeF if the variant has userType() \l
SizeF; otherwise returns an invalid QSizeF. QMetaType::QSizeF; otherwise returns an invalid QSizeF.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2121,8 +2127,9 @@ QSizeF QVariant::toSizeF() const
/*! /*!
\fn QRectF QVariant::toRectF() const \fn QRectF QVariant::toRectF() const
Returns the variant as a QRectF if the variant has type() \l Rect Returns the variant as a QRectF if the variant has userType()
or \l RectF; otherwise returns an invalid QRectF. \l QMetaType::QRect or \l QMetaType::QRectF; otherwise returns an invalid
QRectF.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2134,8 +2141,8 @@ QRectF QVariant::toRectF() const
/*! /*!
\fn QLineF QVariant::toLineF() const \fn QLineF QVariant::toLineF() const
Returns the variant as a QLineF if the variant has type() \l Returns the variant as a QLineF if the variant has userType()
LineF; otherwise returns an invalid QLineF. \l QMetaType::QLineF; otherwise returns an invalid QLineF.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2147,8 +2154,8 @@ QLineF QVariant::toLineF() const
/*! /*!
\fn QLine QVariant::toLine() const \fn QLine QVariant::toLine() const
Returns the variant as a QLine if the variant has type() \l Line; Returns the variant as a QLine if the variant has userType()
otherwise returns an invalid QLine. \l QMetaType::QLine; otherwise returns an invalid QLine.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2160,8 +2167,9 @@ QLine QVariant::toLine() const
/*! /*!
\fn QPointF QVariant::toPointF() const \fn QPointF QVariant::toPointF() const
Returns the variant as a QPointF if the variant has type() \l Returns the variant as a QPointF if the variant has userType() \l
Point or \l PointF; otherwise returns a null QPointF. QMetaType::QPoint or \l QMetaType::QPointF; otherwise returns a null
QPointF.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2176,8 +2184,8 @@ QPointF QVariant::toPointF() const
/*! /*!
\fn QUrl QVariant::toUrl() const \fn QUrl QVariant::toUrl() const
Returns the variant as a QUrl if the variant has type() Returns the variant as a QUrl if the variant has userType()
\l Url; otherwise returns an invalid QUrl. \l QMetaType::QUrl; otherwise returns an invalid QUrl.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2190,8 +2198,8 @@ QUrl QVariant::toUrl() const
/*! /*!
\fn QLocale QVariant::toLocale() const \fn QLocale QVariant::toLocale() const
Returns the variant as a QLocale if the variant has type() Returns the variant as a QLocale if the variant has userType()
\l Locale; otherwise returns an invalid QLocale. \l QMetaType::QLocale; otherwise returns an invalid QLocale.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2204,8 +2212,8 @@ QLocale QVariant::toLocale() const
\fn QRegExp QVariant::toRegExp() const \fn QRegExp QVariant::toRegExp() const
\since 4.1 \since 4.1
Returns the variant as a QRegExp if the variant has type() \l Returns the variant as a QRegExp if the variant has userType()
RegExp; otherwise returns an empty QRegExp. \l QMetaType::QRegExp; otherwise returns an empty QRegExp.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2221,7 +2229,7 @@ QRegExp QVariant::toRegExp() const
\fn QRegularExpression QVariant::toRegularExpression() const \fn QRegularExpression QVariant::toRegularExpression() const
\since 5.0 \since 5.0
Returns the variant as a QRegularExpression if the variant has type() \l Returns the variant as a QRegularExpression if the variant has userType() \l
QRegularExpression; otherwise returns an empty QRegularExpression. QRegularExpression; otherwise returns an empty QRegularExpression.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2236,7 +2244,7 @@ QRegularExpression QVariant::toRegularExpression() const
/*! /*!
\since 5.0 \since 5.0
Returns the variant as a QUuid if the variant has type() \l Returns the variant as a QUuid if the variant has userType() \l
QUuid; otherwise returns a default constructed QUuid. QUuid; otherwise returns a default constructed QUuid.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2249,7 +2257,7 @@ QUuid QVariant::toUuid() const
/*! /*!
\since 5.0 \since 5.0
Returns the variant as a QModelIndex if the variant has type() \l Returns the variant as a QModelIndex if the variant has userType() \l
QModelIndex; otherwise returns a default constructed QModelIndex. QModelIndex; otherwise returns a default constructed QModelIndex.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2262,7 +2270,7 @@ QModelIndex QVariant::toModelIndex() const
/*! /*!
\since 5.0 \since 5.0
Returns the variant as a QJsonValue if the variant has type() \l Returns the variant as a QJsonValue if the variant has userType() \l
QJsonValue; otherwise returns a default constructed QJsonValue. QJsonValue; otherwise returns a default constructed QJsonValue.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2275,7 +2283,7 @@ QJsonValue QVariant::toJsonValue() const
/*! /*!
\since 5.0 \since 5.0
Returns the variant as a QJsonObject if the variant has type() \l Returns the variant as a QJsonObject if the variant has userType() \l
QJsonObject; otherwise returns a default constructed QJsonObject. QJsonObject; otherwise returns a default constructed QJsonObject.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2288,7 +2296,7 @@ QJsonObject QVariant::toJsonObject() const
/*! /*!
\since 5.0 \since 5.0
Returns the variant as a QJsonArray if the variant has type() \l Returns the variant as a QJsonArray if the variant has userType() \l
QJsonArray; otherwise returns a default constructed QJsonArray. QJsonArray; otherwise returns a default constructed QJsonArray.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2301,7 +2309,7 @@ QJsonArray QVariant::toJsonArray() const
/*! /*!
\since 5.0 \since 5.0
Returns the variant as a QJsonDocument if the variant has type() \l Returns the variant as a QJsonDocument if the variant has userType() \l
QJsonDocument; otherwise returns a default constructed QJsonDocument. QJsonDocument; otherwise returns a default constructed QJsonDocument.
\sa canConvert(), convert() \sa canConvert(), convert()
@ -2315,8 +2323,9 @@ QJsonDocument QVariant::toJsonDocument() const
/*! /*!
\fn QChar QVariant::toChar() const \fn QChar QVariant::toChar() const
Returns the variant as a QChar if the variant has type() \l Char, Returns the variant as a QChar if the variant has userType()
\l Int, or \l UInt; otherwise returns an invalid QChar. \l QMetaType::QChar, \l QMetaType::Int, or \l QMetaType::UInt; otherwise
returns an invalid QChar.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2326,8 +2335,8 @@ QChar QVariant::toChar() const
} }
/*! /*!
Returns the variant as a QBitArray if the variant has type() Returns the variant as a QBitArray if the variant has userType()
\l BitArray; otherwise returns an empty bit array. \l QMetaType::QBitArray; otherwise returns an empty bit array.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2353,16 +2362,19 @@ inline T qNumVariantToHelper(const QVariant::Private &d,
} }
/*! /*!
Returns the variant as an int if the variant has type() \l Int, Returns the variant as an int if the variant has userType()
\l Bool, \l ByteArray, \l Char, \l Double, \l LongLong, \l \l QMetaType::Int, \l QMetaType::Bool, \l QMetaType::QByteArray,
String, \l UInt, or \l ULongLong; otherwise returns 0. \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::LongLong,
\l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong;
otherwise returns 0.
If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be
converted to an int; otherwise \c{*}\a{ok} is set to false. converted to an int; otherwise \c{*}\a{ok} is set to false.
\b{Warning:} If the value is convertible to a \l LongLong but is too \b{Warning:} If the value is convertible to a \l QMetaType::LongLong but is
large to be represented in an int, the resulting arithmetic overflow will too large to be represented in an int, the resulting arithmetic overflow
not be reflected in \a ok. A simple workaround is to use QString::toInt(). will not be reflected in \a ok. A simple workaround is to use
QString::toInt().
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2372,16 +2384,19 @@ int QVariant::toInt(bool *ok) const
} }
/*! /*!
Returns the variant as an unsigned int if the variant has type() Returns the variant as an unsigned int if the variant has userType()
\l UInt, \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l \l QMetaType::UInt, \l QMetaType::Bool, \l QMetaType::QByteArray,
LongLong, \l String, or \l ULongLong; otherwise returns 0. \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int,
\l QMetaType::LongLong, \l QMetaType::QString, or \l QMetaType::ULongLong;
otherwise returns 0.
If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be
converted to an unsigned int; otherwise \c{*}\a{ok} is set to false. converted to an unsigned int; otherwise \c{*}\a{ok} is set to false.
\b{Warning:} If the value is convertible to a \l ULongLong but is too \b{Warning:} If the value is convertible to a \l QMetaType::ULongLong but is
large to be represented in an unsigned int, the resulting arithmetic overflow will too large to be represented in an unsigned int, the resulting arithmetic
not be reflected in \a ok. A simple workaround is to use QString::toUInt(). overflow will not be reflected in \a ok. A simple workaround is to use
QString::toUInt().
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2391,9 +2406,11 @@ uint QVariant::toUInt(bool *ok) const
} }
/*! /*!
Returns the variant as a long long int if the variant has type() Returns the variant as a long long int if the variant has userType()
\l LongLong, \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l QMetaType::LongLong, \l QMetaType::Bool, \l QMetaType::QByteArray,
\l String, \l UInt, or \l ULongLong; otherwise returns 0. \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int,
\l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong;
otherwise returns 0.
If \a ok is non-null: \c{*}\c{ok} is set to true if the value could be If \a ok is non-null: \c{*}\c{ok} is set to true if the value could be
converted to an int; otherwise \c{*}\c{ok} is set to false. converted to an int; otherwise \c{*}\c{ok} is set to false.
@ -2407,9 +2424,10 @@ qlonglong QVariant::toLongLong(bool *ok) const
/*! /*!
Returns the variant as as an unsigned long long int if the Returns the variant as as an unsigned long long int if the
variant has type() \l ULongLong, \l Bool, \l ByteArray, \l Char, variant has type() \l QMetaType::ULongLong, \l QMetaType::Bool,
\l Double, \l Int, \l LongLong, \l String, or \l UInt; otherwise \l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::Double,
returns 0. \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString, or
\l QMetaType::UInt; otherwise returns 0.
If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be
converted to an int; otherwise \c{*}\a{ok} is set to false. converted to an int; otherwise \c{*}\a{ok} is set to false.
@ -2422,13 +2440,14 @@ qulonglong QVariant::toULongLong(bool *ok) const
} }
/*! /*!
Returns the variant as a bool if the variant has type() Bool. Returns the variant as a bool if the variant has userType() Bool.
Returns true if the variant has type() \l Bool, \l Char, \l Double, Returns true if the variant has userType() \l QMetaType::Bool,
\l Int, \l LongLong, \l UInt, or \l ULongLong and the value is \l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int,
non-zero, or if the variant has type \l String or \l ByteArray and \l QMetaType::LongLong, \l QMetaType::UInt, or \l QMetaType::ULongLong and
its lower-case content is not one of the following: empty, "0" the value is non-zero, or if the variant has type \l QMetaType::QString or
or "false"; otherwise returns false. \l QMetaType::QByteArray and its lower-case content is not one of the
following: empty, "0" or "false"; otherwise returns false.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2444,9 +2463,11 @@ bool QVariant::toBool() const
} }
/*! /*!
Returns the variant as a double if the variant has type() \l Returns the variant as a double if the variant has userType()
Double, \l QMetaType::Float, \l Bool, \l ByteArray, \l Int, \l LongLong, \l String, \l \l QMetaType::Double, \l QMetaType::Float, \l QMetaType::Bool,
UInt, or \l ULongLong; otherwise returns 0.0. \l QMetaType::QByteArray, \l QMetaType::Int, \l QMetaType::LongLong,
\l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong;
otherwise returns 0.0.
If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be If \a ok is non-null: \c{*}\a{ok} is set to true if the value could be
converted to a double; otherwise \c{*}\a{ok} is set to false. converted to a double; otherwise \c{*}\a{ok} is set to false.
@ -2459,9 +2480,11 @@ double QVariant::toDouble(bool *ok) const
} }
/*! /*!
Returns the variant as a float if the variant has type() \l Returns the variant as a float if the variant has userType()
Double, \l QMetaType::Float, \l Bool, \l ByteArray, \l Int, \l LongLong, \l String, \l \l QMetaType::Double, \l QMetaType::Float, \l QMetaType::Bool,
UInt, or \l ULongLong; otherwise returns 0.0. \l QMetaType::QByteArray, \l QMetaType::Int, \l QMetaType::LongLong,
\l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong;
otherwise returns 0.0.
\since 4.6 \since 4.6
@ -2476,9 +2499,11 @@ float QVariant::toFloat(bool *ok) const
} }
/*! /*!
Returns the variant as a qreal if the variant has type() \l Returns the variant as a qreal if the variant has userType()
Double, \l QMetaType::Float, \l Bool, \l ByteArray, \l Int, \l LongLong, \l String, \l \l QMetaType::Double, \l QMetaType::Float, \l QMetaType::Bool,
UInt, or \l ULongLong; otherwise returns 0.0. \l QMetaType::QByteArray, \l QMetaType::Int, \l QMetaType::LongLong,
\l QMetaType::QString, \l QMetaType::UInt, or \l QMetaType::ULongLong;
otherwise returns 0.0.
\since 4.6 \since 4.6
@ -2493,8 +2518,9 @@ qreal QVariant::toReal(bool *ok) const
} }
/*! /*!
Returns the variant as a QVariantList if the variant has type() Returns the variant as a QVariantList if the variant has userType()
\l List or \l StringList; otherwise returns an empty list. \l QMetaType::QVariantList or \l QMetaType::QStringList; otherwise returns
an empty list.
\sa canConvert(), convert() \sa canConvert(), convert()
*/ */
@ -2633,27 +2659,51 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\table \table
\header \li Type \li Automatically Cast To \header \li Type \li Automatically Cast To
\row \li \l Bool \li \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong \row \li \l QMetaType::Bool \li \l QMetaType::QChar, \l QMetaType::Double,
\row \li \l ByteArray \li \l Double, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString,
\row \li \l Char \li \l Bool, \l Int, \l UInt, \l LongLong, \l ULongLong \l QMetaType::UInt, \l QMetaType::ULongLong
\row \li \l Color \li \l String \row \li \l QMetaType::QByteArray \li \l QMetaType::Double,
\row \li \l Date \li \l DateTime, \l String \l QMetaType::Int, \l QMetaType::LongLong, \l QMetaType::QString,
\row \li \l DateTime \li \l Date, \l String, \l Time \l QMetaType::UInt, \l QMetaType::ULongLong
\row \li \l Double \li \l Bool, \l Int, \l LongLong, \l String, \l UInt, \l ULongLong \row \li \l QMetaType::QChar \li \l QMetaType::Bool, \l QMetaType::Int,
\row \li \l Font \li \l String \l QMetaType::UInt, \l QMetaType::LongLong, \l QMetaType::ULongLong
\row \li \l Int \li \l Bool, \l Char, \l Double, \l LongLong, \l String, \l UInt, \l ULongLong \row \li \l QMetaType::QColor \li \l QMetaType::QString
\row \li \l KeySequence \li \l Int, \l String \row \li \l QMetaType::QDate \li \l QMetaType::QDateTime,
\row \li \l List \li \l StringList (if the list's items can be converted to strings) \l QMetaType::QString
\row \li \l LongLong \li \l Bool, \l ByteArray, \l Char, \l Double, \l Int, \l String, \l UInt, \l ULongLong \row \li \l QMetaType::QDateTime \li \l QMetaType::QDate,
\row \li \l Point \li PointF \l QMetaType::QString, \l QMetaType::QTime
\row \li \l Rect \li RectF \row \li \l QMetaType::Double \li \l QMetaType::Bool, \l QMetaType::Int,
\row \li \l String \li \l Bool, \l ByteArray, \l Char, \l Color, \l Date, \l DateTime, \l Double, \l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt,
\l Font, \l Int, \l KeySequence, \l LongLong, \l StringList, \l Time, \l UInt, \l QMetaType::ULongLong
\l ULongLong \row \li \l QMetaType::QFont \li \l QMetaType::QString
\row \li \l StringList \li \l List, \l String (if the list contains exactly one item) \row \li \l QMetaType::Int \li \l QMetaType::Bool, \l QMetaType::QChar,
\row \li \l Time \li \l String \l QMetaType::Double, \l QMetaType::LongLong, \l QMetaType::QString,
\row \li \l UInt \li \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l ULongLong \l QMetaType::UInt, \l QMetaType::ULongLong
\row \li \l ULongLong \li \l Bool, \l Char, \l Double, \l Int, \l LongLong, \l String, \l UInt \row \li \l QMetaType::QKeySequence \li \l QMetaType::Int,
\l QMetaType::QString
\row \li \l QMetaType::QVariantList \li \l QMetaType::QStringList (if the
list's items can be converted to QStrings)
\row \li \l QMetaType::LongLong \li \l QMetaType::Bool,
\l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::Double,
\l QMetaType::Int, \l QMetaType::QString, \l QMetaType::UInt,
\l QMetaType::ULongLong
\row \li \l QMetaType::QPoint \li QMetaType::QPointF
\row \li \l QMetaType::QRect \li QMetaType::QRectF
\row \li \l QMetaType::QString \li \l QMetaType::Bool,
\l QMetaType::QByteArray, \l QMetaType::QChar, \l QMetaType::QColor,
\l QMetaType::QDate, \l QMetaType::QDateTime, \l QMetaType::Double,
\l QMetaType::QFont, \l QMetaType::Int, \l QMetaType::QKeySequence,
\l QMetaType::LongLong, \l QMetaType::QStringList, \l QMetaType::QTime,
\l QMetaType::UInt, \l QMetaType::ULongLong
\row \li \l QMetaType::QStringList \li \l QMetaType::QVariantList,
\l QMetaType::QString (if the list contains exactly one item)
\row \li \l QMetaType::QTime \li \l QMetaType::QString
\row \li \l QMetaType::UInt \li \l QMetaType::Bool, \l QMetaType::QChar,
\l QMetaType::Double, \l QMetaType::Int, \l QMetaType::LongLong,
\l QMetaType::QString, \l QMetaType::ULongLong
\row \li \l QMetaType::ULongLong \li \l QMetaType::Bool,
\l QMetaType::QChar, \l QMetaType::Double, \l QMetaType::Int,
\l QMetaType::LongLong, \l QMetaType::QString, \l QMetaType::UInt
\endtable \endtable
A QVariant containing a pointer to a type derived from QObject will also return true for this A QVariant containing a pointer to a type derived from QObject will also return true for this

View File

@ -260,8 +260,7 @@ static QString fmtDateTime(const QString& f, const QTime* dt = 0, const QDate* d
If the specified date is invalid, the date is not set and If the specified date is invalid, the date is not set and
isValid() returns false. isValid() returns false.
\warning Years 0 to 99 are interpreted as is, i.e., years \warning Years 1 to 99 are interpreted as is. Year 0 is invalid.
0-99.
\sa isValid() \sa isValid()
*/ */
@ -1483,10 +1482,7 @@ int QTime::msec() const
If \a format is Qt::ISODate, the string format corresponds to the If \a format is Qt::ISODate, the string format corresponds to the
ISO 8601 extended specification for representations of dates, ISO 8601 extended specification for representations of dates,
which is also HH:MM:SS. (However, contrary to ISO 8601, dates which is also HH:MM:SS.
before 15 October 1582 are handled as Julian dates, not Gregorian
dates. See \l{QDate G and J} {Use of Gregorian and Julian
Calendars}. This might change in a future version of Qt.)
If the \a format is Qt::SystemLocaleShortDate or If the \a format is Qt::SystemLocaleShortDate or
Qt::SystemLocaleLongDate, the string format depends on the locale Qt::SystemLocaleLongDate, the string format depends on the locale
@ -1555,9 +1551,9 @@ QString QTime::toString(Qt::DateFormat format) const
\row \li z \li the milliseconds without leading zeroes (0 to 999) \row \li z \li the milliseconds without leading zeroes (0 to 999)
\row \li zzz \li the milliseconds with leading zeroes (000 to 999) \row \li zzz \li the milliseconds with leading zeroes (000 to 999)
\row \li AP or A \row \li AP or A
\li use AM/PM display. \e AP will be replaced by either "AM" or "PM". \li use AM/PM display. \e A/AP will be replaced by either "AM" or "PM".
\row \li ap or a \row \li ap or a
\li use am/pm display. \e ap will be replaced by either "am" or "pm". \li use am/pm display. \e a/ap will be replaced by either "am" or "pm".
\row \li t \li the timezone (for example "CEST") \row \li t \li the timezone (for example "CEST")
\endtable \endtable
@ -3754,8 +3750,7 @@ static bool hasUnquotedAP(const QString &f)
for (int i=0; i<max; ++i) { for (int i=0; i<max; ++i) {
if (f.at(i) == quote) { if (f.at(i) == quote) {
inquote = !inquote; inquote = !inquote;
} else if (!inquote && f.at(i).toUpper() == QLatin1Char('A') } else if (!inquote && f.at(i).toUpper() == QLatin1Char('A')) {
&& i + 1 < max && f.at(i + 1).toUpper() == QLatin1Char('P')) {
return true; return true;
} }
} }

View File

@ -2953,7 +2953,7 @@ QString& QString::replace(const QRegExp &rx, const QString &after)
QString &QString::replace(const QRegularExpression &re, const QString &after) QString &QString::replace(const QRegularExpression &re, const QString &after)
{ {
if (!re.isValid()) { if (!re.isValid()) {
qWarning("QString::replace: invalid QRegularExpresssion object"); qWarning("QString::replace: invalid QRegularExpression object");
return *this; return *this;
} }
@ -3278,7 +3278,7 @@ int QString::count(const QRegExp& rx) const
int QString::indexOf(const QRegularExpression& re, int from) const int QString::indexOf(const QRegularExpression& re, int from) const
{ {
if (!re.isValid()) { if (!re.isValid()) {
qWarning("QString::indexOf: invalid QRegularExpresssion object"); qWarning("QString::indexOf: invalid QRegularExpression object");
return -1; return -1;
} }
@ -3304,7 +3304,7 @@ int QString::indexOf(const QRegularExpression& re, int from) const
int QString::lastIndexOf(const QRegularExpression &re, int from) const int QString::lastIndexOf(const QRegularExpression &re, int from) const
{ {
if (!re.isValid()) { if (!re.isValid()) {
qWarning("QString::lastIndexOf: invalid QRegularExpresssion object"); qWarning("QString::lastIndexOf: invalid QRegularExpression object");
return -1; return -1;
} }
@ -3333,7 +3333,7 @@ int QString::lastIndexOf(const QRegularExpression &re, int from) const
bool QString::contains(const QRegularExpression &re) const bool QString::contains(const QRegularExpression &re) const
{ {
if (!re.isValid()) { if (!re.isValid()) {
qWarning("QString::contains: invalid QRegularExpresssion object"); qWarning("QString::contains: invalid QRegularExpression object");
return false; return false;
} }
QRegularExpressionMatch match = re.match(*this); QRegularExpressionMatch match = re.match(*this);
@ -3382,7 +3382,7 @@ bool QString::contains(const QRegularExpression &re, QRegularExpressionMatch *ma
int QString::count(const QRegularExpression &re) const int QString::count(const QRegularExpression &re) const
{ {
if (!re.isValid()) { if (!re.isValid()) {
qWarning("QString::count: invalid QRegularExpresssion object"); qWarning("QString::count: invalid QRegularExpression object");
return 0; return 0;
} }
int count = 0; int count = 0;

View File

@ -128,8 +128,19 @@ contains(QT_CONFIG, zlib) {
contains(QT_CONFIG,icu) { contains(QT_CONFIG,icu) {
SOURCES += tools/qlocale_icu.cpp SOURCES += tools/qlocale_icu.cpp
DEFINES += QT_USE_ICU DEFINES += QT_USE_ICU
win32:LIBS_PRIVATE += -licuin -licuuc win32 {
else:LIBS_PRIVATE += -licui18n -licuuc CONFIG(static, static|shared) {
CONFIG(debug, debug|release) {
LIBS_PRIVATE += -lsicuind -lsicuucd -lsicudtd
} else {
LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt
}
} else {
LIBS_PRIVATE += -licuin -licuuc
}
} else {
LIBS_PRIVATE += -licui18n -licuuc
}
} }
pcre { pcre {

View File

@ -290,14 +290,14 @@ void QCosmeticStroker::setup()
ppl = buffer->bytesPerLine()>>2; ppl = buffer->bytesPerLine()>>2;
} }
// dashes are sensitive to clips, so we need to clip consistently when painting to the same device // line drawing produces different results with different clips, so
QRect clipRect = strokeSelection & Dashed ? deviceRect : clip; // we need to clip consistently when painting to the same device
// setup FP clip bounds // setup FP clip bounds
xmin = clipRect.left() - 1; xmin = deviceRect.left() - 1;
xmax = clipRect.right() + 2; xmax = deviceRect.right() + 2;
ymin = clipRect.top() - 1; ymin = deviceRect.top() - 1;
ymax = clipRect.bottom() + 2; ymax = deviceRect.bottom() + 2;
lastPixel.x = -1; lastPixel.x = -1;
} }

View File

@ -1340,7 +1340,9 @@ static inline QString appendSuffix(const QString &fileName, const QString &filte
if (suffixPos < 0) if (suffixPos < 0)
return fileName; return fileName;
suffixPos += 3; suffixPos += 3;
int endPos = filter.indexOf(QLatin1Char(';'), suffixPos + 1); int endPos = filter.indexOf(QLatin1Char(' '), suffixPos + 1);
if (endPos < 0)
endPos = filter.indexOf(QLatin1Char(';'), suffixPos + 1);
if (endPos < 0) if (endPos < 0)
endPos = filter.indexOf(QLatin1Char(')'), suffixPos + 1); endPos = filter.indexOf(QLatin1Char(')'), suffixPos + 1);
if (endPos < 0) if (endPos < 0)

View File

@ -490,7 +490,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
} }
if (cursor && cshape >= 0 && cshape < Qt::LastCursor) { if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
const char *name = cursorNames[cshape]; const char *name = cursorNames[cshape];
xcb_xfixes_set_cursor_name(conn, cursor, strlen(name), name); xcb_xfixes_set_cursor_name(conn, cursor, strlen(name), name);
} }

View File

@ -42,6 +42,7 @@ CONFIG += minimal_syncqt
QMAKE_SYNCQT_OPTIONS = -module QtCore -module QtDBus -module QtXml QMAKE_SYNCQT_OPTIONS = -module QtCore -module QtDBus -module QtXml
contains(QT_CONFIG, zlib): \ contains(QT_CONFIG, zlib): \
QMAKE_SYNCQT_OPTIONS += -module QtZlib QMAKE_SYNCQT_OPTIONS += -module QtZlib
QMAKE_SYNCQT_OPTIONS += -version $$QT_VERSION
load(qt_module) load(qt_module)

View File

@ -745,9 +745,6 @@
#include <QtGui/qevent.h> #include <QtGui/qevent.h>
#include <QtGui/qinputmethod.h> #include <QtGui/qinputmethod.h>
#include <QtWidgets/qgraphicseffect.h> #include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#include <private/qgraphicsitem_p.h> #include <private/qgraphicsitem_p.h>
#include <private/qgraphicswidget_p.h> #include <private/qgraphicswidget_p.h>
@ -7357,12 +7354,6 @@ void QGraphicsItem::updateMicroFocus()
if (scene()->views().at(i) == fw) { if (scene()->views().at(i) == fw) {
if (qApp) if (qApp)
qApp->inputMethod()->update(Qt::ImQueryAll); qApp->inputMethod()->update(Qt::ImQueryAll);
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
if (toGraphicsObject())
QAccessible::updateAccessibility(toGraphicsObject(), 0, QAccessible::StateChanged);
#endif
break; break;
} }
} }

View File

@ -245,9 +245,6 @@
#include <QtGui/qtransform.h> #include <QtGui/qtransform.h>
#include <QtGui/qinputmethod.h> #include <QtGui/qinputmethod.h>
#include <QtWidgets/qgraphicseffect.h> #include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include <QtGui/qaccessible.h>
#endif
#include <private/qapplication_p.h> #include <private/qapplication_p.h>
#include <private/qobject_p.h> #include <private/qobject_p.h>
#include <private/qgraphicseffect_p.h> #include <private/qgraphicseffect_p.h>
@ -866,14 +863,6 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
focusItem = item; focusItem = item;
updateInputMethodSensitivityInViews(); updateInputMethodSensitivityInViews();
#ifndef QT_NO_ACCESSIBILITY
if (focusItem) {
if (QGraphicsObject *focusObj = focusItem->toGraphicsObject()) {
QAccessibleEvent event(focusObj, QAccessible::Focus);
QAccessible::updateAccessibility(&event);
}
}
#endif
if (item) { if (item) {
QFocusEvent event(QEvent::FocusIn, focusReason); QFocusEvent event(QEvent::FocusIn, focusReason);
sendEvent(item, &event); sendEvent(item, &event);

View File

@ -1481,16 +1481,10 @@ void tst_QDateTime::toString_strformat_data()
QTest::newRow( "datetime13" ) << QDateTime(QDate(1974, 12, 1), QTime(14, 14, 20)) QTest::newRow( "datetime13" ) << QDateTime(QDate(1974, 12, 1), QTime(14, 14, 20))
<< QString("hh''mm''ss dd''MM''yyyy") << QString("hh''mm''ss dd''MM''yyyy")
<< QString("14'14'20 01'12'1974"); << QString("14'14'20 01'12'1974");
QTest::newRow( "missing p and P" ) << QDateTime(QDate(1999, 12, 31), QTime(3, 59, 59, 999))
<< QString("hhhhhaA") << QString("03033aA");
QTest::newRow( "OK A, bad P" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999))
<< QString("hhAX") << QString("00AX");
QTest::newRow( "single, 0 => 12 AM" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999)) QTest::newRow( "single, 0 => 12 AM" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999))
<< QString("hAP") << QString("12AM"); << QString("hAP") << QString("12AM");
QTest::newRow( "double, 0 => 12 AM" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999)) QTest::newRow( "double, 0 => 12 AM" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999))
<< QString("hhAP") << QString("12AM"); << QString("hhAP") << QString("12AM");
QTest::newRow( "double, garbage" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999))
<< QString("hhAX") << QString("00AX");
QTest::newRow( "dddd" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999)) QTest::newRow( "dddd" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999))
<< QString("dddd") << QString("Friday"); << QString("dddd") << QString("Friday");
QTest::newRow( "ddd" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999)) QTest::newRow( "ddd" ) << QDateTime(QDate(1999, 12, 31), QTime(0, 59, 59, 999))

View File

@ -156,6 +156,7 @@ private slots:
void count(); void count();
void lastIndexOf_data(); void lastIndexOf_data();
void lastIndexOf(); void lastIndexOf();
void lastIndexOfInvalidRegex();
void indexOf_data(); void indexOf_data();
void indexOf(); void indexOf();
void indexOf2_data(); void indexOf2_data();
@ -635,6 +636,7 @@ void tst_QString::replace_regexp_data()
<< QString("a9a8a7a6a5nmlkjii0hh0gg0ff0ee0dd0cc0bb0a"); << QString("a9a8a7a6a5nmlkjii0hh0gg0ff0ee0dd0cc0bb0a");
QTest::newRow("backref10") << QString("abc") << QString("((((((((((((((abc))))))))))))))") QTest::newRow("backref10") << QString("abc") << QString("((((((((((((((abc))))))))))))))")
<< QString("\\0\\01\\011") << QString("\\0\\01\\011"); << QString("\\0\\01\\011") << QString("\\0\\01\\011");
QTest::newRow("invalid") << QString("") << QString("invalid regex\\") << QString("") << QString("");
} }
void tst_QString::utf8_data() void tst_QString::utf8_data()
@ -1383,6 +1385,12 @@ void tst_QString::lastIndexOf()
} }
} }
void tst_QString::lastIndexOfInvalidRegex()
{
QTest::ignoreMessage(QtWarningMsg, "QString::lastIndexOf: invalid QRegularExpression object");
QCOMPARE(QString("").lastIndexOf(QRegularExpression("invalid regex\\"), 0), -1);
}
void tst_QString::count() void tst_QString::count()
{ {
QString a; QString a;
@ -1400,7 +1408,8 @@ void tst_QString::count()
QCOMPARE(a.count(QRegExp("[G][HE]")),2); QCOMPARE(a.count(QRegExp("[G][HE]")),2);
QCOMPARE(a.count(QRegularExpression("[FG][HI]")), 1); QCOMPARE(a.count(QRegularExpression("[FG][HI]")), 1);
QCOMPARE(a.count(QRegularExpression("[G][HE]")), 2); QCOMPARE(a.count(QRegularExpression("[G][HE]")), 2);
QTest::ignoreMessage(QtWarningMsg, "QString::count: invalid QRegularExpression object");
QCOMPARE(a.count(QRegularExpression("invalid regex\\")), 0);
CREATE_REF(QLatin1String("FG")); CREATE_REF(QLatin1String("FG"));
QCOMPARE(a.count(ref),2); QCOMPARE(a.count(ref),2);
@ -1485,6 +1494,8 @@ void tst_QString::contains()
QStringRef emptyRef(&a, 0, 0); QStringRef emptyRef(&a, 0, 0);
QVERIFY(a.contains(emptyRef, Qt::CaseInsensitive)); QVERIFY(a.contains(emptyRef, Qt::CaseInsensitive));
QTest::ignoreMessage(QtWarningMsg, "QString::contains: invalid QRegularExpression object");
QVERIFY(!a.contains(QRegularExpression("invalid regex\\")));
} }
@ -2395,7 +2406,10 @@ void tst_QString::replace_regexp()
s2.replace( QRegExp(regexp), after ); s2.replace( QRegExp(regexp), after );
QTEST( s2, "result" ); QTEST( s2, "result" );
s2 = string; s2 = string;
s2.replace( QRegularExpression(regexp), after ); QRegularExpression regularExpression(regexp);
if (!regularExpression.isValid())
QTest::ignoreMessage(QtWarningMsg, "QString::replace: invalid QRegularExpression object");
s2.replace( regularExpression, after );
QTEST( s2, "result" ); QTEST( s2, "result" );
} }

View File

@ -277,7 +277,9 @@ private slots:
void drawTextWithComplexBrush(); void drawTextWithComplexBrush();
void QTBUG26013_squareCapStroke(); void QTBUG26013_squareCapStroke();
void QTBUG25153_drawLine(); void QTBUG25153_drawLine();
void dashing_systemClip();
void cosmeticStrokerClipping_data();
void cosmeticStrokerClipping();
private: private:
void fillData(); void fillData();
@ -4459,22 +4461,54 @@ void tst_QPainter::QTBUG25153_drawLine()
} }
} }
static void dashing_systemClip_paint(QPainter *p) enum CosmeticStrokerPaint
{ {
p->setPen(QPen(Qt::black, 1, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin)); Antialiasing,
p->drawLine(8, 8, 42, 8); Dashing
p->drawLine(42, 8, 42, 42); };
p->drawLine(42, 42, 8, 42);
p->drawLine(8, 42, 8, 8); static void paint_func(QPainter *p, CosmeticStrokerPaint type)
{
p->save();
switch (type) {
case Antialiasing:
p->setPen(Qt::black);
p->setRenderHint(QPainter::Antialiasing);
p->drawLine(4, 8, 42, 42);
break;
case Dashing:
p->setPen(QPen(Qt::black, 1, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin));
p->drawLine(8, 8, 42, 8);
p->drawLine(42, 8, 42, 42);
p->drawLine(42, 42, 8, 42);
p->drawLine(8, 42, 8, 8);
break;
default:
Q_ASSERT(false);
break;
}
p->restore();
} }
void tst_QPainter::dashing_systemClip() Q_DECLARE_METATYPE(CosmeticStrokerPaint)
void tst_QPainter::cosmeticStrokerClipping_data()
{ {
QTest::addColumn<CosmeticStrokerPaint>("paint");
QTest::newRow("antialiasing_paint") << Antialiasing;
QTest::newRow("dashing_paint") << Dashing;
}
void tst_QPainter::cosmeticStrokerClipping()
{
QFETCH(CosmeticStrokerPaint, paint);
QImage image(50, 50, QImage::Format_RGB32); QImage image(50, 50, QImage::Format_RGB32);
image.fill(Qt::white); image.fill(Qt::white);
QPainter p(&image); QPainter p(&image);
dashing_systemClip_paint(&p); paint_func(&p, paint);
p.end(); p.end();
QImage old = image.copy(); QImage old = image.copy();
@ -4482,7 +4516,8 @@ void tst_QPainter::dashing_systemClip()
image.paintEngine()->setSystemClip(QRect(10, 0, image.width() - 10, image.height())); image.paintEngine()->setSystemClip(QRect(10, 0, image.width() - 10, image.height()));
p.begin(&image); p.begin(&image);
dashing_systemClip_paint(&p); p.fillRect(image.rect(), Qt::white);
paint_func(&p, paint);
// doing same paint operation again with different system clip should not change the image // doing same paint operation again with different system clip should not change the image
QCOMPARE(old, image); QCOMPARE(old, image);
@ -4490,7 +4525,8 @@ void tst_QPainter::dashing_systemClip()
old = image; old = image;
p.setClipRect(QRect(20, 20, 30, 30)); p.setClipRect(QRect(20, 20, 30, 30));
dashing_systemClip_paint(&p); p.fillRect(image.rect(), Qt::white);
paint_func(&p, paint);
// ditto for regular clips // ditto for regular clips
QCOMPARE(old, image); QCOMPARE(old, image);

View File

@ -708,6 +708,8 @@ void tst_QSslSocket::peerCertificateChain()
if (!QSslSocket::supportsSsl()) if (!QSslSocket::supportsSsl())
return; return;
QSKIP("QTBUG-29941 - Unstable auto-test due to intermittently unreachable host");
QSslSocketPtr socket = newSocket(); QSslSocketPtr socket = newSocket();
this->socket = socket.data(); this->socket = socket.data();

View File

@ -4246,6 +4246,7 @@ void tst_QWidget::scroll()
UpdateWidget updateWidget; UpdateWidget updateWidget;
updateWidget.resize(w, h); updateWidget.resize(w, h);
updateWidget.reset(); updateWidget.reset();
updateWidget.move(QGuiApplication::primaryScreen()->geometry().center() - QPoint(250, 250));
updateWidget.show(); updateWidget.show();
qApp->setActiveWindow(&updateWidget); qApp->setActiveWindow(&updateWidget);
QVERIFY(QTest::qWaitForWindowActive(&updateWidget)); QVERIFY(QTest::qWaitForWindowActive(&updateWidget));
@ -4257,7 +4258,7 @@ void tst_QWidget::scroll()
qApp->processEvents(); qApp->processEvents();
QRegion dirty(QRect(0, 0, w, 10)); QRegion dirty(QRect(0, 0, w, 10));
dirty += QRegion(QRect(0, 10, 10, h - 10)); dirty += QRegion(QRect(0, 10, 10, h - 10));
QCOMPARE(updateWidget.paintedRegion, dirty); QTRY_COMPARE(updateWidget.paintedRegion, dirty);
} }
{ {
@ -4267,7 +4268,7 @@ void tst_QWidget::scroll()
qApp->processEvents(); qApp->processEvents();
QRegion dirty(QRect(0, 0, w, 10)); QRegion dirty(QRect(0, 0, w, 10));
dirty += QRegion(QRect(0, 10, 10, 10)); dirty += QRegion(QRect(0, 10, 10, 10));
QCOMPARE(updateWidget.paintedRegion, dirty); QTRY_COMPARE(updateWidget.paintedRegion, dirty);
} }
if (updateWidget.width() < 200 || updateWidget.height() < 200) if (updateWidget.width() < 200 || updateWidget.height() < 200)
@ -4283,7 +4284,7 @@ void tst_QWidget::scroll()
dirty += QRegion(QRect(0, 60, 110, 40)); dirty += QRegion(QRect(0, 60, 110, 40));
dirty += QRegion(QRect(50, 100, 60, 10)); dirty += QRegion(QRect(50, 100, 60, 10));
dirty += QRegion(QRect(50, 110, 10, 40)); dirty += QRegion(QRect(50, 110, 10, 40));
QCOMPARE(updateWidget.paintedRegion, dirty); QTRY_COMPARE(updateWidget.paintedRegion, dirty);
} }
{ {
@ -4294,7 +4295,7 @@ void tst_QWidget::scroll()
QRegion dirty(QRect(0, 0, 100, 100)); QRegion dirty(QRect(0, 0, 100, 100));
dirty += QRegion(QRect(100, 100, 100, 10)); dirty += QRegion(QRect(100, 100, 100, 10));
dirty += QRegion(QRect(100, 110, 10, 90)); dirty += QRegion(QRect(100, 110, 10, 90));
QCOMPARE(updateWidget.paintedRegion, dirty); QTRY_COMPARE(updateWidget.paintedRegion, dirty);
} }
} }
#endif #endif

View File

@ -172,7 +172,7 @@ Configure::Configure(int& argc, char** argv)
QTextStream stream(&syncqt_bat); QTextStream stream(&syncqt_bat);
stream << "@echo off" << endl stream << "@echo off" << endl
<< "call " << QDir::toNativeSeparators(sourcePath + "/bin/syncqt.bat") << "call " << QDir::toNativeSeparators(sourcePath + "/bin/syncqt.bat")
<< " -mkspecsdir \"" << QDir::toNativeSeparators(buildPath) << "/mkspecs\" %*" << endl; << " %*" << endl;
syncqt_bat.close(); syncqt_bat.close();
} }
} }
@ -2032,7 +2032,8 @@ bool Configure::checkAvailability(const QString &part)
else if (part == "ICU") else if (part == "ICU")
available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h") available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h")
&& (findFile("icuin.lib") || findFile("libicuin.lib")); // libicun.lib if compiled with mingw && (findFile("icuin.lib") || findFile("sicuin.lib")
|| findFile("libicuin.lib") || findFile("libsicuin.lib")); // "lib" prefix for mingw, 's' prefix for static
else if (part == "ANGLE") { else if (part == "ANGLE") {
available = checkAngleAvailability(); available = checkAngleAvailability();
@ -2141,6 +2142,8 @@ bool Configure::checkAvailability(const QString &part)
*/ */
void Configure::autoDetection() void Configure::autoDetection()
{ {
cout << "Running configuration tests..." << endl;
if (dictionary["C++11"] == "auto") { if (dictionary["C++11"] == "auto") {
if (!dictionary["QMAKESPEC"].contains("msvc")) if (!dictionary["QMAKESPEC"].contains("msvc"))
dictionary["C++11"] = tryCompileProject("common/c++11") ? "yes" : "no"; dictionary["C++11"] = tryCompileProject("common/c++11") ? "yes" : "no";