diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:40:38 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:40:38 +0100 |
commit | 79be8352ced650e98ab0afe89e91cffee4f6a04a (patch) | |
tree | 9dc5d3c5bb3c68c51fd218c50f3ffe0b153af2d3 | |
parent | df63b731c920cf235cf2197e22a04597bf784d10 (diff) | |
parent | 215f137e29ad9176fa1a5d4c446115379f5dbc0d (diff) | |
download | qtbase-79be8352ced650e98ab0afe89e91cffee4f6a04a.tar.gz |
Merge v5.1.0 release
160 files changed, 1361 insertions, 924 deletions
diff --git a/LICENSE.PREVIEW.COMMERCIAL b/LICENSE.PREVIEW.COMMERCIAL index e90ad1acb5..15e61fc19e 100644 --- a/LICENSE.PREVIEW.COMMERCIAL +++ b/LICENSE.PREVIEW.COMMERCIAL @@ -14,8 +14,8 @@ TECHNOLOGY PREVIEW LICENSE AGREEMENT: The Americas Agreement version 2.4 This Technology Preview License Agreement ("Agreement")is a legal agreement -between Digia USA, Inc. ("Digia"), with its registered office at 32 W. -Loockerman Street, Suite 201, City of Dover, County of Kent, Delaware 19904, +between Digia USA, Inc. ("Digia"), with its registered office at 2350 +Mission College Blvd., Suite 1020, Santa Clara, California 95054, U.S.A. and you (either an individual or a legal entity) ("Licensee") for the Licensed Software (as defined below). diff --git a/bin/syncqt.pl b/bin/syncqt.pl index ce07af4895..cc91a11de0 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -172,6 +172,30 @@ sub checkRelative { } ###################################################################### +# Syntax: shouldMasterInclude(iheader) +# Params: iheader, string, filename to verify inclusion +# +# Purpose: Determines if header should be in the master include file. +# Returns: 0 if file contains "#pragma qt_no_master_include" or not +# able to open, else 1. +###################################################################### +sub shouldMasterInclude { + my ($iheader) = @_; + return 0 if (basename($iheader) =~ /_/); + return 0 if (basename($iheader) =~ /qconfig/); + if (open(F, "<$iheader")) { + while (<F>) { + chomp; + return 0 if (/^\#pragma qt_no_master_include$/); + } + close(F); + } else { + return 0; + } + return 1; +} + +###################################################################### # Syntax: classNames(iheader) # Params: iheader, string, filename to parse for classname "symlinks" # @@ -383,6 +407,32 @@ sub fileContents { } ###################################################################### +# Syntax: writeFile(filename, contents) +# Params: filename, string, filename of file to write +# contents, string, new contents for the file +# +# Purpose: Write file with given contents. If new contents match old +# ones, do no change the file's timestamp. +# Returns: 1 if the file's contents changed. +###################################################################### +sub writeFile { + my ($filename, $contents, $lib, $what) = @_; + my $oldcontents = fileContents($filename); + $oldcontents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms + if ($oldcontents ne $contents) { + open(O, "> " . $filename) || die "Could not open $filename for writing: $!\n"; + print O $contents; + close O; + if ($lib && $verbose_level) { + my $action = ($oldcontents eq "") ? "created" : "updated"; + print "$lib: $action $what\n"; + } + return 1; + } + return 0; +} + +###################################################################### # Syntax: fileCompare(file1, file2) # Params: file1, string, filename of first file # file2, string, filename of second file @@ -787,7 +837,9 @@ foreach my $lib (@modules_to_sync) { die "No such module: $lib" unless(defined $modules{$lib}); #iteration info - my @dirs = split(/;/, $modules{$lib}); + my $module = $modules{$lib}; + my $is_qt = !($module =~ s/^!//); + my @dirs = split(/;/, $module); my $dir = $dirs[0]; my $pathtoheaders = ""; @@ -802,6 +854,12 @@ foreach my $lib (@modules_to_sync) { my $pri_install_pfiles = ""; my $pri_install_qpafiles = ""; + my $libcapitals = uc($lib); + my $master_contents = + "#ifndef QT_".$libcapitals."_MODULE_H\n" . + "#define QT_".$libcapitals."_MODULE_H\n" . + "#include <$lib/${lib}Depends>\n"; + #remove the old files if($remove_stale) { my %injections = (); @@ -867,15 +925,8 @@ foreach my $lib (@modules_to_sync) { #calc files and "copy" them foreach my $subdir (@subdirs) { my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0); - if (defined $inject_headers{$subdir}) { - foreach my $if (@{$inject_headers{$subdir}}) { - @headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously - push @headers, "*".$if; - } - } my $header_dirname = ""; foreach my $header (@headers) { - my $shadow = ($header =~ s/^\*//); $header = 0 if($header =~ /^ui_.*.h/); foreach (@ignore_headers) { $header = 0 if($header eq $_); @@ -897,8 +948,7 @@ 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) : (); + my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : (); if($showonly) { print "$header [$lib]\n"; foreach(@classes) { @@ -938,10 +988,13 @@ foreach my $lib (@modules_to_sync) { } foreach(@headers) { #sync them - $header_copies++ if(syncHeader($lib, $_, $iheader, $copy_headers && !$shadow, $ts)); + $header_copies++ if (syncHeader($lib, $_, $iheader, $copy_headers, $ts)); } if($public_header) { + #put it into the master file + $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); + #deal with the install directives if($public_header) { my $pri_install_iheader = fixPaths($iheader, $dir); @@ -1000,7 +1053,12 @@ foreach my $lib (@modules_to_sync) { } } - unless ($showonly || $minimal) { + # close the master include: + $master_contents .= + "#include \"".lc($lib)."version.h\"\n" . + "#endif\n"; + + unless ($showonly || $minimal || !$is_qt) { # create deprecated headers my $first = 1; while (my ($header, $include) = each %{$deprecatedheaders{$lib}}) { @@ -1068,7 +1126,26 @@ foreach my $lib (@modules_to_sync) { syncHeader($lib, $VHeader, $vheader, 0); $pri_install_files .= fixPaths($vheader, $dir) . " "; $pri_install_classes .= fixPaths($VHeader, $dir) . " "; + my @versions = split(/\./, $module_version); + my $modulehexstring = sprintf("0x%02X%02X%02X", $versions[0], $versions[1], $versions[2]); + my $vhdrcont = + "/* This file was generated by syncqt. */\n". + "#ifndef QT_".uc($lib)."_VERSION_H\n". + "#define QT_".uc($lib)."_VERSION_H\n". + "\n". + "#define ".uc($lib)."_VERSION_STR \"".$module_version."\"\n". + "\n". + "#define ".uc($lib)."_VERSION ".$modulehexstring."\n". + "\n". + "#endif // QT_".uc($lib)."_VERSION_H\n"; + writeFile($vheader, $vhdrcont, $lib, "version header"); + + my $master_include = "$out_basedir/include/$lib/$lib"; + $pri_install_files .= fixPaths($master_include, $dir) . " "; + writeFile($master_include, $master_contents, $lib, "master header"); + } + unless ($showonly || $minimal) { #handle the headers.pri for each module my $headers_pri_contents = ""; $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; @@ -1076,23 +1153,7 @@ foreach my $lib (@modules_to_sync) { $headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n"; $headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n"; my $headers_pri_file = "$out_basedir/include/$lib/headers.pri"; - if(-e $headers_pri_file) { - open HEADERS_PRI_FILE, "<$headers_pri_file"; - local $/; - binmode HEADERS_PRI_FILE; - my $old_headers_pri_contents = <HEADERS_PRI_FILE>; - close HEADERS_PRI_FILE; - $old_headers_pri_contents =~ s/\r//g; # remove \r's , so comparison is ok on all platforms - $headers_pri_file = 0 if($old_headers_pri_contents eq $headers_pri_contents); - } - if($headers_pri_file) { - my $headers_pri_dir = dirname($headers_pri_file); - make_path($headers_pri_dir, $lib, $verbose_level); - open HEADERS_PRI_FILE, ">$headers_pri_file"; - print HEADERS_PRI_FILE $headers_pri_contents; - close HEADERS_PRI_FILE; - print "$lib: created headers.pri file\n" if($verbose_level); - } + writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file"); } } unless($showonly || !$create_uic_class_map) { @@ -1117,6 +1178,7 @@ unless($showonly || !$create_uic_class_map) { if($check_includes) { foreach my $lib (@modules_to_sync) { + next if ($modules{$lib} =~ /^!/); #calc subdirs my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib})); @@ -2344,12 +2344,6 @@ for e in gawk nawk awk; do fi done -# find perl -PERL="/usr/bin/perl" -if "$WHICH" perl >/dev/null 2>&1 && ( perl /dev/null ) >/dev/null 2>&1; then - PERL=`$WHICH perl` -fi - ### skip this if the user just needs help... if [ "$OPT_HELP" != "yes" ]; then @@ -2395,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 @@ -3901,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 @@ -4034,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" @@ -6425,9 +6424,23 @@ 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 +mkdir -p "$outpath/include/QtCore" || exit +echo '#include "../../src/corelib/global/qconfig.h"' > $outpath/include/QtCore/qconfig.h.new +if cmp -s "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h"; then + rm -f "$outpath/include/QtCore/qconfig.h.new" +else + mv "$outpath/include/QtCore/qconfig.h.new" "$outpath/include/QtCore/qconfig.h" || exit +fi + +# create a camelcase forwarding header +echo '#include "qconfig.h"' > $outpath/include/QtCore/QtConfig.new +if cmp -s "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig"; then + rm -f "$outpath/include/QtCore/QtConfig.new" +else + mv "$outpath/include/QtCore/QtConfig.new" "$outpath/include/QtCore/QtConfig" || exit fi #------------------------------------------------------------------------------- diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0 index cb96c2debe..bc0db0b9c8 100644 --- a/dist/changes-5.1.0 +++ b/dist/changes-5.1.0 @@ -88,7 +88,16 @@ QtGui QtNetwork --------- - - + - QNetworkAccessManager / QNetworkReply: + * Add a new encrypted() signal so that applications can perform + additional checks on the certificate chain. + - QSslSocket: + * Support for sending intermediate certificates when QSslSocket is used + as a server, and when using client certificates. + - HTTPS internals: + * SSL sessions are re-used by default. + - QHostInfo: + * Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache. QtWidgets --------- diff --git a/doc/global/externalsites/qt-webpages.qdoc b/doc/global/externalsites/qt-webpages.qdoc index f7bb9b1b89..1bb6228ed1 100644 --- a/doc/global/externalsites/qt-webpages.qdoc +++ b/doc/global/externalsites/qt-webpages.qdoc @@ -33,7 +33,7 @@ \title Qt Bug Tracker */ /*! - \externalpage http://qt.digia.com/downloads + \externalpage http://qt-project.org/downloads \title Downloads */ /*! diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index d4b2f9f066..a86f3a14e4 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -32,11 +32,10 @@ # manifestmeta.global.names = * # manifestmeta.global.tags = qt5 -manifestmeta.filters = highlighted webkit1 webkit2 +manifestmeta.filters = highlighted webkit1 webkit2 android manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ - "QtQuick/Qt Quick Demo - Tweet Search" \ "QtQuick/Qt Quick Demo - Maroon*" \ "QtQuick/Qt Quick Demo - Calqlatr" \ "QtQuick/Qt Quick Particles Examples - Emitters" \ @@ -70,3 +69,102 @@ manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \ "QtWebKitExamples/YouTube View Example" manifestmeta.webkit2.tags = webkit2 + +manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \ + "QtQuick/Qt Quick Demo - Calqlatr" \ + "QtWidgets/Application Chooser Example" \ + "QtWidgets/Stickman Example" \ + "QtWidgets/Move Blocks Example" \ + "QtWidgets/Border Layout Example" \ + "QtWidgets/Dynamic Layouts Example" \ + "QtWidgets/Flow Layout Example" \ + "QtWidgets/MDI Example" \ + "QtWidgets/Dock Widgets Example" \ + "QtWidgets/Recent Files Example" \ + "QtWidgets/Menus Example" \ + "QtWidgets/Concentric Circles Example" \ + "QtWidgets/Gradients" \ + "QtWidgets/Font Sampler Example" \ + "QtWidgets/Path Stroking" \ + "QtWidgets/Transformations Example" \ + "QtWidgets/Syntax Highlighter Example" \ + "QtWidgets/Calendar Example" \ + "QtWidgets/Movie Example" \ + "QtWidgets/Validators Example" \ + "QtWidgets/Analog Clock Example" \ + "QtWidgets/Calculator Example" \ + "QtWidgets/Mouse Button Tester" \ + "QtWidgets/Character Map Example" \ + "QtWidgets/Wiggly Example" \ + "QtWidgets/Digital Clock Example" \ + "QtWidgets/Elided Label Example" \ + "QtWidgets/Image Viewer Example" \ + "QtWidgets/Sliders Example" \ + "QtWidgets/Tetrix Example" \ + "QtWidgets/Group Box Example" \ + "QtWidgets/Spin Boxes Example" \ + "QtWidgets/Undo Framework" \ + "QtWidgets/Regular Expressions Example" \ + "QtWidgets/Colliding Mice Example" \ + "QtWidgets/Basic Graphics Layouts Example" \ + "QtWidgets/Boxes" \ + "QtWidgets/40000 Chips" \ + "QtWidgets/Diagram Scene Example" \ + "QtWidgets/Drag and Drop Robot Example" \ + "QtWidgets/Elastic Nodes Example" \ + "QtWidgets/Pad Navigator Example" \ + "QtWidgets/Anchor Layout Example" \ + "QtWidgets/Weather Anchor Layout Example" \ + "QtConcurrent/Image Scaling Example" \ + "QtConcurrent/QtConcurrent Progress Dialog Example" \ + "QtNetwork/Torrent Example" \ + "QtNetwork/Network Chat Example" \ + "QtSQL/Master Detail Example" \ + "QtOpenGL/Cube OpenGL ES 2.0 example" \ + "QtOpenGL/Textures Example" \ + "QtLinguist/Arrow Pad Example" \ + "QtGui/Raster Window Example" \ + "QtGui/Analog Clock Window Example" \ + "QtMultimedia/Video Widget Example" \ + "QtMultimedia/Media Player Example" \ + "QtSVG/Text Object Example" \ + "QtQML/Qt Quick Examples - XMLHttpRequest" \ + "QtQuick/Qt Quick Particles Examples - *" \ + "QtQuick/Qt Quick Examples - Touch Interaction" \ + "QtQuick/Scene Graph - *" \ + "QtQuick/Qt Quick Examples - Image Elements" \ + "QtQuick/Qt Quick Examples - Key Interaction" \ + "QtQuick/Qt Quick Examples - Text" \ + "QtQuick/Qt Quick Examples - Animation" \ + "QtQuick/Qt Quick Examples - Shader Effects" \ + "QtQuick/Qt Quick Examples - Canvas" \ + "QtWidgets/Interview" \ + "QtWidgets/Spreadsheet" \ + "QtWidgets/Pixelator Example" \ + "QtWidgets/Class Wizard Example" \ + "QtWidgets/Animated Tiles Example" \ + "QtWidgets/Basic Layouts Example" \ + "QtWidgets/Application Example" \ + "QtWidgets/Affine Transformations" \ + "QtWidgets/Image Composition Example" \ + "QtWidgets/Basic Drawing Example" \ + "QtWidgets/Vector Deformation" \ + "QtWidgets/Painter Paths Example" \ + "QtWidgets/Text Edit" \ + "QtWidgets/Style Sheet Example" \ + "QtWidgets/Code Editor Example" \ + "QtWidgets/Window Flags Example" \ + "QtWidgets/Scribble Example" \ + "QtWidgets/Shaped Clock Example" \ + "QtWidgets/Line Edits Example" \ + "QtWidgets/Calendar Widget Example" \ + "QtWidgets/Completer Example" \ + "QtWidgets/I18N Example" \ + "QtQML/Extending QML - Grouped Properties Example" \ + "QtQML/Extending QML - Methods Example" \ + "QtQML/Extending QML - Signal Support Example" \ + "QtQML/Extending QML - Attached Properties Example" \ + "QtQuick/Qt Quick Examples - Window and Screen" \ + "QtWidgets/Address Book Example" + +manifestmeta.android.tags = android diff --git a/examples/widgets/doc/src/dirview.qdoc b/examples/widgets/doc/src/dirview.qdoc index b9698ea498..7687737cef 100644 --- a/examples/widgets/doc/src/dirview.qdoc +++ b/examples/widgets/doc/src/dirview.qdoc @@ -32,7 +32,7 @@ \brief This example demonstrates the usage of a tree view. \brief The Dir View example shows a tree view onto the local filing system. It uses the - QDirModel class to provide file and directory information. + QFileSystemModel class to provide file and directory information. \image dirview-example.png */ diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index 08295da75f..2dc72a7a2f 100644 --- a/mkspecs/features/cmake_functions.prf +++ b/mkspecs/features/cmake_functions.prf @@ -45,7 +45,7 @@ defineReplace(cmakePortablePaths) { variable = $$1 out = for(v, variable) { - out += ${CMAKE_FIND_ROOT_PATH}$$cmakeTargetPath($$v) + out += $$[QT_SYSROOT]$$cmakeTargetPath($$v) } return ($$join(out, ";")) } @@ -54,7 +54,7 @@ defineReplace(cmakeProcessLibs) { variable = $$1 out = for(v, variable) { - if(!equals(v, -framework)) { + if(!equals(v, -framework):!contains(v, -L.*)) { v ~= s,^-l,, v ~= s,^-lib,, v ~= s,.lib$,, diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 3dae3895de..7a200056ae 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -60,6 +60,17 @@ contains(CMAKE_BIN_DIR, "^\\.\\./.*") { CMAKE_BIN_DIR_IS_ABSOLUTE = True } +!isEmpty(DLLDESTDIR):!static:!staticlib { + CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX]) + contains(CMAKE_DLL_DIR, "^\\.\\./.*") { + CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/ + CMAKE_DLL_DIR_IS_ABSOLUTE = True + } +} else { + CMAKE_DLL_DIR = $$CMAKE_LIB_DIR + CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE +} + CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX]) contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") { CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA]/ diff --git a/mkspecs/features/data/android/dx.bat b/mkspecs/features/data/android/dx.bat index af143c52b5..c4ad0e3ebc 100644 --- a/mkspecs/features/data/android/dx.bat +++ b/mkspecs/features/data/android/dx.bat @@ -46,6 +46,12 @@ if exist "%frameworkdir%\%jarfile%" goto JarFileOk if exist "%frameworkdir%\%jarfile%" goto JarFileOk set "frameworkdir=%androidsdk%\framework" +if exist "%frameworkdir%\%jarfile%" goto JarFileOk + set "frameworkdir=%androidsdk%\build-tools\%ANDROID_BUILD_TOOLS_REVISION%\lib" + +if exist "%frameworkdir%\%jarfile%" goto JarFileOk + set "frameworkdir=%androidsdk%\build-tools\17.0.0\lib" + :JarFileOk set jarpath=%frameworkdir%\%jarfile% diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index f6fd61602f..1a2bd4a94d 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -46,10 +46,10 @@ endmacro() macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\") +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ELSE - set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\") + set(imported_location \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location}) set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES @@ -104,7 +104,11 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) !!ENDIF - foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS} ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS}) + foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS} +!!IF isEmpty(CMAKE_BUILD_IS_FRAMEWORK) + ${Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS} +!!ENDIF + ) _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${_dir}) endforeach() @@ -183,22 +187,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) !!IF isEmpty(CMAKE_DEBUG_TYPE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ELSE - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD -!!ELSE -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE + _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) +!!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" !!ELSE - if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" !!ENDIF -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" ) + AND EXISTS +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) +!!ENDIF _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" ) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() @@ -216,22 +224,26 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD) !!IF isEmpty(CMAKE_RELEASE_TYPE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ELSE - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD -!!ELSE -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) +!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) +!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE + _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) +!!ELSE // CMAKE_STATIC_WINDOWS_BUILD + if (EXISTS +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" !!ELSE - if (EXISTS \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" AND EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) -!!ENDIF // CMAKE_STATIC_WINDOWS_BUILD + \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" !!ENDIF -!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD) - _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" ) + AND EXISTS +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ELSE + \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) +!!ENDIF _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" ) !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD endif() diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 7360103757..411a839ad8 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -62,8 +62,8 @@ android:!bundled_jar_file { } else { DEX_CMD = $$SDK_ROOT/platform-tools/dx !exists($$DEX_CMD): DEX_CMD = $$SDK_ROOT/build-tools/$$BUILD_TOOLS_REVISION/dx + !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") } - !exists($$DEX_CMD): error("The path $$DEX_CMD does not exist. Please set the environment variable ANDROID_BUILD_TOOLS_REVISION to the revision of the build tools installed in your Android SDK.") QMAKE_LINK_SHLIB_CMD = $$DEX_CMD --dex --output $(TARGET) $$CLASS_DIR } else { QMAKE_LINK_SHLIB_CMD = jar cf $(TARGET) -C $$CLASS_DIR . diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 0538a81771..b183814e63 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,12 +1,12 @@ load(default_post) !no_objective_c:CONFIG += objective_c -# Pick a suitable default architecture for qmake-based applications. -# If the Qt package contains one of x86 and x86_64, pick that one. If it -# contains both then use the compiler default. Make a similiar decision for -# PowerPC-based systems. Note that this logic assumes that Qt has been -# configured with an architecture that is usable on the system. qt:!isEmpty(QT_CONFIG) { + # Pick a suitable default architecture for qmake-based applications. + # If the Qt package contains one of x86 and x86_64, pick that one. If it + # contains both then use the compiler default. Make a similar decision for + # PowerPC-based systems. Note that this logic assumes that Qt has been + # configured with an architecture that is usable on the system. contains(QMAKE_HOST.arch, ppc)|contains(QMAKE_HOST.arch, "Power Macintosh") { !contains(QT_CONFIG, ppc64):contains(QT_CONFIG, ppc):CONFIG += ppc contains(QT_CONFIG, ppc64):!contains(QT_CONFIG, ppc):CONFIG += ppc64 @@ -14,6 +14,9 @@ qt:!isEmpty(QT_CONFIG) { !contains(QT_CONFIG, x86_64):contains(QT_CONFIG, x86):CONFIG += x86 contains(QT_CONFIG, x86_64):!contains(QT_CONFIG, x86):CONFIG += x86_64 } + + # Ensure that C++11 is always used when linking against a static Qt build + contains(QT_CONFIG, static):contains(QT_CONFIG, c++11): CONFIG += c++11 } isEmpty(_QMAKE_CACHE_) { diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf index 70c3bd6b66..28fbb392a7 100644 --- a/mkspecs/features/qml_plugin.prf +++ b/mkspecs/features/qml_plugin.prf @@ -86,7 +86,7 @@ load(qt_common) qtAddToolEnv(QMLPLUGINDUMP, importpath) TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) qmltypes.target = qmltypes - qmltypes.commands = $$QMLPLUGINDUMP $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE + qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE qmltypes.depends = $$QMAKE_RESOLVED_TARGET } else { qmltypes.CONFIG += recursive diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf index c258d55687..96337da9de 100644 --- a/mkspecs/features/qt_android_deps.prf +++ b/mkspecs/features/qt_android_deps.prf @@ -13,7 +13,7 @@ # of the module on JNI-based libraries etc. Used for deployment of an Android # app. -ANDROID_DEPENDS_DIR = $$MODULE_QMAKE_OUTDIR/lib/ +ANDROID_DEPENDS_DIR = $$MODULE_BASE_OUTDIR/lib/ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml !build_pass { diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 03b43e3153..9163ac30b2 100644 --- a/mkspecs/features/qt_build_paths.prf +++ b/mkspecs/features/qt_build_paths.prf @@ -11,11 +11,15 @@ # Find the module's source root dir. isEmpty(_QMAKE_CONF_): error("Project has no top-level .qmake.conf file.") -MODULE_PROFILE_DIR = $$dirname(_QMAKE_CONF_) -isEmpty(MODULE_BASE_DIR): MODULE_BASE_DIR = $$MODULE_PROFILE_DIR -isEmpty(MODULE_BASE_OUTDIR): MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_DIR) +MODULE_BASE_INDIR = $$dirname(_QMAKE_CONF_) +MODULE_BASE_OUTDIR = $$shadowed($$MODULE_BASE_INDIR) +!isEmpty(MODULE_BASE_DIR): MODULE_SYNCQT_DIR = $$MODULE_BASE_DIR # compat for webkit +isEmpty(MODULE_SYNCQT_DIR): MODULE_SYNCQT_DIR = $$MODULE_BASE_INDIR isEmpty(MODULE_QMAKE_OUTDIR): MODULE_QMAKE_OUTDIR = $$MODULE_BASE_OUTDIR +exists($$MODULE_BASE_INDIR/.git): \ + CONFIG += git_build + !prefix_build { QTDIR = $$[QT_HOST_PREFIX] # Permit modules to enforce being built outside QTDIR ... diff --git a/mkspecs/features/qt_config.prf b/mkspecs/features/qt_config.prf index 77d2c0ffc7..cbbd136270 100644 --- a/mkspecs/features/qt_config.prf +++ b/mkspecs/features/qt_config.prf @@ -15,9 +15,9 @@ QMAKE_QT_CONFIG = $$[QT_HOST_DATA/get]/mkspecs/qconfig.pri for(dir, QMAKE_MODULE_PATH) { debug(1, "Loading modules from $${dir}") for(mod, $$list($$files($$dir/qt_*.pri))) { - # For installed Qt these paths will be common for all modules - # For development these will vary per module, and syncqt will override the value in the - # qt_<module>.pri forwarding file + # For installed Qt these paths will be common for all modules. + # For uninstalled prefix builds these will vary per module, via the + # forwarding module pri files. Keep qt_module_pris.prf in sync with this! QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS] QT_MODULE_LIB_BASE = $$[QT_INSTALL_LIBS] QT_MODULE_HOST_LIB_BASE = $$[QT_HOST_LIBS] diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 9ec22d57db..bbbb5d36a3 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -75,17 +75,17 @@ defineTest(qtAddModule) { } unset(LINKAGE) - mac { - contains(MODULE_CONFIG, lib_bundle) { + mac:contains(MODULE_CONFIG, lib_bundle) { FRAMEWORK_INCLUDE = $${MODULE_LIBS}/$${MODULE_NAME}.framework/Headers !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { INCLUDEPATH *= $$FRAMEWORK_INCLUDE - LINKAGE = -F$${MODULE_LIBS} - } else { - QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} } + auto_use_privates|isEqual(2, UsePrivate): \ + INCLUDEPATH += \ + $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \ + $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME + QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} - } } # Re-insert the major version in the library name (cf qtLibraryTarget above) @@ -189,9 +189,9 @@ defineTest(qtAddRpathLink) { export(QMAKE_RPATHLINKDIR) } -# variable, default +# variable, default, [suffix for variable for system() use] defineTest(qtPrepareTool) { - $$1 = $$eval(QT_TOOL.$${2}.command) + $$1 = $$eval(QT_TOOL.$${2}.binary) isEmpty($$1) { $$1 = $$[QT_HOST_BINS]/$$2 exists($$eval($$1).pl) { @@ -204,17 +204,26 @@ defineTest(qtPrepareTool) { $$1 = $$BUNDLENAME } } - $$1 = $$shell_path($$eval($$1)) } - export($$1) + !isEmpty(3) { + $$1$$3 = $$system_path($$eval($$1)) + qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system) + } + $$1 = $$shell_path($$eval($$1)) + qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, ) } +# target variable, list of env var names, [non-empty: prepare for system(), not make] defineTest(qtAddToolEnv) { + isEmpty(3): \ + ds = $$QMAKE_DIR_SEP + else: \ + ds = $$DIR_SEPARATOR for(env, 2) { value = $$eval($${env}.value) !isEmpty(value) { name = $$eval($${env}.name) - equals(QMAKE_DIR_SEP, /) { + equals(ds, /) { contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name} else: infix = val = "$$name=$$join(value, :)$$infix" @@ -224,20 +233,27 @@ defineTest(qtAddToolEnv) { else: infix = val = "(set $$name=$$join(value, ;)$$infix) &" } - contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g - else: val ~= s,\\\$,\$\$,g + isEmpty(3): !contains(TEMPLATE, vc.*) { + contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g + val ~= s,\\\$,\$\$,g + } $$1 = "$$val $$eval($$1)" } } export($$1) } +# target variable, dependency var name, [non-empty: prepare for system(), not make] defineTest(qtAddTargetEnv) { - deps = $$replace(QT, -private$, ) + deps = $$replace($$2, -private$, ) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { - for(dep, deps): \ - deppath += $$shell_path($$eval(QT.$${dep}.libs)) + for(dep, deps) { + isEmpty(3): \ + deppath += $$shell_path($$eval(QT.$${dep}.libs)) + else: \ + deppath += $$system_path($$eval(QT.$${dep}.libs)) + } equals(QMAKE_HOST.os, Windows) { deppath.name = PATH } else:contains(QMAKE_HOST.os, Linux|FreeBSD) { @@ -256,13 +272,18 @@ defineTest(qtAddTargetEnv) { pluginpath.value = for(qmod, QMAKEMODULES) { qmod = $$section(qmod, /, 0, -3)/plugins - exists($$qmod): pluginpath.value += $$shell_path($$qmod) + exists($$qmod) { + isEmpty(3): \ + pluginpath.value += $$shell_path($$qmod) + else: \ + pluginpath.value += $$system_path($$qmod) + } } pluginpath.name = QT_PLUGIN_PATH QT_TOOL_ENV += deppath pluginpath } - qtAddToolEnv($$1, $$QT_TOOL_ENV) + qtAddToolEnv($$1, $$QT_TOOL_ENV, $$3) } defineReplace(pkgConfigExecutable) { diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index 429e00bed9..53a5499545 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -90,15 +90,16 @@ else: \ #mac frameworks mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) { #QMAKE_FRAMEWORK_VERSION = 4.0 - CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework - CONFIG(release, debug|release) { - !debug_and_release|build_pass { - CONFIG -= qt_install_headers #no need to install these as well - FRAMEWORK_HEADERS.version = Versions - FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - FRAMEWORK_HEADERS.path = Headers - } - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS + CONFIG += lib_bundle qt_framework + !debug_and_release|if(build_all:CONFIG(release, debug|release)) { + FRAMEWORK_HEADERS.version = Versions + FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES + FRAMEWORK_HEADERS.path = Headers + FRAMEWORK_PRIVATE_HEADERS.files = $$SYNCQT.PRIVATE_HEADER_FILES + FRAMEWORK_PRIVATE_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/private + FRAMEWORK_QPA_HEADERS.files = $$SYNCQT.QPA_HEADER_FILES + FRAMEWORK_QPA_HEADERS.path = Headers/$$VERSION/$$MODULE_INCNAME/qpa + QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS FRAMEWORK_PRIVATE_HEADERS FRAMEWORK_QPA_HEADERS } } diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 298ca102bc..ca26eb674b 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 @@ -21,7 +21,7 @@ load(qt_build_paths) QMAKE_SYNCQT += -module $$MODULE_INCNAME -version $$VERSION } QMAKE_SYNCQT += \ - -outdir $$MODULE_BASE_OUTDIR $$MODULE_BASE_DIR + -outdir $$MODULE_BASE_OUTDIR $$MODULE_SYNCQT_DIR !silent: message($$QMAKE_SYNCQT) system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT") } @@ -29,66 +29,25 @@ load(qt_build_paths) minimal_syncqt: return() #load up the headers info -include($$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/headers.pri, "", true) - -lctarget = $$lower($$MODULE_INCNAME) -uctarget = $$upper($$MODULE_INCNAME) - -defineTest(shouldMasterInclude) { - bn = $$basename(1) - contains(bn, .*_.*):return(false) - contains(bn, ^qconfig.*):return(false) - lines = $$cat($$_PRO_FILE_PWD_/$$1, lines) - contains(lines, $${LITERAL_HASH}pragma qt_no_master_include):return(false) - return(true) -} +git_build: \ + INC_PATH = $$MODULE_BASE_OUTDIR +else: \ + INC_PATH = $$MODULE_BASE_INDIR +include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true) autogen_warning = \ - "/* This file was generated by qmake with the info from <root>/$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" - -# Create module version header -MODULE_VERSION_HEADER = $$find(SYNCQT.HEADER_FILES, (^|/)$${lctarget}version\\.h$) -count(MODULE_VERSION_HEADER, 1) { - MODULE_VERSION_HEADER = $$absolute_path($$MODULE_VERSION_HEADER, $$_PRO_FILE_PWD_) - - !build_pass { - majorhexstr = $$format_number($$section(VERSION, ., 0, 0), width=2 zeropad obase=16) - minorhexstr = $$format_number($$section(VERSION, ., 1, 1), width=2 zeropad obase=16) - patchhexstr = $$format_number($$section(VERSION, ., 2, 2), width=2 zeropad obase=16) - modulehexstring = 0x$${majorhexstr}$${minorhexstr}$${patchhexstr} - MODULE_VERSION_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${uctarget}_VERSION_H" \ - "$${LITERAL_HASH}define QT_$${uctarget}_VERSION_H" \ - "" \ - "$${LITERAL_HASH}define $${uctarget}_VERSION_STR \"$$VERSION\"" \ - "" \ - "$${LITERAL_HASH}define $${uctarget}_VERSION $$modulehexstring" \ - "" \ - "$${LITERAL_HASH}endif // QT_$${uctarget}_VERSION_H" - write_file($$MODULE_VERSION_HEADER, MODULE_VERSION_HEADER_CONT)|error("Aborting.") - } - - HEADERS += $$MODULE_VERSION_HEADER -} + "/* This file was generated by qmake with the info from <root>/$$relative_path($$_PRO_FILE_, $$MODULE_BASE_INDIR). */" -# Create a module master header -MODULE_MASTER_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$$MODULE_INCNAME +# Create a module master depends header +MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends !build_pass { - MODULE_MASTER_HEADER_CONT = \ - $$autogen_warning \ - "$${LITERAL_HASH}ifndef QT_$${ucmodule}_MODULE_H" \ - "$${LITERAL_HASH}define QT_$${ucmodule}_MODULE_H" + MODULE_MASTER_DEPS_HEADER_CONT = $$autogen_warning for(dep, MODULE_DEPENDS) { depname = $$eval(QT.$${dep}.name) - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" + MODULE_MASTER_DEPS_HEADER_CONT += "$${LITERAL_HASH}include <$$depname/$$depname>" } - for(hdr, SYNCQT.HEADER_FILES): \ - shouldMasterInclude($$hdr): \ - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}include \"$$replace(hdr, .*/, )\"" - MODULE_MASTER_HEADER_CONT += "$${LITERAL_HASH}endif" - write_file($$MODULE_MASTER_HEADER, MODULE_MASTER_HEADER_CONT)|error("Aborting.") + write_file($$MODULE_MASTER_DEPS_HEADER, MODULE_MASTER_DEPS_HEADER_CONT)|error("Aborting.") } -SYNCQT.HEADER_FILES += $$MODULE_MASTER_HEADER +SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER CONFIG += qt_install_headers diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9e40a67b51..81b37f0e92 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -10,8 +10,17 @@ # load(qt_build_paths) +# Pre-generated headers in the source tree and +# - shadow build or +# - non-shadow non-prefix build of a module which is not qtbase (because the build-time +# generated headers all end up in qtbase). +!git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ + |if(!prefix_build:!equals(MODULE_BASE_INDIR, $$[QT_HOST_PREFIX]))): \ + CONFIG += split_incpath +force_independent|split_incpath: \ + CONFIG += need_fwd_pri MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri -force_independent: \ +need_fwd_pri: \ MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri else: \ MODULE_PRI = $$MODULE_FWD_PRI @@ -52,9 +61,26 @@ 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 + } + split_incpath: \ + MODULE_SHADOW_INCLUDES = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \ + $$MODULE_BASE_OUTDIR/include) + MODULE_INCLUDES += $$MODULE_AUX_INCLUDES + MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES + internal_module { + MODULE_PRIVATE_INCLUDES = $$MODULE_INCLUDES $$MODULE_PRIVATE_INCLUDES + MODULE_INCLUDES = + MODULE_PRIVATE_SHADOW_INCLUDES = $$MODULE_SHADOW_INCLUDES + MODULE_SHADOW_INCLUDES = + } + split_incpath { + !isEmpty(MODULE_SHADOW_INCLUDES): \ + MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.includes += $$MODULE_SHADOW_INCLUDES" + !isEmpty(MODULE_PRIVATE_SHADOW_INCLUDES): \ + MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.private_includes += $$MODULE_PRIVATE_SHADOW_INCLUDES" } MODULE_PRI_CONT = \ "QT.$${MODULE}.VERSION = $${VERSION}" \ @@ -85,26 +111,32 @@ else: \ write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") MODULE_PRI_FILES = $$MODULE_PRI - force_independent { + need_fwd_pri { + + split_incpath: \ + MODULE_BASE_INCDIR = $$MODULE_BASE_INDIR + else: \ + MODULE_BASE_INCDIR = $$MODULE_BASE_OUTDIR # Create a forwarding module .pri file MODULE_FWD_PRI_CONT = \ "QT_MODULE_BIN_BASE = $$MODULE_BASE_OUTDIR/bin" \ - "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_OUTDIR/include" \ + "QT_MODULE_INCLUDE_BASE = $$MODULE_BASE_INCDIR/include" \ "QT_MODULE_IMPORT_BASE = $$MODULE_BASE_OUTDIR/imports" \ "QT_MODULE_QML_BASE = $$MODULE_BASE_OUTDIR/qml" \ "QT_MODULE_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ "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 - } else { # prefix_build + } else { - # This is needed for the direct include() below. + # This is needed for the direct include() below. Mirrors qt_config.prf QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS] QT_MODULE_INCLUDE_BASE = $$[QT_INSTALL_HEADERS] QT_MODULE_IMPORT_BASE = $$[QT_INSTALL_IMPORTS] diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 0a588807c8..9a6b9634e0 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -19,17 +19,17 @@ CONFIG += console !build_pass:if(!host_build|!force_bootstrap|force_independent) { isEmpty(MODULE):MODULE = $$TARGET - MODULE_DEPENDS = $$replace(QT, -private$, ) + !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, ) load(qt_build_paths) load(resolve_target) - cmd = $$shell_path($$QMAKE_RESOLVED_TARGET) - !host_build|!force_bootstrap: qtAddTargetEnv(cmd) TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri - TOOL_PRI_CONT = "QT_TOOL.$${MODULE}.command = $$val_escape(cmd)" + TOOL_PRI_CONT = \ + "QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ + "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -39,6 +39,7 @@ CONFIG += console unset(added) } include($$TOOL_PRI) - cache(QT_TOOL.$${MODULE}.command, transient) + for(var, $$list(binary depends)): \ + cache(QT_TOOL.$${MODULE}.$$var, transient) } diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index ed44d9c308..68ca4d1442 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -1,4 +1,4 @@ -qtPrepareTool(QMAKE_RCC, rcc) +qtPrepareTool(QMAKE_RCC, rcc, _DEP) isEmpty(RCC_DIR):RCC_DIR = . isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc @@ -18,11 +18,11 @@ resource_combine { QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE} } } -rcc.commands = "$$QMAKE_RCC" $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" -o "${QMAKE_FILE_OUT}" -rcc.depend_command = "$$QMAKE_RCC" -list $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" +rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} +rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.CONFIG += add_inputs_as_makefile_deps rcc.input = RESOURCES rcc.variable_out = SOURCES rcc.name = RCC ${QMAKE_FILE_IN} -silent:rcc.commands = @echo rcc "${QMAKE_FILE_IN}" && $$rcc.commands +silent:rcc.commands = @echo rcc ${QMAKE_FILE_IN} && $$rcc.commands QMAKE_EXTRA_COMPILERS += rcc diff --git a/mkspecs/features/spec_post.prf b/mkspecs/features/spec_post.prf index 46a512bf17..c9e9f8b2f6 100644 --- a/mkspecs/features/spec_post.prf +++ b/mkspecs/features/spec_post.prf @@ -42,7 +42,7 @@ isEmpty(QMAKE_COMPILER) { else:*-llvm*: \ QMAKE_COMPILER = gcc llvm else:*-clang*: \ - QMAKE_COMPILER = clang llvm + QMAKE_COMPILER = gcc clang llvm else:*-msvc*: \ QMAKE_COMPILER = msvc else: \ diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 15febe2dd5..e31d1f4539 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -43,7 +43,7 @@ else: check.commands += $(DESTDIR_TARGET) check.commands += $(TESTARGS) # Add environment for non-installed builds -qtAddTargetEnv(check.commands) +qtAddTargetEnv(check.commands, QT) # If the test is marked as insignificant, discard the exit code insignificant_test:check.commands = -$${check.commands} diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 36ec185f7b..c6a64050e0 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -1,10 +1,10 @@ -qtPrepareTool(QMAKE_UIC, uic) +qtPrepareTool(QMAKE_UIC, uic, _DEP) isEmpty(UI_DIR):UI_DIR = . isEmpty(QMAKE_MOD_UIC):QMAKE_MOD_UIC = ui_ uic.commands = $$QMAKE_UIC ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -uic.depend_command = "$$QMAKE_UIC" -d "${QMAKE_FILE_IN}" +uic.depend_command = $$QMAKE_UIC_DEP -d ${QMAKE_FILE_IN} uic.output = $$UI_DIR/$${QMAKE_MOD_UIC}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)} uic.input = FORMS uic.variable_out = GENERATED_FILES diff --git a/mkspecs/macx-clang-libc++-32/qmake.conf b/mkspecs/macx-clang-libc++-32/qmake.conf index aea19a4bc3..3f7342da0b 100644 --- a/mkspecs/macx-clang-libc++-32/qmake.conf +++ b/mkspecs/macx-clang-libc++-32/qmake.conf @@ -2,6 +2,8 @@ # qmake configuration for 32-bit Clang on OS X # +warning("QMakespec macx-clang-libc++-32 is deprecated. Use macx-clang-32 instead.") + MAKEFILE_GENERATOR = UNIX CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname QMAKE_INCREMENTAL_STYLE = sublib diff --git a/mkspecs/macx-clang-libc++/qmake.conf b/mkspecs/macx-clang-libc++/qmake.conf index 94cc0036d2..7f4151e81b 100644 --- a/mkspecs/macx-clang-libc++/qmake.conf +++ b/mkspecs/macx-clang-libc++/qmake.conf @@ -2,6 +2,8 @@ # qmake configuration for Clang on OS X # +warning("QMakespec macx-clang-libc++ is deprecated. Use macx-clang instead.") + MAKEFILE_GENERATOR = UNIX CONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname QMAKE_INCREMENTAL_STYLE = sublib diff --git a/mkspecs/win32-icc/qplatformdefs.h b/mkspecs/win32-icc/qplatformdefs.h index b1950cd71f..e03bce8e6c 100644 --- a/mkspecs/win32-icc/qplatformdefs.h +++ b/mkspecs/win32-icc/qplatformdefs.h @@ -39,110 +39,4 @@ ** ****************************************************************************/ -#ifndef QPLATFORMDEFS_H -#define QPLATFORMDEFS_H - -#ifdef UNICODE -#ifndef _UNICODE -#define _UNICODE -#endif -#endif - -// Get Qt defines/settings - -#include "qglobal.h" - -#define _POSIX_ -#include <limits.h> -#undef _POSIX_ - -#include <tchar.h> -#include <io.h> -#include <direct.h> -#include <stdio.h> -#include <fcntl.h> -#include <errno.h> -#include <sys/stat.h> -#include <stdlib.h> -#include <windows.h> - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct _stati64 // non-ANSI defs -#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs -#define QT_STAT ::_stati64 -#define QT_FSTAT ::_fstati64 -#else -#define QT_STATBUF struct _stat // non-ANSI defs -#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs -#define QT_STAT ::_stat -#define QT_FSTAT ::_fstat -#endif -#define QT_STAT_REG _S_IFREG -#define QT_STAT_DIR _S_IFDIR -#define QT_STAT_MASK _S_IFMT -#if defined(_S_IFLNK) -# define QT_STAT_LNK _S_IFLNK -#endif -#define QT_FILENO _fileno -#define QT_OPEN ::_open -#define QT_CLOSE ::_close -#ifdef QT_LARGEFILE_SUPPORT -#define QT_LSEEK ::_lseeki64 -#define QT_TSTAT ::_tstati64 -#else -#define QT_LSEEK ::_lseek -#define QT_TSTAT ::_tstat -#endif -#define QT_READ ::_read -#define QT_WRITE ::_write -#define QT_ACCESS ::_access -#define QT_GETCWD ::_getcwd -#define QT_CHDIR ::_chdir -#define QT_MKDIR ::_mkdir -#define QT_RMDIR ::_rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY _O_RDONLY -#define QT_OPEN_WRONLY _O_WRONLY -#define QT_OPEN_RDWR _O_RDWR -#define QT_OPEN_CREAT _O_CREAT -#define QT_OPEN_TRUNC _O_TRUNC -#define QT_OPEN_APPEND _O_APPEND -#if defined(O_TEXT) -# define QT_OPEN_TEXT _O_TEXT -# define QT_OPEN_BINARY _O_BINARY -#endif - -#include "../common/c89/qplatformdefs.h" - -#if defined(QT_LARGEFILE_SUPPORT) && _MSC_VER > 1310 -#undef QT_FSEEK -#undef QT_FTELL - -#define QT_FSEEK ::_fseeki64 -#define QT_FTELL ::_ftelli64 -#endif - -#if defined(QT_LARGEFILE_SUPPORT) -#undef QT_OFF_T -#define QT_OFF_T __int64 -#endif - -#define QT_SIGNAL_ARGS int - -#if _MSC_VER>=1400 -# define QT_VSNPRINTF(buffer, count, format, arg) \ - ::vsnprintf_s(buffer, count, count-1, format, arg) -#else -# define QT_VSNPRINTF ::_vsnprintf -#endif -#define QT_SNPRINTF ::_snprintf - -# define F_OK 0 -# define X_OK 1 -# define W_OK 2 -# define R_OK 4 - -typedef int mode_t; - - -#endif // QPLATFORMDEFS_H +#include "../win32-msvc2005/qplatformdefs.h" diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 7293f4c869..9b7bfa6f8b 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 63cdf50563..7dbef61413 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -34,7 +34,7 @@ CFLAGS_BARE = -c -Fo./ \ -W3 -nologo -O1 \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \ - -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \ + -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ -I$(BUILD_PATH)\src\corelib\global -DHAVE_QCONFIG_CPP \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ -I$(SOURCE_PATH)\tools\shared \ diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 67446b2efe..44fbf20f81 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -182,6 +182,7 @@ const char _Optimization[] = "Optimization"; const char _OptimizeReferences[] = "OptimizeReferences"; const char _OutputDirectory[] = "OutputDirectory"; const char _OutputFile[] = "OutputFile"; +const char _PlatformToolSet[] = "PlatformToolSet"; const char _PrecompiledHeader[] = "PrecompiledHeader"; const char _PrecompiledHeaderFile[] = "PrecompiledHeaderFile"; const char _PrecompiledHeaderOutputFile[] = "PrecompiledHeaderOutputFile"; @@ -467,10 +468,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool) << attrTag("Condition", condition) << valueTag(tool.Configuration.IntermediateDirectory); } - if (tool.Configuration.CompilerVersion >= NET2012) { - xml << tagValue("PlatformToolSet", - platformToolSetVersion(tool.Configuration.CompilerVersion)); - } if ( !tool.Configuration.PrimaryOutput.isEmpty() ) { xml<< tag("TargetName") << attrTag("Condition", condition) @@ -668,10 +665,6 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << attrTag("Condition", condition) << valueTag(config.IntermediateDirectory); } - if (config.CompilerVersion >= NET2012) { - xml << tagValue("PlatformToolSet", - platformToolSetVersion(config.CompilerVersion)); - } if (!config.PrimaryOutput.isEmpty()) { xml << tag("TargetName") << attrTag("Condition", condition) @@ -1649,6 +1642,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool) xml << tag("PropertyGroup") << attrTag("Condition", generateCondition(tool)) << attrTag("Label", "Configuration") + << attrTagS(_PlatformToolSet, platformToolSetVersion(tool.CompilerVersion)) << attrTagS(_OutputDirectory, tool.OutputDirectory) << attrTagT(_ATLMinimizesCRunTimeLibraryUsage, tool.ATLMinimizesCRunTimeLibraryUsage) << attrTagT(_BuildBrowserInformation, tool.BuildBrowserInformation) @@ -2057,7 +2051,6 @@ QString VCXProjectWriter::platformToolSetVersion(const DotNET version) case NET2012: return "v110"; } - Q_ASSERT(!"This MSVC version does not support the PlatformToolSet tag!"); return QString(); } diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index c60119615f..6fb9c05ae5 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1222,7 +1222,7 @@ bool QMakeEvaluator::loadSpec() m_qmakespec = QDir::cleanPath(qmakespec); if (!m_superfile.isEmpty() - && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { + && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { return false; } if (!loadSpecInternal()) @@ -1813,7 +1813,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile( m_current = m_locationStack.pop(); pro->deref(); #ifdef PROEVALUATOR_FULL - if (ok == ReturnTrue) { + if (ok == ReturnTrue && !(flags & LoadHidden)) { ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")]; ProString ifn(fileName); if (!iif.contains(ifn)) diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index 59e3295f69..09617ba019 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -102,7 +102,8 @@ public: LoadPreFiles = 1, LoadPostFiles = 2, LoadAll = LoadPreFiles|LoadPostFiles, - LoadSilent = 0x10 + LoadSilent = 0x10, + LoadHidden = 0x20 }; Q_DECLARE_FLAGS(LoadFlags, LoadFlag) diff --git a/qtbase.pro b/qtbase.pro index 02dc11eac2..6ab032e30f 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -88,7 +88,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri - TOOL_PRI_CONT = "QT_TOOL.syncqt.command = $$val_escape(cmd)" + TOOL_PRI_CONT = "QT_TOOL.syncqt.binary = $$val_escape(cmd)" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -97,7 +97,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added) } include($$TOOL_PRI) - cache(QT_TOOL.syncqt.command, transient) + cache(QT_TOOL.syncqt.binary, transient) } diff --git a/src/3rdparty/xkbcommon.pri b/src/3rdparty/xkbcommon.pri index 99536576f7..d437c6b8b6 100644 --- a/src/3rdparty/xkbcommon.pri +++ b/src/3rdparty/xkbcommon.pri @@ -1,4 +1,4 @@ -QMAKE_CFLAGS = -std=gnu99 -w +QMAKE_CFLAGS += -std=gnu99 -w INCLUDEPATH += $$PWD/xkbcommon $$PWD/xkbcommon/src $$PWD/xkbcommon/src/xkbcomp DEFINES += DFLT_XKB_CONFIG_ROOT='\\"/usr/share/X11/xkb\\"' diff --git a/src/android/java/AndroidManifest.xml b/src/android/java/AndroidManifest.xml index 48fb23ab28..2a6f52b315 100644 --- a/src/android/java/AndroidManifest.xml +++ b/src/android/java/AndroidManifest.xml @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='utf-8'?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="org.qtproject.example"> <application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name"> - <activity android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden" > + <activity android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="@string/app_name" android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden|navigation" > <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> diff --git a/src/angle/angle.pro b/src/angle/angle.pro index 721caf880a..83510698d3 100644 --- a/src/angle/angle.pro +++ b/src/angle/angle.pro @@ -6,5 +6,5 @@ SUBDIRS += src # 2) If we made a 'QtANGLE' module, the include directory would be flattened which won't work since # we need to support "#include <GLES2/gl2.h>" CONFIG += minimal_syncqt -QMAKE_SYNCQT_OPTIONS = -module KHR -module EGL -module GLES2 -version none +QMAKE_SYNCQT_OPTIONS = -module QtANGLE/KHR -module QtANGLE/EGL -module QtANGLE/GLES2 -version none load(qt_module_headers) diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index c0d021ccab..1a338ef0d2 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -40,5 +40,5 @@ egl_headers.files = \ $$ANGLE_DIR/include/EGL/egl.h \ $$ANGLE_DIR/include/EGL/eglext.h \ $$ANGLE_DIR/include/EGL/eglplatform.h -egl_headers.path = $$[QT_INSTALL_HEADERS]/EGL +egl_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/EGL INSTALLS += egl_headers diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index d12202f33b..ba1f226143 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -235,12 +235,12 @@ for (vs, CLEAR_SHADERS) { load(qt_installs) khr_headers.files = $$ANGLE_DIR/include/KHR/khrplatform.h -khr_headers.path = $$[QT_INSTALL_HEADERS]/KHR +khr_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/KHR gles2_headers.files = \ $$ANGLE_DIR/include/GLES2/gl2.h \ $$ANGLE_DIR/include/GLES2/gl2ext.h \ $$ANGLE_DIR/include/GLES2/gl2platform.h -gles2_headers.path = $$[QT_INSTALL_HEADERS]/GLES2 +gles2_headers.path = $$[QT_INSTALL_HEADERS]/QtANGLE/GLES2 INSTALLS += khr_headers gles2_headers diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index 51537a3904..126a348b47 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -38,10 +38,6 @@ foreach(module ${CMAKE_MODULES_UNDER_TEST}) ) endforeach() -if(CMAKE_CROSSCOMPILING AND CMAKE_FIND_ROOT_PATH) - list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_CXX_LINK_FLAGS=--sysroot=\"${CMAKE_FIND_ROOT_PATH}\"") -endif() - macro(expect_pass _dir) string(REPLACE "(" "_" testname "${_dir}") string(REPLACE ")" "_" testname "${testname}") diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 6ac32cd35d..a0842a946d 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -29,6 +29,14 @@ 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 +qconfig_h_files = \ + $$OUT_PWD/global/qconfig.h \ + $$QT_BUILD_TREE/include/QtCore/QtConfig +targ_headers.files += $$qconfig_h_files +contains(QMAKE_BUNDLE_DATA, FRAMEWORK_HEADERS): \ + FRAMEWORK_HEADERS.files += $$qconfig_h_files + # Only used on platforms with CONFIG += precompile_header PRECOMPILED_HEADER = global/qt_pch.h diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 548eebd3ad..b685c1fe0d 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -467,7 +467,7 @@ # if __INTEL_COMPILER < 1200 # define Q_NO_TEMPLATE_FRIENDS # endif -# if defined(_CHAR16T) || __cplusplus >= 201103L +# if __cplusplus >= 201103L # define Q_COMPILER_VARIADIC_MACROS # if __INTEL_COMPILER >= 1200 # define Q_COMPILER_AUTO_TYPE diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index c9c4d23aab..9b939feea0 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -78,7 +78,10 @@ template <typename T> inline void qbswap(const T src, uchar *dest) // If you want to avoid the memcopy, you must write specializations for this function template <typename T> inline void qToUnaligned(const T src, uchar *dest) { - memcpy(dest, &src, sizeof(T)); + // Using sizeof(T) inside memcpy function produces internal compiler error with + // MSVC2008/ARM in tst_endian -> use extra indirection to resolve size of T. + const size_t size = sizeof(T); + memcpy(dest, &src, size); } /* T qFromLittleEndian(const uchar *src) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4598f60d5e..7a00e4eb32 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1042,7 +1042,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \enum QSysInfo::MacVersion This enum provides symbolic names for the various versions of the - Macintosh operating system. On Mac, the + OS X operating system. On OS X, the QSysInfo::MacintoshVersion variable gives the version of the system on which the application is run. @@ -1050,12 +1050,13 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_0 Mac OS X 10.0 (unsupported) \value MV_10_1 Mac OS X 10.1 (unsupported) \value MV_10_2 Mac OS X 10.2 (unsupported) - \value MV_10_3 Mac OS X 10.3 - \value MV_10_4 Mac OS X 10.4 - \value MV_10_5 Mac OS X 10.5 + \value MV_10_3 Mac OS X 10.3 (unsupported) + \value MV_10_4 Mac OS X 10.4 (unsupported) + \value MV_10_5 Mac OS X 10.5 (unsupported) \value MV_10_6 Mac OS X 10.6 - \value MV_10_7 Mac OS X 10.7 - \value MV_10_8 Mac OS X 10.8 + \value MV_10_7 OS X 10.7 + \value MV_10_8 OS X 10.8 + \value MV_10_9 OS X 10.9 \value MV_Unknown An unknown and currently unsupported platform \value MV_CHEETAH Apple codename for MV_10_0 @@ -1067,6 +1068,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_SNOWLEOPARD Apple codename for MV_10_6 \value MV_LION Apple codename for MV_10_7 \value MV_MOUNTAINLION Apple codename for MV_10_8 + \value MV_MAVERICKS Apple codename for MV_10_9 \sa WinVersion */ diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 74949b86f0..25c47d5d34 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -980,6 +980,8 @@ public: Key_TouchpadOn = 0x01000111, Key_TouchpadOff = 0x01000112, + Key_MicMute = 0x01000113, + Key_MediaLast = 0x0100ffff, // Keypad navigation keys diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9eb0c6b8f2..f9248eb68d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1621,6 +1621,7 @@ \value Key_TouchpadToggle \value Key_TouchpadOn \value Key_TouchpadOff + \value Key_MicMute \value Key_MediaLast \value Key_unknown diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 58939cc013..a6accdfebc 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -132,6 +132,7 @@ public: MV_10_6 = 0x0008, MV_10_7 = 0x0009, MV_10_8 = 0x000A, + MV_10_9 = 0x000B, /* codenames */ MV_CHEETAH = MV_10_0, @@ -142,7 +143,8 @@ public: MV_LEOPARD = MV_10_5, MV_SNOWLEOPARD = MV_10_6, MV_LION = MV_10_7, - MV_MOUNTAINLION = MV_10_8 + MV_MOUNTAINLION = MV_10_8, + MV_MAVERICKS = MV_10_9 }; static const MacVersion MacintoshVersion; static MacVersion macVersion(); diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 690442d066..cb55fa808b 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -207,12 +207,18 @@ # if !defined(__MAC_10_8) # define __MAC_10_8 1080 # endif +# if !defined(__MAC_10_9) +# define __MAC_10_9 1090 +# endif # if !defined(MAC_OS_X_VERSION_10_7) # define MAC_OS_X_VERSION_10_7 1070 # endif # if !defined(MAC_OS_X_VERSION_10_8) # define MAC_OS_X_VERSION_10_8 1080 # endif +# if !defined(MAC_OS_X_VERSION_10_9) +# define MAC_OS_X_VERSION_10_9 1090 +# endif # # if !defined(__IPHONE_4_3) # define __IPHONE_4_3 40300 @@ -229,9 +235,12 @@ # if !defined(__IPHONE_6_1) # define __IPHONE_6_1 60100 # endif +# if !defined(__IPHONE_7_0) +# define __IPHONE_7_0 70000 +# endif # # if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_8) -# warning "This version of Mac OS X is unsupported" +# warning "This version of OS X is unsupported" # endif #endif diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index b18e32b29a..a7517b4c7f 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -510,11 +510,12 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (slash) { const QByteArray chunk = QFile::encodeName(dirName.left(slash)); - QT_STATBUF st; - if (QT_STAT(chunk.constData(), &st) != -1) { - if ((st.st_mode & S_IFMT) != S_IFDIR) - return false; - } else if (QT_MKDIR(chunk.constData(), 0777) != 0) { + if (QT_MKDIR(chunk.constData(), 0777) != 0) { + if (errno == EEXIST) { + QT_STATBUF st; + if (QT_STAT(chunk.constData(), &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) + continue; + } return false; } } diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index bee7689535..2c9ed9da3d 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1034,6 +1034,10 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (oldslash != -1) oldslash = dirName.indexOf(QDir::separator(), oldslash); + } else if (dirName.size() > 2 + && dirName.at(1) == QLatin1Char(':')) { + // Don't try to call mkdir with just a drive letter + oldslash = 2; } for (int slash=0; slash != -1; oldslash = slash) { slash = dirName.indexOf(QDir::separator(), oldslash+1); @@ -1044,14 +1048,13 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea } if (slash) { QString chunk = dirName.left(slash); - bool existed = false; - if (!isDirPath(chunk, &existed)) { - if (!existed) { - if (!mkDir(chunk)) - return false; - } else { - return false; + if (!mkDir(chunk)) { + if (GetLastError() == ERROR_ALREADY_EXISTS) { + bool existed = false; + if (isDirPath(chunk, &existed) && existed) + continue; } + return false; } } } diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index a0904fea24..5b4d4ec0d8 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2527,7 +2527,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, character in keys. In addition, if you save a top-level setting (a key with no slashes in it, e.g., "someKey"), it will appear in the INI file's "General" section. To avoid - overwriting other keys, if you save something using the a key + overwriting other keys, if you save something using a key such as "General/someKey", the key will be located in the "%General" section, \e not in the "General" section. diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index ae291f13cd..d1bd8fbe95 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -52,6 +52,8 @@ #include "qelapsedtimer.h" #include "qcoreapplication_p.h" +#include "qsysinfo.h" + #include <private/qthread_p.h> #include <private/qmutexpool_p.h> @@ -305,8 +307,14 @@ static void resolveTimerAPI() #endif triedResolve = true; #if !defined(Q_OS_WINCE) +# if defined(_MSC_VER) && _MSC_VER >= 1700 + if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) { // QTBUG-27266, Disable when running MSVC2012-built code on pre-Windows 8 +# else + { +# endif qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("winmm"), "timeKillEvent"); + } #else qtimeSetEvent = (ptimeSetEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeSetEvent"); qtimeKillEvent = (ptimeKillEvent)QSystemLibrary::resolve(QLatin1String("Mmtimer"), "timeKillEvent"); diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index 04b9d92f55..4ec049e20d 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -224,7 +224,7 @@ class QVariantIsNull public: static const bool Value = (sizeof(test<T>(0)) == sizeof(Yes)); }; -#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype) +#elif defined(Q_CC_MSVC) && _MSC_VER >= 1400 && !defined(Q_CC_INTEL) // MSVC 2005, 2008 version: no decltype, but 'sealed' classes (>=2010 has decltype) template<typename T> class HasIsNullMethod { struct Yes { char unused[1]; }; diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 289fda7afc..1288643e32 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -72,7 +72,6 @@ public: QByteArray iid; QList<QLibraryPrivate*> libraryList; QMap<QString,QLibraryPrivate*> keyMap; - QStringList keyList; QString suffix; Qt::CaseSensitivity cs; QStringList loadedPaths; @@ -172,10 +171,8 @@ void QFactoryLoader::update() metaDataOk = true; QJsonArray k = object.value(QLatin1String("Keys")).toArray(); - for (int i = 0; i < k.size(); ++i) { - QString s = k.at(i).toString(); - keys += s; - } + for (int i = 0; i < k.size(); ++i) + keys += d->cs ? k.at(i).toString() : k.at(i).toString().toLower(); } if (qt_debug_component()) qDebug() << "Got keys from plugin meta data" << keys; @@ -186,15 +183,13 @@ void QFactoryLoader::update() continue; } - d->libraryList += library; + int keyUsageCount = 0; for (int k = 0; k < keys.count(); ++k) { // first come first serve, unless the first // library was built with a future Qt version, // whereas the new one has a Qt version that fits // better - QString key = keys.at(k); - if (!d->cs) - key = key.toLower(); + const QString &key = keys.at(k); QLibraryPrivate *previous = d->keyMap.value(key); int prev_qt_version = 0; if (previous) { @@ -203,9 +198,13 @@ void QFactoryLoader::update() int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble(); if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) { d->keyMap[key] = library; - d->keyList += keys.at(k); + ++keyUsageCount; } } + if (keyUsageCount || keys.isEmpty()) + d->libraryList += library; + else + library->release(); } } #else diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index f1bc441009..6ad1d679e1 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -2,23 +2,26 @@ !!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) -set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\") +set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\") !!ELSE -set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\") +set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\") !!ENDIF _qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS}) +list(APPEND Qt5Gui_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) +set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\") +!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) + set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\") + set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") !!ENDIF + !!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") !!ELSE @@ -55,7 +58,7 @@ find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME PATHS $$CMAKE_GL_INCDIRS NO_DEFAULT_PATH) if (NOT _qt5gui_OPENGL_INCLUDE_DIR) - message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\".\") endif() _qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR}) @@ -85,7 +88,7 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) if (\"${ARGN}\" STREQUAL \"OPTIONAL\") break() else() - message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\".\") endif() endif() add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) @@ -114,9 +117,11 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) endif() list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name}) endforeach() - foreach(_dir ${IncDirs}) - _qt5_Gui_check_file_exists(${_dir}) - endforeach() + if (NOT CMAKE_CROSSCOMPILING) + foreach(_dir ${IncDirs}) + _qt5_Gui_check_file_exists(${_dir}) + endforeach() + endif() endmacro() diff --git a/src/gui/gui.pro b/src/gui/gui.pro index e2dd5efcde..3203b41362 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -12,6 +12,12 @@ MODULE_PLUGIN_TYPES = \ platforms \ imageformats +# This is here only because the platform plugin is no module, obviously. +win32:contains(QT_CONFIG, angle) { + MODULE_AUX_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtANGLE +} + load(qt_module) # Code coverage with TestCocoon diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 91374fe2dd..3c019fc5b5 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -31,6 +31,8 @@ HEADERS += \ kernel/qplatformclipboard.h \ kernel/qplatformnativeinterface.h \ kernel/qplatformmenu.h \ + kernel/qshapedpixmapdndwindow_p.h \ + kernel/qsimpledrag_p.h \ kernel/qsurfaceformat.h \ kernel/qguiapplication.h \ kernel/qguiapplication_p.h \ @@ -89,6 +91,8 @@ SOURCES += \ kernel/qplatformclipboard.cpp \ kernel/qplatformnativeinterface.cpp \ kernel/qsessionmanager.cpp \ + kernel/qshapedpixmapdndwindow.cpp \ + kernel/qsimpledrag.cpp \ kernel/qsurfaceformat.cpp \ kernel/qguiapplication.cpp \ kernel/qwindow.cpp \ diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2a1d7e3bcc..29a7e87d46 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; diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index e82e30df80..e4f45ebb6e 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -49,6 +49,7 @@ #include <QtGui/private/qpixmap_raster_p.h> #include <qpa/qplatformscreen_p.h> #include <private/qdnd_p.h> +#include <private/qsimpledrag_p.h> QT_BEGIN_NAMESPACE @@ -99,7 +100,11 @@ QPlatformClipboard *QPlatformIntegration::clipboard() const */ QPlatformDrag *QPlatformIntegration::drag() const { - return 0; + static QSimpleDrag *drag = 0; + if (!drag) { + drag = new QSimpleDrag; + } + return drag; } #endif diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index d23cfde172..4c0d68e7c1 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -510,15 +510,21 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, } } if (w->isTopLevel() && qt_window_private(const_cast<QWindow*>(w))->positionAutomatic) { - const QWindow *tp = w->transientParent(); - if (tp) { - // A transient window should be centered w.r.t. its transient parent. - rect.moveCenter(tp->geometry().center()); - } else { - // Center the window on the screen. (Only applicable on platforms - // which do not provide a better way.) - QPlatformScreen *scr = QPlatformScreen::platformScreenForWindow(w); - rect.moveCenter(scr->availableGeometry().center()); + if (const QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w)) { + const QRect availableGeometry = platformScreen->availableGeometry(); + // Center unless the geometry ( + unknown window frame) is too large for the screen). + if (rect.height() < (availableGeometry.height() * 8) / 9 + && rect.width() < (availableGeometry.width() * 8) / 9) { + const QWindow *tp = w->transientParent(); + if (tp) { + // A transient window should be centered w.r.t. its transient parent. + rect.moveCenter(tp->geometry().center()); + } else { + // Center the window on the screen. (Only applicable on platforms + // which do not provide a better way.) + rect.moveCenter(availableGeometry.center()); + } + } } } return rect; diff --git a/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp b/src/gui/kernel/qshapedpixmapdndwindow.cpp index b3e64b01d0..b3e64b01d0 100644 --- a/src/platformsupport/dnd/qshapedpixmapdndwindow.cpp +++ b/src/gui/kernel/qshapedpixmapdndwindow.cpp diff --git a/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h index 20674b6b19..20674b6b19 100644 --- a/src/platformsupport/dnd/qshapedpixmapdndwindow_p.h +++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h diff --git a/src/platformsupport/dnd/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp index f2ff177055..f6912a2d57 100644 --- a/src/platformsupport/dnd/qsimpledrag.cpp +++ b/src/gui/kernel/qsimpledrag.cpp @@ -62,7 +62,7 @@ #include <private/qguiapplication_p.h> #include <private/qdnd_p.h> -#include <QtPlatformSupport/private/qshapedpixmapdndwindow_p.h> +#include <private/qshapedpixmapdndwindow_p.h> QT_BEGIN_NAMESPACE diff --git a/src/platformsupport/dnd/qsimpledrag_p.h b/src/gui/kernel/qsimpledrag_p.h index 10237b36d7..36ea4c1ec5 100644 --- a/src/platformsupport/dnd/qsimpledrag_p.h +++ b/src/gui/kernel/qsimpledrag_p.h @@ -56,7 +56,7 @@ class QEventLoop; class QDropData; class QShapedPixmapWindow; -class QBasicDrag : public QPlatformDrag, public QObject +class Q_GUI_EXPORT QBasicDrag : public QPlatformDrag, public QObject { public: virtual ~QBasicDrag(); @@ -99,7 +99,7 @@ private: QShapedPixmapWindow *m_drag_icon_window; }; -class QSimpleDrag : public QBasicDrag +class Q_GUI_EXPORT QSimpleDrag : public QBasicDrag { public: QSimpleDrag(); diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index eff057c4cb..392407d86d 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -933,7 +933,6 @@ bool QWindow::isActive() const /*! \property QWindow::contentOrientation \brief the orientation of the window's contents - \since 5.1 This is a hint to the window manager in case it needs to display additional content like popups, dialogs, status bars, or similar @@ -1190,7 +1189,6 @@ void QWindow::setHeight(int arg) /*! \property QWindow::minimumWidth \brief the minimum width of the window's geometry - \since 5.1 */ void QWindow::setMinimumWidth(int w) { @@ -1200,7 +1198,6 @@ void QWindow::setMinimumWidth(int w) /*! \property QWindow::minimumHeight \brief the minimum height of the window's geometry - \since 5.1 */ void QWindow::setMinimumHeight(int h) { @@ -1233,7 +1230,6 @@ void QWindow::setMaximumSize(const QSize &size) /*! \property QWindow::maximumWidth \brief the maximum width of the window's geometry - \since 5.1 */ void QWindow::setMaximumWidth(int w) { @@ -1243,7 +1239,6 @@ void QWindow::setMaximumWidth(int w) /*! \property QWindow::maximumHeight \brief the maximum height of the window's geometry - \since 5.1 */ void QWindow::setMaximumHeight(int h) { diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index efdfd497a6..ca261ff7ce 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -110,14 +110,14 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface Q_PROPERTY(int y READ y WRITE setY NOTIFY yChanged) Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged) Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged) - Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged REVISION 1) - Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged REVISION 1) - Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged REVISION 1) - Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged REVISION 1) + Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged) + Q_PROPERTY(int minimumHeight READ minimumHeight WRITE setMinimumHeight NOTIFY minimumHeightChanged) + Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged) + Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) Q_PROPERTY(bool active READ isActive NOTIFY activeChanged REVISION 1) Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged REVISION 1) - Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged REVISION 1) + Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged REVISION 1) public: @@ -286,12 +286,12 @@ public Q_SLOTS: void setWidth(int arg); void setHeight(int arg); - Q_REVISION(1) void setMinimumWidth(int w); - Q_REVISION(1) void setMinimumHeight(int h); - Q_REVISION(1) void setMaximumWidth(int w); - Q_REVISION(1) void setMaximumHeight(int h); + void setMinimumWidth(int w); + void setMinimumHeight(int h); + void setMaximumWidth(int w); + void setMaximumHeight(int h); - void alert(int msec); + Q_REVISION(1) void alert(int msec); Q_SIGNALS: void screenChanged(QScreen *screen); @@ -304,15 +304,15 @@ Q_SIGNALS: void widthChanged(int arg); void heightChanged(int arg); - Q_REVISION(1) void minimumWidthChanged(int arg); - Q_REVISION(1) void minimumHeightChanged(int arg); - Q_REVISION(1) void maximumWidthChanged(int arg); - Q_REVISION(1) void maximumHeightChanged(int arg); + void minimumWidthChanged(int arg); + void minimumHeightChanged(int arg); + void maximumWidthChanged(int arg); + void maximumHeightChanged(int arg); void visibleChanged(bool arg); Q_REVISION(1) void visibilityChanged(QWindow::Visibility visibility); Q_REVISION(1) void activeChanged(); - Q_REVISION(1) void contentOrientationChanged(Qt::ScreenOrientation orientation); + void contentOrientationChanged(Qt::ScreenOrientation orientation); void focusObjectChanged(QObject *object); diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.cpp b/src/gui/opengl/qopenglfunctions_4_1_core.cpp index b36cb0de94..474397bb1f 100644 --- a/src/gui/opengl/qopenglfunctions_4_1_core.cpp +++ b/src/gui/opengl/qopenglfunctions_4_1_core.cpp @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE \class QOpenGLFunctions_4_1_Core \inmodule QtGui \since 5.1 + \wrapper \brief The QOpenGLFunctions_4_1_Core class provides all functions for this version and profile of OpenGL. \sa QAbstractOpenGLFunctions diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp index e450fe708f..eb7a42f749 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.cpp +++ b/src/gui/opengl/qopenglvertexarrayobject.cpp @@ -118,6 +118,9 @@ public: void destroy(); void bind(); void release(); + void _q_contextAboutToBeDestroyed(); + + Q_DECLARE_PUBLIC(QOpenGLVertexArrayObject) GLuint vao; @@ -141,12 +144,22 @@ public: bool QOpenGLVertexArrayObjectPrivate::create() { + if (vao) { + qWarning("QOpenGLVertexArrayObject::create() VAO is already created"); + return false; + } + + Q_Q(QOpenGLVertexArrayObject); + if (context) + QObject::disconnect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed())); + QOpenGLContext *ctx = QOpenGLContext::currentContext(); if (!ctx) { qWarning("QOpenGLVertexArrayObject::create() requires a valid current OpenGL context"); return false; } context = ctx; + QObject::connect(context, SIGNAL(aboutToBeDestroyed()), q, SLOT(_q_contextAboutToBeDestroyed())); #if defined(QT_OPENGL_ES_2) if (ctx->hasExtension("GL_OES_vertex_array_object")) { @@ -197,8 +210,16 @@ void QOpenGLVertexArrayObjectPrivate::destroy() case NotSupported: break; } - vao = 0; #endif + vao = 0; +} + +/*! + \internal +*/ +void QOpenGLVertexArrayObjectPrivate::_q_contextAboutToBeDestroyed() +{ + destroy(); } void QOpenGLVertexArrayObjectPrivate::bind() @@ -327,7 +348,7 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject() Q_D(QOpenGLVertexArrayObject); QOpenGLContext *oldContext = 0; - if (d->context && d->context != ctx) { + if (d->context && ctx && d->context != ctx) { oldContext = ctx; if (d->context->makeCurrent(oldContext->surface())) { ctx = d->context; @@ -471,3 +492,5 @@ void QOpenGLVertexArrayObject::release() */ QT_END_NAMESPACE + +#include "moc_qopenglvertexarrayobject.cpp" diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h index 569aeea730..8369497660 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.h +++ b/src/gui/opengl/qopenglvertexarrayobject.h @@ -102,6 +102,7 @@ public: private: Q_DISABLE_COPY(QOpenGLVertexArrayObject) Q_DECLARE_PRIVATE(QOpenGLVertexArrayObject) + Q_PRIVATE_SLOT(d_func(), void _q_contextAboutToBeDestroyed()) QOpenGLVertexArrayObject(QOpenGLVertexArrayObjectPrivate &dd); }; diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index cd3f935c5b..edb5f66c5b 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -98,10 +98,12 @@ void QBackingStore::flush(const QRegion ®ion, QWindow *win, const QPoint &off if (!win) win = window(); +#ifdef QBACKINGSTORE_DEBUG if (win && win->isTopLevel() && !qt_window_private(win)->receivedExpose) { qWarning().nospace() << "QBackingStore::flush() called with non-exposed window " << win << ", behavior is undefined"; } +#endif d_ptr->platformBackingStore->flush(win, region, offset); } diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 0f3cde3efd..39f64224f0 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -133,10 +133,15 @@ struct NoDasher { }; +/* + * The return value is the result of the clipLine() call performed at the start + * of each of the two functions, aka "false" means completely outside the devices + * rect. + */ template<DrawPixel drawPixel, class Dasher> -static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); template<DrawPixel drawPixel, class Dasher> -static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) { @@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) caps |= CapEnd; QCosmeticStroker::Point last = this->lastPixel; - stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); /* fix for gaps in polylines with fastpen and aliased in a sequence of points with small distances: if current point p2 has been dropped - out, keep last non dropped point p. */ - if (fastPenAliased) { - if (last.x != lastPixel.x || last.y != lastPixel.y || - points == begin + 2 || points == end - 2 ) { - { - p = p2; - } + out, keep last non dropped point p. + + However, if the line was completely outside the devicerect, we + still need to update p to avoid drawing the line after this one from + a bad starting position. + */ + if (fastPenAliased && unclipped) { + if (last.x != lastPixel.x || last.y != lastPixel.y + || points == begin + 2 || points == end - 2) { + p = p2; } } else { p = p2; @@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) the drawing shifts from horizontal to vertical or back. */ template<DrawPixel drawPixel, class Dasher> -static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; @@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } else { // horizontal if (!dx) - return; + return true; QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; @@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, } } stroker->lastPixel = last; + return true; } template<DrawPixel drawPixel, class Dasher> -static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) +static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return; + return false; int x1 = toF26Dot6(rx1); int y1 = toF26Dot6(ry1); @@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx } else { // horizontal if (!dx) - return; + return true; int yinc = F16Dot16FixedDiv(dy, dx); @@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); } } + return true; } QT_END_NAMESPACE diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index 05c8a2b0cf..5fc3559da4 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE class QCosmeticStroker; -typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); +typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); class QCosmeticStroker { diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index d950c4e45f..cfb9d71f5c 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -293,6 +293,7 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev) // Update matrix. if (q->d_ptr->state->WxF) { q->d_ptr->state->redirectionMatrix = q->d_ptr->state->matrix; + q->d_ptr->state->redirectionMatrix *= q->d_ptr->hidpiScaleTransform().inverted(); q->d_ptr->state->redirectionMatrix.translate(-offset.x(), -offset.y()); q->d_ptr->state->worldMatrix = QTransform(); q->d_ptr->state->WxF = false; diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index a6be7c6c78..197d49369e 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -734,6 +734,35 @@ static inline QPointF snapTo26Dot6Grid(const QPointF &p) qFloorF(p.y() * 64) * (1 / qreal(64))); } +/* + The rasterize line function relies on some div by zero which should + result in +/-inf values. However, when floating point exceptions are + enabled, this will cause crashes, so we return high numbers instead. + As the returned value is used in further arithmetic, returning + FLT_MAX/DBL_MAX will also cause values, so instead return a value + that is well outside the int-range. + */ +static inline qreal qSafeDivide(qreal x, qreal y) +{ + if (y == 0) + return x > 0 ? 1e20 : -1e20; + return x / y; +} + +/* Conversion to int fails if the value is too large to fit into INT_MAX or + too small to fit into INT_MIN, so we need this slightly safer conversion + when floating point exceptions are enabled + */ +static inline int qSafeFloatToQ16Dot16(qreal x) +{ + qreal tmp = x * 65536.; + if (tmp > qreal(INT_MAX)) + return INT_MAX; + else if (tmp < qreal(INT_MIN)) + return -INT_MAX; + return int(tmp); +} + void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) { if (a == b || width == 0 || d->clipRect.isEmpty()) @@ -946,23 +975,23 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, const QPointF bottomLeftEdge = bottom - left; const QPointF bottomRightEdge = bottom - right; - const qreal topLeftSlope = topLeftEdge.x() / topLeftEdge.y(); - const qreal bottomLeftSlope = bottomLeftEdge.x() / bottomLeftEdge.y(); + const qreal topLeftSlope = qSafeDivide(topLeftEdge.x(), topLeftEdge.y()); + const qreal bottomLeftSlope = qSafeDivide(bottomLeftEdge.x(), bottomLeftEdge.y()); - const qreal topRightSlope = topRightEdge.x() / topRightEdge.y(); - const qreal bottomRightSlope = bottomRightEdge.x() / bottomRightEdge.y(); + const qreal topRightSlope = qSafeDivide(topRightEdge.x(), topRightEdge.y()); + const qreal bottomRightSlope = qSafeDivide(bottomRightEdge.x(), bottomRightEdge.y()); - const Q16Dot16 topLeftSlopeFP = FloatToQ16Dot16(topLeftSlope); - const Q16Dot16 topRightSlopeFP = FloatToQ16Dot16(topRightSlope); + const Q16Dot16 topLeftSlopeFP = qSafeFloatToQ16Dot16(topLeftSlope); + const Q16Dot16 topRightSlopeFP = qSafeFloatToQ16Dot16(topRightSlope); - const Q16Dot16 bottomLeftSlopeFP = FloatToQ16Dot16(bottomLeftSlope); - const Q16Dot16 bottomRightSlopeFP = FloatToQ16Dot16(bottomRightSlope); + const Q16Dot16 bottomLeftSlopeFP = qSafeFloatToQ16Dot16(bottomLeftSlope); + const Q16Dot16 bottomRightSlopeFP = qSafeFloatToQ16Dot16(bottomRightSlope); - const Q16Dot16 invTopLeftSlopeFP = FloatToQ16Dot16(1 / topLeftSlope); - const Q16Dot16 invTopRightSlopeFP = FloatToQ16Dot16(1 / topRightSlope); + const Q16Dot16 invTopLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topLeftSlope)); + const Q16Dot16 invTopRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, topRightSlope)); - const Q16Dot16 invBottomLeftSlopeFP = FloatToQ16Dot16(1 / bottomLeftSlope); - const Q16Dot16 invBottomRightSlopeFP = FloatToQ16Dot16(1 / bottomRightSlope); + const Q16Dot16 invBottomLeftSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomLeftSlope)); + const Q16Dot16 invBottomRightSlopeFP = qSafeFloatToQ16Dot16(qSafeDivide(1, bottomRightSlope)); if (d->antialiased) { const Q16Dot16 iTopFP = IntToQ16Dot16(int(topBound)); @@ -1137,10 +1166,10 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, int iBottom = bottom.y() < 0.5f? -1 : int(bottom.y() - 0.5f); int iMiddle = qMin(iLeft, iRight); - Q16Dot16 leftIntersectAf = FloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); - Q16Dot16 leftIntersectBf = FloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); - Q16Dot16 rightIntersectAf = FloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); - Q16Dot16 rightIntersectBf = FloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); + Q16Dot16 leftIntersectAf = qSafeFloatToQ16Dot16(top.x() + 0.5f + (iTop + 0.5f - top.y()) * topLeftSlope); + Q16Dot16 leftIntersectBf = qSafeFloatToQ16Dot16(left.x() + 0.5f + (iLeft + 1.5f - left.y()) * bottomLeftSlope); + Q16Dot16 rightIntersectAf = qSafeFloatToQ16Dot16(top.x() - 0.5f + (iTop + 0.5f - top.y()) * topRightSlope); + Q16Dot16 rightIntersectBf = qSafeFloatToQ16Dot16(right.x() - 0.5f + (iRight + 1.5f - right.y()) * bottomRightSlope); int ny; int y = iTop; diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 10225febcb..4545645dc6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1316,6 +1316,12 @@ void QFontEngineFT::doKerning(QGlyphLayout *g, QFontEngine::ShaperFlags flags) c unlockFace(); } } + + if (shouldUseDesignMetrics(flags) && !(fontDef.styleStrategy & QFont::ForceIntegerMetrics)) + flags |= DesignMetrics; + else + flags &= ~DesignMetrics; + QFontEngine::doKerning(g, flags); } @@ -1571,12 +1577,18 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs return true; } +bool QFontEngineFT::shouldUseDesignMetrics(QFontEngine::ShaperFlags flags) const +{ + if (!FT_IS_SCALABLE(freetype->face)) + return false; + + return default_hint_style == HintNone || default_hint_style == HintLight || (flags & DesignMetrics); +} + void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFlags flags) const { FT_Face face = 0; - bool design = (default_hint_style == HintNone || - default_hint_style == HintLight || - (flags & DesignMetrics)) && FT_IS_SCALABLE(freetype->face); + bool design = shouldUseDesignMetrics(flags); for (int i = 0; i < glyphs->numGlyphs; i++) { Glyph *g = cacheEnabled ? defaultGlyphSet.getGlyph(glyphs->glyphs[i]) : 0; // Since we are passing Format_None to loadGlyph, use same default format logic as loadGlyph diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 434eb76c33..e09fa6f94f 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -325,6 +325,7 @@ private: friend class QFontEngineMultiFontConfig; int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const; + bool shouldUseDesignMetrics(ShaperFlags flags) const; GlyphFormat defaultFormat; FT_Matrix matrix; diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 3a3e24b80b..00d5b81413 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -752,7 +752,8 @@ static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVaria static QNetworkRequest::KnownHeaders parseHeaderName(const QByteArray &headerName) { - // headerName is not empty here + if (headerName.isEmpty()) + return QNetworkRequest::KnownHeaders(-1); switch (tolower(headerName.at(0))) { case 'c': diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 72c6e035d9..3f496a4ffc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1579,10 +1579,7 @@ QGLContextPrivate::QGLContextPrivate(QGLContext *context) { group = new QGLContextGroup(context); - if (qApp) { - texture_destroyer = new QGLTextureDestroyer; - texture_destroyer->moveToThread(qApp->thread()); - } + texture_destroyer = new QGLTextureDestroyer; } QGLContextPrivate::~QGLContextPrivate() diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index ff9baf8971..484c3ea2d9 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -335,25 +335,16 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(GLuint) QT_BEGIN_NAMESPACE -class Q_OPENGL_EXPORT QGLTextureDestroyer : public QObject +class Q_OPENGL_EXPORT QGLTextureDestroyer { - Q_OBJECT public: - QGLTextureDestroyer() : QObject() { - connect(this, SIGNAL(freeTexture(QGLContext *, QPlatformPixmap *, quint32)), - this, SLOT(freeTexture_slot(QGLContext *, QPlatformPixmap *, quint32))); - } - void emitFreeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, GLuint id) { - emit freeTexture(context, boundPixmap, id); + void emitFreeTexture(QGLContext *context, QPlatformPixmap *, GLuint id) { + if (context->contextHandle()) + (new QOpenGLSharedResourceGuard(context->contextHandle(), id, freeTextureFunc))->free(); } -Q_SIGNALS: - void freeTexture(QGLContext *context, QPlatformPixmap *boundPixmap, quint32 id); - -private slots: - void freeTexture_slot(QGLContext *context, QPlatformPixmap *boundPixmap, quint32 id) { - Q_UNUSED(boundPixmap); - QGLShareContextScope scope(context); +private: + static void freeTextureFunc(QOpenGLFunctions *, GLuint id) { glDeleteTextures(1, &id); } }; diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 1c802cabcb..8210b218ec 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1122,7 +1122,6 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const /*! \fn bool QGLFramebufferObject::bindDefault() - \internal Switches rendering back to the default, windowing system provided framebuffer. diff --git a/src/openglextensions/qopenglextensions.cpp b/src/openglextensions/qopenglextensions.cpp index 2119a86ccf..58bd31a339 100644 --- a/src/openglextensions/qopenglextensions.cpp +++ b/src/openglextensions/qopenglextensions.cpp @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and 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. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** 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. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** 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. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/openglextensions/qopenglextensions.h b/src/openglextensions/qopenglextensions.h index 7d6c21e4e5..78bbf4b0cb 100644 --- a/src/openglextensions/qopenglextensions.h +++ b/src/openglextensions/qopenglextensions.h @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and 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. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** 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. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** 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. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/platformsupport/dnd/dnd.pri b/src/platformsupport/dnd/dnd.pri deleted file mode 100644 index 47feb81ef2..0000000000 --- a/src/platformsupport/dnd/dnd.pri +++ /dev/null @@ -1,6 +0,0 @@ -HEADERS += \ - $$PWD/qsimpledrag_p.h \ - $$PWD/qshapedpixmapdndwindow_p.h -SOURCES += \ - $$PWD/qsimpledrag.cpp \ - $$PWD/qshapedpixmapdndwindow.cpp diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 4cb1f2c1bf..da87f395fd 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -9,7 +9,6 @@ PRECOMPILED_HEADER = ../corelib/global/qt_pch.h include(cfsocketnotifier/cfsocketnotifier.pri) include(cglconvenience/cglconvenience.pri) -include(dnd/dnd.pri) include(eglconvenience/eglconvenience.pri) include(eventdispatchers/eventdispatchers.pri) include(fbconvenience/fbconvenience.pri) diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index da6156a330..75cb617ca8 100644 --- a/src/plugins/platforms/android/src/androidjniinput.cpp +++ b/src/plugins/platforms/android/src/androidjniinput.cpp @@ -163,6 +163,10 @@ namespace QtAndroidInput static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y) { + //### TODO: add proper API for Qt 5.2 + static bool rightMouseFromLongPress = qgetenv("QT_NECESSITAS_COMPATIBILITY_LONG_PRESS").toInt(); + if (!rightMouseFromLongPress) + return; m_ignoreMouseEvents = true; QPoint globalPos(x,y); QWindow *tlw = topLevelWindowAt(globalPos); @@ -329,7 +333,7 @@ namespace QtAndroidInput return Qt::Key_BracketLeft; case 0x0000005a: // KEYCODE_MEDIA_FAST_FORWARD - return Qt::Key_Forward; + return Qt::Key_AudioForward; case 0x00000057: return Qt::Key_MediaNext; @@ -340,7 +344,7 @@ namespace QtAndroidInput case 0x00000058: return Qt::Key_MediaPrevious; - case 0x00000059: + case 0x00000059: // KEYCODE_MEDIA_REWIND return Qt::Key_AudioRewind; case 0x00000056: @@ -352,8 +356,8 @@ namespace QtAndroidInput case 0x00000045: return Qt::Key_Minus; - case 0x0000005b: - return Qt::Key_VolumeMute; + case 0x0000005b: // KEYCODE_MUTE + return Qt::Key_MicMute; case 0x0000004e: return Qt::Key_NumLock; @@ -401,6 +405,9 @@ namespace QtAndroidInput case 0x00000019: return Qt::Key_VolumeDown; + case 0x000000a4: // KEYCODE_VOLUME_MUTE + return Qt::Key_VolumeMute; + case 0x00000018: return Qt::Key_VolumeUp; diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index f0630b5224..91ad2b368f 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -216,6 +216,16 @@ QPlatformServices *QAndroidPlatformIntegration::services() const return m_androidPlatformServices; } +QVariant QAndroidPlatformIntegration::styleHint(StyleHint hint) const +{ + switch (hint) { + case ShowIsFullScreen: + return true; + default: + return QPlatformIntegration::styleHint(hint); + } +} + static const QLatin1String androidThemeName("android"); QStringList QAndroidPlatformIntegration::themeNames() const { diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h index 8da9fb2ff4..6cc191701d 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h @@ -112,6 +112,8 @@ public: QPlatformNativeInterface *nativeInterface() const; QPlatformServices *services() const; + QVariant styleHint(StyleHint hint) const; + QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index c40ae3d81d..3ec6ad7a20 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -113,6 +113,7 @@ static void cleanupCocoaApplicationDelegate() - (void)updateScreens:(NSNotification *)notification { + Q_UNUSED(notification); if (QCocoaIntegration *ci = dynamic_cast<QCocoaIntegration *>(QGuiApplicationPrivate::platformIntegration())) ci->updateScreens(); } diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index a0dac445be..594ad65a18 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -98,6 +98,11 @@ static NSButton *macCreateButton(const char *text, NSView *superview) mDialogIsExecuting = false; mResultSet = false; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) + [mColorPanel setRestorable:NO]; +#endif + if (mHelper->options()->testOption(QColorDialogOptions::NoButtons)) { mStolenContentView = 0; mOkButton = 0; @@ -274,6 +279,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview) - (void)showModelessPanel { mDialogIsExecuting = false; + mResultSet = false; [mColorPanel makeKeyAndOrderFront:mColorPanel]; } @@ -367,10 +373,8 @@ void QCocoaColorDialogHelper::exec() bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowModality, QWindow *parent) { - if (windowModality == Qt::WindowModal) { - // Cocoa's shared color panel cannot be shown as a sheet - return false; - } + if (windowModality == Qt::WindowModal) + windowModality = Qt::ApplicationModal; return showCocoaColorPanel(windowModality, parent); } @@ -433,9 +437,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal createNSColorPanelDelegate(); QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate); [delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)]; - if (windowModality == Qt::NonModal) + if (windowModality != Qt::WindowModal) [delegate showModelessPanel]; - // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel() + // no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case return true; } diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h index 6e29fd1a78..80259df600 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.h +++ b/src/plugins/platforms/cocoa/qcocoadrag.h @@ -45,7 +45,7 @@ #include <Cocoa/Cocoa.h> #include <QtGui> #include <qpa/qplatformdrag.h> -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qsimpledrag_p.h> #include <QtGui/private/qdnd_p.h> diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h index 9100b9b15f..7224ee2ff8 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.h +++ b/src/plugins/platforms/cocoa/qcocoamenu.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE +class QCocoaMenuBar; + class QCocoaMenu : public QPlatformMenu { public: @@ -87,6 +89,8 @@ public: QList<QCocoaMenuItem *> items() const; QList<QCocoaMenuItem *> merged() const; + void setMenuBar(QCocoaMenuBar *menuBar); + QCocoaMenuBar *menuBar() const; private: QCocoaMenuItem *itemOrNull(int index) const; void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem); @@ -97,6 +101,7 @@ private: NSObject *m_delegate; bool m_enabled; quintptr m_tag; + QCocoaMenuBar *m_menuBar; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 18e17a340d..d4cf83a380 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -177,7 +177,7 @@ static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader() } QKeyEvent accel_ev(QEvent::ShortcutOverride, (keyCode & (~Qt::KeyboardModifierMask)), - Qt::KeyboardModifiers(keyCode & Qt::KeyboardModifierMask)); + Qt::KeyboardModifiers(modifiers & Qt::KeyboardModifierMask)); accel_ev.ignore(); QCoreApplication::sendEvent(object, &accel_ev); if (accel_ev.isAccepted()) { @@ -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 8086676cc5..7a1bda74a4 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.h +++ b/src/plugins/platforms/cocoa/qcocoamenubar.h @@ -75,6 +75,8 @@ private: static QCocoaMenuBar *findGlobalMenubar(); bool shouldDisable(QCocoaWindow *active) const; + void insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu); + void removeNativeMenu(QCocoaMenu *menu); QList<QCocoaMenu*> m_menus; NSMenu *m_nativeMenu; diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index b112e40549..73331db40d 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -83,9 +83,24 @@ QCocoaMenuBar::~QCocoaMenuBar() } } -void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu) { QCocoaAutoReleasePool pool; + + if (beforeMenu) { + NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; + [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; + } else { + [m_nativeMenu addItem: menu->nsMenuItem()]; + } + + menu->setMenuBar(this); + syncMenu(static_cast<QPlatformMenu *>(menu)); + [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; +} + +void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before) +{ QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu); QCocoaMenu *beforeMenu = static_cast<QCocoaMenu *>(before); #ifdef QT_COCOA_ENABLE_MENU_DEBUG @@ -96,39 +111,36 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first"; return; } - if (beforeMenu) { - if (!m_menus.contains(beforeMenu)) { - qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; - return; - } - m_menus.insert(m_menus.indexOf(beforeMenu), menu); - NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()]; - [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex]; - } else { - m_menus.append(menu); - [m_nativeMenu addItem: menu->nsMenuItem()]; + + if (beforeMenu && !m_menus.contains(beforeMenu)) { + qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar"; + return; } - platformMenu->setParent(this); - syncMenu(platformMenu); - [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()]; + m_menus.insert(beforeMenu ? m_menus.indexOf(beforeMenu) : m_menus.size(), menu); + if (!menu->menuBar()) + insertNativeMenu(menu, beforeMenu); } -void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) +void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu) { QCocoaAutoReleasePool pool; + if (menu->menuBar() == this) + menu->setMenuBar(0); + NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; + [m_nativeMenu removeItemAtIndex: realIndex]; +} + +void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu) +{ QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu); if (!m_menus.contains(menu)) { qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar"; return; } m_menus.removeOne(menu); - - if (platformMenu->parent() == this) - platformMenu->setParent(0); - NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()]; - [m_nativeMenu removeItemAtIndex: realIndex]; + removeNativeMenu(menu); } void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) @@ -136,6 +148,17 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) QCocoaMenu *cocoaMenu = static_cast<QCocoaMenu *>(menu); Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items()) cocoaMenu->syncMenuItem(item); + + // If the NSMenu has no visble items, or only separators, we should hide it + // on the menubar. This can happen after syncing the menu items since they + // can be moved to other menus. + BOOL shouldHide = YES; + for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray]) + if (![item isSeparatorItem] && ![item isHidden]) { + shouldHide = NO; + break; + } + [cocoaMenu->nsMenuItem() setHidden:shouldHide]; } void QCocoaMenuBar::handleReparent(QWindow *newParentWindow) @@ -196,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()]; diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 1255f75eb7..1e2b593a08 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -241,7 +241,8 @@ NSMenuItem *QCocoaMenuItem::sync() mergeItem = [loader quitMenuItem]; break; default: - m_textSynced = true; + if (!m_text.isEmpty()) + m_textSynced = true; break; } break; @@ -264,7 +265,7 @@ NSMenuItem *QCocoaMenuItem::sync() m_native = nil; // create item below m_merged = false; } - } else { + } else if (!m_text.isEmpty()) { m_textSynced = true; // NoRole, and that was set explicitly. So, nothing to do anymore. } diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 60f448044e..b82d096bb5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -118,6 +118,7 @@ public: bool setKeyboardGrabEnabled(bool grab); bool setMouseGrabEnabled(bool grab); QMargins frameMargins() const; + QSurfaceFormat format() const; void requestActivateWindow(); @@ -135,6 +136,8 @@ public: bool windowShouldClose(); bool windowIsPopupType(Qt::WindowType type = Qt::Widget) const; + void setSynchedWindowStateFromWindow(); + NSInteger windowLevel(Qt::WindowFlags flags); NSUInteger windowStyleMask(Qt::WindowFlags flags); void setWindowShadow(Qt::WindowFlags flags); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c8ef967f20..19c4faf369 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -253,6 +253,11 @@ QCocoaWindow::~QCocoaWindow() [m_nsWindowDelegate release]; } +QSurfaceFormat QCocoaWindow::format() const +{ + return window()->requestedFormat(); +} + void QCocoaWindow::setGeometry(const QRect &rect) { if (geometry() == rect) @@ -481,7 +486,7 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) void QCocoaWindow::setWindowState(Qt::WindowState state) { - if ([m_nsWindow isVisible]) + if (window()->isVisible()) syncWindowState(state); // Window state set for hidden windows take effect when show() is called. } @@ -720,6 +725,12 @@ bool QCocoaWindow::windowShouldClose() return accepted; } +void QCocoaWindow::setSynchedWindowStateFromWindow() +{ + if (QWindow *w = window()) + m_synchedWindowState = w->windowState(); +} + bool QCocoaWindow::windowIsPopupType(Qt::WindowType type) const { if (type == Qt::Widget) @@ -818,6 +829,9 @@ NSWindow * QCocoaWindow::createNSWindow() if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { // Make popup winows show on the same desktop as the parent full-screen window. [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; + + if ((type & Qt::Popup) == Qt::Popup) + [window setAnimationBehavior:NSWindowAnimationBehaviorUtilityWindow]; } #endif window->m_cocoaPlatformWindow = this; diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 85f72a4dbb..92215b9e67 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -81,7 +81,9 @@ QT_END_NAMESPACE - (void)invalidateWindowShadowIfNeeded; - (void)drawRect:(NSRect)dirtyRect; - (void)updateGeometry; +- (void)notifyWindowStateChanged:(Qt::WindowState)newState; - (void)windowNotification : (NSNotification *) windowNotification; +- (void)notifyWindowWillZoom:(BOOL)willZoom; - (void)viewDidHide; - (void)viewDidUnhide; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 0916a1faa8..94b414a882 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -251,6 +251,15 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowStateChanged:(Qt::WindowState)newState +{ + QWindowSystemInterface::handleWindowStateChanged(m_window, newState); + // We want to read the window state back from the window, + // but the event we just sent may be asynchronous. + QWindowSystemInterface::flushWindowSystemEvents(); + m_platformWindow->setSynchedWindowStateFromWindow(); +} + - (void)windowNotification : (NSNotification *) windowNotification { //qDebug() << "windowNotification" << QCFString::toQString([windowNotification name]); @@ -269,10 +278,11 @@ static QTouchDevice *touchDevice = 0; if (!m_platformWindow->windowIsPopupType()) QWindowSystemInterface::handleWindowActivated(0); } - } else if (notificationName == NSWindowDidMiniaturizeNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowMinimized); - } else if (notificationName == NSWindowDidDeminiaturizeNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState); + } else if (notificationName == NSWindowDidMiniaturizeNotification + || notificationName == NSWindowDidDeminiaturizeNotification) { + Qt::WindowState newState = notificationName == NSWindowDidMiniaturizeNotification ? + Qt::WindowMinimized : Qt::WindowNoState; + [self notifyWindowStateChanged:newState]; } else if ([notificationName isEqualToString: @"NSWindowDidOrderOffScreenNotification"]) { m_platformWindow->obscureWindow(); } else if ([notificationName isEqualToString: @"NSWindowDidOrderOnScreenAndFinishAnimatingNotification"]) { @@ -290,10 +300,11 @@ static QTouchDevice *touchDevice = 0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { - if (notificationName == NSWindowDidEnterFullScreenNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowFullScreen); - } else if (notificationName == NSWindowDidExitFullScreenNotification) { - QWindowSystemInterface::handleWindowStateChanged(m_window, Qt::WindowNoState); + if (notificationName == NSWindowDidEnterFullScreenNotification + || notificationName == NSWindowDidExitFullScreenNotification) { + Qt::WindowState newState = notificationName == NSWindowDidEnterFullScreenNotification ? + Qt::WindowFullScreen : Qt::WindowNoState; + [self notifyWindowStateChanged:newState]; } } #endif @@ -301,6 +312,12 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowWillZoom:(BOOL)willZoom +{ + Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; + [self notifyWindowStateChanged:newState]; +} + - (void)viewDidHide { m_platformWindow->obscureWindow(); @@ -340,15 +357,20 @@ static QTouchDevice *touchDevice = 0; } const QRect &rect = region->boundingRect(); - QImage maskImage(rect.size(), QImage::Format_RGB888); - maskImage.fill(Qt::white); - QPainter p(&maskImage); - p.setRenderHint(QPainter::Antialiasing); + QImage tmp(rect.size(), QImage::Format_RGB32); + tmp.fill(Qt::white); + QPainter p(&tmp); p.setClipRegion(*region); - p.fillRect(rect, QBrush(Qt::black)); + p.fillRect(rect, Qt::black); p.end(); - - maskImage = maskImage.convertToFormat(QImage::Format_Indexed8); + QImage maskImage = QImage(rect.size(), QImage::Format_Indexed8); + for (int y=0; y<rect.height(); ++y) { + const uint *src = (const uint *) tmp.constScanLine(y); + uchar *dst = maskImage.scanLine(y); + for (int x=0; x<rect.width(); ++x) { + dst[x] = src[x] & 0xff; + } + } m_maskImage = qt_mac_toCGImage(maskImage, true, &m_maskData); } @@ -904,30 +926,25 @@ static QTouchDevice *touchDevice = 0; EventRef eventRef = EventRef([nsevent eventRef]); GetEventParameter(eventRef, kEventParamKeyCode, typeUInt32, 0, sizeof(nativeVirtualKey), 0, &nativeVirtualKey); - QChar ch; - int keyCode; - if ([charactersIgnoringModifiers length] > 0) { // convert the first character into a key code - if ((modifiers & Qt::ControlModifier) && ([characters length] != 0)) { - ch = QChar([characters characterAtIndex:0]); - } else { + QChar ch = QChar::ReplacementCharacter; + int keyCode = Qt::Key_unknown; + if ([characters length] != 0) { + if ((modifiers & Qt::MetaModifier) && ([charactersIgnoringModifiers length] != 0)) ch = QChar([charactersIgnoringModifiers characterAtIndex:0]); - } + else + ch = QChar([characters characterAtIndex:0]); keyCode = [self convertKeyCode:ch]; - } else { - // might be a dead key - ch = QChar::ReplacementCharacter; - keyCode = Qt::Key_unknown; } // we will send a key event unless the input method sets m_sendKeyEvent to false m_sendKeyEvent = true; - QString text; + // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when + // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) + if (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) + text = QCFString::toQString(characters); + if (eventType == QEvent::KeyPress) { - // ignore text for the U+F700-U+F8FF range. This is used by Cocoa when - // delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.) - if ([charactersIgnoringModifiers length] == 1 && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff)) - text = QCFString::toQString(characters); if (m_composingText.isEmpty()) m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(m_window, timestamp, keyCode, modifiers, text); diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h index 9a616ba8e8..06e11fffbb 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.h +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h @@ -57,6 +57,7 @@ - (void)windowDidMove:(NSNotification *)notification; - (void)windowWillMove:(NSNotification *)notification; - (BOOL)windowShouldClose:(NSNotification *)notification; +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame; @end diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 8e17936a78..10536bd5f4 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -90,4 +90,12 @@ return YES; } +- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame +{ + Q_UNUSED(newFrame); + if (m_cocoaWindow && m_cocoaWindow->m_qtView) + [m_cocoaWindow->m_qtView notifyWindowWillZoom:![window isZoomed]]; + return YES; +} + @end diff --git a/src/plugins/platforms/cocoa/qt_mac_p.h b/src/plugins/platforms/cocoa/qt_mac_p.h index 0906431986..808ca9194b 100644 --- a/src/plugins/platforms/cocoa/qt_mac_p.h +++ b/src/plugins/platforms/cocoa/qt_mac_p.h @@ -111,21 +111,6 @@ public: } }; -// Class for chaining to gether a bunch of fades. It pretty much is only used for qmenu fading. -class QMacWindowFader -{ - QWidgetList m_windowsToFade; - float m_duration; - Q_DISABLE_COPY(QMacWindowFader) -public: - QMacWindowFader(); // PLEASE DON'T CALL THIS. - static QMacWindowFader *currentFader(); - void registerWindowToFade(QWidget *window); - void setFadeDuration(float durationInSecs) { m_duration = durationInSecs; } - float fadeDuration() const { return m_duration; } - void performFade(); -}; - class Q_WIDGETS_EXPORT QMacCocoaAutoReleasePool { private: diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp index 91a97ff977..c334f46c2c 100644 --- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -99,6 +99,7 @@ QSizeF QEglFSHooks::physicalScreenSize() const struct fb_var_screeninfo vinfo; int w = -1; int h = -1; + QSize screenResolution; if (framebuffer != -1) { if (ioctl(framebuffer, FBIOGET_VSCREENINFO, &vinfo) == -1) { @@ -106,12 +107,15 @@ QSizeF QEglFSHooks::physicalScreenSize() const } else { w = vinfo.width; h = vinfo.height; + screenResolution = QSize(vinfo.xres, vinfo.yres); } + } else { + screenResolution = screenSize(); } const int defaultPhysicalDpi = 100; - size.setWidth(w <= 0 ? vinfo.xres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w)); - size.setHeight(h <= 0 ? vinfo.yres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h)); + size.setWidth(w <= 0 ? screenResolution.width() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w)); + size.setHeight(h <= 0 ? screenResolution.height() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h)); if (w <= 0 || h <= 0) { qWarning("EGLFS: Unable to query physical screen size, defaulting to %d dpi.\n" diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index cd92a07f00..98c54e0ee0 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -68,11 +68,11 @@ QEglFSWindow::~QEglFSWindow() void QEglFSWindow::create() { - setWindowState(Qt::WindowFullScreen); - if (m_window) return; + setWindowState(Qt::WindowFullScreen); + if (window()->type() == Qt::Desktop) { QRect rect(QPoint(), QEglFSHooks::hooks()->screenSize()); QPlatformWindow::setGeometry(rect); diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm index 9abb4ba851..537d63ae77 100644 --- a/src/plugins/platforms/ios/qiosglobal.mm +++ b/src/plugins/platforms/ios/qiosglobal.mm @@ -142,7 +142,7 @@ QRect fromPortraitToPrimary(const QRect &rect, QPlatformScreen *screen) // aligned with UIScreen into whatever is the current orientation of QScreen. QRect geometry = screen->geometry(); return geometry.width() < geometry.height() ? rect - : QRect(rect.y(), geometry.width() - rect.width() - rect.x(), rect.height(), rect.width()); + : QRect(rect.y(), geometry.height() - rect.width() - rect.x(), rect.height(), rect.width()); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm index c1613c1af4..106cf1a978 100644 --- a/src/plugins/platforms/ios/qiosscreen.mm +++ b/src/plugins/platforms/ios/qiosscreen.mm @@ -136,7 +136,7 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex) int unscaledDpi = 163; // Regular iPhone DPI if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad - && deviceIdentifier != QStringLiteral("iPad2,5") /* iPad Mini */) { + && !deviceIdentifier.contains(QRegularExpression("^iPad2,[567]$")) /* excluding iPad Mini */) { unscaledDpi = 132; }; diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 13815a22bf..0c3ae8e834 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -150,7 +150,8 @@ - (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state { - QRect applicationRect = fromCGRect(self.window.screen.applicationFrame); + QPlatformScreen *screen = QGuiApplication::primaryScreen()->handle(); + QRect applicationRect = fromPortraitToPrimary(fromCGRect(self.window.screen.applicationFrame), screen); foreach (UITouch *uiTouch, m_activeTouches.keys()) { QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch]; @@ -163,8 +164,10 @@ // Find the touch position relative to the window. Then calculate the screen // position by subtracting the position of the applicationRect (since UIWindow // does not take that into account when reporting its own frame): - QPoint touchPos = fromCGPoint([uiTouch locationInView:nil]); - touchPoint.area = QRectF(touchPos - applicationRect.topLeft(), QSize(0, 0)); + QRect touchInWindow = QRect(fromCGPoint([uiTouch locationInView:nil]), QSize(0, 0)); + QRect touchInScreen = fromPortraitToPrimary(touchInWindow, screen); + QPoint touchPos = touchInScreen.topLeft() - applicationRect.topLeft(); + touchPoint.area = QRectF(touchPos, QSize(0, 0)); touchPoint.normalPosition = QPointF(touchPos.x() / applicationRect.width(), touchPos.y() / applicationRect.height()); } } diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 005b6d272a..ed959467ff 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -315,6 +315,9 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) } platformWindow->setBufferSize(surfaceSize); + // Post root window, in case it hasn't been posted yet, to make it appear. + platformWindow->screen()->onWindowPost(platformWindow); + // Obtain the native handle for our window screen_window_t handle = platformWindow->nativeHandle(); diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 072f60dff8..feb05e3093 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -89,7 +89,7 @@ #include <QtGui/QOpenGLContext> #endif -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qsimpledrag_p.h> #include <QtCore/QDebug> #include <QtCore/QHash> diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 7204e5bce9..6a7a4d0944 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -81,6 +81,12 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window(); + // Sometimes this method is called even though there is nothing to be + // flushed, for instance, after an expose event directly follows a + // geometry change event. + if (!m_hasUnflushedPaintOperations) + return; + QQnxWindow *targetWindow = 0; if (window) targetWindow = static_cast<QQnxWindow *>(window->handle()); @@ -117,7 +123,6 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const // We assume that the TLW has been flushed previously and that no changes were made to the // backing store inbetween (### does Qt guarantee this?) - Q_ASSERT(!m_hasUnflushedPaintOperations); targetWindow->adjustBufferSize(); targetWindow->blitFrom(platformWindow, offset, region); diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 9523685f70..7daab24d3c 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -200,6 +200,7 @@ void QQnxWindow::setGeometry(const QRect &rect) // could result in re-entering QQnxWindow::setGeometry() again. QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); QWindowSystemInterface::handleGeometryChange(window(), rect); + QWindowSystemInterface::handleExposeEvent(window(), rect); QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); // Now move all children. diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h index d4f141c5d8..5b8d08d3c8 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE bool debug_accessibility(); # define accessibleDebug !debug_accessibility() ? (void)0 : qDebug #else -# define accessibleDebug +# define accessibleDebug while (false) qDebug #endif #ifndef QT_NO_DEBUG_OUTPUT diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 33b4eb4771..f7ccb00233 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -825,7 +825,7 @@ public: inline void updateDirectory() { setDirectory(m_data.directory()); } inline QString directory() const; virtual void exec(HWND owner = 0); - inline void setNameFilters(const QStringList &f); + virtual void setNameFilters(const QStringList &f); inline void selectNameFilter(const QString &filter); inline void updateSelectedNameFilter() { selectNameFilter(m_data.selectedNameFilter()); } inline QString selectedNameFilter() const; @@ -1335,12 +1335,11 @@ class QWindowsNativeSaveFileDialog : public QWindowsNativeFileDialogBase { Q_OBJECT public: - explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data); + explicit QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data) + : QWindowsNativeFileDialogBase(data) {} + virtual void setNameFilters(const QStringList &f); virtual QStringList selectedFiles() const; virtual QStringList dialogResult() const; - -private slots: - void slotFilterSelected(const QString &); }; // Return the first suffix from the name filter "Foo files (*.foo;*.bar)" -> "foo". @@ -1358,20 +1357,21 @@ static inline QString suffixFromFilter(const QString &filter) return endPos >= 0 ? filter.mid(suffixPos, endPos - suffixPos) : QString(); } -QWindowsNativeSaveFileDialog::QWindowsNativeSaveFileDialog(const QWindowsFileDialogSharedData &data) - : QWindowsNativeFileDialogBase(data) +void QWindowsNativeSaveFileDialog::setNameFilters(const QStringList &f) { - connect(this, &QWindowsNativeFileDialogBase::filterSelected, - this, &QWindowsNativeSaveFileDialog::slotFilterSelected); -} - -void QWindowsNativeSaveFileDialog::slotFilterSelected(const QString &filter) -{ - // Cause the dialog to append the suffix of the current filter unless a default - // suffix is set (Note: Qt 4.8 sets the selected filter's suffix before - // calling GetSaveFileName()). - if (!hasDefaultSuffix()) - setDefaultSuffixSys(suffixFromFilter(filter)); + QWindowsNativeFileDialogBase::setNameFilters(f); + // QTBUG-31381, QTBUG-30748: IFileDialog will update the suffix of the selected name + // filter only if a default suffix is set (see docs). Set the first available + // suffix unless we have a defaultSuffix. + if (!hasDefaultSuffix()) { + foreach (const QString &filter, f) { + const QString suffix = suffixFromFilter(filter); + if (!suffix.isEmpty()) { + setDefaultSuffixSys(suffix); + break; + } + } + } // m_hasDefaultSuffix } QStringList QWindowsNativeSaveFileDialog::dialogResult() const diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 73df3ec032..fc2ba454df 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -433,6 +433,9 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons return 0; if (requested.flags != obtained.flags) window->setFlags(obtained.flags); + // Trigger geometry change signals of QWindow. + if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry) + QWindowSystemInterface::handleGeometryChange(window, obtained.geometry); return new QWindowsWindow(window, obtained); } @@ -552,11 +555,15 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co break; case QPlatformIntegration::UseRtlExtensions: return QVariant(d->m_context.useRTLExtensions()); +#ifdef Q_OS_WINCE case QPlatformIntegration::SynthesizeMouseFromTouchEvents: // We do not want Qt to synthesize mouse events as Windows also does that. // Alternatively, Windows-generated touch mouse events can be identified and // ignored by checking GetMessageExtraInfo() for MI_WP_SIGNATURE (0xFF515700). return false; +#endif // Q_OS_WINCE + default: + break; } return QPlatformIntegration::styleHint(hint); } diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index fd00a07d6c..5c096b7eca 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -157,9 +157,19 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result) { + enum { signatureMask = 0xffffff00, miWpSignature = 0xff515700 }; + if (et == QtWindows::MouseWheelEvent) return translateMouseWheelEvent(window, hwnd, msg, result); +#ifndef Q_OS_WINCE + // Check for events synthesized from touch. Lower byte is touch index, 0 means pen. + const LPARAM extraInfo = GetMessageExtraInfo(); + const bool fromTouch = (extraInfo & signatureMask) == miWpSignature && (extraInfo & 0xff); + if (fromTouch) + return false; +#endif // !Q_OS_WINCE + const QPoint winEventPosition(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam)); if (et & QtWindows::NonClientEventFlag) { const QPoint globalPosition = winEventPosition; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 73c78f0090..9d817c2043 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -503,11 +503,6 @@ QWindowsWindow::WindowData const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle)); QWindowsContext::instance()->setWindowCreationContext(context); - if (context->frameX < 0) - context->frameX = 0; - if (context->frameY < 0) - context->frameY = 0; - if (QWindowsContext::verboseWindows) qDebug().nospace() << "CreateWindowEx: " << w << *this diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index db736cef4e..4961e0377c 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -57,8 +57,8 @@ #include <qpa/qwindowsysteminterface.h> -#include <QtPlatformSupport/private/qshapedpixmapdndwindow_p.h> -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qshapedpixmapdndwindow_p.h> +#include <private/qsimpledrag_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index 5678c2d303..5648f70d9e 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -43,7 +43,7 @@ #define QXCBDRAG_H #include <qpa/qplatformdrag.h> -#include <QtPlatformSupport/private/qsimpledrag_p.h> +#include <private/qsimpledrag_p.h> #include <qxcbobject.h> #include <xcb/xcb.h> #include <qlist.h> diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 155b327315..db53e7471e 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -248,6 +248,7 @@ #define XF86XK_TouchpadToggle 0x1008FFA9 #define XF86XK_TouchpadOn 0x1008FFB0 #define XF86XK_TouchpadOff 0x1008FFB1 +#define XF86XK_AudioMicMute 0x1008FFB2 // end of XF86keysyms.h @@ -543,6 +544,7 @@ static const unsigned int KeyTbl[] = { XF86XK_TouchpadToggle, Qt::Key_TouchpadToggle, XF86XK_TouchpadOn, Qt::Key_TouchpadOn, XF86XK_TouchpadOff, Qt::Key_TouchpadOff, + XF86XK_AudioMicMute, Qt::Key_MicMute, XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 6: remap properly XF86XK_Launch1, Qt::Key_Launch3, XF86XK_Launch2, Qt::Key_Launch4, diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 6291396e6e..e1bc7d36eb 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1367,10 +1367,10 @@ void QXcbWindow::requestActivateWindow() event.data.data32[4] = 0; Q_XCB_CALL(xcb_send_event(xcb_connection(), 0, m_screen->root(), XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT, (const char *)&event)); - } else { - Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time())); } + Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), XCB_INPUT_FOCUS_PARENT, m_window, connection()->time())); + connection()->sync(); } diff --git a/src/tools/bootstrap-dbus/bootstrap-dbus.pro b/src/tools/bootstrap-dbus/bootstrap-dbus.pro index 6af70efda7..62f9f96a9b 100644 --- a/src/tools/bootstrap-dbus/bootstrap-dbus.pro +++ b/src/tools/bootstrap-dbus/bootstrap-dbus.pro @@ -7,8 +7,9 @@ CONFIG += no_module_headers internal_module force_bootstrap DEFINES += \ QT_NO_CAST_FROM_ASCII +MODULE_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtDBus MODULE_PRIVATE_INCLUDES = \ - \$\$QT_MODULE_INCLUDE_BASE/QtDBus \ \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtDBus/$$QT_VERSION/QtDBus diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 972f57260e..bf19828634 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -30,12 +30,13 @@ DEFINES += \ DEFINES -= QT_EVAL -MODULE_PRIVATE_INCLUDES = \ +MODULE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE \ \$\$QT_MODULE_INCLUDE_BASE/QtCore \ + \$\$QT_MODULE_INCLUDE_BASE/QtXml +MODULE_PRIVATE_INCLUDES = \ \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtCore/$$QT_VERSION/QtCore \ - \$\$QT_MODULE_INCLUDE_BASE/QtXml \ \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION \ \$\$QT_MODULE_INCLUDE_BASE/QtXml/$$QT_VERSION/QtXml diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp index e39ff203a5..c7d9c5b339 100644 --- a/src/tools/qdoc/codemarker.cpp +++ b/src/tools/qdoc/codemarker.cpp @@ -397,8 +397,11 @@ void CodeMarker::insert(FastSection &fastSection, bool irrelevant = false; bool inheritedMember = false; if (!node->relates()) { - if (node->parent() != fastSection.parent_) { // && !node->parent()->isAbstract()) { - if ((node->parent()->subType() != Node::QmlClass) || !node->parent()->isAbstract()) { + InnerNode* p = node->parent(); + if (p->subType() == Node::QmlPropertyGroup) + p = p->parent(); + if (p != fastSection.parent_) { // && !node->parent()->isAbstract()) { + if (p->subType() != Node::QmlClass || !p->isAbstract()) { //if (node->type() != Node::QmlProperty) { inheritedMember = true; } diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index 107af96607..273cb60d7d 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -1089,7 +1089,7 @@ QStringList Config::getFilesHere(const QString& uncleanDir, const QSet<QString> &excludedDirs, const QSet<QString> &excludedFiles) { - QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : Location::canonicalRelativePath(uncleanDir); + QString dir = location.isEmpty() ? QDir::cleanPath(uncleanDir) : QDir(uncleanDir).canonicalPath(); QStringList result; if (excludedDirs.contains(dir)) return result; diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index eea1845e17..dd87e889bf 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -3138,7 +3138,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative) // If we encounter a group definition page, we add all // the pages in that group to the list for that group. foreach (Node* member, docNode->members()) { - if (member->type() != Node::Document) + if (member->isInternal() || member->type() != Node::Document) continue; DocNode* page = static_cast<DocNode*>(member); if (page) { @@ -3155,7 +3155,7 @@ void DitaXmlGenerator::generateOverviewList(const Node* relative) // If we encounter a page that belongs to a group then // we add that page to the list for that group. const DocNode* gn = qdb_->getGroup(group); - if (gn) + if (gn && !docNode->isInternal()) docNodeMap[gn].insert(sortKey, docNode); } } diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc b/src/tools/qdoc/doc/examples/cpp.qdoc.sample index 08286b956a..08286b956a 100644 --- a/src/tools/qdoc/doc/examples/cpp.qdoc +++ b/src/tools/qdoc/doc/examples/cpp.qdoc.sample diff --git a/src/tools/qdoc/doc/examples/qml.qdoc b/src/tools/qdoc/doc/examples/qml.qdoc.sample index d913c6f164..d913c6f164 100644 --- a/src/tools/qdoc/doc/examples/qml.qdoc +++ b/src/tools/qdoc/doc/examples/qml.qdoc.sample diff --git a/src/tools/qdoc/doc/files/qtgui.qdocconf b/src/tools/qdoc/doc/files/qtgui.qdocconf new file mode 100644 index 0000000000..5073dd7f0f --- /dev/null +++ b/src/tools/qdoc/doc/files/qtgui.qdocconf @@ -0,0 +1,50 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) + +project = QtGui +description = Qt GUI Reference Documentation +url = http://qt-project.org/doc/qt-$QT_VER/qtgui +version = $QT_VERSION + +examplesinstallpath = gui + +qhp.projects = QtGui + +qhp.QtGui.file = qtgui.qhp +qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG +qhp.QtGui.virtualFolder = qtgui +qhp.QtGui.indexTitle = Qt GUI +qhp.QtGui.indexRoot = + +qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc +qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION +qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION + +qhp.QtGui.subprojects = classes +qhp.QtGui.subprojects.classes.title = C++ Classes +qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes +qhp.QtGui.subprojects.classes.selectors = class fake:headerfile +qhp.QtGui.subprojects.classes.sortPages = true + +tagfile = ../../../doc/qtgui/qtgui.tags + +depends += \ + qtcore \ + qtnetwork \ + qtopengl \ + qtsvg \ + qtqml \ + qtquick \ + qtwidgets \ + qtdoc + +headerdirs += .. + +sourcedirs += .. \ + ../../../examples/gui/doc/src + +exampledirs += ../../../examples/gui \ + snippets + +imagedirs += images \ + ../../../examples/gui/doc/images \ + ../../../doc/src/images \ diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc index 4ad1f19f67..2095c4e7cb 100644 --- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc +++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc @@ -41,7 +41,7 @@ Note that the documentation must be in the implementation files such as \c .cpp. Class documentation is generated using the \l{class-command}{\\class} command and the name of the class as the first argument. -\snippet examples/cpp.qdoc class +\snippet examples/cpp.qdoc.sample class \l{Context commands} add information about the class, such as its module or which version the class was added. @@ -79,7 +79,7 @@ Typically, function documentation immediately precedes the implementation of the function in the \c .cpp file. For function documentation that is not immediately above the implementation, the \l{fn-command}{\\fn} is needed. -\snippet examples/cpp.qdoc function +\snippet examples/cpp.qdoc.sample function The function documentation starts with a verb, indicating the operation the function performs. This also applies to constructors and destructors. @@ -102,7 +102,7 @@ The \l{a-command}{\\a} command marks the parameter in the documentation. The return type documentation should link to the type documentation or be marked with the \l{c-command}{\\c} command in the case of boolean values. -\snippet examples/cpp.qdoc return +\snippet examples/cpp.qdoc.sample return \section1 Properties @@ -110,7 +110,7 @@ The property documentation resides immediately above the read function's implementation. The \l{topic-commands}{topic command} for properties is \l{property-command}{\\property}. -\snippet examples/cpp.qdoc property +\snippet examples/cpp.qdoc.sample property Property documentation usually starts with "This property...", but these are alternate expressions: @@ -142,7 +142,7 @@ The \l{topic-commands}{topic command} for signals, notifiers, and slots is \l{fn-command}{\\fn}. Signal documentation state when they are triggered or emitted. -\snippet examples/cpp.qdoc signals +\snippet examples/cpp.qdoc.sample signals Signal documentation typically begin with "This signal is triggered when...". Here are alternate styles: @@ -164,7 +164,7 @@ notifiers together. To refer to a specifc version of a notifier or signal, simply refer to the property and mention that there are different versions of the notifier. -\snippet examples/cpp.qdoc overloaded notifier +\snippet examples/cpp.qdoc.sample overloaded notifier \section1 Enums, Namespaces, and other Types @@ -181,7 +181,7 @@ continues with the type description. For enumerations, the \l{value-command}{\\value} command is for listing the values. QDoc creates a table of values for the enum. -\snippet examples/cpp.qdoc enums +\snippet examples/cpp.qdoc.sample enums */ diff --git a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc index 2d67e62f94..7ca0abed71 100644 --- a/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc +++ b/src/tools/qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc @@ -60,7 +60,7 @@ does not exist. The class documentation may be marked as The \l{qmltype-command}{\\qmltype} command is for QML type documentation. -\snippet examples/qml.qdoc qmltype +\snippet examples/qml.qdoc.sample qmltype The \l{instantiates-command}{\\instantiates} accepts the C++ class which implements the QML type as the argument. For types implemented in QML, this @@ -108,7 +108,7 @@ with the \l{qmlsignal-command}{\\qmlsignal} command. Signal documentation must include the condition for emitting the signal, mention the corresponding signal handler, and document whether the signal accepts a parameter. -\snippet examples/qml.qdoc signals +\snippet examples/qml.qdoc.sample signals These are the possible documentation styles for signals: \list @@ -127,7 +127,7 @@ documentation must reside immediately above the function declaration. The function documentation starts with a verb, indicating the operation the function performs. -\snippet examples/qml.qdoc function +\snippet examples/qml.qdoc.sample function Some common verbs for function documentation: \list @@ -153,7 +153,7 @@ QML enumerations are documented as QML properties with the \l{qmlproperty-command}{\\qmlproperty} command. The type of the property is \c enumeration. -\snippet examples/qml.qdoc enums +\snippet examples/qml.qdoc.sample enums The QDoc comment lists the values of the enumeration. If the enumeration is implemented in C++, the documentation may link to the corresponding C++ diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc index b715b200bf..4a4b1db6ff 100644 --- a/src/tools/qdoc/doc/qdoc-manual.qdoc +++ b/src/tools/qdoc/doc/qdoc-manual.qdoc @@ -66,7 +66,7 @@ \li \l {HTML Specific Configuration Variables} \li \l {Supporting Derived Projects} \li \l {Example Manifest Files} - \li \l {qt.qdocconf} + \li \l {qtgui.qdocconf} \li \l {minimum.qdocconf} \li \l {Generating DITA XML Output} \endlist @@ -7179,13 +7179,13 @@ \list \li A minimum configuration file: \l minimum.qdocconf - \li The Qt configuration file: \l qt.qdocconf + \li The Qt configuration file: \l qtgui.qdocconf \endlist */ /*! \page 21-1-minimum-qdocconf.html - \previouspage qt.qdocconf + \previouspage qtgui.qdocconf \contentspage QDoc Manual \nextpage Generating DITA XML Output @@ -7195,14 +7195,14 @@ */ /*! - \page 21-2-qt-qdocconf.html + \page 21-2-qtgui-qdocconf.html \previouspage Supporting Derived Projects \contentspage QDoc Manual \nextpage minimum.qdocconf - \title qt.qdocconf + \title qtgui.qdocconf - \quotefile files/qt.qdocconf + \quotefile files/qtgui.qdocconf */ /*! @@ -7548,10 +7548,9 @@ The general syntax is \tt {extraimages.\e{format} = \e image}. The file extension is optional. - For example, in \l qt.qdocconf we use a couple of images within - the HTML.postheader variable which value is pure HTML. For that - reason, these images are specified using the \c extraimages - variable: + For example, if additional images are used within the HTML.postheader + value, then these images must also be specified using the \c + extraimages variable: \code extraimages.HTML = qt-logo @@ -7819,7 +7818,7 @@ Currently, C++ is the only language that QDoc understands. It is also the default language, and doesn't really need to be - specified. But for example in \l qt.qdocconf: + specified. \code language = Cpp @@ -7889,7 +7888,7 @@ The \c outputdir variable specifies the directory where QDoc will put the generated documentation. - In qt.qdocconf: + For example: \code outputdir = $QTDIR/doc/html @@ -7972,8 +7971,6 @@ The \c sourcedirs variable specifies the directories containing the \c .cpp or \c .qdoc files used in the documentation. - For example in \l qt.qdocconf - \code sourcedirs = $QTDIR/src \ $QTDIR/doc/src \ @@ -8157,7 +8154,7 @@ The \c versionsym variable specifies a C++ preprocessor symbol that defines the version number of the documented software. - For example in \l qt.qdocconf: + For example: \code versionsym = QT_VERSION_STR @@ -8270,7 +8267,7 @@ Cpp.ignoredirectives} variables, non-standard constructs (typically macros) can result in erroneous documentation. - In \l qt.qdocconf: + For example: \code Cpp.ignoredirectives = Q_DECLARE_INTERFACE \ @@ -8324,8 +8321,6 @@ Cpp.ignoredirectives} variables, non-standard constructs (typically macros) can result in erroneous documentation. - In \l qt.qdocconf: - \code Cpp.ignoretokens = QAXFACTORY_EXPORT \ QM_EXPORT_CANVAS \ @@ -8389,18 +8384,12 @@ quotation marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ ... "</tr></table></div></address>" \endcode - The complete variable entry in \l qt.qdocconf provides the - standard footer of the \l {http://doc.qt.digia.com/4.0/index.html} - {Qt Reference Documentation}. - \target HTML.postheader-variable \section1 HTML.postheader @@ -8414,8 +8403,6 @@ marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.postheader = "<table border=\"0\"..." \ ... @@ -8426,8 +8413,6 @@ "</table>" \endcode - The complete variable entry in \l qt.qdocconf provides the - standard header of the \l {http://doc.qt.digia.com/} {Qt Reference Documentation}. \target HTML.style-variable @@ -8440,8 +8425,6 @@ marks. Note that if the value spans several lines, each line needs to be enclosed by quotation marks. - For example in \l qt.qdocconf: - \code HTML.style = "h3.fn,span.fn" \ "{ margin-left: 1cm; text-indent: -1cm; }\n" \ @@ -8473,7 +8456,7 @@ \endcode QDoc expects to find stylesheets in the directory containing the - \l qt.qdocconf file, and it will copy those specified to the output + \l qtgui.qdocconf file, and it will copy those specified to the output directory alongside the HTML pages. */ @@ -8565,7 +8548,7 @@ This feature makes use of the comprehensive indexes generated by QDoc when it creates the Qt reference documentation. - For example, \l qt.qdocconf (the configuration file for Qt) + For example, \l qtgui.qdocconf (the configuration file for Qt) contains the following variable definitions: \code @@ -8585,9 +8568,6 @@ In a mini-project, you can use an index file by defining an \l indexes configuration variable in your \c .qdocconf file. - For example, you can create a \c qtcreator.qdocconf file to help you - check the Qt Creator documentation: - \code project = QtCreator description = Qt Creator Manual diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 2dc4c1e6c6..3d6f04decf 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -1755,12 +1755,12 @@ void HtmlGenerator::generateHeader(const QString& title, if (shortVersion.count(QChar('.')) == 2) shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); if (!project.isEmpty()) - shortVersion = project + QLatin1Char(' ') + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + project + QLatin1Char(' ') + shortVersion; else - shortVersion = QLatin1String("Qt ") + shortVersion + QLatin1String(": "); + shortVersion = QLatin1String(" | ") + QLatin1String("Qt ") + shortVersion ; // Generating page title - out() << " <title>" << shortVersion << protectEnc(title) << "</title>\n"; + out() << " <title>" << protectEnc(title) << shortVersion << "</title>\n"; // Include style sheet and script links. out() << headerStyles; @@ -2644,7 +2644,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative) // If we encounter a group definition page, we add all // the pages in that group to the list for that group. foreach (Node *member, docNode->members()) { - if (member->type() != Node::Document) + if (member->isInternal() || member->type() != Node::Document) continue; DocNode *page = static_cast<DocNode *>(member); if (page) { @@ -2661,7 +2661,7 @@ void HtmlGenerator::generateOverviewList(const Node *relative) // If we encounter a page that belongs to a group then // we add that page to the list for that group. const DocNode* gn = qdb_->getGroup(group); - if (gn) + if (gn && !docNode->isInternal()) docNodeMap[gn].insert(sortKey, docNode); } } diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index e627cf859e..2184e302ae 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -862,9 +862,12 @@ Node* InnerNode::findChildNodeByNameAndType(const QString& name, Type type) if (type == Function) return primaryFunctionMap.value(name); else { - Node *node = childMap.value(name); - if (node && node->type() == type) - return node; + QList<Node*> nodes = childMap.values(name); + for (int i=0; i<nodes.size(); ++i) { + Node* node = nodes.at(i); + if (node->type() == type) + return node; + } } return 0; } diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index daba2cc78a..5f2ebdfd07 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -1183,8 +1183,13 @@ void QDocIndexFiles::generateIndexSections(QXmlStreamWriter& writer, It is just a place holder for a collection of QML property nodes. Recurse to its children, which are the QML property nodes. + + Do the same thing for collision nodes - we want children + of collision nodes in the index, but leaving out the + parent collision page will make searching for nodes easier. */ - if (child->subType() == Node::QmlPropertyGroup) { + if (child->subType() == Node::QmlPropertyGroup || + child->subType() == Node::Collision) { const InnerNode* pgn = static_cast<const InnerNode*>(child); foreach (Node* c, pgn->childNodes()) { generateIndexSections(writer, c, generateInternalNodes); diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index 6859cd0cd4..cedefb801a 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -587,8 +587,8 @@ QT_CLASS_LIB(QFontDialog, QtWidgets, qfontdialog.h) QT_CLASS_LIB(QInputDialog, QtWidgets, qinputdialog.h) QT_CLASS_LIB(QMessageBox, QtWidgets, qmessagebox.h) QT_CLASS_LIB(QPageSetupDialog, QtWidgets, qpagesetupdialog.h) -QT_CLASS_LIB(QPrintDialog, QtWidgets, qprintdialog.h) -QT_CLASS_LIB(QPrintPreviewDialog, QtWidgets, qprintpreviewdialog.h) +QT_CLASS_LIB(QPrintDialog, QtPrintSupport, qprintdialog.h) +QT_CLASS_LIB(QPrintPreviewDialog, QtPrintSupport, qprintpreviewdialog.h) QT_CLASS_LIB(QProgressDialog, QtWidgets, qprogressdialog.h) QT_CLASS_LIB(QWizard, QtWidgets, qwizard.h) QT_CLASS_LIB(QWizardPage, QtWidgets, qwizard.h) @@ -944,7 +944,7 @@ QT_CLASS_LIB(QMenuBar, QtWidgets, qmenubar.h) QT_CLASS_LIB(QMenuItem, QtWidgets, qmenudata.h) QT_CLASS_LIB(QPlainTextEdit, QtWidgets, qplaintextedit.h) QT_CLASS_LIB(QPlainTextDocumentLayout, QtWidgets, qplaintextedit.h) -QT_CLASS_LIB(QPrintPreviewWidget, QtWidgets, qprintpreviewwidget.h) +QT_CLASS_LIB(QPrintPreviewWidget, QtPrintSupport, qprintpreviewwidget.h) QT_CLASS_LIB(QProgressBar, QtWidgets, qprogressbar.h) QT_CLASS_LIB(QPushButton, QtWidgets, qpushbutton.h) QT_CLASS_LIB(QRadioButton, QtWidgets, qradiobutton.h) diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index d6254076c5..79a71599c0 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -1776,6 +1776,8 @@ void QColorDialog::setOptions(ColorDialogOptions options) d->options->setOptions(QColorDialogOptions::ColorDialogOptions(int(options))); d->buttons->setVisible(!(options & NoButtons)); d->showAlpha(options & ShowAlphaChannel); + if (options & DontUseNativeDialog) + d->nativeDialogInUse = false; } QColorDialog::ColorDialogOptions QColorDialog::options() const @@ -1794,8 +1796,8 @@ QColorDialog::ColorDialogOptions QColorDialog::options() const \value ShowAlphaChannel Allow the user to select the alpha component of a color. \value NoButtons Don't display \uicontrol{OK} and \uicontrol{Cancel} buttons. (Useful for "live dialogs".) - \value DontUseNativeDialog Use Qt's standard color dialog on the Mac instead of Apple's - native color panel. + \value DontUseNativeDialog Use Qt's standard color dialog instead of the operating system + native color dialog. \sa options, setOption(), testOption(), windowModality() */ diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index a76c88dc5e..2cda99a269 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -150,12 +150,11 @@ void QDialogPrivate::deletePlatformHelper() provide a \l{#return}{return value}, and they can have \l{#default}{default buttons}. QDialogs can also have a QSizeGrip in their lower-right corner, using setSizeGripEnabled(). - Note that QDialog (an any other widget that has type Qt::Dialog) uses - the parent widget slightly differently from other classes in Qt. A - dialog is always a top-level widget, but if it has a parent, its - default location is centered on top of the parent's top-level widget - (if it is not top-level itself). It will also share the parent's - taskbar entry. + Note that QDialog (and any other widget that has type \c Qt::Dialog) uses + the parent widget slightly differently from other classes in Qt. A dialog is + always a top-level widget, but if it has a parent, its default location is + centered on top of the parent's top-level widget (if it is not top-level + itself). It will also share the parent's taskbar entry. Use the overload of the QWidget::setParent() function to change the ownership of a QDialog widget. This function allows you to diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 4ec828ac83..995d279e13 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1392,7 +1392,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e) #if !defined(QT_NO_TEXTEDIT) if (e == QKeySequence::Copy) { - if (d->detailsText->isVisible() && d->detailsText->copy()) { + if (d->detailsText && d->detailsText->isVisible() && d->detailsText->copy()) { e->setAccepted(true); return; } diff --git a/src/widgets/graphicsview/qgridlayoutengine.cpp b/src/widgets/graphicsview/qgridlayoutengine.cpp index b80612bc47..4f43a0a4ac 100644 --- a/src/widgets/graphicsview/qgridlayoutengine.cpp +++ b/src/widgets/graphicsview/qgridlayoutengine.cpp @@ -291,7 +291,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz int stretch = stretches[start + i]; if (sumStretches == 0) { - if (hasIgnoreFlag) { + if (hasIgnoreFlag || sizes[i] == 0.0) { factors[i] = (stretch < 0) ? 1.0 : 0.0; } else { factors[i] = (stretch < 0) ? sizes[i] : 0.0; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index edd7cafd83..0da9460794 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2840,6 +2840,37 @@ bool QApplication::notify(QObject *receiver, QEvent *e) break; } + switch (e->type()) { + case QEvent::KeyPress: + { + bool isWidget = receiver->isWidgetType(); + bool isWindow = receiver->isWindowType(); + bool isGraphicsWidget = false; +#ifndef QT_NO_GRAPHICSVIEW + isGraphicsWidget = !isWidget && !isWindow && qobject_cast<QGraphicsWidget *>(receiver); +#endif + if (!isWidget && !isGraphicsWidget && !isWindow) { + return d->notify_helper(receiver, e); + } + + QKeyEvent* key = static_cast<QKeyEvent*>(e); +#ifndef QT_NO_SHORTCUT + // Try looking for a Shortcut before sending key events + if (qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key)) + return true; +#endif + qt_in_tab_key_event = (key->key() == Qt::Key_Backtab + || key->key() == Qt::Key_Tab + || key->key() == Qt::Key_Left + || key->key() == Qt::Key_Up + || key->key() == Qt::Key_Right + || key->key() == Qt::Key_Down); + + } + default: + break; + } + bool res = false; if (!receiver->isWidgetType()) { res = d->notify_helper(receiver, e); @@ -2853,25 +2884,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) #ifndef QT_NO_GRAPHICSVIEW isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver); #endif - if (!isWidget && !isGraphicsWidget) { - res = d->notify_helper(receiver, e); - break; - } - QKeyEvent* key = static_cast<QKeyEvent*>(e); - if (key->type()==QEvent::KeyPress) { -#ifndef QT_NO_SHORTCUT - // Try looking for a Shortcut before sending key events - if ((res = qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key))) - return res; -#endif - qt_in_tab_key_event = (key->key() == Qt::Key_Backtab - || key->key() == Qt::Key_Tab - || key->key() == Qt::Key_Left - || key->key() == Qt::Key_Up - || key->key() == Qt::Key_Right - || key->key() == Qt::Key_Down); - } bool def = key->isAccepted(); QPointer<QObject> pr = receiver; while (receiver) { diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index c5cdce3d60..471b054a99 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -51,6 +51,7 @@ #include <private/qapplication_p.h> #include <private/qshortcutmap_p.h> #include <private/qaction_p.h> +#include <private/qwidgetwindow_qpa_p.h> QT_BEGIN_NAMESPACE @@ -86,6 +87,20 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context) if (QApplication::activePopupWidget()) active_window = QApplication::activePopupWidget(); + if (!active_window) { + QWindow *qwindow = QGuiApplication::focusWindow(); + if (qwindow && qwindow->isActive()) { + while (qwindow) { + QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(qwindow); + if (widgetWindow) { + active_window = widgetWindow->widget(); + break; + } + qwindow = qwindow->parent(); + } + } + } + if (!active_window) return false; @@ -106,6 +121,18 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context) w = s->parentWidget(); } + if (!w) { + QWindow *qwindow = qobject_cast<QWindow *>(object); + while (qwindow) { + QWidgetWindow *widget_window = qobject_cast<QWidgetWindow *>(qwindow); + if (widget_window) { + w = widget_window->widget(); + break; + } + qwindow = qwindow->parent(); + } + } + if (!w) return false; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cfccce7c41..f67a93c7b5 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1546,10 +1546,11 @@ void QWidgetPrivate::createTLExtra() x->inTopLevelResize = false; x->inRepaint = false; x->embedded = 0; + x->window = 0; + x->screenIndex = 0; #ifdef Q_WS_MAC x->wasMaximized = false; #endif // Q_WS_MAC - createTLSysExtra(); #ifdef QWIDGET_EXTRA_DEBUG static int count = 0; qDebug() << "tlextra" << ++count; @@ -10109,6 +10110,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; } case Qt::WA_NativeWindow: { d->createTLExtra(); + if (on) + d->createTLSysExtra(); #ifndef QT_NO_IM QWidget *focusWidget = d->effectiveFocusWidget(); if (on && !internalWinId() && hasFocus() diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 3b6c9ca448..dafe7dc42a 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -890,9 +890,7 @@ void QWidgetPrivate::deleteSysExtra() void QWidgetPrivate::createTLSysExtra() { Q_Q(QWidget); - extra->topextra->screenIndex = 0; - extra->topextra->window = 0; - if (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) { + if (!extra->topextra->window && (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow())) { extra->topextra->window = new QWidgetWindow(q); if (extra->minw || extra->minh) extra->topextra->window->setMinimumSize(QSize(extra->minw, extra->minh)); diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index c19b617091..18dd3156c6 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -446,7 +446,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) if (!widget) widget = m_widget; - if (event->type() == QEvent::MouseButtonPress && !qt_button_down) + if (event->type() == QEvent::MouseButtonPress) qt_button_down = widget; QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(), diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index b7f39d45dd..a8fba4fb68 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3366,7 +3366,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) { QStyleOptionToolButton myTb = *tb; myTb.state &= ~State_AutoRaise; - if (w && qobject_cast<QToolBar *>(w->parentWidget())) { + if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) { QRect cr = tb->rect; int shiftX = 0; int shiftY = 0; @@ -3405,7 +3405,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - QMainWindow *mw = qobject_cast<QMainWindow *>(w->window()); + QMainWindow *mw = w ? qobject_cast<QMainWindow *>(w->window()) : 0; if (mw && mw->unifiedTitleAndToolBarOnMac()) { pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio()); cr.adjust(0, pr.bottom() + 1, 0, 1); diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index a3c331aa2b..5217e57333 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -873,7 +873,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event) QPoint pos = event->globalPos() - state->pressPos; q->move(pos); - if (!state->ctrlDrag) + if (state && !state->ctrlDrag) mwlayout->hover(state->widgetItem, event->globalPos()); ret = true; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 33d2e01ed7..7c72c5c456 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -420,25 +420,17 @@ void QMenuPrivate::hideUpToMenuBar() if (QMenu *m = qobject_cast<QMenu*>(caused)) { caused = m->d_func()->causedPopup.widget; if (!m->d_func()->tornoff) - hideMenu(m, fadeMenus); + hideMenu(m); if (!fadeMenus) // Mac doesn't clear the action until after hidden. m->d_func()->setCurrentAction(0); } else { caused = 0; } } -#if defined(Q_WS_MAC) - if (fadeMenus) { - QEventLoop eventLoop; - QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit())); - QMacWindowFader::currentFader()->performFade(); - eventLoop.exec(); - } -#endif } setCurrentAction(0); } -void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister) +void QMenuPrivate::hideMenu(QMenu *menu) { if (!menu) return; @@ -462,27 +454,10 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister) eventLoop.exec(); } - // Fade out. - if (menu->style()->styleHint(QStyle::SH_Menu_FadeOutOnHide)) { - // ### Qt 4.4: - // Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec); - // Hopefully we'll integrate qt/research/windowtransitions into main before 4.4. - // Talk to Richard, Trenton or Bjoern. -#if defined(Q_WS_MAC) - if (justRegister) { - QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec); - QMacWindowFader::currentFader()->registerWindowToFade(menu); - } else { - macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec); - } - -#endif // Q_WS_MAC - } aboutToHide = false; menu->blockSignals(false); #endif // QT_NO_EFFECTS - if (!justRegister) - menu->close(); + menu->close(); } void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst) diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index 15f3c92127..71a3fca237 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -189,7 +189,7 @@ public: virtual QList<QPointer<QWidget> > calcCausedStack() const; QMenuCaused causedPopup; void hideUpToMenuBar(); - void hideMenu(QMenu *menu, bool justRegister = false); + void hideMenu(QMenu *menu); //index mappings inline QAction *actionAt(int i) const { return q_func()->actions().at(i); } diff --git a/sync.profile b/sync.profile index e07b285dbb..74e29a7acf 100644 --- a/sync.profile +++ b/sync.profile @@ -11,10 +11,10 @@ "QtDBus" => "$basedir/src/dbus", "QtConcurrent" => "$basedir/src/concurrent", "QtPlatformSupport" => "$basedir/src/platformsupport", - "KHR" => "$basedir/src/3rdparty/angle/include/KHR", - "GLES2" => "$basedir/src/3rdparty/angle/include/GLES2", - "EGL" => "$basedir/src/3rdparty/angle/include/EGL", - "QtZlib" => "$basedir/src/3rdparty/zlib", + "QtANGLE/KHR" => "!$basedir/src/3rdparty/angle/include/KHR", + "QtANGLE/GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2", + "QtANGLE/EGL" => "!$basedir/src/3rdparty/angle/include/EGL", + "QtZlib" => "!$basedir/src/3rdparty/zlib", "QtOpenGLExtensions" => "$basedir/src/openglextensions", ); %moduleheaders = ( # restrict the module headers to those found in relative path @@ -24,7 +24,6 @@ %classnames = ( "qglobal.h" => "QtGlobal", "qendian.h" => "QtEndian", - "qconfig.h" => "QtConfig", "qplugin.h" => "QtPlugin", "qalgorithms.h" => "QtAlgorithms", "qcontainerfwd.h" => "QtContainerFwd", diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index d44ef167b5..fbb21e4e9a 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -311,12 +311,28 @@ void tst_QDir::mkdir() void tst_QDir::makedirReturnCode() { QString dirName = QString::fromLatin1("makedirReturnCode"); - QDir::current().rmdir(dirName); // cleanup a previous run. + QFile f(QDir::current().filePath(dirName)); + + // cleanup a previous run. + f.remove(); + QDir::current().rmdir(dirName); + QDir dir(dirName); QVERIFY(!dir.exists()); QVERIFY(QDir::current().mkdir(dirName)); QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing dir will fail. QVERIFY(QDir::current().mkpath(dirName)); // calling mkpath on an existing dir will pass + + // Remove the directory and create a file with the same path + QDir::current().rmdir(dirName); + QVERIFY(!f.exists()); + f.open(QIODevice::WriteOnly); + f.write("test"); + f.close(); + QVERIFY(f.exists()); + QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing file will fail. + QVERIFY(!QDir::current().mkpath(dirName)); // calling mkpath on an existing file will fail. + f.remove(); } void tst_QDir::rmdir_data() diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp index 8515f8a698..713d0c5c17 100644 --- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp +++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp @@ -279,17 +279,18 @@ void tst_QTemporaryDir::openOnRootDrives() void tst_QTemporaryDir::stressTest() { const int iterations = 1000; + QTemporaryDir rootDir; + QVERIFY(rootDir.isValid()); QSet<QString> names; + const QString pattern = rootDir.path() + QStringLiteral("/XXXXXX"); for (int i = 0; i < iterations; ++i) { - QTemporaryDir dir; + QTemporaryDir dir(pattern); dir.setAutoRemove(false); - QVERIFY2(dir.isValid(), qPrintable(QString::number(i))); + QVERIFY2(dir.isValid(), qPrintable(QString::fromLatin1("Failed to create #%1 under %2.").arg(i).arg(QDir::toNativeSeparators(pattern)))); QVERIFY(!names.contains(dir.path())); names.insert(dir.path()); } - for (QSet<QString>::const_iterator it = names.constBegin(); it != names.constEnd(); ++it) - QDir(*it).removeRecursively(); } void tst_QTemporaryDir::rename() diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 2250d0bb5e..25e5f03566 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -159,23 +159,6 @@ public slots: } }; -#ifndef QT_NO_EXCEPTIONS -class QEventLoopTestException { }; - -class ExceptionThrower : public QObject -{ - Q_OBJECT -public: - ExceptionThrower() : QObject() { } -public slots: - void throwException() - { - QEventLoopTestException e; - throw e; - } -}; -#endif - class tst_QEventLoop : public QObject { Q_OBJECT @@ -183,9 +166,6 @@ private slots: // This test *must* run first. See the definition for why. void processEvents(); void exec(); -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) - void throwInExec(); -#endif void reexec(); void execAfterExit(); void wakeUp(); @@ -322,53 +302,6 @@ void tst_QEventLoop::exec() } } -#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_OS_WINCE_WM) -// Exceptions need to be enabled for this test -// Q_OS_WINCE_WM case: this platform doesn't support propagating exceptions through the event loop -// Windows Mobile cannot handle cross library exceptions -// qobject.cpp will try to rethrow the exception after handling -// which causes gwes.exe to crash -void tst_QEventLoop::throwInExec() -{ -// exceptions compiled in, runtime tests follow. -#if defined(Q_OS_LINUX) - // C++ exceptions can't be passed through glib callbacks. Skip the test if - // we're using the glib event loop. - QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className(); - if (dispatcher.contains("Glib")) { - QSKIP( - qPrintable(QString( - "Throwing exceptions in exec() won't work if %1 event dispatcher is used.\n" - "Try running with QT_NO_GLIB=1 in environment." - ).arg(QString::fromLatin1(dispatcher))) - ); - } -#endif - - { - // QEventLoop::exec() is exception safe - QEventLoop eventLoop; - int caughtExceptions = 0; - - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - try { - ExceptionThrower exceptionThrower; - QTimer::singleShot(EXEC_TIMEOUT, &exceptionThrower, SLOT(throwException())); - (void) eventLoop.exec(); - } catch (...) { - ++caughtExceptions; - } - QCOMPARE(caughtExceptions, 2); - } -} -#endif - void tst_QEventLoop::reexec() { QEventLoop loop; diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp index da2c961558..1839b0670c 100644 --- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp +++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp @@ -66,7 +66,7 @@ private slots: void constructCopy(); }; -#define FOR_EACH_GUI_METATYPE(F) \ +#define FOR_EACH_GUI_METATYPE_BASE(F) \ F(QFont, QFont) \ F(QPixmap, QPixmap) \ F(QBrush, QBrush) \ @@ -76,7 +76,6 @@ private slots: F(QPolygon, QPolygon) \ F(QRegion, QRegion) \ F(QBitmap, QBitmap) \ - F(QCursor, QCursor) \ F(QKeySequence, QKeySequence) \ F(QPen, QPen) \ F(QTextLength, QTextLength) \ @@ -89,6 +88,16 @@ private slots: F(QVector4D, QVector4D) \ F(QQuaternion, QQuaternion) +#ifndef QTEST_NO_CURSOR +# define FOR_EACH_GUI_METATYPE(F) \ + FOR_EACH_GUI_METATYPE_BASE(F) \ + F(QCursor, QCursor) +#else // !QTEST_NO_CURSOR +# define FOR_EACH_GUI_METATYPE(F) \ + FOR_EACH_GUI_METATYPE_BASE(F) +#endif // !QTEST_NO_CURSOR + + namespace { template <typename T> struct static_assert_trigger { diff --git a/tests/auto/gui/qopengl/qopengl.pro b/tests/auto/gui/qopengl/qopengl.pro index 91eeda34c3..34af962d36 100644 --- a/tests/auto/gui/qopengl/qopengl.pro +++ b/tests/auto/gui/qopengl/qopengl.pro @@ -8,3 +8,5 @@ TARGET = tst_qopengl QT += gui gui-private core-private testlib SOURCES += tst_qopengl.cpp + +win32-msvc2010:contains(QT_CONFIG, angle):CONFIG += insignificant_test # QTBUG-31611 diff --git a/tests/auto/tools/moc/no-keywords.h b/tests/auto/tools/moc/no-keywords.h index e04e36b678..ffd5928370 100644 --- a/tests/auto/tools/moc/no-keywords.h +++ b/tests/auto/tools/moc/no-keywords.h @@ -47,7 +47,7 @@ #define slots Baz #define emit Yoyodyne -#include <QtGui/QtGui> +#include <QtConcurrent/QtConcurrent> #include <QtCore> #include <QtNetwork/QtNetwork> #include <QtSql/QtSql> diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 41e5ed466c..8c8f27d635 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -1884,6 +1884,18 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data() << QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10) ); + QTest::newRow("preferredsizeIsZero") << (ItemList() + << ItemDesc(0,0) + .preferredSizeHint(QSizeF(0,10)) + << ItemDesc(0,1) + .preferredSizeHint(QSizeF(10,10)) + .maxSize(QSizeF(20, 10)) + ) + << QSizeF(30, 10) + << (SizeList() + << QSizeF(10,10) << QSizeF(20,10) + ); + QTest::newRow("ignoreitem01") << (ItemList() << ItemDesc(0,0) .preferredSizeHint(QSizeF(10,10)) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index a83f451b81..f92fad1d69 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -151,12 +151,6 @@ Configure::Configure(int& argc, char** argv) const QString installPath = buildPath; #endif if (sourceDir != buildDir) { //shadow builds! - if (QStandardPaths::findExecutable(QStringLiteral("perl.exe")).isEmpty()) { - cout << "Error: Creating a shadow build of Qt requires" << endl - << "perl to be in the PATH environment"; - exit(0); // Exit cleanly for Ctrl+C - } - cout << "Preparing build tree..." << endl; QDir(buildPath).mkpath("bin"); @@ -1841,7 +1835,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"); @@ -1987,7 +1981,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 @@ -3351,6 +3345,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); @@ -3779,7 +3804,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 @@ -3920,7 +3948,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; diff --git a/util/glgen/qopenglextensions.cpp.header b/util/glgen/qopenglextensions.cpp.header index 6a9f639d5d..a3a9a9fa73 100644 --- a/util/glgen/qopenglextensions.cpp.header +++ b/util/glgen/qopenglextensions.cpp.header @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and 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. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** 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. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** 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. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/util/glgen/qopenglextensions.h.header b/util/glgen/qopenglextensions.h.header index b83b081166..c13ba37b39 100644 --- a/util/glgen/qopenglextensions.h.header +++ b/util/glgen/qopenglextensions.h.header @@ -5,35 +5,34 @@ ** ** This file is part of the QtGui module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and 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. +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: ** -** 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. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. ** -** 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. ** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** |