From 69fa0012c748f9024ac21b5d6a9f1be1abb805a5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 6 Jun 2013 11:58:19 +0200 Subject: use qtconcurrent instead of qtgui in test code this works with -no-gui, and doesn't interfere with our upcoming ANGLE hackery. Change-Id: I2985cc0acd1fbf185b8967ffe58606b1b7dd9d1e Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart --- tests/auto/tools/moc/no-keywords.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 +#include #include #include #include -- cgit v1.2.3 From 150408e37d58c64509e7183014593c51f370415b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 15:55:30 +0200 Subject: don't process ANGLE and zlib headers like real qt modules we run syncqt on them only to get normal forwarding headers and the headers.pri file. the module master include header and the module version header are useless, and scanning for qt class names just wastes time. Change-Id: I58e8d1eb36cea5c31cbd46ce673438316d1963dc Reviewed-by: Joerg Bornemann --- bin/syncqt.pl | 11 ++++++++--- sync.profile | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 497e8deb2c..cc91a11de0 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -837,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 = ""; @@ -946,7 +948,7 @@ foreach my $lib (@modules_to_sync) { } my $iheader = $subdir . "/" . $header; - my @classes = $public_header && !$minimal ? classNames($iheader) : (); + my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : (); if($showonly) { print "$header [$lib]\n"; foreach(@classes) { @@ -1056,7 +1058,7 @@ foreach my $lib (@modules_to_sync) { "#include \"".lc($lib)."version.h\"\n" . "#endif\n"; - unless ($showonly || $minimal) { + unless ($showonly || $minimal || !$is_qt) { # create deprecated headers my $first = 1; while (my ($header, $include) = each %{$deprecatedheaders{$lib}}) { @@ -1141,7 +1143,9 @@ foreach my $lib (@modules_to_sync) { 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"; @@ -1174,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})); diff --git a/sync.profile b/sync.profile index 3d89d9d71f..91503d425f 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", + "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", "QtOpenGLExtensions" => "$basedir/src/openglextensions", ); %moduleheaders = ( # restrict the module headers to those found in relative path -- cgit v1.2.3 From 366d276f8c534819b0624ea86e36c7f2eb020f24 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Jun 2013 13:20:37 +0200 Subject: allow modules to extend their MODULE_{,PRIVATE_}INCLUDES Change-Id: I5e401edbe891846579cf6d9ff84427d16783923b Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 666989f75e..9eb9b02e14 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -56,6 +56,8 @@ else: \ MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \ \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME } + MODULE_INCLUDES += $$MODULE_AUX_INCLUDES + MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES !git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ |if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) { pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) -- cgit v1.2.3 From b35ea875a12e89661f370df7e91c4791234aaa44 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Jun 2013 13:24:23 +0200 Subject: put ANGLE includes in a QtANGLE subdir otherwise even non-angle builds with pre-generated headers will get them into their include path, which is Not Good (tm). Change-Id: Ie98354297baf3564ef82b3d4a32e5763e625b8f2 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/angle/angle.pro | 2 +- src/angle/src/libEGL/libEGL.pro | 2 +- src/angle/src/libGLESv2/libGLESv2.pro | 4 ++-- src/gui/Qt5GuiConfigExtras.cmake.in | 6 ++++-- src/gui/gui.pro | 6 ++++++ sync.profile | 6 +++--- 6 files changed, 17 insertions(+), 9 deletions(-) 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 " 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/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index f1bc441009..4a6f6250f5 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -2,13 +2,15 @@ !!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) 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/sync.profile b/sync.profile index 91503d425f..74e29a7acf 100644 --- a/sync.profile +++ b/sync.profile @@ -11,9 +11,9 @@ "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", + "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", ); -- cgit v1.2.3 From f533941179b92af5a6c4db85233496ac5b9a5f31 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 14:06:24 +0200 Subject: update some comments relating to forwarding module pri files Change-Id: I3486f949fee2ac977e3cde669188790e5f4b3167 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_config.prf | 6 +++--- mkspecs/features/qt_module_pris.prf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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_.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_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 9eb9b02e14..a80b44f2f6 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -120,7 +120,7 @@ else: \ } else { # prefix_build - # 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] -- cgit v1.2.3 From 81b942f0d15d2e73f017cea507ed01c1c29b7952 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 8 Jun 2013 11:50:45 +0200 Subject: use correct variable for library base path Change-Id: I6d621db2c4d5365a9c9a7284026b464e663a4cc6 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_android_deps.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- cgit v1.2.3 From f3331e14e68089035cc302e11c6e60153f806026 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 8 Jun 2013 11:58:54 +0200 Subject: reshuffle path setup rename MODULE_PROFILE_DIR to MODULE_BASE_INDIR. force MODULE_BASE_OUTDIR to be always the shadow of the above. rename MODULE_BASE_DIR to MODULE_SYNCQT_DIR (the former is still recognized for backwards compat with webkit). the idea behind these changes is making the variable names and override possibilities reflect their actual use. Change-Id: Ica4062d7231a0ce13241670e0d0f43e6b1b97160 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_build_paths.prf | 9 +++++---- mkspecs/features/qt_module_headers.prf | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf index 25fc2c3033..9163ac30b2 100644 --- a/mkspecs/features/qt_build_paths.prf +++ b/mkspecs/features/qt_build_paths.prf @@ -11,12 +11,13 @@ # 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_PROFILE_DIR/.git): \ +exists($$MODULE_BASE_INDIR/.git): \ CONFIG += git_build !prefix_build { diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index fd6cf6b943..ca26eb674b 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -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") } @@ -32,11 +32,11 @@ minimal_syncqt: return() git_build: \ INC_PATH = $$MODULE_BASE_OUTDIR else: \ - INC_PATH = $$MODULE_BASE_DIR + 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 /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_DIR). */" + "/* This file was generated by qmake with the info from /$$relative_path($$_PRO_FILE_, $$MODULE_BASE_INDIR). */" # Create a module master depends header MODULE_MASTER_DEPS_HEADER = $$MODULE_BASE_OUTDIR/include/$$MODULE_INCNAME/$${MODULE_INCNAME}Depends -- cgit v1.2.3 From 4fd568fa0633b17b4a8e24736a4766e81afff4f3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 7 Jun 2013 16:23:25 +0200 Subject: redo include path logic for pre-generated headers make the include dir in the source tree the "main" include path, as that's where the majority of the headers is. then selectively add the shadowed dirs. Change-Id: I03ad13cfcf77175c141b94d41b1221740d851faf Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_module_pris.prf | 48 +++++++++++++++++++---------- src/tools/bootstrap-dbus/bootstrap-dbus.pro | 3 +- src/tools/bootstrap/bootstrap.pro | 5 +-- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index a80b44f2f6..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 @@ -56,20 +65,22 @@ else: \ 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 - !git_build:if(!equals(_PRO_FILE_PWD_, $$OUT_PWD) \ - |if(!prefix_build:!equals(MODULE_BASE_DIR, $$[QT_HOST_PREFIX]))) { - pub_inc = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) - priv_inc = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, $$MODULE_BASE_DIR/include) - force_independent { - MODULE_FWD_PRI_CONT_SUFFIX = \ - "QT.$${MODULE}.includes += $$pub_inc" \ - "QT.$${MODULE}.private_includes = $$priv_inc" - } else { - MODULE_INCLUDES += $$pub_inc - MODULE_PRIVATE_INCLUDES = $$priv_inc - } + 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}" \ @@ -100,12 +111,17 @@ 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" \ @@ -118,7 +134,7 @@ else: \ touch($$MODULE_FWD_PRI, $$MODULE_PRI) MODULE_PRI_FILES += $$MODULE_FWD_PRI - } else { # prefix_build + } else { # This is needed for the direct include() below. Mirrors qt_config.prf QT_MODULE_BIN_BASE = $$[QT_INSTALL_BINS] 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 -- cgit v1.2.3 From 45d8bf327eee744570933211f611cf4410ae7e29 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 10 Jun 2013 14:45:40 +0200 Subject: Doc: Mark QOpenGLFunctions_4_1_Core as a wrapper class The class documentation missing the \wrapper command, making QDoc complain a lot. Change-Id: Iad8fa3d2facadfb3393642dc08ff4dc416bdccc7 Reviewed-by: Martin Smith Reviewed-by: Jerome Pasion --- src/gui/opengl/qopenglfunctions_4_1_core.cpp | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3 From 074c5c94f6018d08abac9bad5151f9300284feb4 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 10 Jun 2013 13:17:18 +0200 Subject: Doc: Fixed snippet issues in QDoc documentation QDoc uses .qdoc files as snippets in other .qdoc files. These snippet .qdoc files are also parsed, which is not the intent. This change resolves the issue by renaming the files to have a different extension. Task-number: QTBUG-31574 Change-Id: I399c8b714478b9c4b8fbe2db53f601e6a1386cea Reviewed-by: Jerome Pasion --- src/tools/qdoc/doc/examples/cpp.qdoc | 126 --------------------- src/tools/qdoc/doc/examples/cpp.qdoc.sample | 126 +++++++++++++++++++++ src/tools/qdoc/doc/examples/qml.qdoc | 116 ------------------- src/tools/qdoc/doc/examples/qml.qdoc.sample | 116 +++++++++++++++++++ .../qdoc/doc/qdoc-guide/qtwritingstyle-cpp.qdoc | 14 +-- .../qdoc/doc/qdoc-guide/qtwritingstyle-qml.qdoc | 8 +- 6 files changed, 253 insertions(+), 253 deletions(-) delete mode 100644 src/tools/qdoc/doc/examples/cpp.qdoc create mode 100644 src/tools/qdoc/doc/examples/cpp.qdoc.sample delete mode 100644 src/tools/qdoc/doc/examples/qml.qdoc create mode 100644 src/tools/qdoc/doc/examples/qml.qdoc.sample diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc b/src/tools/qdoc/doc/examples/cpp.qdoc deleted file mode 100644 index 08286b956a..0000000000 --- a/src/tools/qdoc/doc/examples/cpp.qdoc +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![class] -/*! - \class QCache - \brief The QCache class is a template class that provides a cache. - - \ingroup tools - \ingroup shared - - \reentrant - - QCache\ defines a cache that stores objects of type T - associated with keys of type Key. For example, here's the - definition of a cache that stores objects of type Employee - associated with an integer key: - - \snippet code/doc_src_qcache.cpp 0 - - Here's how to insert an object in the cache: - - \snippet code/doc_src_qcache.cpp 1 - - ... detailed description ommitted - - \sa QPixmapCache, QHash, QMap -*/ -//![class] - -//![function] -/*! - \fn QString &QString::remove(int position, int n) - - Removes \a n characters from the string, starting at the given \a - position index, and returns a reference to the string. - - If the specified \a position index is within the string, but \a - position + \a n is beyond the end of the string, the string is - truncated at the specified \a position. - - \snippet qstring/main.cpp 37 - - \sa insert(), replace() -*/ -QString &QString::remove(int pos, int len) -//! [function] - -//! [return] -/*! - Returns \c true if a QScroller object was already created for \a target; \c false otherwise. - - \sa scroller() -*/ -bool QScroller::hasScroller(QObject *target) -//! [return] - -//! [property] -/*! - \property QVariantAnimation::duration - \brief the duration of the animation - - This property describes the duration in milliseconds of the - animation. The default duration is 250 milliseconds. - - \sa QAbstractAnimation::duration() - */ -int QVariantAnimation::duration() const -//! [property] - -//! [signals] -/*! - \fn QAbstractTransition::triggered() - - This signal is emitted when the transition has been triggered (after - onTransition() has been called). -*/ -//! [signals] - -//! [enums] -/*! - \enum QSql::TableType - - This enum type describes types of SQL tables. - - \value Tables All the tables visible to the user. - \value SystemTables Internal tables used by the database. - \value Views All the views visible to the user. - \value AllTables All of the above. -*/ -//! [enums] - -//! [overloaded notifier] -/*! -\property QSpinBox::value -\brief the value of the spin box - -setValue() will emit valueChanged() if the new value is different -from the old one. The \l{QSpinBox::}{value} property has a second notifier -signal which includes the spin box's prefix and suffix. -*/ -//! [overloaded notifier] diff --git a/src/tools/qdoc/doc/examples/cpp.qdoc.sample b/src/tools/qdoc/doc/examples/cpp.qdoc.sample new file mode 100644 index 0000000000..08286b956a --- /dev/null +++ b/src/tools/qdoc/doc/examples/cpp.qdoc.sample @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![class] +/*! + \class QCache + \brief The QCache class is a template class that provides a cache. + + \ingroup tools + \ingroup shared + + \reentrant + + QCache\ defines a cache that stores objects of type T + associated with keys of type Key. For example, here's the + definition of a cache that stores objects of type Employee + associated with an integer key: + + \snippet code/doc_src_qcache.cpp 0 + + Here's how to insert an object in the cache: + + \snippet code/doc_src_qcache.cpp 1 + + ... detailed description ommitted + + \sa QPixmapCache, QHash, QMap +*/ +//![class] + +//![function] +/*! + \fn QString &QString::remove(int position, int n) + + Removes \a n characters from the string, starting at the given \a + position index, and returns a reference to the string. + + If the specified \a position index is within the string, but \a + position + \a n is beyond the end of the string, the string is + truncated at the specified \a position. + + \snippet qstring/main.cpp 37 + + \sa insert(), replace() +*/ +QString &QString::remove(int pos, int len) +//! [function] + +//! [return] +/*! + Returns \c true if a QScroller object was already created for \a target; \c false otherwise. + + \sa scroller() +*/ +bool QScroller::hasScroller(QObject *target) +//! [return] + +//! [property] +/*! + \property QVariantAnimation::duration + \brief the duration of the animation + + This property describes the duration in milliseconds of the + animation. The default duration is 250 milliseconds. + + \sa QAbstractAnimation::duration() + */ +int QVariantAnimation::duration() const +//! [property] + +//! [signals] +/*! + \fn QAbstractTransition::triggered() + + This signal is emitted when the transition has been triggered (after + onTransition() has been called). +*/ +//! [signals] + +//! [enums] +/*! + \enum QSql::TableType + + This enum type describes types of SQL tables. + + \value Tables All the tables visible to the user. + \value SystemTables Internal tables used by the database. + \value Views All the views visible to the user. + \value AllTables All of the above. +*/ +//! [enums] + +//! [overloaded notifier] +/*! +\property QSpinBox::value +\brief the value of the spin box + +setValue() will emit valueChanged() if the new value is different +from the old one. The \l{QSpinBox::}{value} property has a second notifier +signal which includes the spin box's prefix and suffix. +*/ +//! [overloaded notifier] diff --git a/src/tools/qdoc/doc/examples/qml.qdoc b/src/tools/qdoc/doc/examples/qml.qdoc deleted file mode 100644 index d913c6f164..0000000000 --- a/src/tools/qdoc/doc/examples/qml.qdoc +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//![qmltype] - \qmltype TextEdit - \instantiates QQuickTextEdit - \inqmlmodule QtQuick 2 - \ingroup qtquick-visual - \ingroup qtquick-input - \inherits Item - \brief Displays multiple lines of editable formatted text - - The TextEdit item displays a block of editable, formatted text. - - It can display both plain and rich text. For example: - - \qml - TextEdit { - width: 240 - text: "Hello World!" - font.family: "Helvetica" - font.pointSize: 20 - color: "blue" - focus: true - } - \endqml - - \image declarative-textedit.gif - - ... omitted detailed description - - \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example} -//![qmltype] - -//![function] -/* - \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1) - - Deletes the content at \a index from the model. - - \sa clear() -*/ -void QQuickListModel::remove(QQmlV8Function *args) -//! [function] - -//! [return] -/* - Returns \c true if a QScroller object was already created for \a target; \c false otherwise. - - \sa scroller() -*/ -bool QScroller::hasScroller(QObject *target) -//! [return] - -//! [property] -/* - \property QVariantAnimation::duration - \brief the duration of the animation - - This property describes the duration in milliseconds of the - animation. The default duration is 250 milliseconds. - - \sa QAbstractAnimation::duration() - */ -int QVariantAnimation::duration() const -//! [property] - -//! [signals] -/* - This signal is emitted when the user clicks the button. A click is defined - as a press followed by a release. The corresponding handler is - \c onClicked. -*/ -signal clicked() -//! [signals] - -//! [enums] -/*! -\qmlproperty enumeration QtQuick2::Text::font.weight - -Sets the font's weight. - -The weight can be one of: -\list -\li Font.Light -\li Font.Normal - the default -\li Font.DemiBold -\li Font.Bold -\li Font.Black -\endlist -*/ -//! [enums] diff --git a/src/tools/qdoc/doc/examples/qml.qdoc.sample b/src/tools/qdoc/doc/examples/qml.qdoc.sample new file mode 100644 index 0000000000..d913c6f164 --- /dev/null +++ b/src/tools/qdoc/doc/examples/qml.qdoc.sample @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//![qmltype] + \qmltype TextEdit + \instantiates QQuickTextEdit + \inqmlmodule QtQuick 2 + \ingroup qtquick-visual + \ingroup qtquick-input + \inherits Item + \brief Displays multiple lines of editable formatted text + + The TextEdit item displays a block of editable, formatted text. + + It can display both plain and rich text. For example: + + \qml + TextEdit { + width: 240 + text: "Hello World!" + font.family: "Helvetica" + font.pointSize: 20 + color: "blue" + focus: true + } + \endqml + + \image declarative-textedit.gif + + ... omitted detailed description + + \sa Text, TextInput, {examples/quick/text/textselection}{Text Selection example} +//![qmltype] + +//![function] +/* + \qmlmethod QtQuick2::ListModel::remove(int index, int count = 1) + + Deletes the content at \a index from the model. + + \sa clear() +*/ +void QQuickListModel::remove(QQmlV8Function *args) +//! [function] + +//! [return] +/* + Returns \c true if a QScroller object was already created for \a target; \c false otherwise. + + \sa scroller() +*/ +bool QScroller::hasScroller(QObject *target) +//! [return] + +//! [property] +/* + \property QVariantAnimation::duration + \brief the duration of the animation + + This property describes the duration in milliseconds of the + animation. The default duration is 250 milliseconds. + + \sa QAbstractAnimation::duration() + */ +int QVariantAnimation::duration() const +//! [property] + +//! [signals] +/* + This signal is emitted when the user clicks the button. A click is defined + as a press followed by a release. The corresponding handler is + \c onClicked. +*/ +signal clicked() +//! [signals] + +//! [enums] +/*! +\qmlproperty enumeration QtQuick2::Text::font.weight + +Sets the font's weight. + +The weight can be one of: +\list +\li Font.Light +\li Font.Normal - the default +\li Font.DemiBold +\li Font.Bold +\li Font.Black +\endlist +*/ +//! [enums] 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++ -- cgit v1.2.3 From b2a0a1437000c6cd78de4bf960993732457a8e92 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 28 May 2013 13:09:20 +0200 Subject: Fix issue when QKeyEvent::text() was returning empty string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code that sets 'text' variable was executed only for KeyPress events. This patch moves 'text' initialization higher up where it will be run for both - KeyPress and KeyRelease events. Task-number: QTBUG-31285 Change-Id: I140de9ef5d29beedad276d348bed964ecdf46f9d Reviewed-by: Tor Arne Vestbø Reviewed-by: Andy Shaw --- src/plugins/platforms/cocoa/qnsview.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 5c5da830ac..10fb293ec0 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -917,13 +917,13 @@ static QTouchDevice *touchDevice = 0; // 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 (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff) - text = QCFString::toQString(characters); if (m_composingText.isEmpty()) m_sendKeyEvent = !QWindowSystemInterface::tryHandleShortcutEvent(m_window, timestamp, keyCode, modifiers, text); -- cgit v1.2.3 From a90d93285a0b95013020644f29c5d932aa989d37 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 6 Jun 2013 13:50:23 +0200 Subject: Windows save file dialog: Set default suffix only once. IFileDialog::SetDefaultExtension() needs to be called for the dialog to automatically update the suffix when the user chooses a new file type. Calling it IFileDialogEvents::OnTypeChanged as introduced by 42760e43eaa64e834809ef5fb01a83cfb75f4f04 causes it to use the previous suffix when switching. Call in setNameFilters() using the first available suffix instead. Task-number: QTBUG-31381 Task-number: QTBUG-30748 Change-Id: Idd532e4190c752aa80abce963dd0389be7d22a34 Reviewed-by: Andy Shaw Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowsdialoghelpers.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) 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 -- cgit v1.2.3 From d7b79ff3ef714ca0c433763a0563a069575271cb Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Mon, 13 May 2013 18:34:08 +0200 Subject: mkspecs/qml_plugin: adding -nonrelocatable flag to qmldump call nonrelocatable adds the full uri to the exported type information which is the correct thing to do for the qt plugins (and 99% of the cases). This way import bla.x 1.0 works correctly in the code model. Change-Id: Ia06873dd8b2ea4627e3297a98e8df87275ceaf73 Reviewed-by: Alan Alpert Reviewed-by: Kai Koehne Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qml_plugin.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From e1109df7a92812233935489bc9fbae524536130a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Jun 2013 13:22:51 +0200 Subject: Remove the use of CMAKE_FIND_ROOT_PATH. This is actually a list in CMake, not a value to be prepended to paths. Specify the QT_SYSROOT instead to root the location of include directories. CMake will soon get a CMAKE_SYSROOT variable which will replace this. Change-Id: I239f69f127f3676a3835aa4f29638f44ef209819 Reviewed-by: Volker Krause Reviewed-by: Stephen Kelly Reviewed-by: Oswald Buddenhagen --- mkspecs/features/cmake_functions.prf | 2 +- src/corelib/Qt5CTestMacros.cmake | 4 ---- src/gui/Qt5GuiConfigExtras.cmake.in | 12 +++++++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf index f48ef43b88..a67fd9af9b 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, ";")) } 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/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 4a6f6250f5..83e77280d5 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -57,7 +57,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}) @@ -87,7 +87,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) @@ -116,9 +116,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() -- cgit v1.2.3 From f2ea45363dae1ad67386d0aeb0697e716cc10aee Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 10 Jun 2013 11:25:24 +0200 Subject: qdoc: QGLFrameBufferObject::bindDefault() was marked \internal The \internal is removed. Task-number: QTBUG-31638 Change-Id: Ib1b65783599fe50e907373e3223a0774f17ac65e Reviewed-by: Jerome Pasion Reviewed-by: Gunnar Sletta --- src/opengl/qglframebufferobject.cpp | 1 - 1 file changed, 1 deletion(-) 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. -- cgit v1.2.3 From 1937012b3e09e5f0b9a1c056e05e6109e3bd8d55 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 10 Jun 2013 11:19:21 +0200 Subject: Don't test existence of private header directories for mac frameworks These directories are not currently part of the Qt installation for mac frameworks. Task-number: QTBUG-31641 Change-Id: Ifef372cc2ebb692f9ae5a7b1f8dba5f683d1e7eb Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index f6fd61602f..c55b728f1b 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -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() -- cgit v1.2.3 From 900cccfd459fcbdbc4aa3d313afe12cfbf68fd87 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 10 Jun 2013 13:50:44 +0200 Subject: Fix drawing of 0-width polylines from outside the devicerect. This was broken by a previous fix which aimed to fix gaps in polylines with tiny line segments. The result was that we skipped updating the origin point when stroke() didn't produce pixels which accidentally included the case of the line being completely outside the deviceRect. I fixed this by returning the value of clipLine in drawLine to the caller so we could still update the origin for this case. Task-number: QTBUG-31579 Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065 Reviewed-by: Lars Knoll --- src/gui/painting/qcosmeticstroker.cpp | 42 ++++++++++++++++++++++------------- src/gui/painting/qcosmeticstroker_p.h | 2 +- 2 files changed, 27 insertions(+), 17 deletions(-) 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 -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 -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 -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 -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 { -- cgit v1.2.3 From 425af59f534ed8a0f4bc7a77a1f83e4d1e2e2bdc Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 10 Jun 2013 11:56:14 +0200 Subject: Disable long press on Android Remove the mapping from press-and-hold to right-mouse-button press. This logic was implemented in the android plugin, and there was no way to disable it for applications that needed to handle long presses in a different way. Add an environment variable to enable the mapping for those who really need it, but do not advertise it. (We want to add a proper API for this in 5.2) Task-number: QTBUG-31644 Change-Id: Ia5ae75d6147485b73c78b7c3fa88d11af5d84c06 Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/src/androidjniinput.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index da6156a330..29ccfe0125 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); -- cgit v1.2.3 From 85b4f0d2d3ffd326548ca8f0e15ac27f5fd8d77d Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 11 Jun 2013 11:09:34 +0200 Subject: Avoid floating point exceptions in rasterizeLine. Task-number: QTBUG-16757 Change-Id: I3ef988f1e039c12529d62197d85a62f201e4ae12 Reviewed-by: Lars Knoll --- src/gui/painting/qrasterizer.cpp | 61 +++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 16 deletions(-) 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; -- cgit v1.2.3 From 70cb5db4f219dd3e0e5fdffc4309c35b0195a017 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 11 Jun 2013 10:41:33 +0200 Subject: Fix gcc warnings about unused-value Fix multiple gcc warnings about statements in accessibleDebug arguments have no effect. Change-Id: I34bf05d911707f0b50592bf76442a3805c560d56 Reviewed-by: Friedemann Kleint Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3 From c47b66589341a07abb42ca913247cef51bfe624f Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 11 Jun 2013 14:07:00 +0200 Subject: Qdoc: replaced example file qt.qdocconf with qtgui.qdocconf Task-number: QTBUG-31574 Change-Id: Idf8509395dd5f16c696473d1eeb91fb86f2b97e7 Reviewed-by: Martin Smith --- src/tools/qdoc/doc/files/qtgui.qdocconf | 50 +++++++++++++++++++++++++++++++++ src/tools/qdoc/doc/qdoc-manual.qdoc | 50 ++++++++++----------------------- 2 files changed, 65 insertions(+), 35 deletions(-) create mode 100644 src/tools/qdoc/doc/files/qtgui.qdocconf 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-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 = "


\n" \ ... "
" \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 = "" \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 -- cgit v1.2.3 From 80d24a737ac4f93eaabaab79e0c60c9da97d6eed Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 10 Jun 2013 16:56:42 -0400 Subject: Update support status for older Mac OS X platforms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifdf487fbae8acbffb32b6db5f8dd93e9eb213d77 Reviewed-by: Gabriel de Dietrich Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4598f60d5e..6f63a0d9d3 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1050,9 +1050,9 @@ 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 -- cgit v1.2.3 From 3b5954e405cfbc3dcf1564d0e9e397825c5c1e5a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:28:03 +0200 Subject: Cocoa: Remove compilation warning Change-Id: Ib530e7ef4643de07aec91c4af0de8bbedef9882a Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 1 + 1 file changed, 1 insertion(+) 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(QGuiApplicationPrivate::platformIntegration())) ci->updateScreens(); } -- cgit v1.2.3 From 7ee15bfbb815df87ae0526f105a13a591b192c76 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:29:56 +0200 Subject: Cocoa: Make sure we update internal window fullscreen state We update the internal/synched state by assigning it its QWindow's state. Since that one is not a flag, it can only be in one state at a time, meaning that we may lose the maximized state (but we've been losing it for some time). Task-number: QTBUG-30139 Change-Id: Idf30713c6ae912cafe3bbdd7be18214cf4de34f7 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.h | 2 ++ src/plugins/platforms/cocoa/qcocoawindow.mm | 6 ++++++ src/plugins/platforms/cocoa/qnsview.mm | 13 +++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 91eaea21b6..b82d096bb5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -136,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 f8d0eafcb3..d9043979d6 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -725,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) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 10fb293ec0..529a0ccfe7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -290,10 +290,15 @@ 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; + 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(); } } #endif -- cgit v1.2.3 From b8c007ede01360594ec5399532f2229e82715cc3 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 3 Jun 2013 18:33:03 +0200 Subject: Cocoa: Update window state when maximizing from the title bar There's no NSWindow notification we can listen to, but we can override behavior from its delegate. Change-Id: I61cebf4119f83c770fe4e7f45ff0d4e8bf9d0df9 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 10 ++++++++++ src/plugins/platforms/cocoa/qnswindowdelegate.h | 1 + src/plugins/platforms/cocoa/qnswindowdelegate.mm | 8 ++++++++ 4 files changed, 20 insertions(+) diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 85f72a4dbb..d28e38886b 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -82,6 +82,7 @@ QT_END_NAMESPACE - (void)drawRect:(NSRect)dirtyRect; - (void)updateGeometry; - (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 529a0ccfe7..ec53fc6a7e 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -306,6 +306,16 @@ static QTouchDevice *touchDevice = 0; } } +- (void)notifyWindowWillZoom:(BOOL)willZoom +{ + Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; + 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)viewDidHide { m_platformWindow->obscureWindow(); 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 -- cgit v1.2.3 From bfab741cb7ed24d2decfab4cffdcdbf14f6317ca Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 4 Jun 2013 13:54:07 +0200 Subject: Cocoa: Make sure internal minimized state is up to date Refactors some code from previous changes addressing the same issue for maximized and fullscreen states. Change-Id: I8a27274a90e6610b424ea7af3269369a1d724c48 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.h | 1 + src/plugins/platforms/cocoa/qnsview.mm | 30 ++++++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index d28e38886b..92215b9e67 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -81,6 +81,7 @@ 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; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ec53fc6a7e..ab3f495a60 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"]) { @@ -294,11 +304,7 @@ static QTouchDevice *touchDevice = 0; || notificationName == NSWindowDidExitFullScreenNotification) { Qt::WindowState newState = notificationName == NSWindowDidEnterFullScreenNotification ? Qt::WindowFullScreen : Qt::WindowNoState; - 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(); + [self notifyWindowStateChanged:newState]; } } #endif @@ -309,11 +315,7 @@ static QTouchDevice *touchDevice = 0; - (void)notifyWindowWillZoom:(BOOL)willZoom { Qt::WindowState newState = willZoom ? Qt::WindowMaximized : Qt::WindowNoState; - 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(); + [self notifyWindowStateChanged:newState]; } - (void)viewDidHide -- cgit v1.2.3 From d8f4abec711d7af4013209fd8b0c9edcedb44ab6 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 5 Jun 2013 15:47:55 +0200 Subject: Cocoa: Make QWidget::showNormal() work on minimized windows Cocoa sets the NSWindow hidden when it's minimized, and we don't propagate that further to QWindow or QWidget (QWidget's 'visible' documentation is quite ambiguous about that state). The obvious fix is to check for QWindow's visibility. However, this might need to be corrected later if we truly want the visible state to be in sync. Task-number: QTBUG-31117 Change-Id: I457452eff75e6ea746a0ef5351104f8bbb65f98b Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d9043979d6..19c4faf369 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -486,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. } -- cgit v1.2.3 From e2765098db18a7570b04fe3e30ded728aa97120a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 16:23:24 +0200 Subject: don't claim that we need perl for shadow builds any more amends 0a1b89bff, which took care only of the unix version. Change-Id: Idb82881a9c47e67c973500721fd499bcf41a848b Reviewed-by: Joerg Bornemann --- tools/configure/configureapp.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 98b59ab6fd..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"); -- cgit v1.2.3 From aa3f1cc8c6a15e29b592a46252a78c571262928d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 10 Jun 2013 11:37:55 +0200 Subject: fix QMAKE_COMPILER fallback for clang specs in the actual specs, we also set 'gcc' for clang. Change-Id: Ifc6b27d56596f34c944205795d665f545d090f80 Reviewed-by: Joerg Bornemann Reviewed-by: Jake Petroules --- mkspecs/features/spec_post.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: \ -- cgit v1.2.3 From 7f6c864157d63091e351fd0f11c1b2408969a670 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 15:38:52 +0200 Subject: remove overquoting of extra compiler commands the commands are already quoted appropriately for the shell. Change-Id: I746bb5fba2cd6548c5dc7ef81087c69a200ecbb8 Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 4 ++-- mkspecs/features/uic.prf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index ed44d9c308..5092362b44 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -18,8 +18,8 @@ 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 -list $$QMAKE_RESOURCE_FLAGS "${QMAKE_FILE_IN}" rcc.CONFIG += add_inputs_as_makefile_deps rcc.input = RESOURCES rcc.variable_out = SOURCES diff --git a/mkspecs/features/uic.prf b/mkspecs/features/uic.prf index 36ec185f7b..6d85443200 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -4,7 +4,7 @@ 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 -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 -- cgit v1.2.3 From 6bf5ef044f12bd4ac2bcb608365162334cb50252 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Jun 2013 15:45:44 +0200 Subject: remove overquoting of extra compiler arguments qmake automatically escapes the ${expandos}. Change-Id: If74b6d2f2c68ff50785fdcbb66351122a273051f Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 6 +++--- mkspecs/features/uic.prf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 5092362b44..34a04b4ee2 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -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 -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/uic.prf b/mkspecs/features/uic.prf index 6d85443200..83e579cb3a 100644 --- a/mkspecs/features/uic.prf +++ b/mkspecs/features/uic.prf @@ -4,7 +4,7 @@ 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 -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 -- cgit v1.2.3 From 2d9cd8eef8652873e73d5cde6b6545eea9a17612 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 12 Jun 2013 09:37:46 +0200 Subject: Fix xkbcommon.pri not to override QMAKE_CFLAGS Task-number: QTBUG-31585 Change-Id: I6628a8eececc34aef4cd358ad2c8b246d8845602 Reviewed-by: Jani Heikkinen Reviewed-by: Andy Shaw --- src/3rdparty/xkbcommon.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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\\"' -- cgit v1.2.3