From 530c475d90a530fbf91b10d64f4b9978a13f389e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 31 May 2013 10:35:49 +0200 Subject: [PATCH 01/78] Fix typo in QSettings docs. Change-Id: I96dc2d57f5cc52c162ba0fd38d20141683847423 Reviewed-by: Oswald Buddenhagen Reviewed-by: Jerome Pasion --- src/corelib/io/qsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index a0904fea24d..5b4d4ec0d82 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. From 681da4feb3bdc91b84469d298a16b8b83dcffaf4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 30 May 2013 15:52:40 +0200 Subject: [PATCH 02/78] Android: Fix Windows build with recent SDK Since the dx tool has moved in the SDK, we need to update our copy of it to also search in the new location for dx.jar. Task-number: QTBUG-31405 Change-Id: If093a9f51f33c5d8666919f516a3b336322a7169 Reviewed-by: Ray Donnelly Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Olav Tvete --- mkspecs/features/data/android/dx.bat | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mkspecs/features/data/android/dx.bat b/mkspecs/features/data/android/dx.bat index af143c52b52..c4ad0e3ebc1 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% From d12c045a9587a1d46669fe4e554945ec3b2238ef Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 30 May 2013 15:37:14 +0200 Subject: [PATCH 03/78] qdoc: excludedirs works again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was comparing an absolute path to a relative path. These could never be the same. Instead of the relative path, it now gets the canonical absolute path, so the comparison succeeds when it should. Task-number: QTBUG-31404 Change-Id: I9c482d4649d493ce6d4f9a522cb61f2c8a5eb21f Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- src/tools/qdoc/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 107af966074..273cb60d7da 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 &excludedDirs, const QSet &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; From ca73ed25d45c15ed30daacb02adce51d7c8339fc Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 31 May 2013 08:31:53 +0200 Subject: [PATCH 04/78] docs: DirView example uses QFileSystemModel not QDirModel Change-Id: Ie172b1458401c4627314ff0db6992647388bf382 Reviewed-by: Jerome Pasion --- examples/widgets/doc/src/dirview.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/doc/src/dirview.qdoc b/examples/widgets/doc/src/dirview.qdoc index b9698ea4981..7687737cef6 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 */ From 5c555e3a296af3f2510fdc95caa864f020e69263 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 20:28:54 +0200 Subject: [PATCH 05/78] factor out writeFile() function Change-Id: I8e3e1665d7628c3210d000c46dfffa9f1af71009 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index ce07af4895c..8ce091053ff 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -382,6 +382,32 @@ sub fileContents { return $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 @@ -1076,23 +1102,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 = ; - 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); - } + writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file"); } } unless($showonly || !$create_uic_class_map) { From 5d8b8eed90c52afbd54d7c057657dc12d1e8e61a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 17 May 2013 19:53:25 +0200 Subject: [PATCH 06/78] move module version header generation back to syncqt there is no particular reason for it being done by qmake. avoids that the logic is distributed over two source files, and allows us to generate these headers at pre-build time already, including not forwarding to a yet unexisting file (which would have a yet unknown location). Change-Id: I9c78ab425cf6f01d076c86fd1ee602626f231487 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 13 ++++++++++++ mkspecs/features/qt_module_headers.prf | 29 -------------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 8ce091053ff..f31466ad339 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -1094,6 +1094,19 @@ 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"); #handle the headers.pri for each module my $headers_pri_contents = ""; diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 298ca102bc7..3c50e041c78 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -31,9 +31,6 @@ 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) @@ -46,32 +43,6 @@ defineTest(shouldMasterInclude) { autogen_warning = \ "/* This file was generated by qmake with the info from /$$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 !build_pass { From 8d69232b28165079aed1d754f9bdd8c7c4336b16 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:07:13 +0200 Subject: [PATCH 07/78] let configure create the forwarding qconfig.h again this avoids that syncqt needs to forward to a yet unexisting file (which will have a yet unknown location, when syncqt is run at packaging time already). the %inject_headers syncqt config variable remains, so it can be told not to purge "foreign" files. Change-Id: I127ff6e0b7d5702fb0acaee9a5b7940b482d3608 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 10 +--------- configure | 17 +++++++++++++++++ src/corelib/global/global.pri | 5 +++++ sync.profile | 1 - tools/configure/configureapp.cpp | 31 +++++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 10 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index f31466ad339..1da3878695d 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -893,15 +893,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 $_); @@ -923,7 +916,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"; @@ -964,7 +956,7 @@ 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) { diff --git a/configure b/configure index 079f2e7415c..43e7f8851e5 100755 --- a/configure +++ b/configure @@ -6424,6 +6424,23 @@ else fi 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 + #------------------------------------------------------------------------------- # save configuration into qconfig.pri #------------------------------------------------------------------------------- diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 6ac32cd35da..4084d4f2ad5 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/sync.profile b/sync.profile index e07b285dbbf..3d89d9d71f3 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/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a83f451b815..9620129509f 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3351,6 +3351,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); From f4e529070998090598a66b2c0f66275d8479c5be Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:57:01 +0200 Subject: [PATCH 08/78] remove pointless quoting of MODULE_*INCLUDES assignments it would only cause trouble further down the line. Change-Id: Ied9ba8a1ecf36b77e1091c73564bd7601ea6a6b4 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9e40a67b510..77adc022596 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -52,9 +52,9 @@ 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 } MODULE_PRI_CONT = \ "QT.$${MODULE}.VERSION = $${VERSION}" \ From 0519129c5977280dfa2f8a47ca4aa93fe9fee84b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 19:09:24 +0200 Subject: [PATCH 09/78] split out dependencies from module master header this will allow us the create the dependency list in a different way than the rest of the master header. Change-Id: Ib083fbbf6194cd9a161d669f860aaf32fd96d9d4 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_headers.prf | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 3c50e041c78..65e9a888f39 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -43,17 +43,26 @@ defineTest(shouldMasterInclude) { autogen_warning = \ "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" +# Create a module master depends header +MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends +!build_pass { + MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning + for(dep, MODULE_DEPENDS) { + depname = $$eval(QT.$${dep}.name) + MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" + } + write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.") +} +SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER + # Create a module master header MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME !build_pass { MODULE_MASTER_HEADER_CONT = \ $$autogen_warning \ "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" - for(dep, MODULE_DEPENDS) { - depname = $$eval(QT.$${dep}.name) - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" - } + "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" \ + "$${LITERAL_HASH}include <$$MODULE_INCNAME/$${MODULE_INCNAME}Depends>" for(hdr, SYNCQT.HEADER_FILES): \ shouldMasterInclude($$hdr): \ MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include \"$$replace(hdr, .*/, )\"" From 96557bc389794abdcb15305c2a439f344ec2f0c3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 20:57:07 +0200 Subject: [PATCH 10/78] move module master header generation back to syncqt now that we split out the part that depends on the project file, we can do it cleanly here. this way we can generate these headers at pre-build time already. and for git builds, perl is probably faster than qmake at this task. Change-Id: I343255c6de22329471a3ae2c2aac9ebeb160a501 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 42 ++++++++++++++++++++++++++ mkspecs/features/qt_module_headers.prf | 25 --------------- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 1da3878695d..497e8deb2c4 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -171,6 +171,30 @@ sub checkRelative { return 1; } +###################################################################### +# 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 () { + 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" @@ -828,6 +852,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 = (); @@ -960,6 +990,9 @@ foreach my $lib (@modules_to_sync) { } 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); @@ -1018,6 +1051,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; @@ -1100,6 +1138,10 @@ foreach my $lib (@modules_to_sync) { "#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 = ""; $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 65e9a888f39..7591bffb196 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -31,15 +31,6 @@ minimal_syncqt: return() #load up the headers info include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", true) -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) -} - autogen_warning = \ "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" @@ -55,20 +46,4 @@ MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MOD } SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER -# Create a module master header -MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME -!build_pass { - MODULE_MASTER_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}include <$$MODULE_INCNAME/$${MODULE_INCNAME}Depends>" - 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.") -} -SYNCQT.HEADER_FILES += $$MODULE_MASTER_HEADER - CONFIG += qt_install_headers From 0a1b89bff5015c8389807f55c1b39d360af55e9a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 21:34:05 +0200 Subject: [PATCH 11/78] run syncqt only for builds from git the logic in the configures was even trying to express that, only that nowadays we always ship syncqt, so the tests were kinda pointless. this frees us from the perl dependency for non-developer builds of packaged modules (except for webkit, which needs almost every scripting language on earth anyway). obviously, this requires that the packaging scripts run syncqt in the source dir before tarring up the sources. note that for repositories other than qtbase, the -version argument needs to be passed to syncqt. Task-number: QTBUG-29465 Change-Id: Ic929ab17a5de4b30fbf48b3aa9bfa3b4d2ef37d6 Reviewed-by: Joerg Bornemann --- configure | 21 +++++++++++++-------- mkspecs/features/qt_build_paths.prf | 3 +++ mkspecs/features/qt_module_headers.prf | 8 ++++++-- mkspecs/features/qt_module_pris.prf | 15 ++++++++++++++- qmake/Makefile.unix | 4 ++-- qmake/Makefile.win32 | 2 +- tools/configure/configureapp.cpp | 7 +++++-- 7 files changed, 44 insertions(+), 16 deletions(-) diff --git a/configure b/configure index 43e7f8851e5..1e15220ca16 100755 --- a/configure +++ b/configure @@ -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" # save a pre-existing mkspecs/modules dir @@ -3895,7 +3888,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 @@ -4028,6 +4028,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" diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 03b43e3153c..25fc2c3033f 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 7591bffb196..fd6cf6b9433 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,7 +29,11 @@ load(qt_build_paths) minimal_syncqt: return() #load up the headers info -include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", 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 /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 77adc022596..653f7538150 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,6 +56,18 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } + !git_build:!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + 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}" \ "QT.$${MODULE}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ @@ -97,7 +109,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/qmake/Makefile.unix b/qmake/Makefile.unix index 7293f4c869c..9b7bfa6f8b7 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 63cdf505637..7dbef614132 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/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 9620129509f..ad2854880a4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1987,7 +1987,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 @@ -3810,7 +3810,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 From 9a9abf8a8a19faaf805c9ca4e09c9e2e3ae0c122 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 29 May 2013 15:04:06 +0200 Subject: [PATCH 12/78] Only process vcproj files if we do a -fully-process A top-level vcproj (really a .sln file) only makes sense when sub- projects are generated too, since the solutions generator will ignore all non-generated projects. Originally-by: Marius Storm-Olsen Change-Id: Iff09279d5760b5114a4cfb9b58ad677f2f69fa58 Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index ad2854880a4..98b59ab6fdd 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1841,7 +1841,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"); @@ -3954,7 +3954,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; From 101c47242b955b4fe3da8f3de57450815b9d4aec Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 3 Jun 2013 12:44:46 +0200 Subject: [PATCH 13/78] Update LICENSE.PREVIEW.COMMERCIAL license Change-Id: I87b9c77327e2e32db77efb027172ccd21659e032 Reviewed-by: Iikka Eklund --- LICENSE.PREVIEW.COMMERCIAL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL index e90ad1acb52..15e61fc19e8 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). From 51a35f5c021836bf31276749c638addefac12ebb Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Fri, 31 May 2013 14:57:52 +0200 Subject: [PATCH 14/78] eglfs: prevent expose/geometrychange loop This prevents EGLFS from getting stuck after exposing the first frame, by constantly generating new Expose and GeometryChange events which are synchronously processed. Change-Id: Id3b09821ea31e9c1ddab7c520e782a4e42844a08 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/eglfs/qeglfswindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index cd92a07f00a..98c54e0ee0f 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); From fb7e0e24c4181e9e97d85a3a80c3e2ef5a40770a Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Sat, 1 Jun 2013 17:57:34 +0200 Subject: [PATCH 15/78] eglfs: Fix bug determining physical screen size In the situation that the screenSize EGLFS hook had been defined, but not the physicalScreenSize, the uninitialized contents of fb_var_screeninfo vinfo would be used to calculate the fall-back physical screen size. Since this value is undefined, devices like the Raspberry Pi would end unable to render DPI dependent fonts. Change-Id: Ic9f67c1c646cc7b328b695b76a84d78577fefcd8 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index 91a97ff977f..c334f46c2c9 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" From 55f01addb201c153ba5049a11f8ddfc0aa7544c7 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 4 Jun 2013 08:39:03 +0200 Subject: [PATCH 16/78] Adapt QtPrintSupport related uic rules It's no more on QtWidgets. Task-number: QTBUG-31508 Change-Id: Iba117a4103c2b32173816a4ecb5faa187f169b32 Reviewed-by: Friedemann Kleint --- src/tools/uic/qclass_lib_map.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index 6859cd0cd4d..cedefb801ac 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) From 76d75fd7df66c2687cf78945ccead03c5500f531 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 May 2013 14:53:14 -0700 Subject: [PATCH 17/78] Use the GCC inline assembly when building for MinGW MinGW has a longstanding problem of providing the MSVC intrinsics that every Windows developer expects to be there. Other projects have run into those problems. So instead just use the GCC inline assembly. Change-Id: I5651f97f9a4dfbf98ebbf063f91f221eab80b224 Reviewed-by: Olivier Goffart --- src/corelib/tools/qsimd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index 97a64eb5bb3..c81df7a6f25 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 } From f36374727e5445cdab489a27605c35d1c4515317 Mon Sep 17 00:00:00 2001 From: Andrew Patterson Date: Mon, 13 May 2013 08:02:39 -0400 Subject: [PATCH 18/78] Changed project dependencies for solution files Reorganized project dependency output in solution files for vc 2005+ Task-number: QTBUG-30993 Change-Id: I4764f3d98be40b3e217130522bb89a43bbf3669e Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_vcproj.cpp | 44 ++++++++++++++++---------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index fb4bf084318..17c72fa5d0e 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, QHashtarget, 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 subdirProjectLookup; collectDependencies(project, profileLookup, projGuids, extraSubdirs, solution_depends, solution_cleanup, t, subdirProjectLookup); + // write out projects + for (QList::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 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::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::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { QString platform = is64Bit ? "x64" : "Win32"; From 53698f3e7c9451774b60e3f65988654e24c8968e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 4 Jun 2013 20:34:49 +0200 Subject: [PATCH 19/78] fix non-git non-shadow non-prefix non-qtbase builds these builds usually assume all headers in the qtbase build (== source == install) dir, so the path for adding our pre-generated per-module include paths needs to be triggered explicitly. Change-Id: I57ec441d58cdf8186907ee6c36dce08daa206c49 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 653f7538150..11f56198d1e 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,7 +56,8 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } - !git_build:!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + !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 { From 07337def652a13002ccc98d77bb1a13372bba26f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 4 Jun 2013 20:59:08 +0200 Subject: [PATCH 20/78] don't add absent private include paths to non-git builds all private headers are created by syncqt (and are thus in the source dir), so we can simply override the normal (build dir based) paths instead of extending them. Change-Id: I9c1f3344c401b481b3f3d2295515f1aabffaa9a0 Reviewed-by: Thiago Macieira --- mkspecs/features/qt_module_pris.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 11f56198d1e..666989f75ec 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -63,10 +63,10 @@ else: \ force_independent { MODULE_FWD_PRI_CONT_SUFFIX = \ "QT.$${MODULE}.includes += $$pub_inc" \ - "QT.$${MODULE}.private_includes += $$priv_inc" + "QT.$${MODULE}.private_includes = $$priv_inc" } else { MODULE_INCLUDES += $$pub_inc - MODULE_PRIVATE_INCLUDES += $$priv_inc + MODULE_PRIVATE_INCLUDES = $$priv_inc } } MODULE_PRI_CONT = \ From 9aa24645eb09be9e1d05060b2d976327726cb747 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 30 May 2013 14:51:18 +0200 Subject: [PATCH 21/78] Prevent negative size in QBitArray, QVector and QVarLengthArray ctors. As shown in QTBUG-24345, QBitArray will exhibit invalid reads when initialised with a negative size and run under valgrind. QVector and QVarLengthArray both cause a crash if initialised with a negative size. This patch enforces sizes greater than or equal to 0 with asserts and existing if statements, and hence impose no performance penalty for release builds. Task-number: QTBUG-24345 Task-number: QTBUG-30037 Change-Id: I9a969f6016e0a59904a60bbfe9e5360e6f523b87 Reviewed-by: Thiago Macieira --- src/corelib/tools/qbitarray.cpp | 3 ++- src/corelib/tools/qvarlengtharray.h | 2 ++ src/corelib/tools/qvector.h | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index 2b459b2b1bf..b04c4f9c3d9 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -122,7 +122,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/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 3a2028057d4..825e05ae1b1 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -197,6 +197,8 @@ private: template Q_INLINE_TEMPLATE QVarLengthArray::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(malloc(s * sizeof(T))); Q_CHECK_PTR(ptr); diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 816e1f15f62..489ee821b93 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -398,7 +398,8 @@ QVector &QVector::operator=(const QVector &v) template QVector::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::QVector(int asize) template QVector::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(); From 930dc240d1938dac8d6512b947cb143fc91c3d21 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:11:56 +0200 Subject: [PATCH 22/78] remove pointless symlink fallback for qconfig.h syncqt does that nowadays. Change-Id: Iffc465cce86a7c6370afaa543ba9b9ed8d478eea Reviewed-by: Joerg Bornemann --- configure | 3 --- 1 file changed, 3 deletions(-) diff --git a/configure b/configure index 1e15220ca16..d7c96749f4e 100755 --- a/configure +++ b/configure @@ -6424,9 +6424,6 @@ 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 fi # create a forwarding header From 1d8ec5fae2fa4bf694b93bb6bf14a7c42c84a9b6 Mon Sep 17 00:00:00 2001 From: Valery Volgutov Date: Tue, 21 May 2013 14:18:17 -0700 Subject: [PATCH 23/78] Fix FBO restoring in QOpenGLTextureGlyphCache QOpenGLTextureGlyphCache::restoreTextureData restores FBO which was binded before restoreTextureData call. More specifically, it restores QOpenGLContextPrivate's current_fbo member. This works if FBO was binded by QOpenGLFramebufferObject but not if FBO was binded using glBindFramebufferObject and rendering done via QOpenGLPaintDevice. This patch fixes it by querying current FBO using GL_FRAMEBUFFER_BINDING query and restoring it. Change-Id: Ia97a21e62566dc39a5191b66d3ca0e3ad0845ce1 Reviewed-by: Valery Volgutov Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopengltextureglyphcache.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp index 83f407575ee..7d49c03f5bb 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); From bd01db4a9899458081d73a4019c006e026a9514c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 5 Jun 2013 10:45:50 +0200 Subject: [PATCH 24/78] Fix typo in QAlgorithms documentation. Change-Id: Ic9107f427acc1e009779d39e0a204ea81d54aee7 Reviewed-by: Jerome Pasion --- src/corelib/tools/qalgorithms.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index cc544af8686..ad6c3d913c1 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -33,7 +33,7 @@ \brief The header includes the generic, template-based algorithms. Qt provides a number of global template functions in \c - that work on containers and perform well-know + 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. From c97a1bc538dea1e38dfcba6c8191ed4b35dbe133 Mon Sep 17 00:00:00 2001 From: Mikko Harju Date: Mon, 3 Jun 2013 13:13:49 +0300 Subject: [PATCH 25/78] Fixed raw coordinate reporting for touch events The raw coordinates were not reported by the evdevtouch plugin. Change-Id: Ia06129edd771b12cc9f6a97dc678b545d226af70 Reviewed-by: Andy Nichols --- src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index 2c93da147e6..ddd059c5a06 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -421,6 +421,8 @@ 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)); + tp.rawPositions.append(QPointF(contact.x, contact.y)); + m_touchPoints.append(tp); if (contact.state == Qt::TouchPointReleased) From b73ad2dd197c5f35817bb33db17777596671478b Mon Sep 17 00:00:00 2001 From: Mikko Harju Date: Tue, 4 Jun 2013 08:34:46 +0300 Subject: [PATCH 26/78] Prevent touch coordinates outside target geometry Previously, normalized positions with either of coordinates equal to 1.0 would be reported outside the screen / window geometry, which would cause hit test to fail. Change-Id: Ia5e083bd52254c7e05143eedf930be3bcba7a412 Initial-patch-by: Aaron Kennedy Reviewed-by: Andy Nichols --- src/platformsupport/input/evdevtouch/qevdevtouch.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index ddd059c5a06..b05ea0de596 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp @@ -515,9 +515,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); From 1df0f4b2af84ec503c86b72b05490942f04e541f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 14:50:18 +0200 Subject: [PATCH 27/78] Fix tst_qcombobox::itemListPosition. Add font combo to top level via layout and position top level instead of the (child) font combo. Change-Id: I0f754c37c009d1ed83615b800d6f2467e858c047 Reviewed-by: Joerg Bornemann --- tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp index 36b83eefdaf..0bfd4baa0c8 100644 --- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp @@ -2044,10 +2044,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); @@ -2058,11 +2059,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()); From c9398312fefcbb8d519c73346fa9876c8c05a3d9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2013 15:48:20 +0200 Subject: [PATCH 28/78] Print directories for QT_DEBUG_PLUGINS So far we stayed completely silent if the user forgot to deploy all plugins, or deployed them in the wrong way. Change-Id: Idd776c4b4a2ddffd5da08985e5925248c97e0270 Reviewed-by: Friedemann Kleint --- src/corelib/plugin/qfactoryloader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 289fda7afcd..61c9b40e83f 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; From 04830dbcb2c1b92bd949ac7fd56d293b02e91fef Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Jun 2013 14:26:03 +0200 Subject: [PATCH 29/78] Strip the -L dirs when processing GL dirs for the CMake files. The generated cmake files expect only the names of libraries, so the existence of directories causes erroneous fatal errors when attempting to use Qt5Gui, if pkg-config returns a -L entry from pkg-config --libs egl Change-Id: Iec50b4be68ab643c3c02abce2435a98e69955138 Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly Reviewed-by: Iikka Eklund --- mkspecs/features/cmake_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index 08295da75f7..f48ef43b883 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$,, From fdde071b06cd19f41de01f4ffdb9fdeef3c20914 Mon Sep 17 00:00:00 2001 From: Mikko Harju Date: Mon, 3 Jun 2013 15:26:27 +0300 Subject: [PATCH 30/78] Added rotation parameter to qevdevtouch In some cases the event coordinates reported by evdev are in different orientation compared to the primary orientation of the platform window. This commit adds plugin parameter rotate=[90, 180, 270] to rotate the normalized coordinate system before reporting the touch event. Change-Id: Ic830a2d259f9d3c5fb63b80afb795d8b400c2ece Reviewed-by: Andy Nichols --- .../input/evdevtouch/qevdevtouch.cpp | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp index b05ea0de596..5e493ac68c5 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,9 @@ 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); From d4415cdd84519de5c3a4b8830b7407074877ea80 Mon Sep 17 00:00:00 2001 From: Daiwei Li Date: Wed, 5 Jun 2013 14:28:26 -0700 Subject: [PATCH 31/78] Fix themeHint typo in qcocoatheme: PasswordMaskDelay should be PasswordMaskCharacter Task-number: QTBUG-31498 Change-Id: Ie6b1b0a2238923e37d52fa2e90782e874bb224b4 Reviewed-by: Mitch Curtis --- src/plugins/platforms/cocoa/qcocoatheme.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 36d7a497461..9c10bc26ddb 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -281,7 +281,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; From 24c52bd44b700725d4feec0d2e05a7e382e59c4e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 May 2013 07:57:35 -0600 Subject: [PATCH 32/78] Update the DNS and name-resolver tests to the official zone Change-Id: I02feb8029461383f38bcbdca138789b119a58b5a Reviewed-by: Thiago Macieira --- tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp | 8 ++++---- .../kernel/qdnslookup_appless/tst_qdnslookup_appless.cpp | 4 ++-- tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp b/tests/auto/network/kernel/qdnslookup/tst_qdnslookup.cpp index a381ba7b711..17be5e4c435 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("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 84b63c71483..91b5d9292df 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 ee6ea546f3f..e81c7f71dba 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 From 119882714f87ffeb6945fdb2d02997ae125ff50c Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Thu, 30 May 2013 08:33:25 +0200 Subject: [PATCH 33/78] Cocoa:Fixed crash when sharing QMenu between two QMenuBar instances Don't insert a NSMenuItem into a NSMenu if this one already belongs to another NSMenu, this is forbidden in the Cocoa framework and raises an Exception. The solution consists in tagging the menu as sharable and moving it from one menubar to another when the window gets focus. Task-number: QTBUG-31342 Change-Id: Ic3bfadd4704f363ac26122ae15547543a0f6d44d Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenu.h | 5 ++ src/plugins/platforms/cocoa/qcocoamenu.mm | 13 +++- src/plugins/platforms/cocoa/qcocoamenubar.h | 2 + src/plugins/platforms/cocoa/qcocoamenubar.mm | 70 ++++++++++++++------ 4 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 9100b9b15f2..7224ee2ff86 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 items() const; QList 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 25ece7349c7..d4cf83a3803 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -215,7 +215,8 @@ QT_BEGIN_NAMESPACE QCocoaMenu::QCocoaMenu() : m_enabled(true), - m_tag(0) + m_tag(0), + m_menuBar(0) { m_delegate = [[QT_MANGLE_NAMESPACE(QCocoaMenuDelegate) alloc] initWithMenu:this]; m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; @@ -534,4 +535,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 8086676cc5d..7a1bda74a4e 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 m_menus; NSMenu *m_nativeMenu; diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index e280cf45816..73331db40dd 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(menu)); + [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; +} + +void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +{ QCocoaMenu *menu = static_cast(platformMenu); QCocoaMenu *beforeMenu = static_cast(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::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) { - QCocoaAutoReleasePool pool; - QCocoaMenu *menu = static_cast(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); + } + } + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); [loader ensureAppMenuInMenu:mb->nsMenu()]; From 25a4405c69a032bbe817935be1f1f0929e98da63 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 4 Jun 2013 16:11:06 +0200 Subject: [PATCH 34/78] Doc: Rearranged page titles in the of HTML pages. Before: QtMultimedia 5.1: Camera After: Camera | QtMultimedia 5.1 "Camera" is page name and "QtMultimedia 5.1" is the assembled project name. -Regular page title is the same. -It's a readability issue to not see the page title right away -New arrangement conforms to Qt Project and blog name format: " | <Domain>" -Tested with the tw-parser and it looks compatible with the qt-project.org site Change-Id: Iae0eec9e66b5e21285bdad1e525923f60c72e56b Reviewed-by: Sami Makkonen <sami.makkonen@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> --- src/tools/qdoc/htmlgenerator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 7e1467f300a..3d6f04decf0 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) << "\n"; + out() << " " << protectEnc(title) << shortVersion << "\n"; // Include style sheet and script links. out() << headerStyles; From c889e2848398c7beca9d31544e9cbdba88ebe5bb Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 3 Jun 2013 12:23:50 +0200 Subject: [PATCH 35/78] Doc: Fixed typo in QDialog. Task-number: QTBUG-31493 Change-Id: I7bb7b249a0336dd949f8c74bcc22c0b7c39d0885 Reviewed-by: Geir Vattekar --- src/widgets/dialogs/qdialog.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index a76c88dc5e9..2cda99a2690 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 From 476dba9a9f3842041f465da92764646976b96551 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 16:11:50 +0200 Subject: [PATCH 36/78] Use QWindow::geometry() for size when sending resize before expose. Task-number: QTBUG-30996 Change-Id: I9c3589ea67b563f6e588568ee54cc8bbd084f87c Reviewed-by: Gunnar Sletta --- src/gui/kernel/qguiapplication.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2a1d7e3bcc1..29a7e87d46b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2251,8 +2251,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; From 1828ab8557e824ec22b0c425dd417df3a0794a8c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 5 Jun 2013 16:14:42 +0200 Subject: [PATCH 37/78] Windows: Send a geometry change after Window creation. Task-number: QTBUG-30996 Change-Id: I03b5e1fdbbdd779f86541291c13e9eb6840ff3c6 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/windows/qwindowsintegration.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 814892b43a8..fc2ba454df9 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); } From a1c8c581ce590c1c3185fe4bb1d3b4851bdbfd33 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jun 2013 14:02:19 +0200 Subject: [PATCH 38/78] tst_qnetworkproxyfactory: Fix warnings about unused variables. Change-Id: I6fa08353ebea5cdd7fc7a0c982bf1b9d34bbc077 Reviewed-by: Mitch Curtis --- .../kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index e06285dc675..dd24f6757e4 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(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 } From cd756e5ed55a7859eca354e898ea5a3039fcb2e6 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 30 May 2013 13:02:45 +0200 Subject: [PATCH 39/78] Cocoa Accessibility: fix ignoring of objects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Mac it's expected that some elements are filtered out of the a11y hierarchy. We do this with the shouldBeIgnored function. The problem is that we would ignore some objects and then return them in the child attribute function. This is inconsistent and leads to voice over not working. For example having a plain QWidget with other widgets as children would cut off all of these widgets, since the plain QWidget would be ignored. Change-Id: I5f6c26b272e5ca57d59c1ed1ef47e9a2b1181295 Reviewed-by: Gabriel de Dietrich Reviewed-by: Jan Arve Sæther --- .../cocoa/qcocoaaccessibilityelement.mm | 6 +- .../platforms/cocoa/qnsviewaccessibility.mm | 2 +- tests/auto/other/other.pro | 4 +- .../qaccessibilitymac/qaccessibilitymac.pro | 16 ++ .../tst_qaccessibilitymac.cpp | 136 +++++++++++ .../tst_qaccessibilitymac_helpers.h | 51 +++++ .../tst_qaccessibilitymac_helpers.mm | 213 ++++++++++++++++++ 7 files changed, 422 insertions(+), 6 deletions(-) create mode 100644 tests/auto/other/qaccessibilitymac/qaccessibilitymac.pro create mode 100644 tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac.cpp create mode 100644 tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.h create mode 100644 tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm index f7c945c50d7..55a23fda761 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/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm index 6ebb1f6ba8e..331a66417d4 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/tests/auto/other/other.pro b/tests/auto/other/other.pro index 1f7582243e0..1d57206a733 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 00000000000..5d81567f457 --- /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 00000000000..25dd0d39ddd --- /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 +#include +#include +#include + +#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 00000000000..ec5beab125d --- /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 +#include +#include + + +#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 00000000000..8620b7dd2fd --- /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 +#include +#include + +#import +#import + +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; +} From 21356b3ec34f4e83719389775b83825fbd8b02e6 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 5 Jun 2013 11:20:07 +0200 Subject: [PATCH 40/78] RecalcAdvances and DoKerning should agree on when to use design metrics QFontEngineFT::recalcAdvances uses design metrics if hinting is disabled or slight. QFontEngine::doKerning only follows the QFontEngine::DesignMetrics flag. This means in some instances the advances will be calculated in subpixels but kerned in full pixels. This patch makes QFontEngineFT decide if it should request design metrics from QFontEngine::doKerning or not. Change-Id: Ia0236efde2d7269623f690a6074afbe26e07c458 Reviewed-by: Konstantin Ritt Reviewed-by: Pierre Rossi --- src/gui/text/qfontengine_ft.cpp | 18 +++++++++++++++--- src/gui/text/qfontengine_ft_p.h | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 10225febcb9..4545645dc6a 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 434eb76c33c..e09fa6f94fb 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; From 9ef24ff8ed487d49cf441c65c69ea7ebfe8acfb3 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Fri, 7 Jun 2013 13:03:34 +0200 Subject: [PATCH 41/78] test: Mark tst_qopengl as insignificant on Win7 + Angle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This only marks tst_qopengl as insignificant on Windows 7 32bit with the Angle configuration. Task-number: QTBUG-31611 Change-Id: I1876b6fdc32fef93edf34c2bd61d03cc9ba11135 Reviewed-by: Friedemann Kleint Reviewed-by: Tony Sarajärvi --- tests/auto/gui/qopengl/qopengl.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index 91eeda34c38..34af962d361 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 From 16eea84aa873771047785db9ee00a51904c50ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 31 May 2013 16:04:21 +0200 Subject: [PATCH 42/78] Fix for when we don't have XSettings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-31418 Task-number: QTBUG-31410 Task-number: QTBUG-31446 Change-Id: I3fbed40054f3e0720b50ada0dc4ad0ae4cb0412e Reviewed-by: Jan Arve Sæther --- src/plugins/platforms/xcb/qxcbxsettings.cpp | 22 +++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp index 7ffd3e105fd..c106bd00f8e 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()); } From 60df445d3bca6d6908bc8c07708e2df1c02584c9 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Fri, 31 May 2013 15:26:41 -0300 Subject: [PATCH 43/78] QNX: fix QQnxWindow To ensure the correct event order, only set the geometry() once the window is actually made visible. We also need to post the expose event even for child windows (i.e., windows which have a parent). Change-Id: Ief80778bc3202352bd194e4b3ba655f619350b1a Reviewed-by: Kevin Krammer Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qqnxwindow.cpp | 80 +++++++++++++----------- src/plugins/platforms/qnx/qqnxwindow.h | 1 + 2 files changed, 45 insertions(+), 36 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 9523685f703..4c95950a7e3 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); } } @@ -625,35 +627,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() @@ -734,6 +711,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 4a327fd54b5..63d5dc09796 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(); From 528fd2149ecdc921bf0af91de9dd3262498c9121 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 29 May 2013 17:44:37 -0300 Subject: [PATCH 44/78] Use QFINDTESTDATA on tst_QStyle instead of SRCDIR Update the test code to match the current Qt idiom for finding test data (and fix it on QNX). Change-Id: I63e7c97b717722e4e6859a12f329d56b26584ce6 Reviewed-by: Friedemann Kleint --- tests/auto/widgets/styles/qstyle/qstyle.pro | 3 --- tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro index 2b9268f35d5..4d18971cc65 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 fc94f95f8ee..94d2d22d968 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); From d4dba8a5c414bfdd7cbec6e6ee133f04604b2d2c Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Thu, 30 May 2013 14:55:22 -0300 Subject: [PATCH 45/78] Unix: fix tst_QFile when run as root Because tests are usually run as root on some setups, it does not make sense to test for the right permissions of a readonly file. Change-Id: I484f88722d3a9ce7123edc0fb57acae528fa194e Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index cca4655f580..42dca7fc669 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1192,6 +1192,13 @@ void tst_QFile::permissions() #ifdef Q_OS_WIN 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); From 2ccf4c32cc593f568581dd237e1e27d39fd965a2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 18:39:12 -0700 Subject: [PATCH 46/78] QUrl stringprep: recalculate the current position if the size changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the case folding operation results in either expansion or reduction of the string, we need to adapt. Reduction happens most often when a non-BMP character is case-folded to a character in the BMP (example: mathematical signs at U+1D400-1D7FF). Expansion happens in the rare case of symbols containing words, like U+2121 ℡ (this is part of the unit test), and one common case: the German sharp S (ß) is expanded to "ss". Change-Id: I1bdbdc908b958a89bf30e4bb648d65dfdd9097f8 Reviewed-by: Konstantin Ritt --- src/corelib/io/qurlidna.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index fac1703da8a..7478099e9e6 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1472,7 +1472,8 @@ static void mapToLowerCase(QString *str, int from) if (uc <= 0xffff) str->replace(i, 1, reinterpret_cast(&entry->mapping[0]), l); else - str->replace(i-1, 2, reinterpret_cast(&entry->mapping[0]), l); + str->replace(--i, 2, reinterpret_cast(&entry->mapping[0]), l); + i += l - 1; d = 0; } else { if (!d) From 86312275197c3fde948035a59c0358162701f9f2 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 18:42:04 -0700 Subject: [PATCH 47/78] QUrl stringprep: fix case folding from non-BMP to BMP When uc > 0xffff (non-BMP character) and l == 1 (replacement is in the BMP), we must use QString::replace so the correct number of characters is replaced. There's one case testing this in tst_qurlinternal, but it is being obscured by another bug (false positive). Change-Id: I32388dd5bef32d4d6804aeeec4904bd5f563e9b9 Reviewed-by: Konstantin Ritt --- src/corelib/io/qurlidna.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 7478099e9e6..9bb6b2a42d4 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1468,7 +1468,7 @@ 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(&entry->mapping[0]), l); else From 736a052d93d9c75e51e8f3da733bc8e4a50c39ce Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 18:56:58 -0700 Subject: [PATCH 48/78] QUrl stringprep: fix handling of prohibited characters RFC 3454 says about prohibited characters (section 2, "Preparation Overview"): 3) Prohibit -- Check for any characters that are not allowed in the output. If any are found, return an error. This is described in section 5. In other words, we mustn't simply strip the output of prohibited characters. We must generate an error if they are present. We do that by clearing the data. We already had tests for prohibited output, but they were indistinguishable from being stripped. So instead add some extra characters so that we can tell whether the label was cleared. Change-Id: I2d95217c27be5e2d54deed0036cb009e3b7f4886 Reviewed-by: Konstantin Ritt --- src/corelib/io/qurlidna.cpp | 25 +++++----- .../io/qurlinternal/tst_qurlinternal.cpp | 48 ++++++++----------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 9bb6b2a42d4..fa0a229f4f1 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1502,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(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) { @@ -1538,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) @@ -1562,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) @@ -2084,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/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index fa3dec620a9..d60e1b66477 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; @@ -376,12 +376,12 @@ void tst_QUrlInternal::nameprep_testsuite_data() << QString() << 0 << 0; 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 +391,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 +441,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 +512,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 +543,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; From 53388cd8e0451ea375ed250b59f9e89319fb3e1c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 18:58:11 -0700 Subject: [PATCH 49/78] QUrl stringprep: avoid recalculating the surrogates we already know Change-Id: Icac4e81fff6f7f7fa4f46ec2a08105f8d3d2b403 Reviewed-by: Konstantin Ritt --- src/corelib/io/qurlidna.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index fa0a229f4f1..b41ad9033da 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2066,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]; } } } From 4d93393a6de2d6631979df2bc6d12aa43781dc6f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 19:20:32 -0700 Subject: [PATCH 50/78] QUrl stringprep: fix handling of U+0080: it's prohibited Edge case: a > that should have been >=. Without it, we never ran the rest of the IDN nameprepping. Change-Id: I2276d660de3a70d0c561bb18816820d9a0f47e77 Reviewed-by: Konstantin Ritt --- src/corelib/io/qurlidna.cpp | 2 +- tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index b41ad9033da..5fa4b5f7a15 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2029,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); diff --git a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp index d60e1b66477..20140451718 100644 --- a/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp +++ b/tests/auto/corelib/io/qurlinternal/tst_qurlinternal.cpp @@ -375,6 +375,11 @@ 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("x\xC2\x85x") << QString() From 275c4b8403ddbdcd126cd55dfcc37bd1f5b6d9f7 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 16 May 2013 04:42:39 +1000 Subject: [PATCH 51/78] code cleanup. make one way to access system dbus. remove dead uncommented code Change-Id: Ia53cdc27f354269bb393ac137802b8807652cef9 Reviewed-by: Thiago Macieira --- .../bearer/connman/qconnmanservice_linux.cpp | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp index 4efecc54643..380cf92a247 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 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() { } From 876202ddf29ddeb9fe74063d0590b2865c226cd0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Jun 2013 10:14:26 +0200 Subject: [PATCH 52/78] tst_qjson: Fix MSVC C4293 warning about shift operation. warning C4293: '<<' : shift count negative or too big, undefined behavior. Change-Id: I858dd08f16ea0e00f2384491fc735b7367c6925d Reviewed-by: Lars Knoll --- tests/auto/corelib/json/tst_qtjson.cpp | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index c19a42e4a69..6f5cda5307d 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -252,18 +252,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); @@ -289,18 +289,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, From 274e571be1f5786b4db5de6e22661490f1232dc7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jun 2013 13:51:13 +0200 Subject: [PATCH 53/78] QtCore: Fix MSVC-64 warnings about integer truncation. warning C4267: 'argument' : conversion from 'size_t' to ' int', possible loss of data. Change-Id: I79af7497420d468b5bc7c48c9ae21b86117519a9 Reviewed-by: Mitch Curtis --- src/corelib/kernel/qmetatype.h | 4 ++-- src/corelib/tools/qarraydataops.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index aed998f2e24..7413ef4d890 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -830,8 +830,8 @@ struct QMetaTypeId_ ## SMART_POINTER ## _QObjectStar \ 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 >( \ typeName, \ diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index 3cd8c51c07d..c8a08254808 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! From 3e56b0189558f7768524ca541cbc81a7a72ea79f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jun 2013 13:54:21 +0200 Subject: [PATCH 54/78] tst_qglthreads: Fix warnings about unused variables. Change-Id: I6bc95e8335474753d6506db5e8119710797f4f1b Reviewed-by: Mitch Curtis --- tests/auto/opengl/qglthreads/tst_qglthreads.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index b6b534b1da7..c74edab9a23 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); From 9e069d95f4fc5ae32283a564b4eec12081a68644 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jun 2013 13:56:39 +0200 Subject: [PATCH 55/78] tst_qdom: Fix warning about character conversion, warning C4309: 'argument' : truncation of constant value. Change-Id: I04262dcb71b916abeab27e7b8bc2ca6c875794d2 Reviewed-by: Mitch Curtis --- tests/auto/xml/dom/qdom/tst_qdom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index 6b4bc3cd350..26f49a3fed3 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(" Date: Fri, 7 Jun 2013 13:59:04 +0200 Subject: [PATCH 56/78] tst_qguivariant: Fix warnings about double / float conversion. warning C4305: 'argument' : truncation from 'double ' to 'float' Change-Id: If9bf2f79592d305e767d2a8c38e577c5dff51129 Reviewed-by: Mitch Curtis --- tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 4856f52c55c..75aed3bf8bc 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(variant); QVERIFY(vector.isNull()); - variant.setValue(QVector2D(0.1, 0.2)); - QCOMPARE(QVector2D(0.1, 0.2), qvariant_cast(variant)); + variant.setValue(QVector2D(0.1f, 0.2f)); + QCOMPARE(QVector2D(0.1f, 0.2f), qvariant_cast(variant)); void *pvector = QMetaType::create(QVariant::Vector2D, 0); QVERIFY(pvector); From a730b5fabf3d31e01abb058ed2ffffa3395e4fbf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jun 2013 14:01:10 +0200 Subject: [PATCH 57/78] tst_qmessageauthenticationcode: Fix warning about character conversion. warning C4309: 'argument' : truncation of constant value. Change-Id: I54e9b515d065c1a89bf790fb214c335e852ce5ac Reviewed-by: Mitch Curtis --- .../tst_qmessageauthenticationcode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp b/tests/auto/corelib/tools/qmessageauthenticationcode/tst_qmessageauthenticationcode.cpp index 0e243988e2f..1ac36453497 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"); } From 9e65808acfc82354188a67f23304f1c09074136c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 7 Jun 2013 14:04:53 +0200 Subject: [PATCH 58/78] tst_qfilesystemmodel: Fix warnings about comparing int/bool. warning C4804: '<=' : unsafe use of type 'bool' in operation Remove outer loop and replace ugly ROW_NAME macro by inline function. Change-Id: Id7e4ef047adaf8017b8c21621d19c151993cc6dd Reviewed-by: Mitch Curtis --- .../qfilesystemmodel/tst_qfilesystemmodel.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index e36eaa5af2c..0fe7c8ab755 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("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 From 9095210c0b57f75fe2fecf7289fabbdfdf64e198 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 19:22:28 -0700 Subject: [PATCH 59/78] tst_QUrl: check that prohibited characters in hostnames are not valid qt_nameprep is tested by tst_qurlinternal. We just need to be sure that QUrl handles them correctly. Change-Id: Ic563004870d2cf2fa7a31ce49fff7280d5ffb5f3 Reviewed-by: Konstantin Ritt --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 898aefffd39..2a79a6963e6 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"; From ebea15cb33da8063a630867e38eacf7857b0b936 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Jun 2013 15:52:26 -0700 Subject: [PATCH 60/78] QEventLoop: Remove the test that checked throwing from an event handler In Qt 5, we declared that throwing from event handlers is undefined behavior. So stop testing this. We will try our best to capture and pass along std::bad_alloc, but even that might not work, depending on compiler settings. In particular, after the upgrade to MinGW/GCC 4.8 with DW2, this test stopped working. Task-number: QTBUG-31615 Change-Id: Ibf5fb2ce0c48b983549096bf7aac434b6ed3ac2e Reviewed-by: Lars Knoll --- .../kernel/qeventloop/tst_qeventloop.cpp | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 2250d0bb5ef..25e5f035666 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; From f7dee7383dd30c1abc643386d24c80ef6ec202bc Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 7 Jun 2013 15:12:05 +0200 Subject: [PATCH 61/78] Q_DISABLE_COPY doesn't need a ; at the end Fixes warnings when -Wpedantic is enabled Change-Id: I8fcfbfa9bb3a5ab61c85f8cb74660f6f7e459fc0 Reviewed-by: Gunnar Sletta Reviewed-by: Alejandro Exojo Piqueras Reviewed-by: Giuseppe D'Angelo --- src/corelib/tools/qregularexpression.cpp | 2 +- src/gui/kernel/qopenglcontext_p.h | 2 +- src/gui/kernel/qwindowsysteminterface_p.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index a50c7da6cc5..a2a58f89267 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/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index 8a36df3e7ca..3cbcd1c06db 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 c4968f8ca63..398df0a96f6 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; From e554ab4585e0c674eb9e513eb44a719acace4740 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Thu, 6 Jun 2013 15:40:12 -0300 Subject: [PATCH 62/78] BlackBerry: fix tst_QLocale::emptyCtor() BlackBerry OS does not allow for explicitly controlling the locale through the "LANG" environment variable. Locale is controlled by the underlying PPS Service instead. Change-Id: I22154e39f81a9467ad7fdb90a042396390398b1b Reviewed-by: Konstantin Ritt Reviewed-by: Kevin Krammer Reviewed-by: Friedemann Kleint Reviewed-by: Mehdi Fekari --- .../auto/corelib/tools/qlocale/test/test.pro | 1 + .../corelib/tools/qlocale/tst_qlocale.cpp | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro index 4002a5c5eaf..66a968b7c31 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 0f6015ebdcb..0c4dde4b1a2 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 #endif +#ifdef Q_OS_BLACKBERRY +#include +#include +#include +#include +#include + +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 } From 3ad3939f72c923ab8a4c6fc497292affe6457908 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 4 Jun 2013 14:33:31 -0700 Subject: [PATCH 63/78] Add objcopy to MinGW's mkspec Change-Id: I03442f65e281751c8353eca8b987026e9be2437f Reviewed-by: Oswald Buddenhagen --- mkspecs/win32-g++/qmake.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 9c776e86558..505ef67e539 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -108,4 +108,5 @@ QMAKE_RC = $${CROSS_COMPILE}windres QMAKE_STRIP = $${CROSS_COMPILE}strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy load(qt_config) From bea3ae76693d7f9f61219254a864cb97459b2d01 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 22 Apr 2013 14:22:09 -0700 Subject: [PATCH 64/78] Add QMAKE_NM to the mkspecs We'll use nm to get the listing of symbols in the next commit. The -P option is "portable", which sounds like a good idea. I don't have access to any of the commercial Unix systems, but I do remember them printing a different format than GNU binutils's nm. Change-Id: If6f80624bedaf2b1dabf608e16aa097d9910d739 Reviewed-by: Oswald Buddenhagen --- mkspecs/aix-g++-64/qmake.conf | 1 + mkspecs/aix-g++/qmake.conf | 1 + mkspecs/aix-xlc-64/qmake.conf | 1 + mkspecs/aix-xlc/qmake.conf | 1 + mkspecs/android-g++/qmake.conf | 1 + mkspecs/common/linux-android.conf | 1 + mkspecs/common/linux.conf | 1 + mkspecs/common/mac.conf | 1 + mkspecs/common/nacl/g++-nacl32.conf | 1 + mkspecs/common/nacl/g++-nacl64.conf | 1 + mkspecs/common/qcc-base-qnx-armv7le.conf | 1 + mkspecs/common/qcc-base-qnx-x86.conf | 1 + mkspecs/cygwin-g++/qmake.conf | 1 + mkspecs/darwin-g++/qmake.conf | 1 + mkspecs/devices/common/linux_device_pre.conf | 1 + mkspecs/devices/linux-archos-gen8-g++/qmake.conf | 1 + mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf | 1 + mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf | 1 + mkspecs/devices/linux-beagleboard-g++/qmake.conf | 1 + mkspecs/devices/linux-maemo-n9-g++/qmake.conf | 1 + mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf | 1 + mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf | 1 + mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf | 1 + mkspecs/devices/linux-snowball-g++/qmake.conf | 1 + mkspecs/freebsd-g++/qmake.conf | 1 + mkspecs/freebsd-g++46/qmake.conf | 1 + mkspecs/freebsd-icc/qmake.conf | 1 + mkspecs/hpux-acc-64/qmake.conf | 1 + mkspecs/hpux-acc-o64/qmake.conf | 1 + mkspecs/hpux-acc/qmake.conf | 1 + mkspecs/hpux-g++-64/qmake.conf | 1 + mkspecs/hpux-g++/qmake.conf | 1 + mkspecs/hpuxi-acc-32/qmake.conf | 1 + mkspecs/hpuxi-acc-64/qmake.conf | 1 + mkspecs/hpuxi-g++-64/qmake.conf | 1 + mkspecs/hurd-g++/qmake.conf | 1 + mkspecs/irix-cc-64/qmake.conf | 1 + mkspecs/irix-cc/qmake.conf | 1 + mkspecs/irix-g++-64/qmake.conf | 1 + mkspecs/irix-g++/qmake.conf | 1 + mkspecs/linux-arm-gnueabi-g++/qmake.conf | 1 + mkspecs/linux-icc/qmake.conf | 1 + mkspecs/linux-kcc/qmake.conf | 1 + mkspecs/linux-pgcc/qmake.conf | 1 + mkspecs/lynxos-g++/qmake.conf | 1 + mkspecs/netbsd-g++/qmake.conf | 1 + mkspecs/openbsd-g++/qmake.conf | 1 + mkspecs/sco-cc/qmake.conf | 1 + mkspecs/sco-g++/qmake.conf | 1 + mkspecs/solaris-cc-64/qmake.conf | 1 + mkspecs/solaris-cc/qmake.conf | 1 + mkspecs/solaris-g++-64/qmake.conf | 1 + mkspecs/solaris-g++/qmake.conf | 1 + mkspecs/tru64-cxx/qmake.conf | 1 + mkspecs/tru64-g++/qmake.conf | 1 + mkspecs/unixware-cc/qmake.conf | 1 + mkspecs/unixware-g++/qmake.conf | 1 + mkspecs/unsupported/android-g++/qmake.conf | 1 + mkspecs/unsupported/linux-host-g++/qmake.conf | 1 + mkspecs/unsupported/linux-scratchbox2-g++/qmake.conf | 1 + mkspecs/unsupported/vxworks-ppc-dcc/qmake.conf | 1 + mkspecs/unsupported/vxworks-simpentium-dcc/qmake.conf | 1 + mkspecs/win32-g++/qmake.conf | 1 + 63 files changed, 63 insertions(+) diff --git a/mkspecs/aix-g++-64/qmake.conf b/mkspecs/aix-g++-64/qmake.conf index 25acf04eda5..176c437c459 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 94dbbd12ef9..553d9af5447 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 d4b9718d742..42dbd18b4a9 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 c4efebff24b..d2de649355d 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 5a056b3d006..95fa8a97869 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 363dac3a34f..b90a22ebeff 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 1c46ab7c213..c727bd9aeff 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 cf54f3f5801..341c74657a4 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 7ab48dba3ab..319d3ca4756 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 91ffcc2310d..8a20535775f 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 9bd9e288d38..331a65b2bf6 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 a2803a5c5ac..b49075086d3 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 a8e9d414859..06135beb304 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 21a13a3bb5c..24a6224b7c2 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 6d80fc7e1d1..a4837a435d6 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 a2c831e7fe7..6f2b4736ac4 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 3f884ccb88a..90f0d90a3c2 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 3c8c78e0c78..d734e97e89f 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 54fe994bfa9..0791693bbe2 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 fadeb85e8cd..a9e2376d7c5 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 bca69c39697..bdaaa391e50 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 526716e9915..e3a28fb9c44 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 caf9537f39a..f8ba5937c53 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 f0d77fbb4af..0d3a90d5244 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/freebsd-g++/qmake.conf b/mkspecs/freebsd-g++/qmake.conf index 4e078ce2f29..cb6cd3131cb 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 364dcd62332..8f8e0cd21c3 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 91aeb255207..fb419f7e5b8 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 60c87c29bf3..2156b448fe3 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 c11909fb812..69c3df1375d 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 5d1427c1f38..eaa8888fbef 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 8d598d73880..3e822edbfba 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 2f02e8e904d..866a3416bcb 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 a469b4f34cd..79bf20fbb2a 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 a3b0ad08498..aaec3eab146 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 756d361bb97..8a05a5f6119 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 9a3e83f3730..ef3be3b37b7 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 33514486f93..05c8b6fc84d 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 8073cf40122..72d4e654743 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 845ded9667f..12c224b5c08 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 af5f5fe91d5..2c02165e0d7 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 d402f00d4dc..b2653d8feae 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 4c3bbb5183c..c18623b1293 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 921b4e63904..06efc8c12c8 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 404c1de1e9f..286f937b0e9 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 ab887825d68..a53d6a8ec74 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 ee36b3ac5dc..6c699aac53e 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 f7b19cfe48e..f0773e9d0d7 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 a1ebc5d0338..fab66b42153 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 38ea4f65b7e..ebf60a39547 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 fc761420d37..6e1d35ef437 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 29fbec38c05..23814135b67 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 e0c2f2de9c2..34fd044f3e1 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 9f714ea2d11..ccc178395ba 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 04cbe59b137..a2e01126236 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 a3f08220f6c..dd7eb6c9c38 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 68018213c94..483b8c0bb35 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 28f43143867..feca5a4c9e3 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 71b843af7ee..7ef85d43279 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 710c1876aa0..586854d66c0 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 a300712d331..63f5168951e 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 806484369b7..814b844131e 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 d3491898782..c362d098dbb 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 505ef67e539..d514b6d0d32 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -109,4 +109,5 @@ 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) From 809bd1db8c63d246ac97446b09ac9ccc73be95aa Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Mon, 10 Jun 2013 18:07:04 +0200 Subject: [PATCH 65/78] The SingleClickActivation setting was wired to the wrong platform setting Change-Id: I24dacd6d6cbc22eaf29dc09a6f59bf4ee7d48f37 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index c6edbee67d0..936eb76dad6 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; From 01b6eea4157a7a3d45e55e3ada9786aaaccb99fb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 10 Jun 2013 21:56:30 +0200 Subject: [PATCH 66/78] When the file could not be accessed, we should return 0 for the size Some functions rely on the size to be sure that the file can be read from. Therefore when nativeSize() fails to access the file we should return 0 instead of a random size to prevent these functions from acting as if there is a valid file to read from. Task-number: QTBUG-31571 Change-Id: I589fc199760ba40ef2e63047b2f226cb196f7e56 Reviewed-by: Thiago Macieira Reviewed-by: Janne Anttila --- src/corelib/io/qfsfileengine_win.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index fca1a446cec..2b38019674c 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(); } From 9ddcd900f6616da19bed344583ce08ced46fec36 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Fri, 24 May 2013 17:06:35 +0400 Subject: [PATCH 67/78] Fix leak in QCocoaDrag. Change-Id: I2961d08f95c68446a2893721dc79ba56bf98c0de Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoadrag.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 7dad4271b5c..a37552d8442 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(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; } From 0d7d53fd46e8ab512bed88d0dab114cfada227ce Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2013 15:40:10 +0200 Subject: [PATCH 68/78] Improve error output when platform plugin cannot be loaded Forgetting to deploy the platform plugin, or deploying it to the wrong folder, is a common mistake. The old error message didn't made it however explicit what was happening. Make the log more verbose, and explicitly state that the missing plugin is the reason for termination. Change-Id: I810a0ef8da5f8e898e7e0c6f853972514a05c75d Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 29a7e87d46b..3c3cea29109 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; } From 505a10baf76dc9cc10432d62205dc352bd6cefbe Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 10 Jun 2013 13:54:11 +0200 Subject: [PATCH 69/78] qdoc: qdoc was confused by namespace and module with same name When qdoc searched for QtConncurrent::blockingFilter(), it found the module node for QtConcurrent instead of the namespace. This was because qdoc wasn't given specific enough instructions on how to perform the search. Now it searches for the namespace first, then the C++ class, then the module. Task-number: QTBUG-31535 Change-Id: I4f8aec503903508789738f2a77c76f47a3e80a93 Reviewed-by: Jerome Pasion --- src/tools/qdoc/cppcodeparser.cpp | 49 +++++++++--------------------- src/tools/qdoc/cppcodeparser.h | 1 - src/tools/qdoc/puredocparser.cpp | 4 +-- src/tools/qdoc/qdocdatabase.cpp | 52 ++++++++++++++++++++++++++++++++ src/tools/qdoc/qdocdatabase.h | 6 ++++ src/tools/qdoc/tree.cpp | 12 +++++--- src/tools/qdoc/tree.h | 6 ++-- 7 files changed, 86 insertions(+), 44 deletions(-) diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index 41fe2f775ce..5c25eeedc4c 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 eae5d1e97db..957142712be 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 activeNamespaces_; private: QString sequentialIteratorDefinition; diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp index aba17d79b1d..d11ef3a3c79 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 674917f6dca..7a3df4e4f2f 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 d97fb3809a2..d88160ee56b 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 openNamespaces_; }; QT_END_NAMESPACE diff --git a/src/tools/qdoc/tree.cpp b/src/tools/qdoc/tree.cpp index 1efab11a92b..553c569ae9d 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(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(root()); return static_cast(findNodeRecursive(path, 0, start, Node::Namespace, Node::NoSubType)); diff --git a/src/tools/qdoc/tree.h b/src/tools/qdoc/tree.h index 67cd3a97520..e44b8d7d12d 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, From fabd791bcca92d39d0476a2b1b4c15a58c386329 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 11 Jun 2013 14:17:23 +0200 Subject: [PATCH 70/78] doc: QOpenGLFramebufferObject::bindDefault() was marked internal The \internal was removed. Task-number: QTBUG-31645 Change-Id: I98b57ec3816b6d9c49e3488accb65f147aeb15f1 Reviewed-by: Jerome Pasion --- src/gui/opengl/qopenglframebufferobject.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 8d6b05d0b43..90416db72bc 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. From 0c313b3adb73e7b91d01909e7230913102fac9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 6 Jun 2013 18:14:28 +0200 Subject: [PATCH 71/78] Xcode: Don't set TARGET_BUILD_DIR; that's handled by a copy phase This reverts an earlier change that tried to fix the relationship between Qt's concept of output directories with what Xcode expects, but it broke DESTDIR. The relationship between Qt and Xcode is still a mess, but at least DESTDIR now works. Change-Id: I44f056d48c87359a609e0337da266120ba4eb155 Reviewed-by: Oswald Buddenhagen Reviewed-by: Andy Shaw --- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index a09e10c55eb..9f83d7a898c 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") From 0715dc9ee32054c4a344dc7d8694cf0b8b6cbdbb Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Tue, 11 Jun 2013 23:03:47 +0300 Subject: [PATCH 72/78] Mark the Q_DECLARE_OPAQUE_POINTER macro as introduced in 5.0 Change-Id: Ida52c9f1f72b628d9a7faaf7998798e781b53df2 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetatype.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index b9f7462b128..50f3a1814b2 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() From 0d459619a902e547d8c74745453b3bdb8f67a660 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Jun 2013 15:35:22 +0200 Subject: [PATCH 73/78] QDockWidget: Keep position when undocking. Initialize undockedGeometry to roughly the current position. Task-number: QTBUG-31044 Change-Id: I03cbe280d1215bb58ab721b60e29b45359cde76d Reviewed-by: Andy Shaw --- src/widgets/widgets/qdockwidget.cpp | 3 +++ .../auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index a3c331aa2bf..ae931deb169 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/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp index 6ab7cb4491f..a4ad18c7a68 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()); From 7ae6e48d57f89596ddf40980aeff4ef7340ba689 Mon Sep 17 00:00:00 2001 From: Sebastian Eifert Date: Thu, 30 May 2013 19:13:32 +0200 Subject: [PATCH 74/78] Windows: Prevent spurious leave events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When behind a mouse-event-transparent window, synthesized leave events are emitted, because the transparent window is considered as the window under the mouse, not the Qt window. This change skips transparent windows when searching for the window under the mouse. Task-number: QTBUG-31464 Change-Id: I85c8b46a1af37b4d1c5d1d77566ab045657aa9ae Reviewed-by: Björn Breitmeyer Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qplatformfunctions_wince.h | 1 + src/plugins/platforms/windows/qwindowsmousehandler.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qplatformfunctions_wince.h b/src/plugins/platforms/windows/qplatformfunctions_wince.h index 3190e39ec5b..30fc66563eb 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/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 5c096b7ecad..c6cfa4dbbc6 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 From 49bee21d576df63c679584bb3665cc86cdaa1d01 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 11:18:09 +0200 Subject: [PATCH 75/78] don't make qconfig.h read-only not much point in it, really. Change-Id: If984aa137993ae6b95cb3591fceac729ae3aa819 Reviewed-by: Joerg Bornemann --- configure | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure b/configure index d7c96749f4e..a5831efb50a 100755 --- a/configure +++ b/configure @@ -6421,9 +6421,7 @@ 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" + mv -f "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h" fi # create a forwarding header From f5a5272bc7ac5a4c3fa690d0b49be87278e5a946 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 17 May 2013 19:54:59 +0200 Subject: [PATCH 76/78] remove unused symlinkFile() function Change-Id: Ie235fe65020ed7c4870d9c8784a181bf880b9e28 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 497e8deb2c4..47288ff844d 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -507,36 +507,6 @@ sub copyFile return 0; } -###################################################################### -# 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 From ad52be1acc2aba3c856d007567161e04377a0b7f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 20:13:25 +0200 Subject: [PATCH 77/78] purge dead uic class map code. Change-Id: I9b67924a66c847cd4cf2ce9f2996017ae7eb61a4 Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 47288ff844d..255503c1275 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; @@ -756,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; @@ -1122,25 +1120,6 @@ foreach my $lib (@modules_to_sync) { writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file"); } } -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 = ; - 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, "", $verbose_level); - open CLASS_LIB_MAP, ">$class_lib_map"; - print CLASS_LIB_MAP $class_lib_map_contents; - close CLASS_LIB_MAP; - } -} if($check_includes) { foreach my $lib (@modules_to_sync) { From af2f1e14f61ee8d3a4ade723aed9618d1707f975 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 May 2013 20:29:47 +0200 Subject: [PATCH 78/78] don't touch deprecated headers unless they actually change Change-Id: Iabeec90c2a6549cf92b3b8369a41764a576fd0aa Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 255503c1275..d1424f0c325 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -1045,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) . " ";