diff options
156 files changed, 1302 insertions, 557 deletions
diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL index e90ad1acb5..15e61fc19e 100644 --- a/LICENSE.PREVIEW.COMMERCIAL +++ b/LICENSE.PREVIEW.COMMERCIAL @@ -14,8 +14,8 @@ TECHNOLOGY PREVIEW LICENSE AGREEMENT: The Americas Agreement version 2.4 This Technology Preview License Agreement ("Agreement")is a legal agreement -between Digia USA, Inc. ("Digia"), with its registered office at 32 W. -Loockerman Street, Suite 201, City of Dover, County of Kent, Delaware 19904, +between Digia USA, Inc. ("Digia"), with its registered office at 2350 +Mission College Blvd., Suite 1020, Santa Clara, California 95054, U.S.A. and you (either an individual or a legal entity) ("Licensee") for the Licensed Software (as defined below). diff --git a/bin/syncqt.pl b/bin/syncqt.pl index ce07af4895..d1424f0c32 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -97,7 +97,6 @@ my $force_win = 0; my $force_relative = 0; my $check_includes = 0; my $copy_headers = 0; -my $create_uic_class_map = 0; my $create_private_headers = 1; my $minimal = 0; my $module_version = 0; @@ -172,6 +171,30 @@ sub checkRelative { } ###################################################################### +# Syntax: shouldMasterInclude(iheader) +# Params: iheader, string, filename to verify inclusion +# +# Purpose: Determines if header should be in the master include file. +# Returns: 0 if file contains "#pragma qt_no_master_include" or not +# able to open, else 1. +###################################################################### +sub shouldMasterInclude { + my ($iheader) = @_; + return 0 if (basename($iheader) =~ /_/); + return 0 if (basename($iheader) =~ /qconfig/); + if (open(F, "<$iheader")) { + while (<F>) { + chomp; + return 0 if (/^\#pragma qt_no_master_include$/); + } + close(F); + } else { + return 0; + } + return 1; +} + +###################################################################### # Syntax: classNames(iheader) # Params: iheader, string, filename to parse for classname "symlinks" # @@ -383,6 +406,32 @@ sub fileContents { } ###################################################################### +# Syntax: writeFile(filename, contents) +# Params: filename, string, filename of file to write +# contents, string, new contents for the file +# +# Purpose: Write file with given contents. If new contents match old +# ones, do no change the file's timestamp. +# Returns: 1 if the file's contents changed. +###################################################################### +sub writeFile { + my ($filename, $contents, $lib, $what) = @_; + my $oldcontents = fileContents($filename); + $oldcontents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms + if ($oldcontents ne $contents) { + open(O, "> " . $filename) || die "Could not open $filename for writing: $!\n"; + print O $contents; + close O; + if ($lib && $verbose_level) { + my $action = ($oldcontents eq "") ? "created" : "updated"; + print "$lib: $action $what\n"; + } + return 1; + } + return 0; +} + +###################################################################### # Syntax: fileCompare(file1, file2) # Params: file1, string, filename of first file # file2, string, filename of second file @@ -458,36 +507,6 @@ sub copyFile } ###################################################################### -# Syntax: symlinkFile(file, ifile) -# Params: file, string, filename to create "symlink" for -# ifile, string, destination name of symlink -# -# Purpose: File is symlinked to ifile (or copied if filesystem doesn't -# support symlink). -# Returns: 1 on success, else 0. -###################################################################### -sub symlinkFile -{ - my ($lib, $file, $ifile) = @_; - - if ($isunix) { - print "$lib: symlink created for $file " if ($verbose_level); - if ( $force_relative && ($ifile =~ /^$quoted_basedir/)) { - my $t = getcwd(); - my $c = -1; - my $p = "../"; - $t =~ s-^$quoted_basedir/--; - $p .= "../" while( ($c = index( $t, "/", $c + 1)) != -1 ); - $file =~ s-^$quoted_basedir/-$p-; - print " ($file)\n" if($verbose_level); - } - print "\n" if($verbose_level); - return symlink($file, $ifile); - } - return copyFile($lib, $file, $ifile); -} - -###################################################################### # Syntax: findFiles(dir, match, descend) # Params: dir, string, directory to search for name # match, string, regular expression to match in dir @@ -736,7 +755,6 @@ while ( @ARGV ) { $modules{$module} = $prodir; push @modules_to_sync, $module; $moduleheaders{$module} = $headerdir; - $create_uic_class_map = 0; } elsif ($var eq "version") { if($val) { $module_version = $val; @@ -802,6 +820,12 @@ foreach my $lib (@modules_to_sync) { my $pri_install_pfiles = ""; my $pri_install_qpafiles = ""; + my $libcapitals = uc($lib); + my $master_contents = + "#ifndef QT_".$libcapitals."_MODULE_H\n" . + "#define QT_".$libcapitals."_MODULE_H\n" . + "#include <$lib/${lib}Depends>\n"; + #remove the old files if($remove_stale) { my %injections = (); @@ -867,15 +891,8 @@ foreach my $lib (@modules_to_sync) { #calc files and "copy" them foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); - if (defined $inject_headers{$subdir}) { - foreach my $if (@{$inject_headers{$subdir}}) { - @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously - push @headers, "*".$if; - } - } my $header_dirname = ""; foreach my $header (@headers) { - my $shadow = ($header =~ s/^\*//); $header = 0 if($header =~ /^ui_.*.h/); foreach (@ignore_headers) { $header = 0 if($header eq $_); @@ -897,7 +914,6 @@ foreach my $lib (@modules_to_sync) { } my $iheader = $subdir . "/" . $header; - $iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow); my @classes = $public_header && !$minimal ? classNames($iheader) : (); if($showonly) { print "$header [$lib]\n"; @@ -938,10 +954,13 @@ foreach my $lib (@modules_to_sync) { } foreach(@headers) { #sync them - $header_copies++ if(syncHeader($lib, $_, $iheader, $copy_headers && !$shadow, $ts)); + $header_copies++ if (syncHeader($lib, $_, $iheader, $copy_headers, $ts)); } if($public_header) { + #put it into the master file + $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); + #deal with the install directives if($public_header) { my $pri_install_iheader = fixPaths($iheader, $dir); @@ -1000,6 +1019,11 @@ foreach my $lib (@modules_to_sync) { } } + # close the master include: + $master_contents .= + "#include \"".lc($lib)."version.h\"\n" . + "#endif\n"; + unless ($showonly || $minimal) { # create deprecated headers my $first = 1; @@ -1021,34 +1045,37 @@ foreach my $lib (@modules_to_sync) { my $header_dir = dirname($header_path); make_path($header_dir, $lib, $verbose_level); - open(HEADER, ">$header_path") || die "Could not open $header_path for writing: $!\n"; - print HEADER "#ifndef $guard\n"; - print HEADER "#define $guard\n"; + my $hdrcont = + "#ifndef $guard\n" . + "#define $guard\n"; my $warning = "Header <$lib/"; $warning .= "private/" unless ($public_header); $warning .= "$header> is deprecated. Please include <$include> instead."; - print HEADER "#if defined(__GNUC__)\n"; - print HEADER "# warning $warning\n"; - print HEADER "#elif defined(_MSC_VER)\n"; - print HEADER "# pragma message (\"$warning\")\n"; - print HEADER "#endif\n"; - print HEADER "#include <$include>\n"; + $hdrcont .= + "#if defined(__GNUC__)\n" . + "# warning $warning\n" . + "#elif defined(_MSC_VER)\n" . + "# pragma message (\"$warning\")\n" . + "#endif\n" . + "#include <$include>\n"; if ($public_header) { - print HEADER "#if 0\n"; - print HEADER "#pragma qt_no_master_include\n"; - print HEADER "#endif\n"; + $hdrcont .= + "#if 0\n" . + "#pragma qt_no_master_include\n" . + "#endif\n"; } - print HEADER "#endif\n"; - close HEADER; - - if ($verbose_level < 3) { - my $line_prefix = ","; - $line_prefix = "$lib: created deprecated header(s) {" if ($first); - print "$line_prefix $header"; - } else { - print "$lib: created deprecated header $header => $include\n"; + $hdrcont .= + "#endif\n"; + if (writeFile($header_path, $hdrcont)) { + if ($verbose_level < 3) { + my $line_prefix = ","; + $line_prefix = "$lib: created deprecated header(s) {" if ($first); + print "$line_prefix $header"; + } else { + print "$lib: created deprecated header $header => $include\n"; + } + $first = 0; } - $first = 0; } my $addendum = fixPaths($header_path, $dir) . " "; @@ -1068,6 +1095,23 @@ foreach my $lib (@modules_to_sync) { syncHeader($lib, $VHeader, $vheader, 0); $pri_install_files .= fixPaths($vheader, $dir) . " "; $pri_install_classes .= fixPaths($VHeader, $dir) . " "; + my @versions = split(/\./, $module_version); + my $modulehexstring = sprintf("0x%02X%02X%02X", $versions[0], $versions[1], $versions[2]); + my $vhdrcont = + "/* This file was generated by syncqt. */\n". + "#ifndef QT_".uc($lib)."_VERSION_H\n". + "#define QT_".uc($lib)."_VERSION_H\n". + "\n". + "#define ".uc($lib)."_VERSION_STR \"".$module_version."\"\n". + "\n". + "#define ".uc($lib)."_VERSION ".$modulehexstring."\n". + "\n". + "#endif // QT_".uc($lib)."_VERSION_H\n"; + writeFile($vheader, $vhdrcont, $lib, "version header"); + + my $master_include = "$out_basedir/include/$lib/$lib"; + $pri_install_files .= fixPaths($master_include, $dir) . " "; + writeFile($master_include, $master_contents, $lib, "master header"); #handle the headers.pri for each module my $headers_pri_contents = ""; @@ -1076,42 +1120,7 @@ foreach my $lib (@modules_to_sync) { $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n"; $headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n"; my $headers_pri_file = "$out_basedir/include/$lib/headers.pri"; - if(-e $headers_pri_file) { - open HEADERS_PRI_FILE, "<$headers_pri_file"; - local $/; - binmode HEADERS_PRI_FILE; - my $old_headers_pri_contents = <HEADERS_PRI_FILE>; - close HEADERS_PRI_FILE; - $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents); - } - if($headers_pri_file) { - my $headers_pri_dir = dirname($headers_pri_file); - make_path($headers_pri_dir, $lib, $verbose_level); - open HEADERS_PRI_FILE, ">$headers_pri_file"; - print HEADERS_PRI_FILE $headers_pri_contents; - close HEADERS_PRI_FILE; - print "$lib: created headers.pri file\n" if($verbose_level); - } - } -} -unless($showonly || !$create_uic_class_map) { - my $class_lib_map = "$out_basedir/src/tools/uic/qclass_lib_map.h"; - if(-e $class_lib_map) { - open CLASS_LIB_MAP, "<$class_lib_map"; - local $/; - binmode CLASS_LIB_MAP; - my $old_class_lib_map_contents = <CLASS_LIB_MAP>; - close CLASS_LIB_MAP; - $old_class_lib_map_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $class_lib_map = 0 if($old_class_lib_map_contents eq $class_lib_map_contents); - } - if($class_lib_map) { - my $class_lib_map_dir = dirname($class_lib_map); - make_path($class_lib_map_dir, "<outdir>", $verbose_level); - open CLASS_LIB_MAP, ">$class_lib_map"; - print CLASS_LIB_MAP $class_lib_map_contents; - close CLASS_LIB_MAP; + writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file"); } } @@ -2389,13 +2389,6 @@ fi if [ "$OPT_SHADOW" = "yes" ]; then echo "Preparing build tree..." - if [ -z "$PERL" ]; then - echo - echo "You need perl in your PATH to make a shadow build." - echo "Cannot proceed." - exit 1 - fi - [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin" mkdir -p "$outpath/mkspecs" @@ -3878,7 +3871,14 @@ fi # ----------------------------------------------------------------------------- # symlink includes -if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt.pl" ]; then +if [ -e "$relpath/.git" ]; then + if [ -z "$PERL" ]; then + echo + echo "You need perl in your PATH to make a build from GIT." + echo "Cannot proceed." + exit 1 + fi + "$relpath/bin/syncqt.pl" -minimal -module QtCore "$relpath" || exit 1 fi @@ -4011,6 +4011,11 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; echo "BUILD_PATH = $adjoutpath" >> "$mkfile" echo "SOURCE_PATH = $adjrelpath" >> "$mkfile" + if [ -e "$relpath/.git" ]; then + echo 'INC_PATH = $(BUILD_PATH)/include' >> "$mkfile" + else + echo 'INC_PATH = $(SOURCE_PATH)/include' >> "$mkfile" + fi echo "QMAKESPEC = $adjqmakespec" >> "$mkfile" echo "QT_VERSION = $QT_VERSION" >> "$mkfile" echo "EXTRA_CFLAGS = $EXTRA_CFLAGS" >> "$mkfile" @@ -6404,12 +6409,24 @@ echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$out if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then rm -f "$outpath/src/corelib/global/qconfig.h.new" else - [ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h" - mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h" - chmod -w "$outpath/src/corelib/global/qconfig.h" - if [ ! -f "$outpath/include/QtCore/qconfig.h" ]; then - ln -s "$outpath/src/corelib/global/qconfig.h" "$outpath/include/QtCore/qconfig.h" - fi + mv -f "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h" +fi + +# create a forwarding header +mkdir -p "$outpath/include/QtCore" || exit +echo '#include "../../src/corelib/global/qconfig.h"' > $outpath/include/QtCore/qconfig.h.new +if cmp -s "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h"; then + rm -f "$outpath/include/QtCore/qconfig.h.new" +else + mv "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h" || exit +fi + +# create a camelcase forwarding header +echo '#include "qconfig.h"' > $outpath/include/QtCore/QtConfig.new +if cmp -s "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig"; then + rm -f "$outpath/include/QtCore/QtConfig.new" +else + mv "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig" || exit fi #------------------------------------------------------------------------------- diff --git a/examples/widgets/doc/src/dirview.qdoc b/examples/widgets/doc/src/dirview.qdoc index b9698ea498..7687737cef 100644 --- a/examples/widgets/doc/src/dirview.qdoc +++ b/examples/widgets/doc/src/dirview.qdoc @@ -32,7 +32,7 @@ \brief This example demonstrates the usage of a tree view. \brief The Dir View example shows a tree view onto the local filing system. It uses the - QDirModel class to provide file and directory information. + QFileSystemModel class to provide file and directory information. \image dirview-example.png */ diff --git a/mkspecs/aix-g++-64/qmake.conf b/mkspecs/aix-g++-64/qmake.conf index 25acf04eda..176c437c45 100644 --- a/mkspecs/aix-g++-64/qmake.conf +++ b/mkspecs/aix-g++-64/qmake.conf @@ -64,6 +64,7 @@ QMAKE_LIBS_THREAD = -lpthreads QMAKE_AR = ar -X64 cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = ranlib -X64 include(../common/unix.conf) diff --git a/mkspecs/aix-g++/qmake.conf b/mkspecs/aix-g++/qmake.conf index 94dbbd12ef..553d9af544 100644 --- a/mkspecs/aix-g++/qmake.conf +++ b/mkspecs/aix-g++/qmake.conf @@ -64,6 +64,7 @@ QMAKE_LIBS_THREAD = -lpthreads QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/aix-xlc-64/qmake.conf b/mkspecs/aix-xlc-64/qmake.conf index d4b9718d74..42dbd18b4a 100644 --- a/mkspecs/aix-xlc-64/qmake.conf +++ b/mkspecs/aix-xlc-64/qmake.conf @@ -63,6 +63,7 @@ QMAKE_LIBS_THREAD = -lpthreads QMAKE_AR = ar -X64 cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = ranlib -X64 include(../common/unix.conf) diff --git a/mkspecs/aix-xlc/qmake.conf b/mkspecs/aix-xlc/qmake.conf index c4efebff24..d2de649355 100644 --- a/mkspecs/aix-xlc/qmake.conf +++ b/mkspecs/aix-xlc/qmake.conf @@ -66,6 +66,7 @@ QMAKE_LIBS_THREAD = -lpthreads QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = ranlib include(../common/unix.conf) diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf index 5a056b3d00..95fa8a9786 100644 --- a/mkspecs/android-g++/qmake.conf +++ b/mkspecs/android-g++/qmake.conf @@ -137,6 +137,7 @@ QMAKE_LINK_SHLIB = $$QMAKE_LINK # modifications to linux.conf QMAKE_AR = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-ar cqs QMAKE_OBJCOPY = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-objcopy +QMAKE_NM = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-nm -P QMAKE_STRIP = #$$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-strip diff --git a/mkspecs/common/linux-android.conf b/mkspecs/common/linux-android.conf index 363dac3a34..b90a22ebef 100644 --- a/mkspecs/common/linux-android.conf +++ b/mkspecs/common/linux-android.conf @@ -65,6 +65,7 @@ QMAKE_LINK_SHLIB = $$QMAKE_LINK # modifications to linux.conf QMAKE_AR = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-ar cqs QMAKE_OBJCOPY = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-objcopy +QMAKE_NM = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-nm -P QMAKE_STRIP = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-strip QMAKE_RANLIB = $$NDK_TOOLCHAIN_PATH/bin/$$ANDROID_NDK_TOOLS_PREFIX-ranlib diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index 1c46ab7c21..c727bd9aef 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -48,6 +48,7 @@ QMAKE_DEFINES_XCB = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_STRIP = strip diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf index cf54f3f580..341c74657a 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -25,5 +25,6 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cq QMAKE_RANLIB = ranlib -s +QMAKE_NM = nm -P include(unix.conf) diff --git a/mkspecs/common/nacl/g++-nacl32.conf b/mkspecs/common/nacl/g++-nacl32.conf index 7ab48dba3a..319d3ca475 100644 --- a/mkspecs/common/nacl/g++-nacl32.conf +++ b/mkspecs/common/nacl/g++-nacl32.conf @@ -7,5 +7,6 @@ QMAKE_LINK = i686-nacl-g++ QMAKE_LINK_SHLIB = i686-nacl-g++ QMAKE_AR = i686-nacl-ar q QMAKE_OBJCOPY = i686-nacl-objcopy +QMAKE_NM = i686-nacl-nm -P QMAKE_STRIP = i686-nacl-strip diff --git a/mkspecs/common/nacl/g++-nacl64.conf b/mkspecs/common/nacl/g++-nacl64.conf index 91ffcc2310..8a20535775 100644 --- a/mkspecs/common/nacl/g++-nacl64.conf +++ b/mkspecs/common/nacl/g++-nacl64.conf @@ -7,5 +7,6 @@ QMAKE_LINK = x86_64-nacl-g++ QMAKE_LINK_SHLIB = x86_64-nacl-g++ QMAKE_AR = x86_64-nacl-ar q QMAKE_OBJCOPY = x86_64-nacl-objcopy +QMAKE_NM = x86_64-nacl-nm -P QMAKE_STRIP = x86_64-nacl-strip diff --git a/mkspecs/common/qcc-base-qnx-armv7le.conf b/mkspecs/common/qcc-base-qnx-armv7le.conf index 9bd9e288d3..331a65b2bf 100644 --- a/mkspecs/common/qcc-base-qnx-armv7le.conf +++ b/mkspecs/common/qcc-base-qnx-armv7le.conf @@ -15,6 +15,7 @@ include(qcc-base-qnx.conf) QMAKE_AR = ntoarmv7-ar cqs QMAKE_OBJCOPY = ntoarmv7-objcopy +QMAKE_NM = ntoarmv7-nm -P QMAKE_RANLIB = ntoarmv7-ranlib QMAKE_STRIP = ntoarmv7-strip diff --git a/mkspecs/common/qcc-base-qnx-x86.conf b/mkspecs/common/qcc-base-qnx-x86.conf index a2803a5c5a..b49075086d 100644 --- a/mkspecs/common/qcc-base-qnx-x86.conf +++ b/mkspecs/common/qcc-base-qnx-x86.conf @@ -15,6 +15,7 @@ include(qcc-base-qnx.conf) QMAKE_AR = ntox86-ar cqs QMAKE_OBJCOPY = ntox86-objcopy +QMAKE_NM = ntox86-nm -P QMAKE_RANLIB = ntox86-ranlib QMAKE_STRIP = ntox86-strip diff --git a/mkspecs/cygwin-g++/qmake.conf b/mkspecs/cygwin-g++/qmake.conf index a8e9d41485..06135beb30 100644 --- a/mkspecs/cygwin-g++/qmake.conf +++ b/mkspecs/cygwin-g++/qmake.conf @@ -70,6 +70,7 @@ QMAKE_EXTENSION_STATICLIB = a QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/shell-unix.conf) diff --git a/mkspecs/darwin-g++/qmake.conf b/mkspecs/darwin-g++/qmake.conf index 21a13a3bb5..24a6224b7c 100644 --- a/mkspecs/darwin-g++/qmake.conf +++ b/mkspecs/darwin-g++/qmake.conf @@ -76,6 +76,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = ranlib -s QMAKE_PCH_OUTPUT_EXT = .gch diff --git a/mkspecs/devices/common/linux_device_pre.conf b/mkspecs/devices/common/linux_device_pre.conf index 6d80fc7e1d..a4837a435d 100644 --- a/mkspecs/devices/common/linux_device_pre.conf +++ b/mkspecs/devices/common/linux_device_pre.conf @@ -21,4 +21,5 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} # modifications to linux.conf QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip diff --git a/mkspecs/devices/linux-archos-gen8-g++/qmake.conf b/mkspecs/devices/linux-archos-gen8-g++/qmake.conf index a2c831e7fe..6f2b4736ac 100644 --- a/mkspecs/devices/linux-archos-gen8-g++/qmake.conf +++ b/mkspecs/devices/linux-archos-gen8-g++/qmake.conf @@ -27,6 +27,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} # modifications to linux.conf QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf index 3f884ccb88..90f0d90a3c 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf @@ -19,6 +19,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_CFLAGS += -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a9 diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf index 3c8c78e0c7..d734e97e89 100644 --- a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf @@ -43,6 +43,7 @@ QMAKE_CXXFLAGS = $$QMAKE_CFLAGS # modifications to linux.conf QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_INCDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/include diff --git a/mkspecs/devices/linux-beagleboard-g++/qmake.conf b/mkspecs/devices/linux-beagleboard-g++/qmake.conf index 54fe994bfa..0791693bbe 100644 --- a/mkspecs/devices/linux-beagleboard-g++/qmake.conf +++ b/mkspecs/devices/linux-beagleboard-g++/qmake.conf @@ -23,6 +23,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} # modifications to linux.conf QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp diff --git a/mkspecs/devices/linux-maemo-n9-g++/qmake.conf b/mkspecs/devices/linux-maemo-n9-g++/qmake.conf index fadeb85e8c..a9e2376d7c 100644 --- a/mkspecs/devices/linux-maemo-n9-g++/qmake.conf +++ b/mkspecs/devices/linux-maemo-n9-g++/qmake.conf @@ -23,6 +23,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} # modifications to linux.conf QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_CFLAGS += -mfloat-abi=hard -mfpu=neon -march=armv7-a -mcpu=cortex-a8 diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf index bca69c3969..bdaaa391e5 100644 --- a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf @@ -21,6 +21,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip #TODO: Clean Qt to work with uclibc not calling itself GLIBC. diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf index 526716e991..e3a28fb9c4 100644 --- a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf +++ b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf @@ -21,6 +21,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip deviceSanityCheckCompiler() diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf index caf9537f39..f8ba5937c5 100644 --- a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf +++ b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf @@ -21,6 +21,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip deviceSanityCheckCompiler() diff --git a/mkspecs/devices/linux-snowball-g++/qmake.conf b/mkspecs/devices/linux-snowball-g++/qmake.conf index f0d77fbb4a..0d3a90d524 100644 --- a/mkspecs/devices/linux-snowball-g++/qmake.conf +++ b/mkspecs/devices/linux-snowball-g++/qmake.conf @@ -20,6 +20,7 @@ QMAKE_LINK_SHLIB = $${QMAKE_CXX} # modifications to linux.conf QMAKE_AR = $${CROSS_COMPILE}ar cqs QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \ diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index 08295da75f..f48ef43b88 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -54,7 +54,7 @@ defineReplace(cmakeProcessLibs) { variable = $$1 out = for(v, variable) { - if(!equals(v, -framework)) { + if(!equals(v, -framework):!equals(v, -L.*)) { v ~= s,^-l,, v ~= s,^-lib,, v ~= s,.lib$,, diff --git a/mkspecs/features/data/android/dx.bat b/mkspecs/features/data/android/dx.bat index af143c52b5..c4ad0e3ebc 100644 --- a/mkspecs/features/data/android/dx.bat +++ b/mkspecs/features/data/android/dx.bat @@ -46,6 +46,12 @@ if exist "%frameworkdir%\%jarfile%" goto JarFileOk if exist "%frameworkdir%\%jarfile%" goto JarFileOk set "frameworkdir=%androidsdk%\framework" +if exist "%frameworkdir%\%jarfile%" goto JarFileOk + set "frameworkdir=%androidsdk%\build-tools\%ANDROID_BUILD_TOOLS_REVISION%\lib" + +if exist "%frameworkdir%\%jarfile%" goto JarFileOk + set "frameworkdir=%androidsdk%\build-tools\17.0.0\lib" + :JarFileOk set jarpath=%frameworkdir%\%jarfile% diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 03b43e3153..25fc2c3033 100644 --- a/mkspecs/features/qt_build_paths.prf +++ b/mkspecs/features/qt_build_paths.prf @@ -16,6 +16,9 @@ isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR) isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR +exists($$MODULE_PROFILE_DIR/.git): \ + CONFIG += git_build + !prefix_build { QTDIR = $$[QT_HOST_PREFIX] # Permit modules to enforce being built outside QTDIR ... diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 298ca102bc..fd6cf6b943 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -11,7 +11,7 @@ load(qt_build_paths) -!build_pass { +!build_pass:git_build { qtPrepareTool(QMAKE_SYNCQT, syncqt) minimal_syncqt { QMAKE_SYNCQT += -minimal $$QMAKE_SYNCQT_OPTIONS @@ -29,66 +29,25 @@ load(qt_build_paths) minimal_syncqt: return() #load up the headers info -include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", true) - -lctarget = $$lower($$MODULE_INCNAME) -uctarget = $$upper($$MODULE_INCNAME) - -defineTest(shouldMasterInclude) { - bn = $$basename(1) - contains(bn, .*_.*):return(false) - contains(bn, ^qconfig.*):return(false) - lines = $$cat($$_PRO_FILE_PWD_/$$1, lines) - contains(lines, $${LITERAL_HASH}pragma qt_no_master_include):return(false) - return(true) -} +git_build: \ + INC_PATH = $$MODULE_BASE_OUTDIR +else: \ + INC_PATH = $$MODULE_BASE_DIR +include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true) autogen_warning = \ "/* This file was generated by qmake with the info from <root>/$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" -# Create module version header -MODULE_VERSION_HEADER = $$find(SYNCQT.HEADER_FILES, (^|/)$${lctarget}version\\.h$) -count(MODULE_VERSION_HEADER, 1) { - MODULE_VERSION_HEADER = $$absolute_path($$MODULE_VERSION_HEADER, $$_PRO_FILE_PWD_) - - !build_pass { - majorhexstr = $$format_number($$section(VERSION, ., 0, 0), width=2 zeropad obase=16) - minorhexstr = $$format_number($$section(VERSION, ., 1, 1), width=2 zeropad obase=16) - patchhexstr = $$format_number($$section(VERSION, ., 2, 2), width=2 zeropad obase=16) - modulehexstring = 0x$${majorhexstr}$${minorhexstr}$${patchhexstr} - MODULE_VERSION_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${uctarget}_VERSION_H" \ - "$${LITERAL_HASH}define QT_$${uctarget}_VERSION_H" \ - "" \ - "$${LITERAL_HASH}define $${uctarget}_VERSION_STR \"$$VERSION\"" \ - "" \ - "$${LITERAL_HASH}define $${uctarget}_VERSION $$modulehexstring" \ - "" \ - "$${LITERAL_HASH}endif // QT_$${uctarget}_VERSION_H" - write_file($$MODULE_VERSION_HEADER, MODULE_VERSION_HEADER_CONT)|error("Aborting.") - } - - HEADERS += $$MODULE_VERSION_HEADER -} - -# Create a module master header -MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME +# Create a module master depends header +MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends !build_pass { - MODULE_MASTER_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" + MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning for(dep, MODULE_DEPENDS) { depname = $$eval(QT.$${dep}.name) - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" + MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" } - for(hdr, SYNCQT.HEADER_FILES): \ - shouldMasterInclude($$hdr): \ - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include \"$$replace(hdr, .*/, )\"" - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}endif" - write_file($$MODULE_MASTER_HEADER, MODULE_MASTER_HEADER_CONT)|error("Aborting.") + write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.") } -SYNCQT.HEADER_FILES += $$MODULE_MASTER_HEADER +SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER CONFIG += qt_install_headers diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9e40a67b51..666989f75e 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -52,9 +52,22 @@ else: \ else: \ module_config = !no_module_headers:!minimal_syncqt { - MODULE_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME" - MODULE_PRIVATE_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ - \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME" + MODULE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME + MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ + \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME + } + !git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ + |if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) { + pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) + priv_inc = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) + force_independent { + MODULE_FWD_PRI_CONT_SUFFIX = \ + "QT.$${MODULE}.includes += $$pub_inc" \ + "QT.$${MODULE}.private_includes = $$priv_inc" + } else { + MODULE_INCLUDES += $$pub_inc + MODULE_PRIVATE_INCLUDES = $$priv_inc + } } MODULE_PRI_CONT = \ "QT.$${MODULE}.VERSION = $${VERSION}" \ @@ -97,7 +110,8 @@ else: \ "QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ "QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \ "QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \ - "include($$MODULE_PRI)" + "include($$MODULE_PRI)" \ + $$MODULE_FWD_PRI_CONT_SUFFIX write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.") touch($$MODULE_FWD_PRI, $$MODULE_PRI) MODULE_PRI_FILES += $$MODULE_FWD_PRI diff --git a/mkspecs/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index 4e078ce2f2..cb6cd3131c 100644 --- a/mkspecs/freebsd-g++/qmake.conf +++ b/mkspecs/freebsd-g++/qmake.conf @@ -28,6 +28,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/freebsd-g++46/qmake.conf b/mkspecs/freebsd-g++46/qmake.conf index 364dcd6233..8f8e0cd21c 100644 --- a/mkspecs/freebsd-g++46/qmake.conf +++ b/mkspecs/freebsd-g++46/qmake.conf @@ -28,6 +28,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/freebsd-icc/qmake.conf b/mkspecs/freebsd-icc/qmake.conf index 91aeb25520..fb419f7e5b 100644 --- a/mkspecs/freebsd-icc/qmake.conf +++ b/mkspecs/freebsd-icc/qmake.conf @@ -87,6 +87,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpux-acc-64/qmake.conf b/mkspecs/hpux-acc-64/qmake.conf index 60c87c29bf..2156b448fe 100644 --- a/mkspecs/hpux-acc-64/qmake.conf +++ b/mkspecs/hpux-acc-64/qmake.conf @@ -108,6 +108,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpux-acc-o64/qmake.conf b/mkspecs/hpux-acc-o64/qmake.conf index c11909fb81..69c3df1375 100644 --- a/mkspecs/hpux-acc-o64/qmake.conf +++ b/mkspecs/hpux-acc-o64/qmake.conf @@ -106,6 +106,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpux-acc/qmake.conf b/mkspecs/hpux-acc/qmake.conf index 5d1427c1f3..eaa8888fbe 100644 --- a/mkspecs/hpux-acc/qmake.conf +++ b/mkspecs/hpux-acc/qmake.conf @@ -87,6 +87,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpux-g++-64/qmake.conf b/mkspecs/hpux-g++-64/qmake.conf index 8d598d7388..3e822edbfb 100644 --- a/mkspecs/hpux-g++-64/qmake.conf +++ b/mkspecs/hpux-g++-64/qmake.conf @@ -70,6 +70,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpux-g++/qmake.conf b/mkspecs/hpux-g++/qmake.conf index 2f02e8e904..866a3416bc 100644 --- a/mkspecs/hpux-g++/qmake.conf +++ b/mkspecs/hpux-g++/qmake.conf @@ -71,6 +71,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpuxi-acc-32/qmake.conf b/mkspecs/hpuxi-acc-32/qmake.conf index a469b4f34c..79bf20fbb2 100644 --- a/mkspecs/hpuxi-acc-32/qmake.conf +++ b/mkspecs/hpuxi-acc-32/qmake.conf @@ -63,6 +63,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpuxi-acc-64/qmake.conf b/mkspecs/hpuxi-acc-64/qmake.conf index a3b0ad0849..aaec3eab14 100644 --- a/mkspecs/hpuxi-acc-64/qmake.conf +++ b/mkspecs/hpuxi-acc-64/qmake.conf @@ -106,6 +106,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hpuxi-g++-64/qmake.conf b/mkspecs/hpuxi-g++-64/qmake.conf index 756d361bb9..8a05a5f611 100644 --- a/mkspecs/hpuxi-g++-64/qmake.conf +++ b/mkspecs/hpuxi-g++-64/qmake.conf @@ -73,6 +73,7 @@ QMAKE_LIBS_YACC = -ly QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf index 9a3e83f373..ef3be3b37b 100644 --- a/mkspecs/hurd-g++/qmake.conf +++ b/mkspecs/hurd-g++/qmake.conf @@ -38,6 +38,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_STRIP = strip diff --git a/mkspecs/irix-cc-64/qmake.conf b/mkspecs/irix-cc-64/qmake.conf index 33514486f9..05c8b6fc84 100644 --- a/mkspecs/irix-cc-64/qmake.conf +++ b/mkspecs/irix-cc-64/qmake.conf @@ -98,6 +98,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = CC -ar -o QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)so_locations $(OBJECTS_DIR)ii_files diff --git a/mkspecs/irix-cc/qmake.conf b/mkspecs/irix-cc/qmake.conf index 8073cf4012..72d4e65474 100644 --- a/mkspecs/irix-cc/qmake.conf +++ b/mkspecs/irix-cc/qmake.conf @@ -98,6 +98,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = CC -ar -o QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)so_locations $(OBJECTS_DIR)ii_files diff --git a/mkspecs/irix-g++-64/qmake.conf b/mkspecs/irix-g++-64/qmake.conf index 845ded9667..12c224b5c0 100644 --- a/mkspecs/irix-g++-64/qmake.conf +++ b/mkspecs/irix-g++-64/qmake.conf @@ -68,6 +68,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = so_locations diff --git a/mkspecs/irix-g++/qmake.conf b/mkspecs/irix-g++/qmake.conf index af5f5fe91d..2c02165e0d 100644 --- a/mkspecs/irix-g++/qmake.conf +++ b/mkspecs/irix-g++/qmake.conf @@ -68,6 +68,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = so_locations diff --git a/mkspecs/linux-arm-gnueabi-g++/qmake.conf b/mkspecs/linux-arm-gnueabi-g++/qmake.conf index d402f00d4d..b2653d8fea 100644 --- a/mkspecs/linux-arm-gnueabi-g++/qmake.conf +++ b/mkspecs/linux-arm-gnueabi-g++/qmake.conf @@ -19,5 +19,6 @@ QMAKE_LINK_SHLIB = arm-linux-gnueabi-g++ # modifications to linux.conf QMAKE_AR = arm-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-linux-gnueabi-objcopy +QMAKE_NM = arm-linux-gnueabi-nm -P QMAKE_STRIP = arm-linux-gnueabi-strip load(qt_config) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 4c3bbb5183..c18623b129 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -73,6 +73,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = xiar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)/ti_files diff --git a/mkspecs/linux-kcc/qmake.conf b/mkspecs/linux-kcc/qmake.conf index 921b4e6390..06efc8c12c 100644 --- a/mkspecs/linux-kcc/qmake.conf +++ b/mkspecs/linux-kcc/qmake.conf @@ -73,6 +73,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)ti_files diff --git a/mkspecs/linux-pgcc/qmake.conf b/mkspecs/linux-pgcc/qmake.conf index 404c1de1e9..286f937b0e 100644 --- a/mkspecs/linux-pgcc/qmake.conf +++ b/mkspecs/linux-pgcc/qmake.conf @@ -64,6 +64,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/lynxos-g++/qmake.conf b/mkspecs/lynxos-g++/qmake.conf index ab887825d6..a53d6a8ec7 100644 --- a/mkspecs/lynxos-g++/qmake.conf +++ b/mkspecs/lynxos-g++/qmake.conf @@ -68,6 +68,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_STRIP = strip diff --git a/mkspecs/netbsd-g++/qmake.conf b/mkspecs/netbsd-g++/qmake.conf index ee36b3ac5d..6c699aac53 100644 --- a/mkspecs/netbsd-g++/qmake.conf +++ b/mkspecs/netbsd-g++/qmake.conf @@ -66,6 +66,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = ranlib include(../common/unix.conf) diff --git a/mkspecs/openbsd-g++/qmake.conf b/mkspecs/openbsd-g++/qmake.conf index f7b19cfe48..f0773e9d0d 100644 --- a/mkspecs/openbsd-g++/qmake.conf +++ b/mkspecs/openbsd-g++/qmake.conf @@ -67,6 +67,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar q QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = ranlib include(../common/unix.conf) diff --git a/mkspecs/sco-cc/qmake.conf b/mkspecs/sco-cc/qmake.conf index a1ebc5d033..fab66b4215 100644 --- a/mkspecs/sco-cc/qmake.conf +++ b/mkspecs/sco-cc/qmake.conf @@ -60,6 +60,7 @@ QMAKE_LIBS_OPENGL = -lGL -lXt QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/sco-g++/qmake.conf b/mkspecs/sco-g++/qmake.conf index 38ea4f65b7..ebf60a3954 100644 --- a/mkspecs/sco-g++/qmake.conf +++ b/mkspecs/sco-g++/qmake.conf @@ -62,6 +62,7 @@ QMAKE_LIBS_OPENGL = -lGL QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf index fc761420d3..6e1d35ef43 100644 --- a/mkspecs/solaris-cc-64/qmake.conf +++ b/mkspecs/solaris-cc-64/qmake.conf @@ -85,6 +85,7 @@ QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl QMAKE_AR = CC -xar -o QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)Templates.DB $(OBJECTS_DIR)SunWS_cache diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf index 29fbec38c0..23814135b6 100644 --- a/mkspecs/solaris-cc/qmake.conf +++ b/mkspecs/solaris-cc/qmake.conf @@ -68,6 +68,7 @@ QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl QMAKE_AR = CC -xar -o QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_CLEAN = -r $(OBJECTS_DIR)Templates.DB $(OBJECTS_DIR)SunWS_cache diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf index e0c2f2de9c..34fd044f3e 100644 --- a/mkspecs/solaris-g++-64/qmake.conf +++ b/mkspecs/solaris-g++-64/qmake.conf @@ -89,6 +89,7 @@ QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/solaris-g++/qmake.conf b/mkspecs/solaris-g++/qmake.conf index 9f714ea2d1..ccc178395b 100644 --- a/mkspecs/solaris-g++/qmake.conf +++ b/mkspecs/solaris-g++/qmake.conf @@ -72,6 +72,7 @@ QMAKE_LIBS_NETWORK = -lresolv -lsocket -lxnet -lnsl QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/tru64-cxx/qmake.conf b/mkspecs/tru64-cxx/qmake.conf index 04cbe59b13..a2e0112623 100644 --- a/mkspecs/tru64-cxx/qmake.conf +++ b/mkspecs/tru64-cxx/qmake.conf @@ -62,6 +62,7 @@ QMAKE_LIBS_THREAD = -lrt QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/tru64-g++/qmake.conf b/mkspecs/tru64-g++/qmake.conf index a3f08220f6..dd7eb6c9c3 100644 --- a/mkspecs/tru64-g++/qmake.conf +++ b/mkspecs/tru64-g++/qmake.conf @@ -64,6 +64,7 @@ QMAKE_LIBS_THREAD = -lpthread -lexc -lrt QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/unixware-cc/qmake.conf b/mkspecs/unixware-cc/qmake.conf index 68018213c9..483b8c0bb3 100644 --- a/mkspecs/unixware-cc/qmake.conf +++ b/mkspecs/unixware-cc/qmake.conf @@ -66,6 +66,7 @@ QMAKE_LIBS_THREAD = QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/unixware-g++/qmake.conf b/mkspecs/unixware-g++/qmake.conf index 28f4314386..feca5a4c9e 100644 --- a/mkspecs/unixware-g++/qmake.conf +++ b/mkspecs/unixware-g++/qmake.conf @@ -65,6 +65,7 @@ QMAKE_LIBS_THREAD = -lthread QMAKE_AR = ar cq QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = include(../common/unix.conf) diff --git a/mkspecs/unsupported/android-g++/qmake.conf b/mkspecs/unsupported/android-g++/qmake.conf index 71b843af7e..7ef85d4327 100644 --- a/mkspecs/unsupported/android-g++/qmake.conf +++ b/mkspecs/unsupported/android-g++/qmake.conf @@ -90,6 +90,7 @@ QMAKE_LINK_SHLIB = $$QMAKE_LINK QMAKE_AR = $${ANDROID_TOOLCHAIN_PREFIX}ar cqs QMAKE_OBJCOPY = $${ANDROID_TOOLCHAIN_PREFIX}objcopy +QMAKE_NM = $${ANDROID_TOOLCHAIN_PREFIX}nm -P QMAKE_STRIP = $${ANDROID_TOOLCHAIN_PREFIX}strip QMAKE_RANLIB = $${ANDROID_TOOLCHAIN_PREFIX}ranlib diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index 710c1876aa..586854d66c 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -107,6 +107,7 @@ QMAKE_LIBS_THREAD = -lpthread QMAKE_AR = host-ar cqs QMAKE_OBJCOPY = host-objcopy +QMAKE_NM = host-nm -P QMAKE_RANLIB = QMAKE_STRIP = host-strip diff --git a/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf b/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf index a300712d33..63f5168951 100644 --- a/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf +++ b/mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf @@ -28,6 +28,7 @@ QMAKE_LINK_SHLIB = sb2 g++ # modifications to linux.conf QMAKE_AR = sb2 ar cqs QMAKE_OBJCOPY = sb2 objcopy +QMAKE_NM = sb2 nm -P QMAKE_STRIP = sb2 strip load(qt_config) diff --git a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf index 806484369b..814b844131 100644 --- a/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf +++ b/mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf @@ -82,6 +82,7 @@ QMAKE_LIBS_NETWORK = # -lnetwrap # only needed if kernel is missing gethost QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_STRIP = strip diff --git a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf index d349189878..c362d098db 100644 --- a/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf +++ b/mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf @@ -81,6 +81,7 @@ QMAKE_LIBS_NETWORK = # -lnet # only needed if kernel is missing gethostbyna QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy +QMAKE_NM = nm -P QMAKE_RANLIB = QMAKE_STRIP = strip diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 9c776e8655..d514b6d0d3 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -108,4 +108,6 @@ QMAKE_RC = $${CROSS_COMPILE}windres QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_NM = $${CROSS_COMPILE}nm -P load(qt_config) diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index c5bce375ae..f55dfe45e2 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -85,8 +85,8 @@ DEPEND_SRC = \ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \ -I$(QMKSRC) -I$(QMKLIBSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \ -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \ - -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ - -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ + -I$(INC_PATH) -I$(INC_PATH)/QtCore \ + -I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global -DHAVE_QCONFIG_CPP \ -I$(QMAKESPEC) \ -I$(SOURCE_PATH)/tools/shared \ diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index aa2f162290..761cf78975 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -34,7 +34,7 @@ CFLAGS_BARE = -c -Fo./ \ -W3 -nologo -O1 \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \ - -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \ + -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ -I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ -I$(SOURCE_PATH)\tools\shared \ diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index e148448c06..5af71cbc7b 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1340,7 +1340,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProString dir = project->first("DESTDIR"); if (QDir::isRelativePath(dir.toQString())) dir.prepend(qmake_getpwd() + Option::dir_sep); - t << "\t\t\t\t" << writeSettings("TARGET_BUILD_DIR", dir) << ";" << "\n"; + t << "\t\t\t\t" << writeSettings("INSTALL_DIR", dir) << ";" << "\n"; } if (project->first("TEMPLATE") == "lib") diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index fb4bf08431..17c72fa5d0 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -200,8 +200,9 @@ const char _slnSolutionConf[] = "\n\tGlobalSection(SolutionConfiguration) = pr "\n\t\tConfigName.0 = Debug|Win32" "\n\t\tConfigName.1 = Release|Win32" "\n\tEndGlobalSection"; -const char _slnProjDepBeg[] = "\n\tGlobalSection(ProjectDependencies) = postSolution"; -const char _slnProjDepEnd[] = "\n\tEndGlobalSection"; + +const char _slnProjDepBeg[] = "\n\tProjectSection(ProjectDependencies) = postProject"; +const char _slnProjDepEnd[] = "\n\tEndProjectSection"; const char _slnProjConfBeg[] = "\n\tGlobalSection(ProjectConfiguration) = postSolution"; const char _slnProjRelConfTag1[]= ".Release|%1.ActiveCfg = Release|"; const char _slnProjRelConfTag2[]= ".Release|%1.Build.0 = Release|"; @@ -571,10 +572,6 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt #endif solution_cleanup.append(newDep); solution_depends.insert(newDep->target, newDep); - t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid - << "\"" << newDep->orig_target << "\", \"" << newDep->vcprojFile - << "\", \"" << newDep->uuid << "\""; - t << _slnProjectEnd; } nextfile: qmake_setpwd(oldpwd); @@ -634,6 +631,30 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) QHash<QString, ProStringList> subdirProjectLookup; collectDependencies(project, profileLookup, projGuids, extraSubdirs, solution_depends, solution_cleanup, t, subdirProjectLookup); + // write out projects + for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { + t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid + << "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile + << "\", \"" << (*it)->uuid << "\""; + + debug_msg(1, "Project %s has dependencies: %s", (*it)->target.toLatin1().constData(), (*it)->dependencies.join(" ").toLatin1().constData()); + + bool hasDependency = false; + for (QStringList::iterator dit = (*it)->dependencies.begin(); dit != (*it)->dependencies.end(); ++dit) { + if (VcsolutionDepend *vc = solution_depends[*dit]) { + if (!hasDependency) { + hasDependency = true; + t << _slnProjDepBeg; + } + t << "\n\t\t" << vc->uuid << " = " << vc->uuid; + } + } + if (hasDependency) + t << _slnProjDepEnd; + + t << _slnProjectEnd; + } + t << _slnGlobalBeg; QHashIterator<VcsolutionDepend *, QStringList> extraIt(extraSubdirs); @@ -657,20 +678,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } t << slnConf; - t << _slnProjDepBeg; - // Restore previous after_user_var options Option::globals->postcmds = old_after_vars; - // Figure out dependencies - for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { - int cnt = 0; - for(QStringList::iterator dit = (*it)->dependencies.begin(); dit != (*it)->dependencies.end(); ++dit) { - if(VcsolutionDepend *vc = solution_depends[*dit]) - t << "\n\t\t" << (*it)->uuid << "." << cnt++ << " = " << vc->uuid; - } - } - t << _slnProjDepEnd; t << _slnProjConfBeg; for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { QString platform = is64Bit ? "x64" : "Win32"; diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 6ac32cd35d..4084d4f2ad 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -29,6 +29,11 @@ SOURCES += \ # qlibraryinfo.cpp includes qconfig.cpp INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global +# configure creates these, not syncqt, so we need to manually inject them +targ_headers.files += \ + $$OUT_PWD/global/qconfig.h \ + $$QT_BUILD_TREE/include/QtCore/QtConfig + # Only used on platforms with CONFIG += precompile_header PRECOMPILED_HEADER = global/qt_pch.h diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index fca1a446ce..2b38019674 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -255,6 +255,7 @@ qint64 QFSFileEnginePrivate::nativeSize() const if (!filled) { thatQ->setError(QFile::UnspecifiedError, qt_error_string(errno)); + return 0; } return metaData.size(); } diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index a0904fea24..5b4d4ec0d8 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2527,7 +2527,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, character in keys. In addition, if you save a top-level setting (a key with no slashes in it, e.g., "someKey"), it will appear in the INI file's "General" section. To avoid - overwriting other keys, if you save something using the a key + overwriting other keys, if you save something using a key such as "General/someKey", the key will be located in the "%General" section, \e not in the "General" section. diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index fac1703da8..5fa4b5f7a1 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1468,11 +1468,12 @@ static void mapToLowerCase(QString *str, int from) int l = 1; while (l < 4 && entry->mapping[l]) ++l; - if (l > 1) { + if (l > 1 || uc > 0xffff) { if (uc <= 0xffff) str->replace(i, 1, reinterpret_cast<const QChar *>(&entry->mapping[0]), l); else - str->replace(i-1, 2, reinterpret_cast<const QChar *>(&entry->mapping[0]), l); + str->replace(--i, 2, reinterpret_cast<const QChar *>(&entry->mapping[0]), l); + i += l - 1; d = 0; } else { if (!d) @@ -1501,18 +1502,20 @@ static bool isMappedToNothing(uint uc) } -static void stripProhibitedOutput(QString *str, int from) +static bool containsProhibitedOuptut(const QString *str, int from) { - ushort *out = (ushort *)str->data() + from; - const ushort *in = out; + const ushort *in = reinterpret_cast<const ushort *>(str->begin() + from); const ushort *end = (ushort *)str->data() + str->size(); - while (in < end) { + for ( ; in < end; ++in) { uint uc = *in; if (QChar(uc).isHighSurrogate() && in < end - 1) { ushort low = *(in + 1); if (QChar(low).isLowSurrogate()) { ++in; uc = QChar::surrogateToUcs4(uc, low); + } else { + // unpaired surrogates are prohibited + return true; } } if (uc <= 0xFFFF) { @@ -1537,7 +1540,7 @@ static void stripProhibitedOutput(QString *str, int from) || (uc >= 0xFDD0 && uc <= 0xFDEF) || uc == 0xFEFF || (uc >= 0xFFF9 && uc <= 0xFFFF))) { - *out++ = *in; + continue; } } else { if (!((uc >= 0x1D173 && uc <= 0x1D17A) @@ -1561,14 +1564,12 @@ static void stripProhibitedOutput(QString *str, int from) || (uc >= 0xFFFFE && uc <= 0xFFFFF) || (uc >= 0x100000 && uc <= 0x10FFFD) || (uc >= 0x10FFFE && uc <= 0x10FFFF))) { - *out++ = QChar::highSurrogate(uc); - *out++ = QChar::lowSurrogate(uc); + continue; } } - ++in; + return true; } - if (in != out) - str->truncate(out - str->utf16()); + return false; } static bool isBidirectionalRorAL(uint uc) @@ -2028,7 +2029,7 @@ Q_AUTOTEST_EXPORT void qt_nameprep(QString *source, int from) for ( ; out < e; ++out) { register ushort uc = out->unicode(); - if (uc > 0x80) { + if (uc >= 0x80) { break; } else if (uc >= 'A' && uc <= 'Z') { *out = QChar(uc | 0x20); @@ -2065,8 +2066,8 @@ Q_AUTOTEST_EXPORT void qt_nameprep(QString *source, int from) if (uc <= 0xFFFF) { *out++ = *in; } else { - *out++ = QChar::highSurrogate(uc); - *out++ = QChar::lowSurrogate(uc); + *out++ = in[-1]; + *out++ = in[0]; } } } @@ -2083,7 +2084,10 @@ Q_AUTOTEST_EXPORT void qt_nameprep(QString *source, int from) firstNonAscii > from ? firstNonAscii - 1 : from); // Strip prohibited output - stripProhibitedOutput(source, firstNonAscii); + if (containsProhibitedOuptut(source, firstNonAscii)) { + source->resize(from); + return; + } // Check for valid bidirectional characters bool containsLCat = false; diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 112ef747a3..16c28966ff 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -90,6 +90,7 @@ struct DefinedTypesFilter { /*! \macro Q_DECLARE_OPAQUE_POINTER(PointerType) \relates QMetaType + \since 5.0 This macro enables pointers to forward-declared types (\a PointerType) to be registered with QMetaType using either Q_DECLARE_METATYPE() diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 5823584b46..6b9fd7d563 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1822,8 +1822,8 @@ struct QMetaTypeId_ ## SMART_POINTER ## _QObjectStar<T, true> \ return id; \ const char * const cName = T::staticMetaObject.className(); \ QByteArray typeName; \ - typeName.reserve(sizeof(#SMART_POINTER) + 1 + strlen(cName) + 1); \ - typeName.append(#SMART_POINTER, sizeof(#SMART_POINTER) - 1) \ + typeName.reserve(int(sizeof(#SMART_POINTER) + 1 + strlen(cName) + 1)); \ + typeName.append(#SMART_POINTER, int(sizeof(#SMART_POINTER)) - 1) \ .append('<').append(cName).append('>'); \ const int newId = qRegisterNormalizedMetaType< SMART_POINTER<T> >( \ typeName, \ diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 289fda7afc..61c9b40e83 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -121,6 +121,10 @@ void QFactoryLoader::update() d->loadedPaths << pluginDir; QString path = pluginDir + d->suffix; + + if (qt_debug_component()) + qDebug() << "QFactoryLoader::QFactoryLoader() checking directory path" << path << "..."; + if (!QDir(path).exists(QLatin1String("."))) continue; diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index 7c3aa1a3b2..f3dfddec77 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -33,7 +33,7 @@ \brief The <QtAlgorithms> header includes the generic, template-based algorithms. Qt provides a number of global template functions in \c - <QtAlgorithms> that work on containers and perform well-know + <QtAlgorithms> that work on containers and perform well-known algorithms. You can use these algorithms with any \l {container class} that provides STL-style iterators, including Qt's QList, QLinkedList, QVector, QMap, and QHash classes. diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index 3cd8c51c07..c8a0825480 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -62,7 +62,7 @@ struct QPodArrayOps Q_ASSERT(newSize <= this->alloc); ::memset(this->end(), 0, (newSize - this->size) * sizeof(T)); - this->size = newSize; + this->size = int(newSize); } void copyAppend(const T *b, const T *e) @@ -84,7 +84,7 @@ struct QPodArrayOps const T *const end = iter + n; for (; iter != end; ++iter) ::memcpy(iter, &t, sizeof(T)); - this->size += n; + this->size += int(n); } void truncate(size_t newSize) @@ -92,7 +92,7 @@ struct QPodArrayOps Q_ASSERT(!this->ref.isShared()); Q_ASSERT(newSize < size_t(this->size)); - this->size = newSize; + this->size = int(newSize); } void destroyAll() // Call from destructors, ONLY! diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index 4949476f25..54c1ff8843 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -123,7 +123,8 @@ QT_BEGIN_NAMESPACE */ QBitArray::QBitArray(int size, bool value) { - if (!size) { + Q_ASSERT_X(size >= 0, "QBitArray::QBitArray", "Size must be greater than or equal to 0."); + if (size <= 0) { d.resize(0); return; } diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index a50c7da6cc..a2a58f8926 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -1031,7 +1031,7 @@ void QRegularExpressionPrivate::getPatternInfo() */ class QPcreJitStackPointer { - Q_DISABLE_COPY(QPcreJitStackPointer); + Q_DISABLE_COPY(QPcreJitStackPointer) public: /*! diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 97a64eb5bb..c81df7a6f2 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -240,14 +240,14 @@ inline quint64 _xgetbv(__int64) { return 0; } #endif static void xgetbv(uint in, uint &eax, uint &edx) { -#ifdef Q_OS_WIN - quint64 result = _xgetbv(in); - eax = result; - edx = result >> 32; -#elif defined(Q_CC_GNU) +#if defined(Q_CC_GNU) asm (".byte 0x0F, 0x01, 0xD0" // xgetbv instruction : "=a" (eax), "=d" (edx) : "c" (in)); +#elif defined(Q_OS_WIN) + quint64 result = _xgetbv(in); + eax = result; + edx = result >> 32; #endif } diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 3a2028057d..825e05ae1b 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -197,6 +197,8 @@ private: template <class T, int Prealloc> Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize) : s(asize) { + Q_STATIC_ASSERT_X(Prealloc > 0, "QVarLengthArray Prealloc must be greater than 0."); + Q_ASSERT_X(s >= 0, "QVarLengthArray::QVarLengthArray()", "Size must be greater than or equal to 0."); if (s > Prealloc) { ptr = reinterpret_cast<T *>(malloc(s * sizeof(T))); Q_CHECK_PTR(ptr); diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 816e1f15f6..489ee821b9 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -398,7 +398,8 @@ QVector<T> &QVector<T>::operator=(const QVector<T> &v) template <typename T> QVector<T>::QVector(int asize) { - if (Q_LIKELY(asize)) { + Q_ASSERT_X(asize >= 0, "QVector::QVector", "Size must be greater than or equal to 0."); + if (Q_LIKELY(asize > 0)) { d = Data::allocate(asize); d->size = asize; defaultConstruct(d->begin(), d->end()); @@ -410,7 +411,8 @@ QVector<T>::QVector(int asize) template <typename T> QVector<T>::QVector(int asize, const T &t) { - if (asize) { + Q_ASSERT_X(asize >= 0, "QVector::QVector", "Size must be greater than or equal to 0."); + if (asize > 0) { d = Data::allocate(asize); d->size = asize; T* i = d->end(); diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2a1d7e3bcc..3c3cea2910 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -782,12 +782,14 @@ static void init_platform(const QString &pluginArgument, const QString &platform QGuiApplicationPrivate::platform_name = new QString(name); } else { QStringList keys = QPlatformIntegrationFactory::keys(platformPluginPath); - QString fatalMessage = - QString::fromLatin1("Failed to load platform plugin \"%1\". Available platforms are: \n").arg(name); - foreach(const QString &key, keys) { - fatalMessage.append(key + QLatin1Char('\n')); - } - qFatal("%s", fatalMessage.toLocal8Bit().constData()); + + QString fatalMessage + = QStringLiteral("Failed to find or load platform plugin \"%1\".\n").arg(name); + if (!keys.isEmpty()) + fatalMessage += QStringLiteral("Available platforms are: %1\n").arg( + keys.join(QStringLiteral(", "))); + fatalMessage += QStringLiteral("GUI applications require a platform plugin. Terminating."); + qFatal(qPrintable(fatalMessage)); return; } @@ -2251,8 +2253,8 @@ void QGuiApplicationPrivate::processExposeEvent(QWindowSystemInterfacePrivate::E if (!p->receivedExpose) { if (p->resizeEventPending) { // as a convenience for plugins, send a resize event before the first expose event if they haven't done so - QSize size = p->geometry.size(); - QResizeEvent e(size, size); + // window->geometry() should have a valid size as soon as a handle exists. + QResizeEvent e(window->geometry().size(), p->geometry.size()); QGuiApplication::sendSpontaneousEvent(window, &e); p->resizeEventPending = false; diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index 8a36df3e7c..3cbcd1c06d 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -96,7 +96,7 @@ private: friend class QOpenGLContextGroupPrivate; friend class QOpenGLMultiGroupSharedResource; - Q_DISABLE_COPY(QOpenGLSharedResource); + Q_DISABLE_COPY(QOpenGLSharedResource) }; class Q_GUI_EXPORT QOpenGLSharedResourceGuard : public QOpenGLSharedResource diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index c4968f8ca6..398df0a96f 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -441,7 +441,7 @@ public: } } private: - Q_DISABLE_COPY(WindowSystemEventList); + Q_DISABLE_COPY(WindowSystemEventList) }; static WindowSystemEventList windowSystemEventQueue; diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 8d6b05d0b4..90416db72b 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1064,7 +1064,6 @@ QImage QOpenGLFramebufferObject::toImage() const /*! \fn bool QOpenGLFramebufferObject::bindDefault() - \internal Switches rendering back to the default, windowing system provided framebuffer. diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp index 83f407575e..7d49c03f5b 100644 --- a/src/gui/opengl/qopengltextureglyphcache.cpp +++ b/src/gui/opengl/qopengltextureglyphcache.cpp @@ -147,6 +147,9 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) return; } + GLint oldFbo; + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFbo); + int oldWidth = m_textureResource->m_width; int oldHeight = m_textureResource->m_height; @@ -265,7 +268,7 @@ void QOpenGLTextureGlyphCache::resizeTextureData(int width, int height) glDeleteTextures(1, &tmp_texture); glDeleteTextures(1, &oldTexture); - funcs.glBindFramebuffer(GL_FRAMEBUFFER, ctx->d_func()->current_fbo); + funcs.glBindFramebuffer(GL_FRAMEBUFFER, (GLuint)oldFbo); if (pex != 0) { glViewport(0, 0, pex->width, pex->height); diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 10225febcb..4545645dc6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1316,6 +1316,12 @@ void QFontEngineFT::doKerning(QGlyphLayout *g, QFontEngine::ShaperFlags flags) c unlockFace(); } } + + if (shouldUseDesignMetrics(flags) && !(fontDef.styleStrategy & QFont::ForceIntegerMetrics)) + flags |= DesignMetrics; + else + flags &= ~DesignMetrics; + QFontEngine::doKerning(g, flags); } @@ -1571,12 +1577,18 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs return true; } +bool QFontEngineFT::shouldUseDesignMetrics(QFontEngine::ShaperFlags flags) const +{ + if (!FT_IS_SCALABLE(freetype->face)) + return false; + + return default_hint_style == HintNone || default_hint_style == HintLight || (flags & DesignMetrics); +} + void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const { FT_Face face = 0; - bool design = (default_hint_style == HintNone || - default_hint_style == HintLight || - (flags & DesignMetrics)) && FT_IS_SCALABLE(freetype->face); + bool design = shouldUseDesignMetrics(flags); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0; // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 434eb76c33..e09fa6f94f 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -325,6 +325,7 @@ private: friend class QFontEngineMultiFontConfig; int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; + bool shouldUseDesignMetrics(ShaperFlags flags) const; GlyphFormat defaultFormat; FT_Matrix matrix; diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 2c93da147e..5e493ac68c 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -125,6 +125,7 @@ public: bool m_forceToActiveWindow; QTouchDevice *m_device; bool m_typeB; + QTransform m_rotate; }; QEvdevTouchScreenData::QEvdevTouchScreenData(QEvdevTouchScreenHandler *q_ptr, const QStringList &args) @@ -177,10 +178,24 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, QStringList args = spec.split(QLatin1Char(':')); + int rotationAngle = 0; for (int i = 0; i < args.count(); ++i) { - if (args.at(i).startsWith(QLatin1String("/dev/"))) { + if (args.at(i).startsWith(QLatin1String("/dev/")) && dev.isEmpty()) { dev = args.at(i); - break; + } else if (args.at(i).startsWith(QLatin1String("rotate"))) { + QString rotateArg = args.at(i).section(QLatin1Char('='), 1, 1); + bool ok; + uint argValue = rotateArg.toUInt(&ok); + if (ok) { + switch (argValue) { + case 90: + case 180: + case 270: + rotationAngle = argValue; + default: + break; + } + } } } @@ -265,6 +280,9 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &specification, #endif qDebug("Protocol type %c %s", d->m_typeB ? 'B' : 'A', mtdevStr); + if (rotationAngle) + d->m_rotate = QTransform::fromTranslate(0.5, 0.5).rotate(rotationAngle).translate(-0.5, -0.5); + d->registerDevice(); } @@ -421,6 +439,11 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) tp.normalPosition = QPointF((contact.x - hw_range_x_min) / qreal(hw_range_x_max - hw_range_x_min), (contact.y - hw_range_y_min) / qreal(hw_range_y_max - hw_range_y_min)); + if (!m_rotate.isIdentity()) + tp.normalPosition = m_rotate.map(tp.normalPosition); + + tp.rawPositions.append(QPointF(contact.x, contact.y)); + m_touchPoints.append(tp); if (contact.state == Qt::TouchPointReleased) @@ -513,9 +536,10 @@ void QEvdevTouchScreenData::reportPoints() QWindowSystemInterface::TouchPoint &tp(m_touchPoints[i]); // Generate a screen position that is always inside the active window - // or the primary screen. - const qreal wx = winRect.left() + tp.normalPosition.x() * winRect.width(); - const qreal wy = winRect.top() + tp.normalPosition.y() * winRect.height(); + // or the primary screen. Even though we report this as a QRectF, internally + // Qt uses QRect/QPoint so we need to bound the size to winRect.size() - QSize(1, 1) + const qreal wx = winRect.left() + tp.normalPosition.x() * (winRect.width() - 1); + const qreal wy = winRect.top() + tp.normalPosition.y() * (winRect.height() - 1); const qreal sizeRatio = (winRect.width() + winRect.height()) / qreal(hw_w + hw_h); if (tp.area.width() == -1) // touch major was not provided tp.area = QRectF(0, 0, 8, 8); diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index 4efecc5464..380cf92a24 100644 --- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp +++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp @@ -74,7 +74,6 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ConnmanMap &map) return argument; } -static QDBusConnection dbusConnection = QDBusConnection::systemBus(); QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent) : QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE), QLatin1String(CONNMAN_MANAGER_PATH), @@ -98,7 +97,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal) QLatin1String(CONNMAN_MANAGER_INTERFACE), QLatin1String("PropertyChanged"), this,SIGNAL(propertyChanged(QString,QDBusVariant)))) { - qWarning() << "PropertyCHanged not connected"; + qWarning() << "PropertyChanged not connected"; } } @@ -118,7 +117,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal) QConnmanDBusHelper *helper; helper = new QConnmanDBusHelper(this); - dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), + QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE), QLatin1String(CONNMAN_MANAGER_PATH), QLatin1String(CONNMAN_MANAGER_INTERFACE), QLatin1String("PropertyChanged"), @@ -379,7 +378,7 @@ void QConnmanProfileInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanProfileInterface::propertyChanged); if (signal == propertyChangedSignal) { - dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), + QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_PROFILE_INTERFACE), QLatin1String("PropertyChanged"), @@ -449,7 +448,7 @@ void QConnmanServiceInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanServiceInterface::propertyChanged); if (signal == propertyChangedSignal) { - dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), + QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_SERVICE_INTERFACE), QLatin1String("PropertyChanged"), @@ -460,7 +459,7 @@ void QConnmanServiceInterface::connectNotify(const QMetaMethod &signal) QConnmanDBusHelper *helper; helper = new QConnmanDBusHelper(this); - dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), + QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_SERVICE_INTERFACE), QLatin1String("PropertyChanged"), @@ -514,9 +513,6 @@ void QConnmanServiceInterface::remove() QDBusReply<QVariantMap> reply = this->call(QLatin1String("Remove")); } -// void moveBefore(QDBusObjectPath &service); -// void moveAfter(QDBusObjectPath &service); - // properties QString QConnmanServiceInterface::getState() { @@ -779,7 +775,7 @@ void QConnmanTechnologyInterface::connectNotify(const QMetaMethod &signal) { static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanTechnologyInterface::propertyChanged); if (signal == propertyChangedSignal) { - dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), + QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE), QLatin1String("PropertyChanged"), @@ -790,7 +786,7 @@ void QConnmanTechnologyInterface::connectNotify(const QMetaMethod &signal) QConnmanDBusHelper *helper; helper = new QConnmanDBusHelper(this); - dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), + QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE), this->path(), QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE), QLatin1String("PropertyChanged"), @@ -861,23 +857,11 @@ QConnmanAgentInterface::~QConnmanAgentInterface() void QConnmanAgentInterface::connectNotify(const QMetaMethod &signal) { Q_UNUSED(signal); -// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanAgentInterface::propertyChanged); -// if (signal == propertyChangedSignal) { -// dbusConnection.connect(QLatin1String(CONNMAN_SERVICE), -// this->path(), -// QLatin1String(CONNMAN_NETWORK_INTERFACE), -// QLatin1String("PropertyChanged"), -// this,SIGNAL(propertyChanged(QString,QVariant&))); -// } } void QConnmanAgentInterface::disconnectNotify(const QMetaMethod &signal) { Q_UNUSED(signal); -// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanAgentInterface::propertyChanged); -// if (signal == propertyChangedSignal) { - -// } } @@ -889,10 +873,6 @@ void QConnmanAgentInterface::reportError(QDBusObjectPath &/*path*/, const QStrin { } -//dict QConnmanAgentInterface::requestInput(QDBusObjectPath &path, dict fields) -//{ -//} - void QConnmanAgentInterface::cancel() { } diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index f7c945c50d..55a23fda76 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm @@ -151,8 +151,7 @@ [kids addObject: element]; [element release]; } - // ### maybe we should use NSAccessibilityUnignoredChildren(kids); this needs more profiling - return kids; + return NSAccessibilityUnignoredChildren(kids); } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { // Just check if the app thinks we're focused. @@ -272,8 +271,7 @@ // No child found, meaning we hit this element. if (!childInterface) { // qDebug() << "Hit test returns: " << id << iface; - return self; - //return NSAccessibilityUnignoredAncestor(self); + return NSAccessibilityUnignoredAncestor(self); } QAccessible::Id childId = QAccessible::uniqueId(childInterface); diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 7dad4271b5..a37552d844 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -123,7 +123,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o) if (pm.isNull()) pm = defaultPixmap(); - NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(pm)); + NSImage *nsimage = qt_mac_create_nsimage(pm); QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacPasteboardMime::MIME_DND); m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy")); @@ -145,6 +145,8 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o) source:m_lastView slideBack:YES]; + [nsimage release]; + m_drag = 0; return m_executed_drop_action; } diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 9100b9b15f..7224ee2ff8 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.h +++ b/src/plugins/platforms/cocoa/qcocoamenu.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE +class QCocoaMenuBar; + class QCocoaMenu : public QPlatformMenu { public: @@ -87,6 +89,8 @@ public: QList<QCocoaMenuItem *> items() const; QList<QCocoaMenuItem *> merged() const; + void setMenuBar(QCocoaMenuBar *menuBar); + QCocoaMenuBar *menuBar() const; private: QCocoaMenuItem *itemOrNull(int index) const; void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem); @@ -97,6 +101,7 @@ private: NSObject *m_delegate; bool m_enabled; quintptr m_tag; + QCocoaMenuBar *m_menuBar; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 08ae6c43bd..f6378d126f 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -217,7 +217,8 @@ QT_BEGIN_NAMESPACE QCocoaMenu::QCocoaMenu() : m_enabled(true), - m_tag(0) + m_tag(0), + m_menuBar(0) { m_delegate = [[QCocoaMenuDelegate alloc] initWithMenu:this]; m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; @@ -536,4 +537,14 @@ void QCocoaMenu::syncModalState(bool modal) } } +void QCocoaMenu::setMenuBar(QCocoaMenuBar *menuBar) +{ + m_menuBar = menuBar; +} + +QCocoaMenuBar *QCocoaMenu::menuBar() const +{ + return m_menuBar; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h index 8086676cc5..7a1bda74a4 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.h +++ b/src/plugins/platforms/cocoa/qcocoamenubar.h @@ -75,6 +75,8 @@ private: static QCocoaMenuBar *findGlobalMenubar(); bool shouldDisable(QCocoaWindow *active) const; + void insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu); + void removeNativeMenu(QCocoaMenu *menu); QList<QCocoaMenu*> m_menus; NSMenu *m_nativeMenu; diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 315f192ff8..52bfdfa385 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -83,9 +83,24 @@ QCocoaMenuBar::~QCocoaMenuBar() } } -void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu) { QCocoaAutoReleasePool pool; + + if (beforeMenu) { + NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; + [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; + } else { + [m_nativeMenu addItem: menu->nsMenuItem()]; + } + + menu->setMenuBar(this); + syncMenu(static_cast<QPlatformMenu *>(menu)); + [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; +} + +void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +{ QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu); QCocoaMenu *beforeMenu = static_cast<QCocoaMenu *>(before); #ifdef QT_COCOA_ENABLE_MENU_DEBUG @@ -96,39 +111,36 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first"; return; } - if (beforeMenu) { - if (!m_menus.contains(beforeMenu)) { - qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; - return; - } - m_menus.insert(m_menus.indexOf(beforeMenu), menu); - NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; - [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; - } else { - m_menus.append(menu); - [m_nativeMenu addItem: menu->nsMenuItem()]; + + if (beforeMenu && !m_menus.contains(beforeMenu)) { + qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; + return; } - platformMenu->setParent(this); - syncMenu(platformMenu); - [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; + m_menus.insert(beforeMenu ? m_menus.indexOf(beforeMenu) : m_menus.size(), menu); + if (!menu->menuBar()) + insertNativeMenu(menu, beforeMenu); } -void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) +void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu) { QCocoaAutoReleasePool pool; + if (menu->menuBar() == this) + menu->setMenuBar(0); + NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; + [m_nativeMenu removeItemAtIndex: realIndex]; +} + +void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) +{ QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu); if (!m_menus.contains(menu)) { qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar"; return; } m_menus.removeOne(menu); - - if (platformMenu->parent() == this) - platformMenu->setParent(0); - NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; - [m_nativeMenu removeItemAtIndex: realIndex]; + removeNativeMenu(menu); } void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) @@ -207,6 +219,20 @@ void QCocoaMenuBar::updateMenuBarImmediately() m->syncModalState(disableForModal); } + // reparent shared menu items if necessary. + // We browse the list in reverse order to be sure that the next items are redrawn before the current ones, + // in this way we are sure that "beforeMenu" (see below) is part of the native menu before "m" is redraw + for (int i = mb->m_menus.size() - 1; i >= 0; i--) { + QCocoaMenu *m = mb->m_menus.at(i); + QCocoaMenuBar *menuBar = m->menuBar(); + if (menuBar != mb) { + QCocoaMenu *beforeMenu = i < (mb->m_menus.size() - 1) ? mb->m_menus.at(i + 1) : 0; + if (menuBar) + menuBar->removeNativeMenu(m); + mb->insertNativeMenu(m, beforeMenu); + } + } + QCocoaMenuLoader *loader = getMenuLoader(); [loader ensureAppMenuInMenu:mb->nsMenu()]; diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 31bbd63e36..5a5b2bc51f 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -283,7 +283,7 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const sizes << 16 << 32 << 64 << 128; return QVariant::fromValue(sizes); } - case QPlatformTheme::PasswordMaskDelay: + case QPlatformTheme::PasswordMaskCharacter: return QVariant(QChar(kBulletUnicode)); default: break; diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm index 6ebb1f6ba8..331a66417d 100644 --- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm +++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm @@ -88,7 +88,7 @@ [element release]; } - return kids; + return NSAccessibilityUnignoredChildren(kids); } else { return [super accessibilityAttributeValue:attribute]; } diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index 91a97ff977..c334f46c2c 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -99,6 +99,7 @@ QSizeF QEglFSHooks::physicalScreenSize() const struct fb_var_screeninfo vinfo; int w = -1; int h = -1; + QSize screenResolution; if (framebuffer != -1) { if (ioctl(framebuffer, FBIOGET_VSCREENINFO, &vinfo) == -1) { @@ -106,12 +107,15 @@ QSizeF QEglFSHooks::physicalScreenSize() const } else { w = vinfo.width; h = vinfo.height; + screenResolution = QSize(vinfo.xres, vinfo.yres); } + } else { + screenResolution = screenSize(); } const int defaultPhysicalDpi = 100; - size.setWidth(w <= 0 ? vinfo.xres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w)); - size.setHeight(h <= 0 ? vinfo.yres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h)); + size.setWidth(w <= 0 ? screenResolution.width() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w)); + size.setHeight(h <= 0 ? screenResolution.height() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h)); if (w <= 0 || h <= 0) { qWarning("EGLFS: Unable to query physical screen size, defaulting to %d dpi.\n" diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index cd92a07f00..98c54e0ee0 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -68,11 +68,11 @@ QEglFSWindow::~QEglFSWindow() void QEglFSWindow::create() { - setWindowState(Qt::WindowFullScreen); - if (m_window) return; + setWindowState(Qt::WindowFullScreen); + if (window()->type() == Qt::Desktop) { QRect rect(QPoint(), QEglFSHooks::hooks()->screenSize()); QPlatformWindow::setGeometry(rect); diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index f7fc5de8d7..cd79ae73fd 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -77,7 +77,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) #endif m_screen(0), m_parentWindow(0), - m_visible(true), + m_visible(false), m_windowState(Qt::WindowNoState), m_requestedBufferSize(window->geometry().size()) { @@ -153,7 +153,6 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) if (window->parent() && window->parent()->handle()) setParent(window->parent()->handle()); setGeometryHelper(window->geometry()); - setVisible(window->isVisible()); } QQnxWindow::~QQnxWindow() @@ -272,6 +271,9 @@ void QQnxWindow::setVisible(bool visible) { qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible; + if (m_visible == visible) + return; + m_visible = visible; QQnxWindow *root = this; @@ -282,13 +284,13 @@ void QQnxWindow::setVisible(bool visible) window()->requestActivate(); - if (window()->isTopLevel()) { - QWindowSystemInterface::handleExposeEvent(window(), window()->geometry()); + QWindowSystemInterface::handleExposeEvent(window(), window()->geometry()); - if (!visible) { - // Flush the context, otherwise it won't disappear immediately - screen_flush_context(m_screenContext, 0); - } + if (visible) { + applyWindowState(); + } else { + // Flush the context, otherwise it won't disappear immediately + screen_flush_context(m_screenContext, 0); } } @@ -638,35 +640,10 @@ void QQnxWindow::setWindowState(Qt::WindowState state) if (m_windowState == state) return; - switch (state) { - - // WindowActive is not an accepted parameter according to the docs - case Qt::WindowActive: - return; - - case Qt::WindowMinimized: - minimize(); - - if (m_unmaximizedGeometry.isValid()) - setGeometry(m_unmaximizedGeometry); - else - setGeometry(m_screen->geometry()); - - break; - - case Qt::WindowMaximized: - case Qt::WindowFullScreen: - m_unmaximizedGeometry = geometry(); - setGeometry(state == Qt::WindowMaximized ? m_screen->availableGeometry() : m_screen->geometry()); - break; - - case Qt::WindowNoState: - if (m_unmaximizedGeometry.isValid()) - setGeometry(m_unmaximizedGeometry); - break; - } - m_windowState = state; + + if (m_visible) + applyWindowState(); } void QQnxWindow::gainedFocus() @@ -747,6 +724,37 @@ void QQnxWindow::updateZorder(int &topZorder) childWindow->updateZorder(topZorder); } +void QQnxWindow::applyWindowState() +{ + switch (m_windowState) { + + // WindowActive is not an accepted parameter according to the docs + case Qt::WindowActive: + return; + + case Qt::WindowMinimized: + minimize(); + + if (m_unmaximizedGeometry.isValid()) + setGeometry(m_unmaximizedGeometry); + else + setGeometry(m_screen->geometry()); + + break; + + case Qt::WindowMaximized: + case Qt::WindowFullScreen: + m_unmaximizedGeometry = geometry(); + setGeometry(m_windowState == Qt::WindowMaximized ? m_screen->availableGeometry() : m_screen->geometry()); + break; + + case Qt::WindowNoState: + if (m_unmaximizedGeometry.isValid()) + setGeometry(m_unmaximizedGeometry); + break; + } +} + void QQnxWindow::blitHelper(QQnxBuffer &source, QQnxBuffer &target, const QPoint &sourceOffset, const QPoint &targetOffset, const QRegion ®ion, bool flush) { diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index 4a327fd54b..63d5dc0979 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -124,6 +124,7 @@ private: void setOffset(const QPoint &setOffset); void updateVisibility(bool parentVisible); void updateZorder(int &topZorder); + void applyWindowState(); void fetchBuffers(); diff --git a/src/plugins/platforms/windows/qplatformfunctions_wince.h b/src/plugins/platforms/windows/qplatformfunctions_wince.h index 3190e39ec5..30fc66563e 100644 --- a/src/plugins/platforms/windows/qplatformfunctions_wince.h +++ b/src/plugins/platforms/windows/qplatformfunctions_wince.h @@ -74,6 +74,7 @@ #ifndef CWP_SKIPINVISIBLE #define CWP_SKIPINVISIBLE 0x0001 +#define CWP_SKIPTRANSPARENT 0x0004 #define findPlatformWindowAt(a, b, c) findPlatformWindowAt(a, b) #endif diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 814892b43a..fc2ba454df 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -433,6 +433,9 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons return 0; if (requested.flags != obtained.flags) window->setFlags(obtained.flags); + // Trigger geometry change signals of QWindow. + if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry) + QWindowSystemInterface::handleGeometryChange(window, obtained.geometry); return new QWindowsWindow(window, obtained); } diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 5c096b7eca..c6cfa4dbbc 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -232,8 +232,10 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, } const QPoint globalPosition = QWindowsGeometryHint::mapToGlobal(hwnd, winEventPosition); + // In this context, neither an invisible nor a transparent window (transparent regarding mouse + // events, "click-through") can be considered as the window under mouse. QWindow *currentWindowUnderMouse = platformWindow->hasMouseCapture() ? - QWindowsScreen::windowAt(globalPosition) : window; + QWindowsScreen::windowAt(globalPosition, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT) : window; compressMouseMove(&msg); // Qt expects the platform plugin to capture the mouse on diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp index 7ffd3e105f..c106bd00f8 100644 --- a/src/plugins/platforms/xcb/qxcbxsettings.cpp +++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp @@ -214,23 +214,37 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen) QByteArray settings_atom_for_screen("_XSETTINGS_S"); settings_atom_for_screen.append(QByteArray::number(screen->screenNumber())); xcb_intern_atom_cookie_t atom_cookie = xcb_intern_atom(screen->xcb_connection(), - false, + true, settings_atom_for_screen.length(), settings_atom_for_screen.constData()); - xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,NULL); + xcb_generic_error_t *error = 0; + xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,&error); + if (error) { + qWarning() << Q_FUNC_INFO << "Failed to find XSETTINGS_S atom"; + return; + } xcb_atom_t selection_owner_atom = atom_reply->atom; free(atom_reply); xcb_get_selection_owner_cookie_t selection_cookie = xcb_get_selection_owner(screen->xcb_connection(), selection_owner_atom); + xcb_get_selection_owner_reply_t *selection_result = - xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, NULL); + xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, &error); + if (error) { + qWarning() << Q_FUNC_INFO << "Failed to get selection owner for XSETTINGS_S atom"; + return; + } d_ptr->x_settings_window = selection_result->owner; + if (!d_ptr->x_settings_window) { + return; + } free(selection_result); + const uint32_t event = XCB_CW_EVENT_MASK; const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE }; - xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,XCB_CW_EVENT_MASK,event_mask); + xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,event,event_mask); d_ptr->populateSettings(d_ptr->getSettings()); } diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 107af96607..273cb60d7d 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -1089,7 +1089,7 @@ QStringList Config::getFilesHere(const QString& uncleanDir, const QSet<QString> &excludedDirs, const QSet<QString> &excludedFiles) { - QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : Location::canonicalRelativePath(uncleanDir); + QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : QDir(uncleanDir).canonicalPath(); QStringList result; if (excludedDirs.contains(dir)) return result; diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index dc086c853d..d0f3ab3667 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -207,10 +207,10 @@ void CppCodeParser::parseSourceFile(const Location& location, const QString& fil readToken(); /* - The set of active namespaces is cleared before parsing + The set of open namespaces is cleared before parsing each source file. The word "source" here means cpp file. */ - activeNamespaces_.clear(); + qdb_->clearOpenNamespaces(); matchDocsAndStuff(); in.close(); @@ -323,21 +323,18 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, doc.startLocation().warning(tr("Invalid syntax in '\\%1'").arg(COMMAND_FN)); } else { - if (!activeNamespaces_.isEmpty()) { - foreach (const QString& usedNamespace_, activeNamespaces_) { - QStringList newPath = usedNamespace_.split("::") + parentPath; - func = qdb_->findFunctionNode(newPath, clone); - if (func) - break; - } - } - // Search the root namespace if no match was found. - if (func == 0) + func = qdb_->findNodeInOpenNamespace(parentPath, clone); + /* + Search the root namespace if no match was found. + */ + if (func == 0) { func = qdb_->findFunctionNode(parentPath, clone); + } if (func == 0) { - if (parentPath.isEmpty() && !lastPath_.isEmpty()) + if (parentPath.isEmpty() && !lastPath_.isEmpty()) { func = qdb_->findFunctionNode(lastPath_, clone); + } if (func == 0) { doc.location().warning(tr("Cannot find '%1' in '\\%2' %3") .arg(clone->name() + "(...)") @@ -426,16 +423,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, C++ namespace, search for it first in all the known C++ namespaces. */ - if (!activeNamespaces_.isEmpty()) { - foreach (const QString& usedNamespace_, activeNamespaces_) { - QStringList newPath = usedNamespace_.split("::") + path; - node = qdb_->findNodeByNameAndType(newPath, type, subtype); - if (node) { - path = newPath; - break; - } - } - } + node = qdb_->findNodeInOpenNamespace(path, type, subtype); /* If the node was not found in a C++ namespace, search @@ -458,7 +446,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, if (path.size() > 1) { path.pop_back(); QString ns = path.join("::"); - activeNamespaces_.insert(ns); + qdb_->insertOpenNamespace(ns); } } return node; @@ -1718,7 +1706,7 @@ bool CppCodeParser::matchUsingDecl() /* So far, so good. We have 'using namespace Foo;'. */ - activeNamespaces_.insert(name); + qdb_->insertOpenNamespace(name); return true; } @@ -2125,13 +2113,7 @@ bool CppCodeParser::matchDocsAndStuff() FunctionNode *func = 0; if (matchFunctionDecl(0, &parentPath, &clone, QString(), extra)) { - foreach (const QString& usedNamespace_, activeNamespaces_) { - QStringList newPath = usedNamespace_.split("::") + parentPath; - func = qdb_->findFunctionNode(newPath, clone); - if (func) { - break; - } - } + func = qdb_->findNodeInOpenNamespace(parentPath, clone); if (func == 0) func = qdb_->findFunctionNode(parentPath, clone); @@ -2256,9 +2238,8 @@ bool CppCodeParser::makeFunctionNode(const QString& signature, Tokenizer* outerTokenizer = tokenizer; int outerTok = tok; - Location loc; QByteArray latin1 = signature.toLatin1(); - Tokenizer stringTokenizer(loc, latin1); + Tokenizer stringTokenizer(location(), latin1); stringTokenizer.setParsingFnOrMacro(true); tokenizer = &stringTokenizer; readToken(); diff --git a/src/tools/qdoc/cppcodeparser.h b/src/tools/qdoc/cppcodeparser.h index eae5d1e97d..957142712b 100644 --- a/src/tools/qdoc/cppcodeparser.h +++ b/src/tools/qdoc/cppcodeparser.h @@ -166,7 +166,6 @@ protected: QStringList lastPath_; QRegExp varComment; QRegExp sep; - QSet<QString> activeNamespaces_; private: QString sequentialIteratorDefinition; diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 7e1467f300..3d6f04decf 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1755,12 +1755,12 @@ void HtmlGenerator::generateHeader(const QString& title, if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!project.isEmpty()) - shortVersion = project + QLatin1Char(' ') + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + project + QLatin1Char(' ') + shortVersion; else - shortVersion = QLatin1String("Qt ") + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + QLatin1String("Qt ") + shortVersion ; // Generating page title - out() << " <title>" << shortVersion << protectEnc(title) << "</title>\n"; + out() << " <title>" << protectEnc(title) << shortVersion << "</title>\n"; // Include style sheet and script links. out() << headerStyles; diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp index aba17d79b1..d11ef3a3c7 100644 --- a/src/tools/qdoc/puredocparser.cpp +++ b/src/tools/qdoc/puredocparser.cpp @@ -101,10 +101,10 @@ void PureDocParser::parseSourceFile(const Location& location, const QString& fil readToken(); /* - The set of active namespaces is cleared before parsing + The set of open namespaces is cleared before parsing each source file. The word "source" here means cpp file. */ - activeNamespaces_.clear(); + qdb_->clearOpenNamespaces(); processQdocComments(); in.close(); diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index 674917f6dc..7a3df4e4f2 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -1126,4 +1126,56 @@ QString QDocDatabase::refForAtom(const Atom* atom) return QString(); } +/*! + If there are open namespaces, search for the function node + having the same function name as the \a clone node in each + open namespace. The \a parentPath is a portion of the path + name provided with the function name at the point of + reference. \a parentPath is usually a class name. Return + the pointer to the function node if one is found in an + open namespace. Otherwise return 0. + + This open namespace concept is of dubious value and might + be removed. + */ +FunctionNode* QDocDatabase::findNodeInOpenNamespace(const QStringList& parentPath, + const FunctionNode* clone) +{ + FunctionNode* fn = 0; + if (!openNamespaces_.isEmpty()) { + foreach (const QString& t, openNamespaces_) { + QStringList path = t.split("::") + parentPath; + fn = findFunctionNode(path, clone); + if (fn) + break; + } + } + return fn; +} + +/*! + Find a node of the specified \a type and \a subtype that is + reached with the specified \a path. If such a node is found + in an open namespace, prefix \a path with the name of the + open namespace and "::" and return a pointer to the node. + Othewrwise return 0. + */ +Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, + Node::Type type, + Node::SubType subtype) +{ + Node* n = 0; + if (!openNamespaces_.isEmpty()) { + foreach (const QString& t, openNamespaces_) { + QStringList p = t.split("::") + path; + n = findNodeByNameAndType(p, type, subtype); + if (n) { + path = p; + break; + } + } + } + return n; +} + QT_END_NAMESPACE diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h index d97fb3809a..d88160ee56 100644 --- a/src/tools/qdoc/qdocdatabase.h +++ b/src/tools/qdoc/qdocdatabase.h @@ -196,6 +196,11 @@ class QDocDatabase Generator* g, bool generateInternalNodes = false); + void clearOpenNamespaces() { openNamespaces_.clear(); } + void insertOpenNamespace(const QString& path) { openNamespaces_.insert(path); } + FunctionNode* findNodeInOpenNamespace(const QStringList& parentPath, const FunctionNode* clone); + Node* findNodeInOpenNamespace(QStringList& path, Node::Type type, Node::SubType subtype); + /* debugging functions */ void printModules() const; void printQmlModules() const; @@ -240,6 +245,7 @@ class QDocDatabase TextToNodeMap legaleseTexts_; DocNodeMultiMap docNodesByTitle_; TargetRecMultiMap targetRecMultiMap_; + QSet<QString> openNamespaces_; }; QT_END_NAMESPACE diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 1efab11a92..553c569ae9 100644 --- a/src/tools/qdoc/tree.cpp +++ b/src/tools/qdoc/tree.cpp @@ -367,7 +367,11 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const Node* relative, int findFlags) const { - const Node* parent = findNode(parentPath, relative, findFlags); + const Node* parent = findNamespaceNode(parentPath); + if (parent == 0) + parent = findClassNode(parentPath, 0); + if (parent == 0) + parent = findNode(parentPath, relative, findFlags); if (parent == 0 || !parent->isInnerNode()) return 0; return ((InnerNode*)parent)->findFunctionNode(clone); @@ -658,7 +662,7 @@ Node* Tree::findNodeRecursive(const QStringList& path, Node* start, Node::Type type, Node::SubType subtype, - bool acceptCollision) + bool acceptCollision) const { if (!start || path.isEmpty()) return 0; // no place to start, or nothing to search for. @@ -736,7 +740,7 @@ EnumNode* Tree::findEnumNode(const QStringList& path, Node* start) at the root of the tree. Only a C++ class node named \a path is acceptible. If one is not found, 0 is returned. */ -ClassNode* Tree::findClassNode(const QStringList& path, Node* start) +ClassNode* Tree::findClassNode(const QStringList& path, Node* start) const { if (!start) start = const_cast<NamespaceNode*>(root()); @@ -748,7 +752,7 @@ ClassNode* Tree::findClassNode(const QStringList& path, Node* start) the root of the tree. Only a Namespace node named \a path is acceptible. If one is not found, 0 is returned. */ -NamespaceNode* Tree::findNamespaceNode(const QStringList& path) +NamespaceNode* Tree::findNamespaceNode(const QStringList& path) const { Node* start = const_cast<NamespaceNode*>(root()); return static_cast<NamespaceNode*>(findNodeRecursive(path, 0, start, Node::Namespace, Node::NoSubType)); diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h index 67cd3a9752..e44b8d7d12 100644 --- a/src/tools/qdoc/tree.h +++ b/src/tools/qdoc/tree.h @@ -82,9 +82,9 @@ class Tree ~Tree(); EnumNode* findEnumNode(const QStringList& path, Node* start = 0); - ClassNode* findClassNode(const QStringList& path, Node* start = 0); + ClassNode* findClassNode(const QStringList& path, Node* start = 0) const; QmlClassNode* findQmlTypeNode(const QStringList& path); - NamespaceNode* findNamespaceNode(const QStringList& path); + NamespaceNode* findNamespaceNode(const QStringList& path) const; DocNode* findQmlModuleNode(const QStringList& path, Node* start = 0); Node* findNodeByNameAndType(const QStringList& path, @@ -98,7 +98,7 @@ class Tree Node* start, Node::Type type, Node::SubType subtype, - bool acceptCollision = false); + bool acceptCollision = false) const; const Node* findNode(const QStringList &path, const Node* relative = 0, diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index 6859cd0cd4..cedefb801a 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -587,8 +587,8 @@ QT_CLASS_LIB(QFontDialog, QtWidgets, qfontdialog.h) QT_CLASS_LIB(QInputDialog, QtWidgets, qinputdialog.h) QT_CLASS_LIB(QMessageBox, QtWidgets, qmessagebox.h) QT_CLASS_LIB(QPageSetupDialog, QtWidgets, qpagesetupdialog.h) -QT_CLASS_LIB(QPrintDialog, QtWidgets, qprintdialog.h) -QT_CLASS_LIB(QPrintPreviewDialog, QtWidgets, qprintpreviewdialog.h) +QT_CLASS_LIB(QPrintDialog, QtPrintSupport, qprintdialog.h) +QT_CLASS_LIB(QPrintPreviewDialog, QtPrintSupport, qprintpreviewdialog.h) QT_CLASS_LIB(QProgressDialog, QtWidgets, qprogressdialog.h) QT_CLASS_LIB(QWizard, QtWidgets, qwizard.h) QT_CLASS_LIB(QWizardPage, QtWidgets, qwizard.h) @@ -944,7 +944,7 @@ QT_CLASS_LIB(QMenuBar, QtWidgets, qmenubar.h) QT_CLASS_LIB(QMenuItem, QtWidgets, qmenudata.h) QT_CLASS_LIB(QPlainTextEdit, QtWidgets, qplaintextedit.h) QT_CLASS_LIB(QPlainTextDocumentLayout, QtWidgets, qplaintextedit.h) -QT_CLASS_LIB(QPrintPreviewWidget, QtWidgets, qprintpreviewwidget.h) +QT_CLASS_LIB(QPrintPreviewWidget, QtPrintSupport, qprintpreviewwidget.h) QT_CLASS_LIB(QProgressBar, QtWidgets, qprogressbar.h) QT_CLASS_LIB(QPushButton, QtWidgets, qpushbutton.h) QT_CLASS_LIB(QRadioButton, QtWidgets, qradiobutton.h) diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index a76c88dc5e..2cda99a269 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -150,12 +150,11 @@ void QDialogPrivate::deletePlatformHelper() provide a \l{#return}{return value}, and they can have \l{#default}{default buttons}. QDialogs can also have a QSizeGrip in their lower-right corner, using setSizeGripEnabled(). - Note that QDialog (an any other widget that has type Qt::Dialog) uses - the parent widget slightly differently from other classes in Qt. A - dialog is always a top-level widget, but if it has a parent, its - default location is centered on top of the parent's top-level widget - (if it is not top-level itself). It will also share the parent's - taskbar entry. + Note that QDialog (and any other widget that has type \c Qt::Dialog) uses + the parent widget slightly differently from other classes in Qt. A dialog is + always a top-level widget, but if it has a parent, its default location is + centered on top of the parent's top-level widget (if it is not top-level + itself). It will also share the parent's taskbar entry. Use the overload of the QWidget::setParent() function to change the ownership of a QDialog widget. This function allows you to diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index e601110c3e..61a823569e 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -5004,7 +5004,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_ItemView_ActivateItemOnSingleClick: ret = 0; if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) - ret = theme->themeHint(QPlatformTheme::ToolButtonStyle).toBool() ? 1 : 0; + ret = theme->themeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick).toBool() ? 1 : 0; break; case SH_TitleBar_ModifyNotification: ret = true; diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index a3c331aa2b..ae931deb16 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1259,6 +1259,9 @@ void QDockWidget::setFloating(bool floating) d->endDrag(true); QRect r = d->undockedGeometry; + // Keep position when undocking for the first time. + if (floating && isVisible() && !r.isValid()) + r = QRect(mapToGlobal(QPoint(0, 0)), size()); d->setWindowState(floating, false, floating ? r : QRect()); diff --git a/sync.profile b/sync.profile index e07b285dbb..3d89d9d71f 100644 --- a/sync.profile +++ b/sync.profile @@ -24,7 +24,6 @@ %classnames = ( "qglobal.h" => "QtGlobal", "qendian.h" => "QtEndian", - "qconfig.h" => "QtConfig", "qplugin.h" => "QtPlugin", "qalgorithms.h" => "QtAlgorithms", "qcontainerfwd.h" => "QtContainerFwd", diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index cca4655f58..42dca7fc66 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1193,6 +1193,13 @@ void tst_QFile::permissions() if (qt_ntfs_permission_lookup) QEXPECT_FAIL("readonly", "QTBUG-25630", Abort); #endif +#ifdef Q_OS_UNIX + if (strcmp(QTest::currentDataTag(), "readonly") == 0) { + // in case accidentally run as root + if (::getuid() == 0) + QSKIP("Running this test as root doesn't make sense"); + } +#endif QCOMPARE((memberResult == QFile::Permissions(perms)), expected); QCOMPARE((staticResult == QFile::Permissions(perms)), expected); } diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 898aefffd3..2a79a6963e 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -1937,6 +1937,21 @@ void tst_QUrl::strictParser_data() QTest::newRow("invalid-ipvfuture-3") << "http://[v789]" << "Invalid IPvFuture address"; QTest::newRow("unbalanced-brackets") << "http://[ff02::1" << "Expected ']' to match '[' in hostname"; + // invalid IDN hostnames happen in TolerantMode too + QTest::newRow("idn-prohibited-char-space") << "http:// " << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-nbsp") << "http://\xc2\xa0" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-control-1f") << "http://\x1f" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-control-7f") << "http://\x7f" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-control-80") << "http://\xc2\x80" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-private-bmp") << "http://\xee\x80\x80" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-private-plane15") << "http://\xf3\xb0\x80\x80" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-private-plane16") << "http://\xf4\x80\x80\x80" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-ffff") << "http://\xef\xbf\xbf" << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-surrogate-1") << "http://" + QString(QChar(0xD800)) << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-surrogate-2") << "http://" + QString(QChar(0xDC00)) << "Invalid hostname (contains invalid characters)"; + QTest::newRow("idn-prohibited-char-surrogate-3") << "http://" + QString(QChar(0xD800)) + "a" << "Invalid hostname (contains invalid characters)"; + // FIXME: add some tests for prohibited BiDi (RFC 3454 section 6) + // port errors happen in TolerantMode too QTest::newRow("empty-port-1") << "http://example.com:" << "Port field was empty"; QTest::newRow("empty-port-2") << "http://example.com:/" << "Port field was empty"; diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index fa3dec620a..2014045171 100644 --- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp +++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp @@ -351,7 +351,7 @@ void tst_QUrlInternal::nameprep_testsuite_data() << QString() << 0 << 0; QTest::newRow("Non-ASCII multibyte space character U+1680") - << QString::fromUtf8("\xE1\x9A\x80") + << QString::fromUtf8("x\xE1\x9A\x80x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; @@ -375,13 +375,18 @@ void tst_QUrlInternal::nameprep_testsuite_data() << QString::fromUtf8("\x10\x7F") << QString() << 0 << 0; + QTest::newRow("Non-ASCII 8bit control character U+0080") + << QString::fromUtf8("x\xC2\x80x") + << QString() + << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; + QTest::newRow("Non-ASCII 8bit control character U+0085") - << QString::fromUtf8("\xC2\x85") + << QString::fromUtf8("x\xC2\x85x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Non-ASCII multibyte control character U+180E") - << QString::fromUtf8("\xE1\xA0\x8E") + << QString::fromUtf8("x\xE1\xA0\x8Ex") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; @@ -391,47 +396,47 @@ void tst_QUrlInternal::nameprep_testsuite_data() << QString() << 0 << 0; QTest::newRow("Non-ASCII control character U+1D175") - << QString::fromUtf8("\xF0\x9D\x85\xB5") + << QString::fromUtf8("x\xF0\x9D\x85\xB5x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Plane 0 private use character U+F123") - << QString::fromUtf8("\xEF\x84\xA3") + << QString::fromUtf8("x\xEF\x84\xA3x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Plane 15 private use character U+F1234") - << QString::fromUtf8("\xF3\xB1\x88\xB4") + << QString::fromUtf8("x\xF3\xB1\x88\xB4x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Plane 16 private use character U+10F234") - << QString::fromUtf8("\xF4\x8F\x88\xB4") + << QString::fromUtf8("x\xF4\x8F\x88\xB4x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Non-character code point U+8FFFE") - << QString::fromUtf8("\xF2\x8F\xBF\xBE") + << QString::fromUtf8("x\xF2\x8F\xBF\xBEx") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Non-character code point U+10FFFF") - << QString::fromUtf8("\xF4\x8F\xBF\xBF") + << QString::fromUtf8("x\xF4\x8F\xBF\xBFx") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Surrogate code U+DF42") - << QString::fromUtf8("\xED\xBD\x82") + << QString::fromUtf8("x\xED\xBD\x82x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Non-plain text character U+FFFD") - << QString::fromUtf8("\xEF\xBF\xBD") + << QString::fromUtf8("x\xEF\xBF\xBDx") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Ideographic description character U+2FF5") - << QString::fromUtf8("\xE2\xBF\xB5") + << QString::fromUtf8("x\xE2\xBF\xB5x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; @@ -441,22 +446,22 @@ void tst_QUrlInternal::nameprep_testsuite_data() << QString() << 0 << 0; QTest::newRow("Left-to-right mark U+200E") - << QString::fromUtf8("\xE2\x80\x8E") - << QString::fromUtf8("\xCC\x81") + << QString::fromUtf8("x\xE2\x80\x8Ex") + << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Deprecated U+202A") - << QString::fromUtf8("\xE2\x80\xAA") - << QString::fromUtf8("\xCC\x81") + << QString::fromUtf8("x\xE2\x80\xAA") + << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Language tagging character U+E0001") - << QString::fromUtf8("\xF3\xA0\x80\x81") - << QString::fromUtf8("\xCC\x81") + << QString::fromUtf8("x\xF3\xA0\x80\x81x") + << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; QTest::newRow("Language tagging character U+E0042") - << QString::fromUtf8("\xF3\xA0\x81\x82") + << QString::fromUtf8("x\xF3\xA0\x81\x82x") << QString() << QString("Nameprep") << 0 << STRINGPREP_CONTAINS_PROHIBITED; @@ -512,12 +517,6 @@ void tst_QUrlInternal::nameprep_testsuite() QFETCH(QString, out); QFETCH(QString, profile); - QEXPECT_FAIL("Left-to-right mark U+200E", - "Investigate further", Continue); - QEXPECT_FAIL("Deprecated U+202A", - "Investigate further", Continue); - QEXPECT_FAIL("Language tagging character U+E0001", - "Investigate further", Continue); qt_nameprep(&in, 0); QCOMPARE(in, out); } @@ -549,9 +548,9 @@ void tst_QUrlInternal::nameprep_highcodes_data() << QString() << 0 << 0; } { - QChar st[] = { 'D', 0xdb40, 0xdc20, 'o', 0xd834, 0xdd7a, '\'', 0x2060, 'h' }; + QChar st[] = { 'D', 'o', '\'', 0x2060, 'h' }; QChar se[] = { 'd', 'o', '\'', 'h' }; - QTest::newRow("highcodes (D, U+E0020, o, U+1D17A, ', U+2060, h)") + QTest::newRow("highcodes (D, o, ', U+2060, h)") << QString(st, sizeof(st)/sizeof(st[0])) << QString(se, sizeof(se)/sizeof(se[0])) << QString() << 0 << 0; diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index 84deb72696..529ddd95fe 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -255,18 +255,18 @@ void tst_QtJson::testNumbers() 0, -1, 1, - (1UL<<54), - (1UL<<55), - (1UL<<56), - -(1UL<<54), - -(1UL<<55), - -(1UL<<56), - (1UL<<54) - 1, - (1UL<<55) - 1, - (1UL<<56) - 1, - -((1UL<<54) - 1), - -((1UL<<55) - 1), - -((1UL<<56) - 1) + (1ll<<54), + (1ll<<55), + (1ll<<56), + -(1ll<<54), + -(1ll<<55), + -(1ll<<56), + (1ll<<54) - 1, + (1ll<<55) - 1, + (1ll<<56) - 1, + -((1ll<<54) - 1), + -((1ll<<55) - 1), + -((1ll<<56) - 1) }; int n = sizeof(numbers)/sizeof(qint64); @@ -292,18 +292,18 @@ void tst_QtJson::testNumbers() 0, -1, 1, - (1UL<<54), - (1UL<<55), - (1UL<<56), - -(1UL<<54), - -(1UL<<55), - -(1UL<<56), - (1UL<<54) - 1, - (1UL<<55) - 1, - (1UL<<56) - 1, - -((1UL<<54) - 1), - -((1UL<<55) - 1), - -((1UL<<56) - 1), + double(1ll<<54), + double(1ll<<55), + double(1ll<<56), + double(-(1ll<<54)), + double(-(1ll<<55)), + double(-(1ll<<56)), + double((1ll<<54) - 1), + double((1ll<<55) - 1), + double((1ll<<56) - 1), + double(-((1ll<<54) - 1)), + double(-((1ll<<55) - 1)), + double(-((1ll<<56) - 1)), 1.1, 0.1, -0.1, diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 2250d0bb5e..25e5f03566 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -159,23 +159,6 @@ public slots: } }; -#ifndef QT_NO_EXCEPTIONS -class QEventLoopTestException { }; - -class ExceptionThrower : public QObject -{ - Q_OBJECT -public: - ExceptionThrower() : QObject() { } -public slots: - void throwException() - { - QEventLoopTestException e; - throw e; - } -}; -#endif - class tst_QEventLoop : public QObject { Q_OBJECT @@ -183,9 +166,6 @@ private slots: // This test *must* run first. See the definition for why. void processEvents(); void exec(); -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) - void throwInExec(); -#endif void reexec(); void execAfterExit(); void wakeUp(); @@ -322,53 +302,6 @@ void tst_QEventLoop::exec() } } -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) -// Exceptions need to be enabled for this test -// Q_OS_WINCE_WM case: this platform doesn't support propagating exceptions through the event loop -// Windows Mobile cannot handle cross library exceptions -// qobject.cpp will try to rethrow the exception after handling -// which causes gwes.exe to crash -void tst_QEventLoop::throwInExec() -{ -// exceptions compiled in, runtime tests follow. -#if defined(Q_OS_LINUX) - // C++ exceptions can't be passed through glib callbacks. Skip the test if - // we're using the glib event loop. - QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className(); - if (dispatcher.contains("Glib")) { - QSKIP( - qPrintable(QString( - "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n" - "Try running with QT_NO_GLIB=1 in environment." - ).arg(QString::fromLatin1(dispatcher))) - ); - } -#endif - - { - // QEventLoop::exec() is exception safe - QEventLoop eventLoop; - int caughtExceptions = 0; - - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - QCOMPARE(caughtExceptions, 2); - } -} -#endif - void tst_QEventLoop::reexec() { QEventLoop loop; diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro index 4002a5c5ea..66a968b7c3 100644 --- a/tests/auto/corelib/tools/qlocale/test/test.pro +++ b/tests/auto/corelib/tools/qlocale/test/test.pro @@ -18,3 +18,4 @@ TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp win32:CONFIG+= insignificant_test # QTBUG-25284 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +blackberry:LIBS += -lpps diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 0f6015ebdc..0c4dde4b1a 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -75,6 +75,52 @@ extern "C" DWORD GetThreadLocale(void) { # include <stdlib.h> #endif +#ifdef Q_OS_BLACKBERRY +#include <unistd.h> +#include <errno.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <sys/pps.h> + +static const char ppsLanguageLocalePath[] = "/pps/services/confstr/_CS_LOCALE"; +static const size_t ppsBufferSize = 256; + +static QByteArray readPpsValue(const char *ppsObject, int ppsFd) +{ + QByteArray result; + if (!ppsObject || ppsFd == -1) + return result; + + char buffer[ppsBufferSize]; + + int bytes = read(ppsFd, buffer, ppsBufferSize - 1); + if (bytes == -1) { + qFatal("Failed to read Locale pps, errno=%d", errno); + return result; + } + // ensure data is null terminated + buffer[bytes] = '\0'; + + pps_decoder_t ppsDecoder; + pps_decoder_initialize(&ppsDecoder, 0); + if (pps_decoder_parse_pps_str(&ppsDecoder, buffer) == PPS_DECODER_OK) { + pps_decoder_push(&ppsDecoder, 0); + const char *ppsBuff; + if (pps_decoder_get_string(&ppsDecoder, ppsObject, &ppsBuff) == PPS_DECODER_OK) { + result = ppsBuff; + } else { + int val; + if (pps_decoder_get_int(&ppsDecoder, ppsObject, &val) == PPS_DECODER_OK) + result = QByteArray::number(val); + } + } + + pps_decoder_cleanup(&ppsDecoder); + + return result; +} +#endif // Q_OS_BLACKBERRY + Q_DECLARE_METATYPE(QLocale::FormatType) class tst_QLocale : public QObject @@ -86,6 +132,7 @@ public: private slots: void initTestCase(); + void cleanupTestCase(); #ifdef Q_OS_WIN void windowsDefaultLocale(); #endif @@ -152,6 +199,10 @@ private slots: private: QString m_decimal, m_thousand, m_sdate, m_ldate, m_time; QString m_sysapp; + +#ifdef Q_OS_BLACKBERRY + int m_languageFd; +#endif }; tst_QLocale::tst_QLocale() @@ -173,6 +224,18 @@ void tst_QLocale::initTestCase() QVERIFY2(fi.exists() && fi.isExecutable(), qPrintable(QDir::toNativeSeparators(m_sysapp) + QStringLiteral(" does not exist or is not executable."))); + +#ifdef Q_OS_BLACKBERRY + if ((m_languageFd = open(ppsLanguageLocalePath, O_RDONLY)) == -1) + QFAIL("Failed to open language pps."); +#endif +} + +void tst_QLocale::cleanupTestCase() +{ +#ifdef Q_OS_BLACKBERRY + close(m_languageFd); +#endif } void tst_QLocale::ctor() @@ -462,6 +525,11 @@ void tst_QLocale::emptyCtor() QVERIFY2(runSysApp(m_sysapp, env, &defaultLoc, &errorMessage), qPrintable(errorMessage)); +#ifdef Q_OS_BLACKBERRY + QString locale = readPpsValue("_CS_LOCALE", m_languageFd); + QVERIFY2(runSysApp(m_sysapp, env, &locale, &errorMessage), + qPrintable(errorMessage)); +#else TEST_CTOR("C", "C") TEST_CTOR("bla", "C") TEST_CTOR("zz", "C") @@ -499,6 +567,7 @@ void tst_QLocale::emptyCtor() TEST_CTOR("en/", defaultLoc.toLatin1()) TEST_CTOR("asdfghj", defaultLoc.toLatin1()); TEST_CTOR("123456", defaultLoc.toLatin1()); +#endif // Q_OS_BLACKBERRY #undef TEST_CTOR } diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp index 0e243988e2..1ac3645349 100644 --- a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp +++ b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp @@ -101,7 +101,7 @@ void tst_QMessageAuthenticationCode::result_data() << QByteArray::fromHex("750c783e6ab0b503eaa86e310a5db738"); QTest::newRow("rfc-md5-3") << QCryptographicHash::Md5 << QByteArray::fromHex("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") - << QByteArray(50, 0xdd) + << QByteArray(50, char(0xdd)) << QByteArray::fromHex("56be34521d144c88dbb8c733f0e8b3f6"); } diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 4856f52c55..75aed3bf8b 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -451,8 +451,8 @@ void tst_QGuiVariant::vector2D() QVariant variant; QVector2D vector = qvariant_cast<QVector2D>(variant); QVERIFY(vector.isNull()); - variant.setValue(QVector2D(0.1, 0.2)); - QCOMPARE(QVector2D(0.1, 0.2), qvariant_cast<QVector2D>(variant)); + variant.setValue(QVector2D(0.1f, 0.2f)); + QCOMPARE(QVector2D(0.1f, 0.2f), qvariant_cast<QVector2D>(variant)); void *pvector = QMetaType::create(QVariant::Vector2D, 0); QVERIFY(pvector); diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index 91eeda34c3..34af962d36 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -8,3 +8,5 @@ TARGET = tst_qopengl QT += gui gui-private core-private testlib SOURCES += tst_qopengl.cpp + +win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTBUG-31611 diff --git a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp index a381ba7b71..17be5e4c43 100644 --- a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp +++ b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp @@ -75,8 +75,8 @@ private slots: void tst_QDnsLookup::initTestCase() { QTest::addColumn<QString>("tld"); - QTest::newRow("normal") << ".test.macieira.org"; - QTest::newRow("idn") << ".alqualond\xc3\xab.test.macieira.org"; + QTest::newRow("normal") << ".test.qt-project.org"; + QTest::newRow("idn") << ".alqualond\xc3\xab.test.qt-project.org"; } QString tst_QDnsLookup::domainName(const QString &input) @@ -153,8 +153,8 @@ void tst_QDnsLookup::lookup_data() QTest::newRow("ns-empty") << int(QDnsLookup::NS) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << ""; QTest::newRow("ns-notfound") << int(QDnsLookup::NS) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << ""; - QTest::newRow("ns-single") << int(QDnsLookup::NS) << "ns-single" << int(QDnsLookup::NoError) << "" << "" << "" << "ns3.macieira.info." << "" << "" << ""; - QTest::newRow("ns-multi") << int(QDnsLookup::NS) << "ns-multi" << int(QDnsLookup::NoError) << "" << "" << "" << "gondolin.macieira.info.;ns3.macieira.info." << "" << "" << ""; + QTest::newRow("ns-single") << int(QDnsLookup::NS) << "ns-single" << int(QDnsLookup::NoError) << "" << "" << "" << "ns-foo.linpro.net." << "" << "" << ""; + QTest::newRow("ns-multi") << int(QDnsLookup::NS) << "ns-multi" << int(QDnsLookup::NoError) << "" << "" << "" << "ns-bar.linpro.net.;ns-foo.linpro.net." << "" << "" << ""; QTest::newRow("ptr-empty") << int(QDnsLookup::PTR) << "" << int(QDnsLookup::InvalidRequestError) << "" << "" << "" << "" << "" << "" << ""; QTest::newRow("ptr-notfound") << int(QDnsLookup::PTR) << "invalid.invalid" << int(QDnsLookup::NotFoundError) << "" << "" << "" << "" << "" << "" << ""; diff --git a/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp b/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp index 84b63c7148..91b5d9292d 100644 --- a/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp +++ b/tests/auto/network/kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp @@ -56,7 +56,7 @@ private slots: void tst_QDnsLookup_Appless::noApplication() { QTest::ignoreMessage(QtWarningMsg, "QDnsLookup requires a QCoreApplication"); - QDnsLookup dns(QDnsLookup::A, "a-single.test.macieira.org"); + QDnsLookup dns(QDnsLookup::A, "a-single.test.qt-project.org"); dns.lookup(); } @@ -66,7 +66,7 @@ void tst_QDnsLookup_Appless::recreateApplication() char **argv = 0; for (int i = 0; i < 10; ++i) { QCoreApplication app(argc, argv); - QDnsLookup dns(QDnsLookup::A, "a-single.test.macieira.org"); + QDnsLookup dns(QDnsLookup::A, "a-single.test.qt-project.org"); dns.lookup(); if (!dns.isFinished()) { QObject::connect(&dns, SIGNAL(finished()), diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp index ee6ea546f3..e81c7f71db 100644 --- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp @@ -93,7 +93,7 @@ #include "../../../network-settings.h" -#define TEST_DOMAIN ".test.macieira.org" +#define TEST_DOMAIN ".test.qt-project.org" class tst_QHostInfo : public QObject diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index e06285dc67..dd24f6757e 100644 --- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -389,6 +389,11 @@ void tst_QNetworkProxyFactory::genericSystemProxy() QCOMPARE(systemProxy.first().port(), static_cast<quint16>(port)); qunsetenv(envVar); #else + Q_UNUSED(envVar) + Q_UNUSED(url) + Q_UNUSED(proxyType) + Q_UNUSED(hostName) + Q_UNUSED(port) QSKIP("Generic system proxy not available on this platform."); #endif } diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index b6b534b1da..c74edab9a2 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -334,12 +334,13 @@ static inline float qrandom() { return (rand() % 100) / 100.f; } void renderAScene(int w, int h) { #ifdef QT_OPENGL_ES_2 + Q_UNUSED(w) + Q_UNUSED(h) QGLShaderProgram program; program.addShaderFromSourceCode(QGLShader::Vertex, "attribute highp vec2 pos; void main() { gl_Position = vec4(pos.xy, 1.0, 1.0); }"); program.addShaderFromSourceCode(QGLShader::Fragment, "uniform lowp vec4 color; void main() { gl_FragColor = color; }"); program.bindAttributeLocation("pos", 0); program.bind(); - int colorId = program.uniformLocation("color"); glEnableVertexAttribArray(0); diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro index 1f7582243e..1d57206a73 100644 --- a/tests/auto/other/other.pro +++ b/tests/auto/other/other.pro @@ -41,6 +41,7 @@ SUBDIRS=\ windowsmobile \ qaccessibility \ qaccessibilitylinux \ + qaccessibilitymac \ !qtHaveModule(network): SUBDIRS -= \ baselineexample \ @@ -63,7 +64,8 @@ wince*|!contains(QT_CONFIG, accessibility): SUBDIRS -= qaccessibility !mac: SUBDIRS -= \ macgui \ macnativeevents \ - macplist + macplist \ + qaccessibilitymac !embedded|wince*: SUBDIRS -= \ qdirectpainter diff --git a/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro b/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro new file mode 100644 index 0000000000..5d81567f45 --- /dev/null +++ b/tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro @@ -0,0 +1,16 @@ +CONFIG += testcase +TARGET = tst_qaccessibilitymac +# LIBS += -framework Carbon +QT += widgets testlib + +HEADERS += tst_qaccessibilitymac_helpers.h +SOURCES += tst_qaccessibilitymac.cpp + +mac { + LIBS += -framework Security -framework AppKit -framework ApplicationServices + OBJECTIVE_SOURCES += tst_qaccessibilitymac_helpers.mm +} + + +requires(mac) +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp new file mode 100644 index 0000000000..25dd0d39dd --- /dev/null +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp @@ -0,0 +1,136 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QApplication> +#include <QtWidgets> +#include <QtTest/QtTest> +#include <QtCore/qcoreapplication.h> + +#include "tst_qaccessibilitymac_helpers.h" + +QT_USE_NAMESPACE + + +class AccessibleTestWindow : public QWidget +{ + Q_OBJECT +public: + AccessibleTestWindow() + { + new QHBoxLayout(this); + } + + void addWidget(QWidget* widget) + { + layout()->addWidget(widget); + widget->show(); + QTest::qWaitForWindowExposed(widget); + } + + void clearChildren() + { + qDeleteAll(children()); + new QHBoxLayout(this); + } +}; + +class tst_QAccessibilityMac : public QObject +{ +Q_OBJECT +private slots: + void init(); + void cleanup(); + + void lineEditTest(); + void hierarchyTest(); +private: + AccessibleTestWindow *m_window; +}; + + +void tst_QAccessibilityMac::init() +{ + m_window = new AccessibleTestWindow(); + m_window->setWindowTitle("Test window"); + m_window->show(); + m_window->resize(400, 400); + + QTest::qWaitForWindowExposed(m_window); +} + +void tst_QAccessibilityMac::cleanup() +{ + delete m_window; +} + + +void tst_QAccessibilityMac::lineEditTest() +{ + if (!macNativeAccessibilityEnabled()) + return; + + QLineEdit *lineEdit = new QLineEdit(m_window); + lineEdit->setText("a11y test QLineEdit"); + m_window->addWidget(lineEdit); + QVERIFY(QTest::qWaitForWindowExposed(m_window)); + QCoreApplication::processEvents(); + QVERIFY(testLineEdit()); +} + +void tst_QAccessibilityMac::hierarchyTest() +{ + if (!macNativeAccessibilityEnabled()) + return; + + QWidget *w = new QWidget(m_window); + m_window->addWidget(w); + QPushButton *b = new QPushButton(w); + w->setLayout(new QVBoxLayout()); + w->layout()->addWidget(b); + b->setText("I am a button"); + + QVERIFY(QTest::qWaitForWindowExposed(m_window)); + QCoreApplication::processEvents(); + QVERIFY(testHierarchy()); +} + +QTEST_MAIN(tst_QAccessibilityMac) +#include "tst_qaccessibilitymac.moc" diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h new file mode 100644 index 0000000000..ec5beab125 --- /dev/null +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <QtCore/QString> +#include <QtCore/QPair> +#include <QtWidgets/QWidget> + + +#pragma once // Yeah, it's deprecated in general, but it's standard practice for Mac OS X. + +bool macNativeAccessibilityEnabled(); +bool trusted(); +bool testLineEdit(); +bool testHierarchy(); diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm new file mode 100644 index 0000000000..8620b7dd2f --- /dev/null +++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm @@ -0,0 +1,213 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// some versions of CALayer.h use 'slots' as an identifier +#define QT_NO_KEYWORDS + +#include "tst_qaccessibilitymac_helpers.h" +#include <QApplication> +#include <QDebug> +#include <unistd.h> + +#import <Cocoa/Cocoa.h> +#import <ApplicationServices/ApplicationServices.h> + +bool macNativeAccessibilityEnabled() +{ + bool enabled = AXAPIEnabled(); + if (!enabled) + qWarning() << "Accessibility is disabled (check System Preferences) skipping test."; + return enabled; +} + +bool trusted() +{ + return AXIsProcessTrusted(); +} + + +#define EXPECT(cond) \ + if (!(cond)) { \ + qWarning("Failure in %s, line: %d", __FILE__ , __LINE__); \ + return false; \ + } \ + + +@interface TestAXObject : NSObject +{ + AXUIElementRef reference; +} + @property (readonly) NSString *role; + @property (readonly) NSString *description; + @property (readonly) NSString *value; + @property (readonly) CGRect rect; +@end + +@implementation TestAXObject +- (id) initWithAXUIElementRef: (AXUIElementRef) ref { + if ( self = [super init] ) { + reference = ref; + AXUIElementCopyAttributeValue(ref, kAXRoleAttribute, (CFTypeRef*)&_role); + AXUIElementCopyAttributeValue(ref, kAXDescriptionAttribute, (CFTypeRef*)&_description); + AXUIElementCopyAttributeValue(ref, kAXValueAttribute, (CFTypeRef*)&_value); + AXValueRef sizeValue; + AXUIElementCopyAttributeValue(ref, kAXSizeAttribute, (CFTypeRef*)&sizeValue); + AXValueGetValue(sizeValue, kAXValueCGSizeType, &_rect.size); + AXValueRef positionValue; + AXUIElementCopyAttributeValue(ref, kAXPositionAttribute, (CFTypeRef*)&positionValue); + AXValueGetValue(positionValue, kAXValueCGPointType, &_rect.origin); + } + return self; +} + +- (AXUIElementRef) ref { return reference; } +- (void) print { + NSLog(@"Accessible Object role: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.description, self.value, NSStringFromRect(self.rect)); + NSLog(@" Children: %ld", [self.childList count]); +} + +- (NSArray*) windowList +{ + NSArray *list; + AXUIElementCopyAttributeValues( + reference, + kAXWindowsAttribute, + 0, 100, /*min, max*/ + (CFArrayRef *) &list); + return list; +} + +- (NSArray*) childList +{ + NSArray *list; + AXUIElementCopyAttributeValues( + reference, + kAXChildrenAttribute, + 0, 100, /*min, max*/ + (CFArrayRef *) &list); + return list; +} + +- (AXUIElementRef) findDirectChildByRole: (CFStringRef) role +{ + AXUIElementRef result = nil; + NSArray *childList = [self childList]; + for (id child in childList) { + CFStringRef typeString; + AXUIElementCopyAttributeValue((AXUIElementRef)child, kAXRoleAttribute, (CFTypeRef*)&typeString); + if (CFStringCompare(typeString, role, 0) == 0) { + result = (AXUIElementRef) child; + break; + } + } + return result; +} + +- (AXUIElementRef) parent +{ + AXUIElementRef p = nil; + AXUIElementCopyAttributeValue(reference, kAXParentAttribute, (CFTypeRef*)&p); + return p; +} + +@end + + +bool testLineEdit() +{ +// not sure if this is needed. on my machine the calls succeed. +// NSString *path = @"/Users/frederik/qt5/qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.app/Contents/MacOS/tst_qaccessibilitymac"; +// NSString *path = @"/Users/frederik/qt5/qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.app"; +// AXError e = AXMakeProcessTrusted((CFStringRef) path); +// NSLog(@"error: %i", e); + + pid_t pid = getpid(); + AXUIElementRef app = AXUIElementCreateApplication(pid); + EXPECT(app != nil); + TestAXObject *appObject = [[TestAXObject alloc] initWithAXUIElementRef: app]; + + NSArray *windowList = [appObject windowList]; + // one window + EXPECT([windowList count] == 1); + AXUIElementRef windowRef = (AXUIElementRef) [windowList objectAtIndex: 0]; + EXPECT(windowRef != nil); + TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef]; + + EXPECT([window rect].size.width == 400); + // height of window includes title bar + EXPECT([window rect].size.height >= 400); + + // children of window: + AXUIElementRef lineEdit = [window findDirectChildByRole: kAXTextFieldRole]; + EXPECT(lineEdit != nil); + + TestAXObject *le = [[TestAXObject alloc] initWithAXUIElementRef: lineEdit]; + EXPECT([[le value] isEqualToString:@"a11y test QLineEdit"]); + return true; +} + +bool testHierarchy() +{ + pid_t pid = getpid(); + AXUIElementRef app = AXUIElementCreateApplication(pid); + EXPECT(app != nil); + TestAXObject *appObject = [[TestAXObject alloc] initWithAXUIElementRef: app]; + + NSArray *windowList = [appObject windowList]; + // one window + EXPECT([windowList count] == 1); + AXUIElementRef windowRef = (AXUIElementRef) [windowList objectAtIndex: 0]; + EXPECT(windowRef != nil); + TestAXObject *window = [[TestAXObject alloc] initWithAXUIElementRef: windowRef]; + + // Because the plain widget is filtered out of the hierarchy, we expect the button + // to be a direct child of the window + AXUIElementRef buttonRef = [window findDirectChildByRole: kAXButtonRole]; + EXPECT(buttonRef != nil); + + TestAXObject *buttonObject = [[TestAXObject alloc] initWithAXUIElementRef: buttonRef]; + TestAXObject *parentObject = [[TestAXObject alloc] initWithAXUIElementRef: [buttonObject parent]]; + + // check that the parent is a window + EXPECT([[parentObject role] isEqualToString: (NSString *)kAXWindowRole]); + + return true; +} diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index e36eaa5af2..0fe7c8ab75 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -1033,6 +1033,14 @@ void tst_QFileSystemModel::roleNames() QVERIFY(values.contains(roleName)); } +static inline QByteArray permissionRowName(bool readOnly, int permission) +{ + QByteArray result = readOnly ? QByteArrayLiteral("ro") : QByteArrayLiteral("rw"); + result += QByteArrayLiteral("-0"); + result += QByteArray::number(permission, 16); + return result; +} + void tst_QFileSystemModel::permissions_data() { QTest::addColumn<int>("permissions"); @@ -1043,11 +1051,10 @@ void tst_QFileSystemModel::permissions_data() QFile::ReadOwner, QFile::WriteOwner|QFile::ReadOwner, }; -#define ROW_NAME(i) qPrintable(QString().sprintf("%s-0%04x", readOnly ? "ro" : "rw", permissions[i])) - for (int readOnly = false ; readOnly <= true; ++readOnly) - for (size_t i = 0; i < sizeof permissions / sizeof *permissions; ++i) - QTest::newRow(ROW_NAME(i)) << permissions[i] << bool(readOnly); -#undef ROW_NAME + for (size_t i = 0; i < sizeof permissions / sizeof *permissions; ++i) { + QTest::newRow(permissionRowName(false, permissions[i]).constData()) << permissions[i] << false; + QTest::newRow(permissionRowName(true, permissions[i]).constData()) << permissions[i] << true; + } } void tst_QFileSystemModel::permissions() // checks QTBUG-20503 diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro index 2b9268f35d..4d18971cc6 100644 --- a/tests/auto/widgets/styles/qstyle/qstyle.pro +++ b/tests/auto/widgets/styles/qstyle/qstyle.pro @@ -6,10 +6,7 @@ QT += widgets testlib SOURCES += tst_qstyle.cpp wince* { - DEFINES += SRCDIR=\\\".\\\" addPixmap.files = task_25863.png addPixmap.path = . DEPLOYMENT += addPixmap -} else { - DEFINES += SRCDIR=\\\"$$PWD\\\" } diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index fc94f95f8e..94d2d22d96 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -250,9 +250,12 @@ void tst_QStyle::testProxyStyle() void tst_QStyle::drawItemPixmap() { testWidget->resize(300, 300); - testWidget->show(); + testWidget->showNormal(); - QPixmap p(QString(SRCDIR) + "/task_25863.png", "PNG"); + const QString imageFileName = QFINDTESTDATA("task_25863.png"); + QVERIFY(!imageFileName.isEmpty()); + + QPixmap p(imageFileName, "PNG"); const QPixmap actualPix = testWidget->grab(); QCOMPARE(actualPix, p); diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 2ca42e3d08..f26af0e1f4 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -2045,10 +2045,11 @@ void tst_QComboBox::itemListPosition() //we test QFontComboBox because it has the specific behaviour to set a fixed size //to the list view QWidget topLevel; - topLevel.resize(200, 200); - topLevel.move(100, 100); + QHBoxLayout *layout = new QHBoxLayout(&topLevel); + QFontComboBox combo(&topLevel); + layout->addWidget(&combo); //the code to get the available screen space is copied from QComboBox code const int scrNumber = QApplication::desktop()->screenNumber(&combo); @@ -2059,11 +2060,12 @@ void tst_QComboBox::itemListPosition() QApplication::desktop()->screenGeometry(scrNumber) : QApplication::desktop()->availableGeometry(scrNumber); - combo.move(screen.width()-combo.sizeHint().width(), 0); //puts the combo to the top-right corner + topLevel.move(screen.width() - topLevel.sizeHint().width() - 10, 0); //puts the combo to the top-right corner topLevel.show(); + //wait because the window manager can move the window if there is a right panel - QTRY_VERIFY(combo.isVisible()); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); combo.showPopup(); QTRY_VERIFY(combo.view()); QTRY_VERIFY(combo.view()->isVisible()); diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp index 6ab7cb4491..a4ad18c7a6 100644 --- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp @@ -347,7 +347,9 @@ void tst_QDockWidget::features() void tst_QDockWidget::setFloating() { + const QRect deskRect = QApplication::desktop()->availableGeometry(); QMainWindow mw; + mw.move(deskRect.left() + deskRect.width() * 2 / 3, deskRect.top() + deskRect.height() / 3); QDockWidget dw; mw.addDockWidget(Qt::LeftDockWidgetArea, &dw); @@ -355,10 +357,16 @@ void tst_QDockWidget::setFloating() QVERIFY(QTest::qWaitForWindowExposed(&mw)); QVERIFY(!dw.isFloating()); + const QPoint dockedPosition = dw.mapToGlobal(dw.pos()); QSignalSpy spy(&dw, SIGNAL(topLevelChanged(bool))); dw.setFloating(true); + const QPoint floatingPosition = dw.pos(); + + // QTBUG-31044, show approximately at old position, give or take window frame. + QVERIFY((dockedPosition - floatingPosition).manhattanLength() < 50); + QVERIFY(dw.isFloating()); QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).value(0).toBool(), dw.isFloating()); diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index 6b4bc3cd35..26f49a3fed 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -1705,8 +1705,8 @@ void tst_QDom::germanUmlautToByteArray() const QByteArray baseline("<a"); /* http://www.fileformat.info/info/unicode/char/00FC/index.htm */ - baseline += 0xC3; - baseline += 0xBC; + baseline += char(0xC3); + baseline += char(0xBC); baseline += "b/>\n"; QCOMPARE(data, baseline); diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 3e91e85882..5ed6b803c3 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1827,7 +1827,7 @@ bool Configure::displayHelp() desc("BUILD_QMAKE", "no", "-no-qmake", "Do not compile qmake."); desc("BUILD_QMAKE", "yes", "-qmake", "Compile qmake.\n"); - desc("PROCESS", "partial", "-process", "Generate top-level Makefiles/Project files."); + desc("PROCESS", "partial", "-process", "Generate only top-level Makefile."); desc("PROCESS", "full", "-fully-process", "Generate Makefiles/Project files for the entire Qt\ntree."); desc("PROCESS", "no", "-dont-process", "Do not generate Makefiles/Project files.\n"); @@ -1973,7 +1973,7 @@ QString Configure::defaultTo(const QString &option) return "auto"; if (option == "SYNCQT" - && (!QFile::exists(sourcePath + "/bin/syncqt.pl"))) + && (!QFile::exists(sourcePath + "/.git"))) return "no"; // Do not actually build the examples in production builds with -prefix, unless requested @@ -3346,6 +3346,37 @@ void Configure::generateConfigfiles() tmpFile.close(); } + QTemporaryFile tmpFile2; + if (tmpFile2.open()) { + tmpStream.setDevice(&tmpFile2); + tmpStream << "#include \"../../src/corelib/global/qconfig.h\"" << endl; + + tmpStream.flush(); + tmpFile2.flush(); + + outName = buildPath + "/include/QtCore/qconfig.h"; + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); + QFile::remove(outName); + + tmpFile2.copy(outName); + tmpFile2.close(); + } + QTemporaryFile tmpFile2a; + if (tmpFile2a.open()) { + tmpStream.setDevice(&tmpFile2a); + tmpStream << "#include \"qconfig.h\"" << endl; + + tmpStream.flush(); + tmpFile2a.flush(); + + outName = buildPath + "/include/QtCore/QtConfig"; + ::SetFileAttributes((wchar_t*)outName.utf16(), FILE_ATTRIBUTE_NORMAL); + QFile::remove(outName); + + tmpFile2a.copy(outName); + tmpFile2a.close(); + } + QTemporaryFile tmpFile3; if (tmpFile3.open()) { tmpStream.setDevice(&tmpFile3); @@ -3774,7 +3805,10 @@ void Configure::buildQmake() QTextStream stream(&out); stream << "#AutoGenerated by configure.exe" << endl << "BUILD_PATH = " << QDir::toNativeSeparators(buildPath) << endl - << "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl; + << "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl + << "INC_PATH = " << QDir::toNativeSeparators( + (QFile::exists(sourcePath + "/.git") ? buildPath : sourcePath) + + "/include") << endl; stream << "QT_VERSION = " << dictionary["VERSION"] << endl; if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) { stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\win32-g++" << endl @@ -3918,7 +3952,8 @@ void Configure::generateMakefiles() { QString dirName; bool generate = true; - bool doDsp = (dictionary["VCPROJFILES"] == "yes"); + bool doDsp = (dictionary["VCPROJFILES"] == "yes" + && dictionary["PROCESS"] == "full"); while (generate) { QString pwd = QDir::currentPath(); QString dirPath = buildPath + dirName; |