diff --git a/.gitignore b/.gitignore index 7c98265f570..3190e4e1ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -215,6 +215,7 @@ examples/tools/plugandpaint/plugins include/* include/*/* lib/* +imports/* !lib/fonts !lib/README plugins/*/* diff --git a/bin/syncqt b/bin/syncqt index 581233a1620..3e77d2001da 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -227,7 +227,7 @@ sub classNames { $line =~ s,//.*$,,; #remove c++ comments $line .= ";" if($line =~ m/^Q_[A-Z_]*\(.*\)[\r\n]*$/); #qt macro $line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro - $line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE[\r\n]*$/); #qt macro + $line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro $line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro $parsable .= " " . $line; } diff --git a/configure b/configure index 7ef52e5af28..1da85c5408d 100755 --- a/configure +++ b/configure @@ -688,6 +688,7 @@ CFG_AUDIO_BACKEND=auto CFG_V8SNAPSHOT=auto CFG_QML_DEBUG=yes CFG_JAVASCRIPTCORE_JIT=auto +CFG_PKGCONFIG=auto # Target architecture CFG_ARCH= @@ -704,6 +705,7 @@ CFG_XKB=auto CFG_XCB=auto CFG_XCB_LIMITED=yes CFG_EGLFS=auto +CFG_DIRECTFB=auto CFG_LIBUDEV=auto CFG_OBSOLETE_WAYLAND=no CFG_EVDEV=auto @@ -887,7 +889,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon) + -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-directfb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1077,8 +1079,15 @@ while [ "$#" -gt 0 ]; do hostbindir) QT_HOST_BINS="$VAL" ;; + pkg-config) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_PKGCONFIG="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; force-pkg-config) - QT_FORCE_PKGCONFIG=yes + CFG_PKGCONFIG="force" ;; docdir) QT_INSTALL_DOCS="$VAL" @@ -1619,6 +1628,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + directfb) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_DIRECTFB="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; libudev) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_LIBUDEV="$VAL" @@ -2153,19 +2169,19 @@ if [ -z "$PLATFORM" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE" in Darwin:*) OSX_VERSION=`uname -r | cut -d. -f1` - if [ "$OSX_VERSION" -ge 11 ]; then - # We're on Lion or above. Check if we have a supported Clang version + # Select compiler. Use g++ unless we find a usable Clang version + PLATFORM=macx-g++ + if [ "$OSX_VERSION" -ge 12 ]; then + # We're on Mountain Lion or above. Use Clang. Don't advertise gcc. + PLATFORM=macx-clang + elif [ "$OSX_VERSION" -eq 11 ]; then + # We're on Lion. Check if we have a supported Clang version case "$(clang -v 2>&1 | grep -Po '(?<=version )\d[\d.]+')" in 3.*) PLATFORM=macx-clang PLATFORM_NOTES="\n - Also available for Mac OS X: macx-g++\n" ;; - *) - PLATFORM=macx-g++ - ;; esac - else - PLATFORM=macx-g++ fi ;; AIX:*) @@ -2441,50 +2457,6 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then QT_CONFIG="$QT_CONFIG build_all" fi -if [ -z "$PKG_CONFIG" ]; then - # See if PKG_CONFIG is set in the mkspec: - PKG_CONFIG=`getXQMakeConf PKG_CONFIG` -fi -if [ -z "$PKG_CONFIG" ]; then - PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` -fi - -# Work out if we can use pkg-config -if [ "$QT_CROSS_COMPILE" = "yes" ]; then - if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then - echo >&2 "" - echo >&2 "You have asked to use pkg-config and are cross-compiling." - echo >&2 "Please make sure you have a correctly set-up pkg-config" - echo >&2 "environment!" - echo >&2 "" - if [ -z "$PKG_CONFIG_LIBDIR" ]; then - echo >&2 "" - echo >&2 "Warning: PKG_CONFIG_LIBDIR has not been set. This could mean" - echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)." - echo >&2 "This is probably not what you want." - echo >&2 "" - elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then - echo >&2 "" - echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not" - echo >&2 "been set. This means your toolchain's .pc files must contain" - echo >&2 "the paths to the toolchain's libraries & headers. If configure" - echo >&2 "tests are failing, please check these files." - echo >&2 "" - fi - else - echo >&2 "" - echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling." - echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for" - echo >&2 "dependencies" - echo >&2 "" - PKG_CONFIG="" - fi -fi - -if [ ! -n "$PKG_CONFIG" ]; then - QT_CONFIG="$QT_CONFIG no-pkg-config" -fi - # pass on $CFG_SDK to the configure tests. if [ '!' -z "$CFG_SDK" ]; then MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK" @@ -2844,6 +2816,13 @@ if [ "$OPT_HELP" = "yes" ]; then EGLFSN=" " fi + if [ "$CFG_DIRECTFB" = "no"]; then + DFBY=" " + DFBN="*" + else + DFBY="*" + DFBN=" " + fi if [ "$CFG_XINPUT2" = "no" ]; then X2Y=" " X2N="*" @@ -3036,6 +3015,13 @@ Configure options: -I ........ Add an explicit include path. -L ........ Add an explicit library path. + + -pkg-config ........ Use pkg-config to detect include and library paths. By default, + configure determines whether to use pkg-config or not with + some heuristics such as checking the environment variables. + -no-pkg-config ..... Disable use of pkg-config. + -force-pkg-config .. Force usage of pkg-config (skips pkg-config usability + detection heuristic). + -help, -h .......... Display this information. Third Party Libraries: @@ -3128,6 +3114,9 @@ Additional options: $EGLFSN -no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support. $EGLFSY -eglfs ............. Compile EGLFS support. + $DFBN -no-directfb ....... Do not compile DirectFB support. + $DFBY -directfb .......... Compile DirectFB support. + -xplatform target ... The target platform when cross-compiling. -sysroot ...... Sets as the target compiler's and qmake's sysroot. @@ -3607,6 +3596,70 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2 fi # Build qmake +#------------------------------------------------------------------------------- +# Detect pkg-config +#------------------------------------------------------------------------------- +if [ -z "$PKG_CONFIG" ]; then + # See if PKG_CONFIG is set in the mkspec: + PKG_CONFIG=`getXQMakeConf PKG_CONFIG` +fi +if [ -z "$PKG_CONFIG" ]; then + PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` +fi + +if [ "$CFG_PKGCONFIG" = "no" ]; then + PKG_CONFIG= +elif [ "$CFG_PKGCONFIG" = "force" ]; then + echo >&2 "" + echo >&2 "You have asked to use pkg-config. Please make sure you have" + echo >&2 "a correctly setup pkg-config environment!" + echo >&2 "" +elif [ -n "$PKG_CONFIG" ]; then + # found a pkg-config + if [ "$QT_CROSS_COMPILE" = "yes" ]; then + # when xcompiling, check environment to see if it's actually usable + if [ -z "$PKG_CONFIG_LIBDIR" ]; then + if [ -n "$CFG_SYSROOT" ] && [ -d "$CFG_SYSROOT/usr/lib/pkgconfig" ]; then + PKG_CONFIG_LIBDIR=$CFG_SYSROOT/usr/lib/pkgconfig:$CFG_SYSROOT/usr/share/pkgconfig + export PKG_CONFIG_LIBDIR + echo >&2 "Note: PKG_CONFIG_LIBDIR automatically set to $PKG_CONFIG_LIBDIR" + elif [ "$CFG_PKGCONFIG" = "yes" ]; then + echo >&2 "Error: PKG_CONFIG_LIBDIR has not been set. This could mean" + echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)." + echo >&2 "Set this variable to the directory that contains target .pc files" + echo >&2 "for pkg-config to function correctly when cross-compiling or" + echo >&2 "use -force-pkg-config to override this test." + exit 101 + else + PKG_CONFIG= + echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set." + fi + fi + if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then + if [ -n "$CFG_SYSROOT" ]; then + PKG_CONFIG_SYSROOT_DIR=$CFG_SYSROOT + export PKG_CONFIG_SYSROOT_DIR + echo >&2 "Note: PKG_CONFIG_SYSROOT_DIR automatically set to $PKG_CONFIG_SYSROOT_DIR" + elif [ "$CFG_PKGCONFIG" = "yes" ]; then + echo >&2 "Error: PKG_CONFIG_SYSROOT_DIR has not been set. Set this variable" + echo >&2 "to your sysroot for pkg-config to function correctly when cross-compiling" + echo >&2 "or use -force-pkg-config to override this test." + exit 101 + else + PKG_CONFIG= + echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set." + fi + fi + fi +elif [ "$CFG_PKGCONFIG" = "yes" ]; then + echo >&2 "Could not detect pkg-config from mkspec or PATH." + exit 101 +fi + +if [ -z "$PKG_CONFIG" ]; then + QT_CONFIG="$QT_CONFIG no-pkg-config" +fi + #------------------------------------------------------------------------------- # tests that need qmake #------------------------------------------------------------------------------- @@ -4404,6 +4457,7 @@ fi # Save these for a check later ORIG_CFG_XCB="$CFG_XCB" ORIG_CFG_EGLFS="$CFG_EGLFS" +ORIG_CFG_DIRECTFB="$CFG_DIRECTFB" if [ "$CFG_LIBUDEV" != "no" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then @@ -4511,6 +4565,16 @@ if [ "$CFG_XCB" != "no" ]; then fi fi +if [ "$CFG_DIRECTFB" != "no" ]; then + if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists directfb 2>/dev/null; then + QMAKE_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null` + QMAKE_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null` + QT_CONFIG="$QT_CONFIG directfb" + else + CFG_DIRECTFB=no + fi +fi + # Detect libxkbcommon if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`" @@ -4558,6 +4622,10 @@ if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB" QMakeVar set QMAKE_DEFINES_XCB "$QMAKE_DEFINES_XCB" fi +if [ -n "$QMAKE_CFLAGS_DIRECTFB" ] || [ -n "$QMAKE_LIBS_DIRECTFB" ]; then + QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB" + QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB" +fi if [ "$BUILD_ON_MAC" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then @@ -4568,12 +4636,12 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then fi if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ]; then - if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ]; then + if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ]; then if [ "$QPA_PLATFORM_GUARD" = "yes" ] && - ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] ); then + ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] ); then echo "No QPA platform plugin enabled!" echo " If you really want to build without a QPA platform plugin you must pass" - echo " -no-xcb and -no-eglfs to configure. Doing this will" + echo " -no-xcb, -no-eglfs and -no-directfb to configure. Doing this will" echo " produce a Qt that cannot run GUI applications." echo " The dependencies needed for xcb to build are listed in" echo " src/plugins/platforms/xcb/README" @@ -5759,6 +5827,7 @@ fi #------------------------------------------------------------------------------- # give feedback on configuration #------------------------------------------------------------------------------- +exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary case "$COMPILER" in g++*) @@ -5836,6 +5905,11 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then else echo "Debug .................. $CFG_DEBUG" fi +if [ -n "$PKG_CONFIG" ]; then + echo "pkg-config ............. yes" +else + echo "pkg-config ............. no" +fi [ "$CFG_DBUS" = "no" ] && echo "QtDBus module .......... no" [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module .......... yes (run-time)" [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module .......... yes (linked)" @@ -5949,6 +6023,7 @@ if [ "$XPLATFORM_MAEMO" = "yes" ] && [ "$CFG_XCB" = "yes" ]; then echo "XInput2 support ........ $CFG_XINPUT2" fi echo "EGLFS support .......... $CFG_EGLFS" +echo "DirectFB support ....... $CFG_DIRECTFB" echo # complain about not being able to use dynamic plugins if we are using a static build @@ -5967,6 +6042,10 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked" echo fi + +exec 1>&3 3>&- # restore stdout +cat $outpath/config.summary # display config feedback to user + if [ "$BUILD_ON_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then echo echo "Error: debug-only framework builds are not supported. Configure with -no-framework" diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index fd107850792..064d16c359c 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -30,7 +30,7 @@ QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL -QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM +QMAKE_LIBS_OPENGL_ES1 = -lGLESv1_CM QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf index a2aefc6cd31..aa6abee0a0c 100644 --- a/mkspecs/common/qcc-base.conf +++ b/mkspecs/common/qcc-base.conf @@ -7,10 +7,9 @@ # # 1) -pipe is removed as it's on by default in qcc (and has an analogous -nopipe option) # 2) -Wno-psabi is added to silence harmless warnings about va_list mangling -# 3) -fstack-protector -fstack-protector-all is added to enable stack smashing protection # -QMAKE_CFLAGS += -Wno-psabi -fstack-protector -fstack-protector-all +QMAKE_CFLAGS += -Wno-psabi QMAKE_CFLAGS_DEPS += -M QMAKE_CFLAGS_WARN_ON += -Wall -W QMAKE_CFLAGS_WARN_OFF += -w diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp similarity index 81% rename from mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp rename to mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp index 06cb424e4f8..6655c505734 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include #include #include @@ -48,20 +48,15 @@ #include #include -void QEglFSHooks::platformInit() +class QEglFS8726MHooks : public QEglFSHooks { -} +public: + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); +}; -void QEglFSHooks::platformDestroy() -{ -} - -EGLNativeDisplayType QEglFSHooks::platformDisplay() const -{ - return EGL_DEFAULT_DISPLAY; -} - -QSize QEglFSHooks::screenSize() const +QSize QEglFS8726MHooks::screenSize() const { int fd = open("/dev/fb0", O_RDONLY); if (fd == -1) { @@ -78,7 +73,7 @@ QSize QEglFSHooks::screenSize() const return QSize(vinfo.xres, vinfo.yres); } -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFS8726MHooks::createNativeWindow(const QSize &size) { fbdev_window *window = new fbdev_window; window->width = size.width(); @@ -87,9 +82,11 @@ EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) return window; } -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +void QEglFS8726MHooks::destroyNativeWindow(EGLNativeWindowType window) { delete window; } -QEglFSHooks platform_hooks; +QEglFS8726MHooks eglFS8726MHooks; +QEglFSHooks *platformHooks = &eglFS8726MHooks; + diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf index b0b02f32e6a..7525397a65e 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf @@ -31,6 +31,6 @@ QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE deviceSanityCheckCompiler() -EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfs_hooks_8726m.cpp +EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_8726m.cpp load(qt_config) diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf new file mode 100644 index 00000000000..fbe6ed100b0 --- /dev/null +++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf @@ -0,0 +1,66 @@ +# +# qmake configuration for building with arm-linux-uclibcgnueabi-g++ +# +# http://wiki.qt-project.org/Devices/Shiner +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) + +load(device_config) + +# Sanity checks +isEmpty(TRIDENT_SHINER_SDK_BUILDTREE): error("TRIDENT_SHINER_SDK_BUILDTREE needs to be set via -device-option TRIDENT_SHINER_SDK_BUILDTREE=") +isEmpty(CROSS_COMPILE): error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") +isEmpty(TRIDENT_SHINER_SDK_BUILDSPEC): error("TRIDENT_SHINER_SDK_BUILDSPEC needs to be set via -device-option TRIDENT_SHINER_SDK_BUILDSPEC=") +isEmpty(TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2): error("TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2 needs to be set via -device-option TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2=") +isEmpty(TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2): error("TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2 needs to be set via -device-option TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2=") + +QMAKE_CC = $${CROSS_COMPILE}gcc +QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_LINK = $${CROSS_COMPILE}g++ +QMAKE_LINK_SHLIB = $${CROSS_COMPILE}g++ + +# +# Usage configure options "-sysroot " with "--prefix=" results into installation of Qt at "". +# Trident Shiner SDK expects all libs to be in "Application file system" which is not +# +# Because of this fact not using "-sysroot " and hence following code is required +# +QMAKE_CFLAGS += --sysroot=$${TRIDENT_SHINER_SDK_BUILDTREE}/open_source_archive/linux/toolchains/gcc-4.5.2_uclibc/ +QMAKE_CXXFLAGS += --sysroot=$${TRIDENT_SHINER_SDK_BUILDTREE}/open_source_archive/linux/toolchains/gcc-4.5.2_uclibc/ +QMAKE_LFLAGS += --sysroot=$${TRIDENT_SHINER_SDK_BUILDTREE}/open_source_archive/linux/toolchains/gcc-4.5.2_uclibc/ + +# Compiler Sanity check +deviceSanityCheckCompiler() + +QMAKE_CFLAGS_RELEASE = -O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE + +# modifications to linux.conf +QMAKE_AR = $${CROSS_COMPILE}ar cqs +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_STRIP = $${CROSS_COMPILE}strip + +QMAKE_INCDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/include +QMAKE_LIBDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/lib +QMAKE_LIBDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generated/lib/armgnu_linux_el_cortex-a9 + +QMAKE_INCDIR_EGL = $${TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2} +QMAKE_LIBDIR_EGL = $${TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2} + +QMAKE_INCDIR_OPENGL_ES2 = $${TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2} +QMAKE_LIBDIR_OPENGL_ES2 = $${TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2} + +QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um -lusc +QMAKE_LIBS_OPENGL_ES2 = $$QMAKE_LIBS_EGL -lGLESv2 -lGLES_CM + +load(qt_config) diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h new file mode 100644 index 00000000000..e2464172231 --- /dev/null +++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" + diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp new file mode 100644 index 00000000000..16aee0c4f70 --- /dev/null +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdirectfbeglhooks.h" +#include "qdirectfbconvenience.h" + +#include "default_directfb.h" + +// Exported to the directfb plugin +QDirectFBEGLHooks platform_hook; +static void *dbpl_handle; + +void QDirectFBEGLHooks::platformInit() +{ + DBPL_RegisterDirectFBDisplayPlatform(&dbpl_handle, QDirectFbConvenience::dfbInterface()); +} + +void QDirectFBEGLHooks::platformDestroy() +{ + DBPL_UnregisterDirectFBDisplayPlatform(&dbpl_handle); + dbpl_handle = 0; +} + +bool QDirectFBEGLHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedOpenGL: + return true; + default: + return false; + } +} + diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf index 866fad639bc..e69a3cee4b8 100644 --- a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf @@ -55,11 +55,13 @@ QMAKE_LIBS_OPENGL_ES2 = -lv3ddriver -lrt INCLUDEPATH += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 QMAKE_LIBDIR += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 -# DirectFB, needs to be changed once -directfb is added to configure -DIRECTFB_INCLUDEPATH = $${BRCM_APPLIBS_PATH}/opensource/directfb/bin/DirectFB-1.4.15_multi_$${BRCM_BUILD_TYPE}_build.97425B1/usr/local/include/directfb $${BRCM_ROCKFORD_PATH}/middleware/platform/directfb -DIRECTFB_LIBS = -L$${BRCM_APPLIBS_PATH}/opensource/directfb/bin/DirectFB-1.4.15_multi_$${BRCM_BUILD_TYPE}_build.97425B1/usr/local/lib -L$${BRCM_ROCKFORD_PATH}/middleware/platform/directfb/lib_$${BRCM_PLATFORM}_$${BRCM_BUILD_TYPE} -ldirectfb -lfusion -ldirect -lpthread -lnexus -ldbpl -lz - - QMAKE_LFLAGS += -Wl,-rpath-link,$$QMAKE_LIBDIR_OPENGL_ES2 -Wl,-rpath-link,$${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 +# DirectFB platform hooks for this hardware +QT_CONFIG += directfb_egl +DIRECTFB_PLATFORM_HOOKS_SOURCES = $$PWD/qdirectfbeglhooks_bcm97425.cpp +DIRECTFB_PLATFORM_HOOKS_INCLUDEPATH = $${BRCM_ROCKFORD_PATH}/middleware/platform/directfb +DIRECTFB_PLATFORM_HOOKS_LIBS = -ldbpl +DIRECTFB_PLATFORM_HOOKS_LIBDIR = $${BRCM_ROCKFORD_PATH}/middleware/platform/directfb/lib_$${BRCM_PLATFORM}_$${BRCM_BUILD_TYPE} + load(qt_config) diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp similarity index 76% rename from mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp rename to mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp index 2cbd297a906..21052a5b63a 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp +++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include @@ -55,23 +55,35 @@ static DISPMANX_DISPLAY_HANDLE_T dispman_display = 0; static DISPMANX_UPDATE_HANDLE_T dispman_update = 0; -void QEglFSHooks::platformInit() +class QEglFSPiHooks : public QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +void QEglFSPiHooks::platformInit() { bcm_host_init(); } -EGLNativeDisplayType QEglFSHooks::platformDisplay() const +EGLNativeDisplayType QEglFSPiHooks::platformDisplay() const { dispman_display = vc_dispmanx_display_open(0/* LCD */); return EGL_DEFAULT_DISPLAY; } -void QEglFSHooks::platformDestroy() +void QEglFSPiHooks::platformDestroy() { vc_dispmanx_display_close(dispman_display); } -QSize QEglFSHooks::screenSize() const +QSize QEglFSPiHooks::screenSize() const { //both mechanisms work #if 1 @@ -98,7 +110,7 @@ QSize QEglFSHooks::screenSize() const #endif } -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +EGLNativeWindowType QEglFSPiHooks::createNativeWindow(const QSize &size) { VC_RECT_T dst_rect; dst_rect.x = 0; @@ -133,11 +145,25 @@ EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) return eglWindow; } -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +void QEglFSPiHooks::destroyNativeWindow(EGLNativeWindowType window) { EGL_DISPMANX_WINDOW_T *eglWindow = static_cast(window); vc_dispmanx_element_remove(dispman_update, eglWindow->element); delete eglWindow; } -QEglFSHooks platform_hooks; +bool QEglFSPiHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedPixmaps: + case QPlatformIntegration::OpenGL: + case QPlatformIntegration::ThreadedOpenGL: + case QPlatformIntegration::BufferQueueingOpenGL: + return true; + default: + return false; + } +} + +QEglFSPiHooks eglFSPiHooks; +QEglFSHooks *platformHooks = &eglFSPiHooks; diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf index 326d6b3b61e..4c75e0b0b2d 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf @@ -48,7 +48,7 @@ QMAKE_CFLAGS_RELEASE += \ QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfs_hooks.cpp +EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp # Sanity check deviceSanityCheckCompiler() diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf new file mode 100644 index 00000000000..ba8ab280265 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf @@ -0,0 +1,35 @@ +# +# qmake configuration for linux-g++ using the sh4-linux-g++ crosscompiler +# +# http://wiki.qt-project.org/Devices/ST7108 +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) + +load(device_config) + +isEmpty(CROSS_COMPILE): error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") + +QMAKE_CC = $${CROSS_COMPILE}gcc +QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_LINK = $${QMAKE_CXX} +QMAKE_LINK_SHLIB = $${QMAKE_CXX} + +QMAKE_AR = $${CROSS_COMPILE}ar cqs +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_STRIP = $${CROSS_COMPILE}strip + +deviceSanityCheckCompiler() + +QMAKE_LIBS_EGL += -lMali + +load(qt_config) diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h new file mode 100644 index 00000000000..e2464172231 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" + diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf new file mode 100644 index 00000000000..9a99a82ee36 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf @@ -0,0 +1,47 @@ +# +# qmake configuration for linux-g++ using the sh4-linux-g++ crosscompiler +# +# http://wiki.qt-project.org/Devices/ST7540 +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) + +load(device_config) + +isEmpty(CROSS_COMPILE): error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") + +QMAKE_CC = $${CROSS_COMPILE}gcc +QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_LINK = $${QMAKE_CXX} +QMAKE_LINK_SHLIB = $${QMAKE_CXX} + +QMAKE_AR = $${CROSS_COMPILE}ar cqs +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_STRIP = $${CROSS_COMPILE}strip + +deviceSanityCheckCompiler() + +QMAKE_INCDIR_EGL += $$[QT_SYSROOT]/root/modules/include/ +QMAKE_LIBDIR_EGL += $$[QT_SYSROOT]/root/modules/ + +# +# The EGL library used for ST7540 is based on DirectFB so it has to be linked with +# 1. libdirectfb.so 2. libfusion.so 3. libdirect.so +# +QMAKE_LIBS_EGL += -lMali -ldirectfb -lfusion -ldirect + +QMAKE_INCDIR_OPENGL_ES2 += $$QMAKE_INCDIR_EGL +QMAKE_LIBDIR_OPENGL_ES2 += $$QMAKE_LIBDIR_EGL +QMAKE_LIBS_OPENGL_ES2 += $$QMAKE_LIBS_EGL + +load(qt_config) + diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h new file mode 100644 index 00000000000..e2464172231 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" + diff --git a/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf b/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf index df9961b1071..4e72667c5d3 100644 --- a/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf +++ b/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf @@ -6,4 +6,7 @@ DEFINES += Q_OS_BLACKBERRY CONFIG += blackberry LIBS += -lbps +# Blackberry also has support for stack smashing protection in its libc +QMAKE_CFLAGS += -fstack-protector -fstack-protector-all + include(../qnx-armv7le-qcc/qmake.conf) diff --git a/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf b/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf index 2cb405cd517..60b67f801ec 100644 --- a/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf +++ b/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf @@ -6,4 +6,7 @@ DEFINES += Q_OS_BLACKBERRY CONFIG += blackberry LIBS += -lbps +# Blackberry also has support for stack smashing protection in its libc +QMAKE_CFLAGS += -fstack-protector -fstack-protector-all + include(../qnx-x86-qcc/qmake.conf) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 2f19ea4495d..c2482b58a8c 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -115,11 +115,13 @@ DotNET which_dotnet_version() current_version = NET2002; QStringList warnPath; + QHash installPaths; int installed = 0; int i = 0; for(; dotNetCombo[i].version; ++i) { QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey); - if(!path.isEmpty()) { + if (!path.isEmpty() && installPaths.value(dotNetCombo[i].version) != path) { + installPaths.insert(dotNetCombo[i].version, path); ++installed; current_version = dotNetCombo[i].version; warnPath += QString("%1").arg(dotNetCombo[i].versionStr); diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index f7fa547a75a..c868021f2be 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -179,7 +179,7 @@ XmlOutput& XmlOutput::operator<<(const xml_output& o) break; case tTagValue: addRaw(QString("\n%1<%2>").arg(currentIndent).arg(o.xo_text)); - addRaw(QString("%1").arg(o.xo_value)); + addRaw(doConversion(o.xo_value)); addRaw(QString("").arg(o.xo_text)); break; case tValueTag: diff --git a/src/3rdparty/README b/src/3rdparty/README index 0248db1c53f..f6d7c525e1f 100644 --- a/src/3rdparty/README +++ b/src/3rdparty/README @@ -15,9 +15,3 @@ library directory, following the latest clean version update commit. The 'patches' subdirectory contains certain patches applied prior to the start of the public git history, where the library has not been updated since. - --- - -The pvr2d.h & wsegl.h in the powervr directory are required for building -the PowerVR plugin on Qt for Embedded Linux. These headers are for SGX -based SoCs, but may also work on MBX SoCs. diff --git a/src/3rdparty/powervr/pvr2d.h b/src/3rdparty/powervr/pvr2d.h deleted file mode 100644 index 07f28c7316b..00000000000 --- a/src/3rdparty/powervr/pvr2d.h +++ /dev/null @@ -1,502 +0,0 @@ -/*!**************************************************************************** -@File pvr2d.h -@Title PVR2D external header file -@Author Imagination Technologies -@Copyright Copyright (c) by Imagination Technologies Limited. - This specification is protected by copyright laws and contains - material proprietary to Imagination Technologies Limited. - You may use and distribute this specification free of charge for implementing - the functionality therein, without altering or removing any trademark, copyright, - or other notice from the specification. -@Platform Generic -@Description PVR2D definitions for PVR2D clients -******************************************************************************/ - - -/****************************************************************************** -Modifications :- -$Log: pvr2d.h $ -******************************************************************************/ - -#ifndef _PVR2D_H_ -#define _PVR2D_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* PVR2D Platform-specific definitions */ -#define PVR2D_EXPORT -#define PVR2D_IMPORT - - -#define PVR2D_REV_MAJOR 2 -#define PVR2D_REV_MINOR 1 - -typedef enum -{ - PVR2D_FALSE = 0, - PVR2D_TRUE -} PVR2D_BOOL; - - -/* error codes */ -typedef enum -{ - PVR2D_OK = 0, - PVR2DERROR_INVALID_PARAMETER = -1, - PVR2DERROR_DEVICE_UNAVAILABLE = -2, - PVR2DERROR_INVALID_CONTEXT = -3, - PVR2DERROR_MEMORY_UNAVAILABLE = -4, - PVR2DERROR_DEVICE_NOT_PRESENT = -5, - PVR2DERROR_IOCTL_ERROR = -6, - PVR2DERROR_GENERIC_ERROR = -7, - PVR2DERROR_BLT_NOTCOMPLETE = -8, - PVR2DERROR_HW_FEATURE_NOT_SUPPORTED = -9, - PVR2DERROR_NOT_YET_IMPLEMENTED = -10, - PVR2DERROR_MAPPING_FAILED = -11 -}PVR2DERROR; - - -/* pixel formats */ -typedef enum -{ - PVR2D_1BPP = 0, - PVR2D_RGB565, - PVR2D_ARGB4444, - PVR2D_RGB888, - PVR2D_ARGB8888, - PVR2D_ARGB1555, - PVR2D_ALPHA8, - PVR2D_ALPHA4, - PVR2D_PAL2, - PVR2D_PAL4, - PVR2D_PAL8, - PVR2D_VGAEMU - -}PVR2DFORMAT; - - -/* wrap surface type */ -typedef enum -{ - PVR2D_WRAPFLAG_NONCONTIGUOUS = 0, - PVR2D_WRAPFLAG_CONTIGUOUS = 1, - -}PVR2DWRAPFLAGS; - -/* flags for control information of additional blits */ -typedef enum -{ - PVR2D_BLIT_DISABLE_ALL = 0x0000, /* disable all additional controls */ - PVR2D_BLIT_CK_ENABLE = 0x0001, /* enable colour key */ - PVR2D_BLIT_GLOBAL_ALPHA_ENABLE = 0x0002, /* enable standard global alpha */ - PVR2D_BLIT_PERPIXEL_ALPHABLEND_ENABLE = 0x0004, /* enable per-pixel alpha bleding */ - PVR2D_BLIT_PAT_SURFACE_ENABLE = 0x0008, /* enable pattern surf (disable fill) */ - PVR2D_BLIT_FULLY_SPECIFIED_ALPHA_ENABLE = 0x0010, /* enable fully specified alpha */ - PVR2D_BLIT_ROT_90 = 0x0020, /* apply 90 degree rotation to the blt */ - PVR2D_BLIT_ROT_180 = 0x0040, /* apply 180 degree rotation to the blt */ - PVR2D_BLIT_ROT_270 = 0x0080, /* apply 270 degree rotation to the blt */ - PVR2D_BLIT_COPYORDER_TL2BR = 0x0100, /* copy order overrides */ - PVR2D_BLIT_COPYORDER_BR2TL = 0x0200, - PVR2D_BLIT_COPYORDER_TR2BL = 0x0400, - PVR2D_BLIT_COPYORDER_BL2TR = 0x0800, - PVR2D_BLIT_COLKEY_SOURCE = 0x1000, /* Key colour is on the source surface */ - PVR2D_BLIT_COLKEY_DEST = 0x2000 /* Key colour is on the destination surface */ - -} PVR2DBLITFLAGS; - -/* standard alpha-blending functions, AlphaBlendingFunc field of PVR2DBLTINFO */ -typedef enum -{ - PVR2D_ALPHA_OP_SRC_DSTINV = 1, /* source alpha : Cdst = Csrc*Asrc + Cdst*(1-Asrc) */ - PVR2D_ALPHA_OP_SRCP_DSTINV = 2 /* premultiplied source alpha : Cdst = Csrc + Cdst*(1-Asrc) */ -} PVR2D_ALPHABLENDFUNC; - -/* blend ops for fully specified alpha */ -typedef enum -{ - PVR2D_BLEND_OP_ZERO = 0, - PVR2D_BLEND_OP_ONE = 1, - PVR2D_BLEND_OP_SRC = 2, - PVR2D_BLEND_OP_DST = 3, - PVR2D_BLEND_OP_GLOBAL = 4, - PVR2D_BLEND_OP_SRC_PLUS_GLOBAL = 5, - PVR2D_BLEND_OP_DST_PLUS_GLOBAL = 6 -}PVR2D_BLEND_OP; - - -typedef void* PVR2D_HANDLE; - - -/* Fully specified alpha blend : pAlpha field of PVR2DBLTINFO structure */ -/* a fully specified Alpha Blend operation is defined as */ -/* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (ALPHA_3 * DST (ALPHA)) */ -/* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (ALPHA_4 * DST (RGB)) */ -/* if the pre-multiplication stage is enabled then the equations become the following: */ -/* PRE_MUL = ((SRC(A)) * (Global Alpha Value)) */ -/* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (PRE_MUL * DST (ALPHA)) */ -/* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (PRE_MUL * DST (RGB)) */ -/* if the transparent source alpha stage is enabled then a source alpha of zero forces the */ -/* source to be transparent for that pixel regardless of the blend equation being used. */ -typedef struct _PVR2D_ALPHABLT -{ - PVR2D_BLEND_OP eAlpha1; - PVR2D_BOOL bAlpha1Invert; - PVR2D_BLEND_OP eAlpha2; - PVR2D_BOOL bAlpha2Invert; - PVR2D_BLEND_OP eAlpha3; - PVR2D_BOOL bAlpha3Invert; - PVR2D_BLEND_OP eAlpha4; - PVR2D_BOOL bAlpha4Invert; - PVR2D_BOOL bPremulAlpha; /* enable pre-multiplication stage */ - PVR2D_BOOL bTransAlpha; /* enable transparent source alpha stage */ - PVR2D_BOOL bUpdateAlphaLookup; /* enable and update the 1555-Lookup alpha table */ - unsigned char uAlphaLookup0; /* 8 bit alpha when A=0 in a 1555-Lookup surface */ - unsigned char uAlphaLookup1; /* 8 bit alpha when A=1 in a 1555-Lookup surface */ - unsigned char uGlobalRGB; /* Global Alpha Value for RGB, 0=transparent 255=opaque */ - unsigned char uGlobalA; /* Global Alpha Value for Alpha */ - -} PVR2D_ALPHABLT, *PPVR2D_ALPHABLT; - - -/* surface memory info structure */ -typedef struct _PVR2DMEMINFO -{ - void *pBase; - unsigned long ui32MemSize; - unsigned long ui32DevAddr; - unsigned long ulFlags; - void *hPrivateData; - void *hPrivateMapData; - -}PVR2DMEMINFO, *PPVR2DMEMINFO; - - -#define PVR2D_MAX_DEVICE_NAME 20 - -typedef struct _PVR2DDEVICEINFO -{ - unsigned long ulDevID; - char szDeviceName[PVR2D_MAX_DEVICE_NAME]; -}PVR2DDEVICEINFO; - - -typedef struct _PVR2DISPLAYINFO -{ - unsigned long ulMaxFlipChains; - unsigned long ulMaxBuffersInChain; - PVR2DFORMAT eFormat; - unsigned long ulWidth; - unsigned long ulHeight; - long lStride; - unsigned long ulMinFlipInterval; - unsigned long ulMaxFlipInterval; - -}PVR2DDISPLAYINFO; - - -typedef struct _PVR2DBLTINFO -{ - unsigned long CopyCode; /* rop code */ - unsigned long Colour; /* fill colour */ - unsigned long ColourKey; /* colour key */ - unsigned char GlobalAlphaValue; /* global alpha blending */ - unsigned char AlphaBlendingFunc; /* per-pixel alpha-blending function */ - - PVR2DBLITFLAGS BlitFlags; /* additional blit control information */ - - PVR2DMEMINFO *pDstMemInfo; /* destination memory */ - unsigned long DstOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */ - long DstStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */ - long DstX, DstY; /* pixel offset from start of dest surface to start of blt rectangle */ - long DSizeX,DSizeY; /* blt size */ - PVR2DFORMAT DstFormat; /* dest format */ - unsigned long DstSurfWidth; /* size of dest surface in pixels */ - unsigned long DstSurfHeight; /* size of dest surface in pixels */ - - PVR2DMEMINFO *pSrcMemInfo; /* source mem, (source fields are also used for patterns) */ - unsigned long SrcOffset; /* byte offset from start of allocation to src/pat surface pixel 0,0 */ - long SrcStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */ - long SrcX, SrcY; /* pixel offset from start of surface to start of source rectangle */ - /* for patterns this is the start offset within the pattern */ - long SizeX,SizeY; /* source rectangle size or pattern size in pixels */ - PVR2DFORMAT SrcFormat; /* source/pattern format */ - PVR2DMEMINFO *pPalMemInfo; /* source/pattern palette memory containing argb8888 colour table */ - unsigned long PalOffset; /* byte offset from start of allocation to start of palette */ - unsigned long SrcSurfWidth; /* size of source surface in pixels */ - unsigned long SrcSurfHeight; /* size of source surface in pixels */ - - PVR2DMEMINFO *pMaskMemInfo; /* mask memory, 1bpp format implied */ - unsigned long MaskOffset; /* byte offset from start of allocation to mask surface pixel 0,0 */ - long MaskStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */ - long MaskX, MaskY; /* mask rect top left (mask size = blt size) */ - unsigned long MaskSurfWidth; /* size of mask surface in pixels */ - unsigned long MaskSurfHeight; /* size of mask surface in pixels */ - - PPVR2D_ALPHABLT pAlpha; /* fully specified alpha blend */ - -}PVR2DBLTINFO, *PPVR2DBLTINFO; - -typedef struct _PVR2DRECT -{ - long left, top; - long right, bottom; -} PVR2DRECT; - -typedef struct -{ - PVR2DMEMINFO *pSurfMemInfo; /* surface memory */ - unsigned long SurfOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */ - long Stride; /* signed stride */ - PVR2DFORMAT Format; - unsigned long SurfWidth; /* surface size in pixels */ - unsigned long SurfHeight; - -} PVR2D_SURFACE, *PPVR2D_SURFACE; - -typedef struct -{ - unsigned long *pUseCode; /* USSE code */ - unsigned long UseCodeSize; /* usse code size in bytes */ - -} PVR2D_USECODE, *PPVR2D_USECODE; - -typedef struct -{ - PVR2D_SURFACE sDst; /* destination surface */ - PVR2D_SURFACE sSrc; /* source surface */ - PVR2DRECT rcDest; /* destination rectangle */ - PVR2DRECT rcSource; /* source rectangle */ - PVR2D_HANDLE hUseCode; /* custom USE code (NULL implies source copy) */ - unsigned long UseParams[2]; /* per-blt params for use code */ - -} PVR2D_3DBLT, *PPVR2D_3DBLT; - - -#define MAKE_COPY_BLIT(src,soff,dest,doff,sx,sy,dx,dy,sz) - -typedef void* PVR2DCONTEXTHANDLE; -typedef void* PVR2DFLIPCHAINHANDLE; - - -// CopyCode field of PVR2DBLTINFO structure: -// the CopyCode field of the PVR2DBLTINFO structure should contain a rop3 or rop4 code. -// a rop3 is an 8 bit code that describes a blt with three inputs : source dest and pattern -// rop4 is a 16 bit code that describes a blt with four inputs : source dest pattern and mask -// common rop3 codes are defined below -// a colour fill blt is processed in the pattern channel as a constant colour with a rop code of 0xF0 -// PVR2D_BLIT_PAT_SURFACE_ENABLE defines whether the pattern channel is a surface or a fill colour. -// a rop4 is defined by two rop3 codes, and the 1 bit-per-pixel mask surface defines which is used. -// a common rop4 is 0xAAF0 which is the mask copy blt used for text glyphs. -// CopyCode is taken to be a rop4 when pMaskMemInfo is non zero, otherwise it is assumed to be a rop3 -// use the PVR2DMASKROP4 macro below to construct a rop4 from two rop3's -// rop3a is the rop used when mask pixel = 1, and rop3b when mask = 0 -#define PVR2DROP4(rop3b, rop3a) ((rop3b<<8)|rop3a) - -/* common rop codes */ -#define PVR2DROPclear 0x00 /* 0 (whiteness) */ -#define PVR2DROPset 0xFF /* 1 (blackness) */ -#define PVR2DROPnoop 0xAA /* dst (used for masked blts) */ - -/* source and dest rop codes */ -#define PVR2DROPand 0x88 /* src AND dst */ -#define PVR2DROPandReverse 0x44 /* src AND NOT dst */ -#define PVR2DROPcopy 0xCC /* src (used for source copy and alpha blts) */ -#define PVR2DROPandInverted 0x22 /* NOT src AND dst */ -#define PVR2DROPxor 0x66 /* src XOR dst */ -#define PVR2DROPor 0xEE /* src OR dst */ -#define PVR2DROPnor 0x11 /* NOT src AND NOT dst */ -#define PVR2DROPequiv 0x99 /* NOT src XOR dst */ -#define PVR2DROPinvert 0x55 /* NOT dst */ -#define PVR2DROPorReverse 0xDD /* src OR NOT dst */ -#define PVR2DROPcopyInverted 0x33 /* NOT src */ -#define PVR2DROPorInverted 0xBB /* NOT src OR dst */ -#define PVR2DROPnand 0x77 /* NOT src OR NOT dst */ - -/* pattern rop codes */ -#define PVR2DPATROPand 0xA0 /* pat AND dst */ -#define PVR2DPATROPandReverse 0x50 /* pat AND NOT dst */ -#define PVR2DPATROPcopy 0xF0 /* pat (used for solid color fills and pattern blts) */ -#define PVR2DPATROPandInverted 0x0A /* NOT pat AND dst */ -#define PVR2DPATROPxor 0x5A /* pat XOR dst */ -#define PVR2DPATROPor 0xFA /* pat OR dst */ -#define PVR2DPATROPnor 0x05 /* NOT pat AND NOT dst */ -#define PVR2DPATROPequiv 0xA5 /* NOT pat XOR dst */ -#define PVR2DPATROPinvert 0x55 /* NOT dst */ -#define PVR2DPATROPorReverse 0xF5 /* pat OR NOT dst */ -#define PVR2DPATROPcopyInverted 0x0F /* NOT pat */ -#define PVR2DPATROPorInverted 0xAF /* NOT pat OR dst */ -#define PVR2DPATROPnand 0x5F /* NOT pat OR NOT dst */ - -/* common rop4 codes */ -#define PVR2DROP4MaskedCopy PVR2DROP4(PVR2DROPnoop,PVR2DROPcopy) /* masked source copy blt (used for rounded window corners etc) */ -#define PVR2DROP4MaskedFill PVR2DROP4(PVR2DROPnoop,PVR2DPATROPcopy) /* masked colour fill blt (used for text) */ - -/* Legacy support */ -#define PVR2DROP3_PATMASK PVR2DPATROPcopy -#define PVR2DROP3_SRCMASK PVR2DROPcopy - -/* pixmap memory alignment */ -#define PVR2D_ALIGNMENT_4 4 /* DWORD alignment */ -#define PVR2D_ALIGNMENT_ANY 0 /* no alignment */ -#define PVR2D_ALIGNMENT_PALETTE 16 /* 16 byte alignment is required for palettes */ - -/* Heap number for PVR2DGetFrameBuffer */ -#define PVR2D_FB_PRIMARY_SURFACE 0 - -#define PVR2D_PRESENT_PROPERTY_SRCSTRIDE (1 << 0) -#define PVR2D_PRESENT_PROPERTY_DSTSIZE (1 << 1) -#define PVR2D_PRESENT_PROPERTY_DSTPOS (1 << 2) -#define PVR2D_PRESENT_PROPERTY_CLIPRECTS (1 << 3) -#define PVR2D_PRESENT_PROPERTY_INTERVAL (1 << 4) - - -#define PVR2D_CREATE_FLIPCHAIN_SHARED (1 << 0) -#define PVR2D_CREATE_FLIPCHAIN_QUERY (1 << 1) - -/* Functions that the library exports */ - -PVR2D_IMPORT -int PVR2DEnumerateDevices(PVR2DDEVICEINFO *pDevInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DCreateDeviceContext(unsigned long ulDevID, - PVR2DCONTEXTHANDLE* phContext, - unsigned long ulFlags); - -PVR2D_IMPORT -PVR2DERROR PVR2DDestroyDeviceContext(PVR2DCONTEXTHANDLE hContext); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetDeviceInfo(PVR2DCONTEXTHANDLE hContext, - PVR2DDISPLAYINFO *pDisplayInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetScreenMode(PVR2DCONTEXTHANDLE hContext, - PVR2DFORMAT *pFormat, - long *plWidth, - long *plHeight, - long *plStride, - int *piRefreshRate); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetFrameBuffer(PVR2DCONTEXTHANDLE hContext, - int nHeap, - PVR2DMEMINFO **ppsMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemAlloc(PVR2DCONTEXTHANDLE hContext, - unsigned long ulBytes, - unsigned long ulAlign, - unsigned long ulFlags, - PVR2DMEMINFO **ppsMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemWrap(PVR2DCONTEXTHANDLE hContext, - void *pMem, - unsigned long ulFlags, - unsigned long ulBytes, - unsigned long alPageAddress[], - PVR2DMEMINFO **ppsMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemMap(PVR2DCONTEXTHANDLE hContext, - unsigned long ulFlags, - void *hPrivateMapData, - PVR2DMEMINFO **ppsDstMem); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemFree(PVR2DCONTEXTHANDLE hContext, - PVR2DMEMINFO *psMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DBlt(PVR2DCONTEXTHANDLE hContext, - PVR2DBLTINFO *pBltInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DBltClipped(PVR2DCONTEXTHANDLE hContext, - PVR2DBLTINFO *pBltInfo, - unsigned long ulNumClipRects, - PVR2DRECT *pClipRects); - -PVR2D_IMPORT -PVR2DERROR PVR2DQueryBlitsComplete(PVR2DCONTEXTHANDLE hContext, - PVR2DMEMINFO *pMemInfo, - unsigned int uiWaitForComplete); - -PVR2D_IMPORT -PVR2DERROR PVR2DSetPresentBltProperties(PVR2DCONTEXTHANDLE hContext, - unsigned long ulPropertyMask, - long lSrcStride, - unsigned long ulDstWidth, - unsigned long ulDstHeight, - long lDstXPos, - long lDstYPos, - unsigned long ulNumClipRects, - PVR2DRECT *pClipRects, - unsigned long ulSwapInterval); - -PVR2D_IMPORT -PVR2DERROR PVR2DPresentBlt(PVR2DCONTEXTHANDLE hContext, - PVR2DMEMINFO *pMemInfo, - long lRenderID); - -PVR2D_IMPORT -PVR2DERROR PVR2DCreateFlipChain(PVR2DCONTEXTHANDLE hContext, - unsigned long ulFlags, - unsigned long ulNumBuffers, - unsigned long ulWidth, - unsigned long ulHeight, - PVR2DFORMAT eFormat, - long *plStride, - unsigned long *pulFlipChainID, - PVR2DFLIPCHAINHANDLE *phFlipChain); - -PVR2D_IMPORT -PVR2DERROR PVR2DDestroyFlipChain(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetFlipChainBuffers(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain, - unsigned long *pulNumBuffers, - PVR2DMEMINFO *psMemInfo[]); - -PVR2D_IMPORT -PVR2DERROR PVR2DSetPresentFlipProperties(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain, - unsigned long ulPropertyMask, - long lDstXPos, - long lDstYPos, - unsigned long ulNumClipRects, - PVR2DRECT *pClipRects, - unsigned long ulSwapInterval); - -PVR2D_IMPORT -PVR2DERROR PVR2DPresentFlip(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain, - PVR2DMEMINFO *psMemInfo, - long lRenderID); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetAPIRev(long *lRevMajor, long *lRevMinor); - -PVR2D_IMPORT -PVR2DERROR PVR2DLoadUseCode (const PVR2DCONTEXTHANDLE hContext, const unsigned char *pUseCode, - const unsigned long UseCodeSize, PVR2D_HANDLE *pUseCodeHandle); -PVR2D_IMPORT -PVR2DERROR PVR2DFreeUseCode (const PVR2DCONTEXTHANDLE hContext, const PVR2D_HANDLE hUseCodeHandle); - -PVR2D_IMPORT -PVR2DERROR PVR2DBlt3D (const PVR2DCONTEXTHANDLE hContext, const PPVR2D_3DBLT pBlt3D); - -#ifdef __cplusplus -} -#endif - -#endif /* _PVR2D_H_ */ - -/****************************************************************************** - End of file (pvr2d.h) -******************************************************************************/ diff --git a/src/3rdparty/powervr/wsegl.h b/src/3rdparty/powervr/wsegl.h deleted file mode 100644 index 04906076a83..00000000000 --- a/src/3rdparty/powervr/wsegl.h +++ /dev/null @@ -1,240 +0,0 @@ -/****************************************************************************** - Name : wsegl.h - Copyright : Copyright (c) Imagination Technologies Limited. - This specification is protected by copyright laws and contains - material proprietary to Imagination Technologies Limited. - You may use and distribute this specification free of charge for implementing - the functionality therein, without altering or removing any trademark, copyright, - or other notice from the specification. - Platform : ANSI -*****************************************************************************/ - - -#if !defined(__WSEGL_H__) -#define __WSEGL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -// WSEGL Platform-specific definitions -*/ -#define WSEGL_EXPORT -#define WSEGL_IMPORT - -/* -// WSEGL API Version Number -*/ - -#define WSEGL_VERSION 1 -#define WSEGL_DEFAULT_DISPLAY 0 -#define WSEGL_DEFAULT_NATIVE_ENGINE 0 - -#define WSEGL_FALSE 0 -#define WSEGL_TRUE 1 -#define WSEGL_NULL 0 - -#define WSEGL_UNREFERENCED_PARAMETER(param) (param) = (param) - -/* -// WSEGL handles -*/ -typedef void *WSEGLDisplayHandle; -typedef void *WSEGLDrawableHandle; - -/* -// Display capability type -*/ -typedef enum WSEGLCapsType_TAG -{ - WSEGL_NO_CAPS = 0, - WSEGL_CAP_MIN_SWAP_INTERVAL = 1, /* System default value = 1 */ - WSEGL_CAP_MAX_SWAP_INTERVAL = 2, /* System default value = 1 */ - WSEGL_CAP_WINDOWS_USE_HW_SYNC = 3, /* System default value = 0 (FALSE) */ - WSEGL_CAP_PIXMAPS_USE_HW_SYNC = 4, /* System default value = 0 (FALSE) */ - -} WSEGLCapsType; - -/* -// Display capability -*/ -typedef struct WSEGLCaps_TAG -{ - WSEGLCapsType eCapsType; - unsigned long ui32CapsValue; - -} WSEGLCaps; - -/* -// Drawable type -*/ -#define WSEGL_NO_DRAWABLE 0x0 -#define WSEGL_DRAWABLE_WINDOW 0x1 -#define WSEGL_DRAWABLE_PIXMAP 0x2 - - -/* -// Pixel format of display/drawable -*/ -typedef enum WSEGLPixelFormat_TAG -{ - WSEGL_PIXELFORMAT_565 = 0, - WSEGL_PIXELFORMAT_4444 = 1, - WSEGL_PIXELFORMAT_8888 = 2, - WSEGL_PIXELFORMAT_1555 = 3 - -} WSEGLPixelFormat; - -/* -// Transparent of display/drawable -*/ -typedef enum WSEGLTransparentType_TAG -{ - WSEGL_OPAQUE = 0, - WSEGL_COLOR_KEY = 1, - -} WSEGLTransparentType; - -/* -// Display/drawable configuration -*/ -typedef struct WSEGLConfig_TAG -{ - /* - // Type of drawables this configuration applies to - - // OR'd values of drawable types. - */ - unsigned long ui32DrawableType; - - /* Pixel format */ - WSEGLPixelFormat ePixelFormat; - - /* Native Renderable - set to WSEGL_TRUE if native renderable */ - unsigned long ulNativeRenderable; - - /* FrameBuffer Level Parameter */ - unsigned long ulFrameBufferLevel; - - /* Native Visual ID */ - unsigned long ulNativeVisualID; - - /* Native Visual */ - void *hNativeVisual; - - /* Transparent Type */ - WSEGLTransparentType eTransparentType; - - /* Transparent Color - only used if transparent type is COLOR_KEY */ - unsigned long ulTransparentColor; /* packed as 0x00RRGGBB */ - - -} WSEGLConfig; - -/* -// WSEGL errors -*/ -typedef enum WSEGLError_TAG -{ - WSEGL_SUCCESS = 0, - WSEGL_CANNOT_INITIALISE = 1, - WSEGL_BAD_NATIVE_DISPLAY = 2, - WSEGL_BAD_NATIVE_WINDOW = 3, - WSEGL_BAD_NATIVE_PIXMAP = 4, - WSEGL_BAD_NATIVE_ENGINE = 5, - WSEGL_BAD_DRAWABLE = 6, - WSEGL_BAD_CONFIG = 7, - WSEGL_OUT_OF_MEMORY = 8 - -} WSEGLError; - -/* -// Drawable orientation (in degrees anti-clockwise) -*/ -typedef enum WSEGLRotationAngle_TAG -{ - WSEGL_ROTATE_0 = 0, - WSEGL_ROTATE_90 = 1, - WSEGL_ROTATE_180 = 2, - WSEGL_ROTATE_270 = 3 - -} WSEGLRotationAngle; - -/* -// Drawable information required by OpenGL-ES driver -*/ -typedef struct WSEGLDrawableParams_TAG -{ - /* Width in pixels of the drawable */ - unsigned long ui32Width; - - /* Height in pixels of the drawable */ - unsigned long ui32Height; - - /* Stride in pixels of the drawable */ - unsigned long ui32Stride; - - /* Pixel format of the drawable */ - WSEGLPixelFormat ePixelFormat; - - /* User space cpu virtual address of the drawable */ - void *pvLinearAddress; - - /* HW address of the drawable */ - unsigned long ui32HWAddress; - - /* Private data for the drawable */ - void *hPrivateData; - -} WSEGLDrawableParams; - - -/* -// Table of function pointers that is returned by WSEGL_GetFunctionTablePointer() -// -// The first entry in the table is the version number of the wsegl.h header file that -// the module has been written against, and should therefore be set to WSEGL_VERSION -*/ -typedef struct WSEGL_FunctionTable_TAG -{ - unsigned long ui32WSEGLVersion; - - WSEGLError (*pfnWSEGL_IsDisplayValid)(NativeDisplayType); - - WSEGLError (*pfnWSEGL_InitialiseDisplay)(NativeDisplayType, WSEGLDisplayHandle *, const WSEGLCaps **, WSEGLConfig **); - - WSEGLError (*pfnWSEGL_CloseDisplay)(WSEGLDisplayHandle); - - WSEGLError (*pfnWSEGL_CreateWindowDrawable)(WSEGLDisplayHandle, WSEGLConfig *, WSEGLDrawableHandle *, NativeWindowType, WSEGLRotationAngle *); - - WSEGLError (*pfnWSEGL_CreatePixmapDrawable)(WSEGLDisplayHandle, WSEGLConfig *, WSEGLDrawableHandle *, NativePixmapType, WSEGLRotationAngle *); - - WSEGLError (*pfnWSEGL_DeleteDrawable)(WSEGLDrawableHandle); - - WSEGLError (*pfnWSEGL_SwapDrawable)(WSEGLDrawableHandle, unsigned long); - - WSEGLError (*pfnWSEGL_SwapControlInterval)(WSEGLDrawableHandle, unsigned long); - - WSEGLError (*pfnWSEGL_WaitNative)(WSEGLDrawableHandle, unsigned long); - - WSEGLError (*pfnWSEGL_CopyFromDrawable)(WSEGLDrawableHandle, NativePixmapType); - - WSEGLError (*pfnWSEGL_CopyFromPBuffer)(void *, unsigned long, unsigned long, unsigned long, WSEGLPixelFormat, NativePixmapType); - - WSEGLError (*pfnWSEGL_GetDrawableParameters)(WSEGLDrawableHandle, WSEGLDrawableParams *, WSEGLDrawableParams *); - - -} WSEGL_FunctionTable; - - -WSEGL_IMPORT const WSEGL_FunctionTable *WSEGL_GetFunctionTablePointer(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __WSEGL_H__ */ - -/****************************************************************************** - End of file (wsegl.h) -******************************************************************************/ diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri index 575412da091..e8fa827b13a 100644 --- a/src/3rdparty/sqlite.pri +++ b/src/3rdparty/sqlite.pri @@ -1,4 +1,5 @@ CONFIG(release, debug|release):DEFINES *= NDEBUG DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE +!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS INCLUDEPATH += $$PWD/sqlite SOURCES += $$PWD/sqlite/sqlite3.c diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index c7076eea3a0..9111ac63791 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -58,7 +58,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::ConverterState *state) @@ -127,7 +127,7 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve continue; } - if (u > 0xffff) { + if (QChar::requiresSurrogates(u)) { *cursor++ = 0xf0 | ((uchar) (u >> 18)); *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f); } else { @@ -196,7 +196,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte bool nonCharacter; if (!headerdone && uc == 0xfeff) { // don't do anything, just skip the BOM - } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { + } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && QChar::requiresSurrogates(uc) && uc < 0x110000) { // surrogate pair Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); *qch++ = QChar::highSurrogate(uc); @@ -487,7 +487,7 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert } } uint code = (endian == BigEndianness) ? qFromBigEndian(tuple) : qFromLittleEndian(tuple); - if (code >= 0x10000) { + if (QChar::requiresSurrogates(code)) { *qch++ = QChar::highSurrogate(code); *qch++ = QChar::lowSurrogate(code); } else { diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 58cff6b81c4..28a1a390b78 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -13,7 +13,8 @@ HEADERS += \ global/qtypeinfo.h \ global/qsysinfo.h \ global/qisenum.h \ - global/qtypetraits.h + global/qtypetraits.h \ + global/qflags.h SOURCES += \ global/qglobal.cpp \ diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 315f53cbb4e..6d7635ef677 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -157,8 +157,10 @@ # define Q_UNREACHABLE() __builtin_unreachable() # else /* Plain GCC */ -# define Q_ASSUME(expr) if (expr){} else __builtin_unreachable() -# define Q_UNREACHABLE() __builtin_unreachable() +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 +# define Q_ASSUME(expr) if (expr){} else __builtin_unreachable() +# define Q_UNREACHABLE() __builtin_unreachable() +# endif # endif # define Q_ALIGNOF(type) __alignof__(type) diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h new file mode 100644 index 00000000000..349f2270027 --- /dev/null +++ b/src/corelib/global/qflags.h @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QFLAGS_H +#define QFLAGS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class QFlag +{ + int i; +public: + inline QFlag(int i); + inline operator int() const { return i; } +}; + +inline QFlag::QFlag(int ai) : i(ai) {} + +class QIncompatibleFlag +{ + int i; +public: + inline explicit QIncompatibleFlag(int i); + inline operator int() const { return i; } +}; + +inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} + + +#ifndef Q_NO_TYPESAFE_FLAGS + +template +class QFlags +{ + typedef void **Zero; + int i; +public: + typedef Enum enum_type; + // compiler-generated copy/move ctor/assignment operators are fine! +#ifdef qdoc + inline QFlags(const QFlags &other); + inline QFlags &operator=(const QFlags &other); +#endif + Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {} + Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} + inline QFlags(QFlag f) : i(f) {} + + inline QFlags &operator&=(int mask) { i &= mask; return *this; } + inline QFlags &operator&=(uint mask) { i &= mask; return *this; } + inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } + inline QFlags &operator|=(Enum f) { i |= f; return *this; } + inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } + inline QFlags &operator^=(Enum f) { i ^= f; return *this; } + + Q_DECL_CONSTEXPR inline operator int() const { return i; } + + Q_DECL_CONSTEXPR inline QFlags operator|(QFlags f) const { return QFlags(Enum(i | f.i)); } + Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | f)); } + Q_DECL_CONSTEXPR inline QFlags operator^(QFlags f) const { return QFlags(Enum(i ^ f.i)); } + Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ f)); } + Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const { return QFlags(Enum(i & mask)); } + Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const { return QFlags(Enum(i & mask)); } + Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & f)); } + Q_DECL_CONSTEXPR inline QFlags operator~() const { return QFlags(Enum(~i)); } + + Q_DECL_CONSTEXPR inline bool operator!() const { return !i; } + + inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } +}; + +#define Q_DECLARE_FLAGS(Flags, Enum)\ +typedef QFlags Flags; + +#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ +inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ +{ return QIncompatibleFlag(int(f1) | f2); } + +#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ +Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ +{ return QFlags(f1) | f2; } \ +Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, QFlags f2) \ +{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) + + +#else /* Q_NO_TYPESAFE_FLAGS */ + +#define Q_DECLARE_FLAGS(Flags, Enum)\ +typedef uint Flags; +#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) + +#endif /* Q_NO_TYPESAFE_FLAGS */ + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QFLAGS_H diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 51849d701a5..74c65d2504f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1711,6 +1711,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_VISTA; } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 1) { winver = QSysInfo::WV_WINDOWS7; + } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 2) { + winver = QSysInfo::WV_WINDOWS8; } else { qWarning("Qt: Untested Windows version %d.%d detected!", int(osver.dwMajorVersion), int(osver.dwMinorVersion)); @@ -1742,6 +1744,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_VISTA; else if (override == "WINDOWS7") winver = QSysInfo::WV_WINDOWS7; + else if (override == "WINDOWS8") + winver = QSysInfo::WV_WINDOWS8; } #endif @@ -2511,7 +2515,9 @@ int qrand() \list \li \c Q_PRIMITIVE_TYPE specifies that \a Type is a POD (plain old - data) type with no constructor or destructor. + data) type with no constructor or destructor, or else a type where + every bit pattern is a valid object and memcpy() creates a valid + independent copy of the object. \li \c Q_MOVABLE_TYPE specifies that \a Type has a constructor and/or a destructor but can be moved in memory using \c memcpy(). @@ -2524,6 +2530,11 @@ int qrand() \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 38 + An example of a non-POD "primitive" type is QUuid: Even though + QUuid has constructors (and therefore isn't POD), every bit + pattern still represents a valid object, and memcpy() can be used + to create a valid independent copy of a QUuid object. + Example of a movable type: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 39 diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0648b08d1f1..0828a3dac3f 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1231,90 +1231,6 @@ Q_CORE_EXPORT void qFreeAligned(void *ptr); # endif #endif -class Q_CORE_EXPORT QFlag -{ - int i; -public: - inline QFlag(int i); - inline operator int() const { return i; } -}; - -inline QFlag::QFlag(int ai) : i(ai) {} - -class Q_CORE_EXPORT QIncompatibleFlag -{ - int i; -public: - inline explicit QIncompatibleFlag(int i); - inline operator int() const { return i; } -}; - -inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} - - -#ifndef Q_NO_TYPESAFE_FLAGS - -template -class QFlags -{ - typedef void **Zero; - int i; -public: - typedef Enum enum_type; - // compiler-generated copy/move ctor/assignment operators are fine! -#ifdef qdoc - inline QFlags(const QFlags &other); - inline QFlags &operator=(const QFlags &other); -#endif - Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {} - Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} - inline QFlags(QFlag f) : i(f) {} - - inline QFlags &operator&=(int mask) { i &= mask; return *this; } - inline QFlags &operator&=(uint mask) { i &= mask; return *this; } - inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } - inline QFlags &operator|=(Enum f) { i |= f; return *this; } - inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } - inline QFlags &operator^=(Enum f) { i ^= f; return *this; } - - Q_DECL_CONSTEXPR inline operator int() const { return i; } - - Q_DECL_CONSTEXPR inline QFlags operator|(QFlags f) const { return QFlags(Enum(i | f.i)); } - Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | f)); } - Q_DECL_CONSTEXPR inline QFlags operator^(QFlags f) const { return QFlags(Enum(i ^ f.i)); } - Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ f)); } - Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const { return QFlags(Enum(i & mask)); } - Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const { return QFlags(Enum(i & mask)); } - Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & f)); } - Q_DECL_CONSTEXPR inline QFlags operator~() const { return QFlags(Enum(~i)); } - - Q_DECL_CONSTEXPR inline bool operator!() const { return !i; } - - inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } -}; - -#define Q_DECLARE_FLAGS(Flags, Enum)\ -typedef QFlags Flags; - -#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ -inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ -{ return QIncompatibleFlag(int(f1) | f2); } - -#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ -Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ -{ return QFlags(f1) | f2; } \ -Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, QFlags f2) \ -{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) - - -#else /* Q_NO_TYPESAFE_FLAGS */ - -#define Q_DECLARE_FLAGS(Flags, Enum)\ -typedef uint Flags; -#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) - -#endif /* Q_NO_TYPESAFE_FLAGS */ - #if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) /* make use of typeof-extension */ template @@ -1495,7 +1411,7 @@ QT_END_HEADER // qDebug and friends #include - +#include #include #include diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index d180e631981..5666afbad84 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -88,7 +88,7 @@ public: #endif SettingsPath = 100 }; - static QString location(LibraryLocation); // ### Qt 5: consider renaming it to path() + static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path() #ifdef QT_BUILD_QMAKE static QString rawLocation(LibraryLocation); #endif diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index edf8a165a0b..c238e9a5f3e 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -153,7 +153,7 @@ public: NoButton = 0x00000000, LeftButton = 0x00000001, RightButton = 0x00000002, - MidButton = 0x00000004, // ### Qt 5: remove me + MidButton = 0x00000004, // ### Qt 6: remove me MiddleButton = MidButton, XButton1 = 0x00000008, BackButton = XButton1, diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 74c8d1de7fa..2c9ce39430e 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -96,6 +96,7 @@ public: WV_2003 = 0x0040, WV_VISTA = 0x0080, WV_WINDOWS7 = 0x0090, + WV_WINDOWS8 = 0x00a0, WV_NT_based = 0x00f0, /* version numbers */ @@ -105,6 +106,7 @@ public: WV_5_2 = WV_2003, WV_6_0 = WV_VISTA, WV_6_1 = WV_WINDOWS7, + WV_6_2 = WV_WINDOWS8, WV_CE = 0x0100, WV_CENET = 0x0200, diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 1f4eb4d4cb2..d6379bf0fe5 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -113,9 +113,15 @@ win32 { SOURCES += io/qsettings_mac.cpp } macx-*: { - SOURCES += io/qstandardpaths_mac.cpp + contains(QT_CONFIG, coreservices) { + SOURCES += io/qstandardpaths_mac.cpp + } else { + SOURCES += io/qstandardpaths_unix.cpp + } } else:standardpathsjson { SOURCES += io/qstandardpaths_json.cpp + } else:blackberry { + SOURCES += io/qstandardpaths_blackberry.cpp } else { SOURCES += io/qstandardpaths_unix.cpp } diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 044c71d00a9..1805e759abd 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -830,7 +830,7 @@ QString QFileInfo::suffix() const QDir QFileInfo::dir() const { Q_D(const QFileInfo); - // ### Qt5: Maybe rename this to parentDirectory(), considering what it actually do? + // ### Qt 6: Maybe rename this to parentDirectory(), considering what it actually does? return QDir(d->fileEntry.path()); } diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h index eba408b2854..8e39f9ccd70 100644 --- a/src/corelib/io/qiodevice.h +++ b/src/corelib/io/qiodevice.h @@ -102,7 +102,7 @@ public: virtual bool open(OpenMode mode); virtual void close(); - // ### Qt 5: pos() and seek() should not be virtual, and + // ### Qt 6: pos() and seek() should not be virtual, and // ### seek() should call a virtual seekData() function. virtual qint64 pos() const; virtual qint64 size() const; diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 2da2913c6f3..bfa132f3539 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -772,7 +772,8 @@ static pid_t doSpawn(int fd_count, int fd_map[], char **argv, char **envp, qWarning("ThreadCtl(): cannot hold threads: %s", qPrintable(qt_error_string(errno))); oldWorkingDir = QT_GETCWD(buff, PATH_MAX + 1); - QT_CHDIR(workingDir); + if (QT_CHDIR(workingDir) == -1) + qWarning("ThreadCtl(): failed to chdir to %s", workingDir); } pid_t childPid; @@ -783,7 +784,8 @@ static pid_t doSpawn(int fd_count, int fd_map[], char **argv, char **envp, } if (oldWorkingDir) { - QT_CHDIR(oldWorkingDir); + if (QT_CHDIR(oldWorkingDir) == -1) + qWarning("ThreadCtl(): failed to chdir to %s", oldWorkingDir); if (ThreadCtl(_NTO_TCTL_THREADS_CONT, 0) == -1) qFatal("ThreadCtl(): cannot resume threads: %s", qPrintable(qt_error_string(errno))); @@ -853,8 +855,10 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv qt_safe_close(childStartedPipe[0]); // enter the working directory - if (workingDir) - QT_CHDIR(workingDir); + if (workingDir) { + if (QT_CHDIR(workingDir) == -1) + qWarning("QProcessPrivate::execChild() failed to chdir to %s", workingDir); + } // this is a virtual call, and it base behavior is to do nothing. q->setupChildProcess(); @@ -1372,8 +1376,10 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a if (doubleForkPid == 0) { qt_safe_close(pidPipe[1]); - if (!encodedWorkingDirectory.isEmpty()) - QT_CHDIR(encodedWorkingDirectory.constData()); + if (!encodedWorkingDirectory.isEmpty()) { + if (QT_CHDIR(encodedWorkingDirectory.constData()) == -1) + qWarning("QProcessPrivate::startDetached: failed to chdir to %s", encodedWorkingDirectory.constData()); + } char **argv = new char *[arguments.size() + 2]; for (int i = 0; i < arguments.size(); ++i) { @@ -1426,7 +1432,8 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a qt_safe_close(startedPipe[1]); qt_safe_write(pidPipe[1], (const char *)&doubleForkPid, sizeof(pid_t)); - QT_CHDIR("/"); + if (QT_CHDIR("/") == -1) + qWarning("QProcessPrivate::startDetached: failed to chdir to /"); ::_exit(1); } diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h index a4bb8349a83..ca3fe245ea0 100644 --- a/src/corelib/io/qsettings.h +++ b/src/corelib/io/qsettings.h @@ -173,8 +173,8 @@ public: static void setDefaultFormat(Format format); static Format defaultFormat(); - static void setSystemIniPath(const QString &dir); // ### remove in 5.0 (use setPath() instead) - static void setUserIniPath(const QString &dir); // ### remove in 5.0 (use setPath() instead) + static void setSystemIniPath(const QString &dir); // ### Qt 6: remove (use setPath() instead) + static void setUserIniPath(const QString &dir); // ### Qt 6: remove (use setPath() instead) static void setPath(Format format, Scope scope, const QString &path); typedef QMap SettingsMap; diff --git a/src/corelib/io/qstandardpaths_blackberry.cpp b/src/corelib/io/qstandardpaths_blackberry.cpp new file mode 100644 index 00000000000..b4c036dcc78 --- /dev/null +++ b/src/corelib/io/qstandardpaths_blackberry.cpp @@ -0,0 +1,103 @@ +/*************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qstandardpaths.h" +#include + +#ifndef QT_NO_STANDARDPATHS + +QT_BEGIN_NAMESPACE + +QString QStandardPaths::writableLocation(StandardLocation type) +{ + QDir sharedDir = QDir::home(); + sharedDir.cd(QLatin1String("../shared")); + + const QString sharedRoot = sharedDir.absolutePath(); + + switch (type) { + case DataLocation: + case DesktopLocation: + case HomeLocation: + return QDir::homePath(); + case RuntimeLocation: + case TempLocation: + return QDir::tempPath(); + case CacheLocation: + case GenericCacheLocation: + return QDir::homePath() + QLatin1String("/Cache"); + case ConfigLocation: + return QDir::homePath() + QLatin1String("/Settings"); + case GenericDataLocation: + return sharedRoot + QLatin1String("/misc"); + case DocumentsLocation: + return sharedRoot + QLatin1String("/documents"); + case PicturesLocation: + return sharedRoot + QLatin1String("/photos"); + case FontsLocation: + // this is not a writable location + return QString(); + case MusicLocation: + return sharedRoot + QLatin1String("/music"); + case MoviesLocation: + return sharedRoot + QLatin1String("/videos"); + case DownloadLocation: + return sharedRoot + QLatin1String("/downloads"); + case ApplicationsLocation: + return QString(); + default: + break; + } + + return QString(); +} + +QStringList QStandardPaths::standardLocations(StandardLocation type) +{ + if (type == FontsLocation) + return QStringList(QLatin1String("/base/usr/fonts")); + + return QStringList(writableLocation(type)); +} + +QT_END_NAMESPACE + +#endif // QT_NO_STANDARDPATHS diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp index d143215efd3..0884f10354d 100644 --- a/src/corelib/json/qjsonarray.cpp +++ b/src/corelib/json/qjsonarray.cpp @@ -87,6 +87,8 @@ QJsonArray::QJsonArray() QJsonArray::QJsonArray(QJsonPrivate::Data *data, QJsonPrivate::Array *array) : d(data), a(array) { + Q_ASSERT(data); + Q_ASSERT(array); d->ref.ref(); } diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp index 9b11c9ac3e7..a17426580fd 100644 --- a/src/corelib/json/qjsonparser.cpp +++ b/src/corelib/json/qjsonparser.cpp @@ -731,7 +731,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } static inline bool scanUtf8Char(const char *&json, const char *end, uint *result) @@ -769,9 +769,10 @@ static inline bool scanUtf8Char(const char *&json, const char *end, uint *result uc = (uc << 6) | (ch & 0x3f); } - if (isUnicodeNonCharacter(uc) || uc >= 0x110000 || - (uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff)) + if (uc < min_uc || isUnicodeNonCharacter(uc) || + (uc >= 0xd800 && uc <= 0xdfff) || uc >= 0x110000) { return false; + } *result = uc; return true; @@ -850,7 +851,7 @@ bool Parser::parseString(bool *latin1) return false; } } - if (ch > 0xffff) { + if (QChar::requiresSurrogates(ch)) { int pos = reserveSpace(4); *(QJsonPrivate::qle_ushort *)(data + pos) = QChar::highSurrogate(ch); *(QJsonPrivate::qle_ushort *)(data + pos + 2) = QChar::lowSurrogate(ch); diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp index a5234945a8d..e25aac50f2d 100644 --- a/src/corelib/json/qjsonvalue.cpp +++ b/src/corelib/json/qjsonvalue.cpp @@ -449,9 +449,17 @@ bool QJsonValue::operator==(const QJsonValue &other) const case String: return toString() == other.toString(); case Array: + if (base == other.base) + return true; + if (!base || !other.base) + return false; return QJsonArray(d, static_cast(base)) == QJsonArray(other.d, static_cast(other.base)); case Object: + if (base == other.base) + return true; + if (!base || !other.base) + return false; return QJsonObject(d, static_cast(base)) == QJsonObject(other.d, static_cast(other.base)); } diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp index d544e6154b8..7cdc3f0dba6 100644 --- a/src/corelib/json/qjsonwriter.cpp +++ b/src/corelib/json/qjsonwriter.cpp @@ -61,7 +61,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } static inline uchar hexdig(uint u) @@ -160,7 +160,7 @@ static QByteArray escapedString(const QString &s) continue; } - if (u > 0xffff) { + if (QChar::requiresSurrogates(u)) { *cursor++ = 0xf0 | ((uchar) (u >> 18)); *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f); } else { diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 06fbfb0d399..45b2293112b 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -202,6 +202,7 @@ QT_BEGIN_NAMESPACE \value OkRequest Ok button in decoration pressed. Supported only for Windows CE. \value TabletEnterProximity Wacom tablet enter proximity event (QTabletEvent), sent to QApplication. \value TabletLeaveProximity Wacom tablet leave proximity event (QTabletEvent), sent to QApplication. + \value ThreadChange The object is moved to another thread. This is the last event sent to this object in the previous thread. See QObject::moveToThread(). \value Timer Regular timer events (QTimerEvent). \value ToolBarChange The toolbar button is toggled on Mac OS X. \value ToolTip A tooltip was requested (QHelpEvent). @@ -264,7 +265,6 @@ QT_BEGIN_NAMESPACE \omitvalue ShowWindowRequest \omitvalue Speech \omitvalue Style - \omitvalue ThreadChange \omitvalue ZeroTimerEvent \omitvalue ApplicationActivated \omitvalue ApplicationDeactivated diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 833755f2443..fb3e4e396b2 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3949,8 +3949,8 @@ void qDeleteInEventHandler(QObject *o) } /*! - \fn QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), const QObject *receiver, (T::*method)(...), Qt::ConnectionType type) - + \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) + \overload connect() \threadsafe Creates a connection of the given \a type from the \a signal in @@ -4006,18 +4006,14 @@ void qDeleteInEventHandler(QObject *o) \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 25 make sure to declare the argument type with Q_DECLARE_METATYPE - - A signal is emitted for every connection you make; - two signals are emitted for duplicate connections. - This overload does not support the type Qt::UniqueConnection */ /*! - \fn QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), Functor functor) + \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor) \threadsafe - \overload + \overload connect() Creates a connection of the given \a type from the \a signal in the \a sender object to the \a functor and returns a handle to the connection @@ -4166,9 +4162,9 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) return true; } -/*! \fn bool QObject::disconnect(const QObject *sender, (T::*signal)(...), const Qbject *receiver, (T::*method)(...)) +/*! \fn bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) + \overload diconnect() \threadsafe - \overload Disconnects \a signal in object \a sender from \a method in object \a receiver. Returns true if the connection is successfully broken; @@ -4225,6 +4221,7 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) \sa connect() */ + bool QObject::disconnectImpl(const QObject *sender, void **signal, const QObject *receiver, void **slot, const QMetaObject *senderMetaObject) { if (sender == 0 || (receiver == 0 && slot != 0)) { @@ -4286,7 +4283,7 @@ QMetaObject::Connection::~Connection() } /*! - \fn bool QMetaObject::Connection::operator bool() + \fn QMetaObject::Connection::operator bool() const Returns true if the connection is valid. diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index bbb583ed82f..11b1a19e0bf 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -221,8 +221,8 @@ public: const char *member, Qt::ConnectionType type = Qt::AutoConnection) const; #ifdef Q_QDOC - QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), const QObject *receiver, (T::*method)(...), Qt::ConnectionType type) - QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), Functor functor) + static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type); + static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor); #else //Connect a signal to a pointer to qobject member function template @@ -301,7 +301,7 @@ public: static bool disconnect(const QMetaObject::Connection &); #ifdef Q_QDOC - bool QObject::disconnect(const QObject *sender, (T::*signal)(...), const Qbject *receiver, (T::*method)(...)) + static bool disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method); #else template static inline bool disconnect(const typename QtPrivate::FunctionPointer::Object *sender, Func1 signal, diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 5ad070d3b1c..9bcb8b92111 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -465,7 +465,7 @@ public: Connection(); Connection(const Connection &other); Connection &operator=(const Connection &other); -#ifdef qdoc +#ifdef Q_QDOC operator bool() const; #else typedef void *Connection::*RestrictedBool; diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp index 2b07fa99ccb..1624bfef5cb 100644 --- a/src/corelib/kernel/qtcore_eval.cpp +++ b/src/corelib/kernel/qtcore_eval.cpp @@ -555,13 +555,8 @@ void qt_eval_init_widget(QWidget *w) { if (qt_eval_days_left() == -2) return; - if (w->isTopLevel()) { - QString windowTitle = w->windowTitle(); - if (windowTitle.isEmpty()) { - w->setWindowTitle(QLatin1String(" ")); - } else if (!windowTitle.startsWith(qt_eval_title_prefix())) { - qt_eval_adapt_window_title(windowTitle); - } + if (w->isTopLevel() && w->windowTitle().isEmpty() && w->windowType() != Qt::Desktop ) { + w->setWindowTitle(QLatin1String(" ")); } } #endif diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 287245182a6..194555334f3 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -358,7 +358,7 @@ public: QByteArray &setNum(qulonglong, int base = 10); QByteArray &setNum(float, char f = 'g', int prec = 6); QByteArray &setNum(double, char f = 'g', int prec = 6); - QByteArray &setRawData(const char *a, uint n); // ### Qt 5: use an int + QByteArray &setRawData(const char *a, uint n); // ### Qt 6: use an int static QByteArray number(int, int base = 10); static QByteArray number(uint, int base = 10); diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 0261843a3ae..ef229fc0fca 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -50,19 +50,12 @@ #include "qchar.h" #include "qdatastream.h" -#include "qtextcodec.h" #include "qunicodetables_p.h" #include "qunicodetables.cpp" QT_BEGIN_NAMESPACE -#ifndef QT_NO_CODEC_FOR_C_STRINGS -# ifdef QT_NO_TEXTCODEC -# define QT_NO_CODEC_FOR_C_STRINGS -# endif -#endif - #define FLAG(x) (1 << (x)) /*! @@ -71,8 +64,7 @@ QT_BEGIN_NAMESPACE \ingroup string-processing - This class is only useful to avoid the codec for C strings business - in the QChar(ch) constructor. You can avoid it by writing QChar(ch, 0). + This class is only useful to construct a QChar with 8-bit character. \sa QChar, QLatin1String, QString */ @@ -565,17 +557,24 @@ bool QChar::isLetter(ushort ucs2) } /*! + \fn bool QChar::isNumber() const + Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns false. \sa isDigit() */ -bool QChar::isNumber() const + +/*! + \internal + \overload +*/ +bool QChar::isNumber(ushort ucs2) { const int test = FLAG(Number_DecimalDigit) | FLAG(Number_Letter) | FLAG(Number_Other); - return FLAG(qGetProp(ucs)->category) & test; + return FLAG(qGetProp(ucs2)->category) & test; } /*! @@ -725,7 +724,7 @@ int QChar::digitValue(ushort ucs2) int QChar::digitValue(uint ucs4) { if (ucs4 > UNICODE_LAST_CODEPOINT) - return 0; + return -1; return qGetProp(ucs4)->digitValue; } @@ -1239,9 +1238,23 @@ ushort QChar::toCaseFolded(ushort ucs2) Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software. + \note It is not possible to distinguish a non-Latin-1 character from a Latin-1 0 + (NUL) character. Prefer to use unicode(), which does not have this ambiguity. + \sa toAscii(), unicode() */ +/*! + \fn QChar QChar::fromLatin1(char) + + Converts the Latin-1 character \a c to its equivalent QChar. This + is mainly useful for non-internationalized software. + + An alternative is to use QLatin1Char. + + \sa fromAscii(), unicode() +*/ + /*! \fn char QChar::toAscii() const @@ -1255,6 +1268,9 @@ ushort QChar::toCaseFolded(ushort ucs2) \note It is not possible to distinguish a non-Latin 1 character from an ASCII 0 (NUL) character. Prefer to use unicode(), which does not have this ambiguity. + \note This function does not check whether the character value is inside + the valid range of US-ASCII. + \sa toLatin1(), unicode() */ @@ -1308,7 +1324,7 @@ QDataStream &operator>>(QDataStream &in, QChar &chr) /*! \fn ushort QChar::unicode() const - \overload + Returns the numeric Unicode value of the QChar. */ /***************************************************************************** diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h index 3209ffb0f26..9f2ca7ae9ed 100644 --- a/src/corelib/tools/qchar.h +++ b/src/corelib/tools/qchar.h @@ -233,35 +233,31 @@ public: bool isPrint() const; bool isPunct() const; inline bool isSpace() const { + // note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly return ucs == 0x20 || (ucs <= 0x0D && ucs >= 0x09) - || (ucs > 127 && (ucs == 0x0085 || isSpace(ucs))); + || (ucs > 127 && (ucs == 0x85 || ucs == 0xa0 || isSpace(ucs))); } bool isMark() const; inline bool isLetter() const { - return (ucs >= 'a' && ucs <= 'z') - || (ucs <= 'Z' && ucs >= 'A') + return (ucs >= 'A' && ucs <= 'z' && (ucs >= 'a' || ucs <= 'Z')) || (ucs > 127 && isLetter(ucs)); } - bool isNumber() const; + inline bool isNumber() const + { return (ucs <= '9' && ucs >= '0') || (ucs > 127 && isNumber(ucs)); } inline bool isLetterOrNumber() const { - return (ucs >= 'a' && ucs <= 'z') - || (ucs <= 'Z' && ucs >= 'A') - || (ucs <= '9' && ucs >= '0') + return (ucs >= 'A' && ucs <= 'z' && (ucs >= 'a' || ucs <= 'Z')) + || (ucs >= '0' && ucs <= '9') || (ucs > 127 && isLetterOrNumber(ucs)); } inline bool isDigit() const { return (ucs <= '9' && ucs >= '0') || (ucs > 127 && isDigit(ucs)); } bool isSymbol() const; - inline bool isLower() const { - return (ucs >= 'a' && ucs <= 'z') - || (ucs > 127 && category(ucs) == Letter_Lowercase); - } - inline bool isUpper() const { - return (ucs <= 'Z' && ucs >= 'A') - || (ucs > 127 && category(ucs) == Letter_Uppercase); - } - inline bool isTitleCase() const { return category() == Letter_Titlecase; } + inline bool isLower() const + { return (ucs <= 'z' && ucs >= 'a') || (ucs > 127 && category() == Letter_Lowercase); } + inline bool isUpper() const + { return (ucs <= 'Z' && ucs >= 'A') || (ucs > 127 && category() == Letter_Uppercase); } + inline bool isTitleCase() const { return ucs > 127 && category() == Letter_Titlecase; } inline bool isHighSurrogate() const { return ((ucs & 0xfc00) == 0xd800); @@ -331,6 +327,7 @@ public: private: static bool QT_FASTCALL isDigit(ushort ucs2); static bool QT_FASTCALL isLetter(ushort ucs2); + static bool QT_FASTCALL isNumber(ushort ucs2); static bool QT_FASTCALL isLetterOrNumber(ushort ucs2); static bool QT_FASTCALL isSpace(ushort ucs2); diff --git a/src/corelib/tools/qline.h b/src/corelib/tools/qline.h index 92ea4ea4262..f2e0d4380ad 100644 --- a/src/corelib/tools/qline.h +++ b/src/corelib/tools/qline.h @@ -245,7 +245,7 @@ public: QLineF unitVector() const; Q_DECL_CONSTEXPR inline QLineF normalVector() const; - // ### Qt 5: rename intersects() or intersection() and rename IntersectType IntersectionType + // ### Qt 6: rename intersects() or intersection() and rename IntersectType IntersectionType IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const; qreal angle(const QLineF &l) const; diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 27264f7e729..393b2bbb7d4 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -288,7 +288,7 @@ QT_BEGIN_NAMESPACE Partial matching is mainly useful in two scenarios: validating user input in real time and incremental/multi-segment matching. - \target + \target validating user input \section2 Validating user input Suppose that we would like the user to input a date in a specific @@ -796,6 +796,7 @@ struct QRegularExpressionPrivate : QSharedData int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions, + bool checkSubjectString = true, const QRegularExpressionMatchPrivate *previous = 0) const; int captureIndexForName(const QString &name) const; @@ -1165,7 +1166,8 @@ static int pcre16SafeExec(const pcre16 *code, const pcre16_extra *extra, Performs a match of type \a matchType on the given \a subject string with options \a matchOptions and returns the QRegularExpressionMatchPrivate of the result. It also advances a match if a previous result is given as \a - previous. + previous. The \a subject string goes a Unicode validity check if + \a checkSubjectString is true (PCRE doesn't like illegal UTF-16 sequences). Advancing a match is a tricky algorithm. If the previous match matched a non-empty string, we just do an ordinary match at the offset position. @@ -1182,6 +1184,7 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions, + bool checkSubjectString, const QRegularExpressionMatchPrivate *previous) const { if (offset < 0) @@ -1211,6 +1214,9 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString else if (matchType == QRegularExpression::PartialPreferFirstMatch) pcreOptions |= PCRE_PARTIAL_HARD; + if (!checkSubjectString) + pcreOptions |= PCRE_NO_UTF16_CHECK; + bool previousMatchWasEmpty = false; if (previous && previous->hasMatch && (previous->capturedOffsets.at(0) == previous->capturedOffsets.at(1))) { @@ -1318,10 +1324,15 @@ QRegularExpressionMatch QRegularExpressionMatchPrivate::nextMatch() const Q_ASSERT(isValid); Q_ASSERT(hasMatch || hasPartialMatch); + // Note the "false" passed for the check of the subject string: + // if we're advancing a match on the same subject, + // then that subject was already checked at least once (when this object + // was created, or when the object that created this one was created, etc.) QRegularExpressionMatchPrivate *nextPrivate = regularExpression.d->doMatch(subject, capturedOffsets.at(1), matchType, matchOptions, + false, this); return QRegularExpressionMatch(*nextPrivate); } diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index f48eaf5721f..e62211ba58b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6537,8 +6537,8 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar:: return; if (version == QChar::Unicode_Unassigned) { - version = UNICODE_DATA_VERSION; - } else if (version != UNICODE_DATA_VERSION) { + version = QChar::currentUnicodeVersion(); + } else if (int(version) <= NormalizationCorrectionsVersionMax) { const QString &s = *data; QChar *d = 0; for (int i = 0; i < NumNormalizationCorrections; ++i) { diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp index 91d260b7240..9504e7168ef 100644 --- a/src/corelib/tools/qunicodetables.cpp +++ b/src/corelib/tools/qunicodetables.cpp @@ -1788,31 +1788,31 @@ static const unsigned short uc_property_trie[] = { 585, 585, 585, 585, 585, 585, 585, 586, 585, 585, 585, 587, 588, 589, 590, 591, 592, 593, 592, 592, 594, 595, 14, 14, - 596, 597, 598, 599, 596, 600, 598, 599, + 596, 597, 598, 596, 596, 599, 598, 596, - 14, 14, 14, 14, 601, 601, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, - 13, 13, 13, 13, 13, 611, 611, 611, - 14, 596, 600, 14, 612, 612, 14, 43, + 14, 14, 14, 14, 600, 600, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, + 13, 13, 13, 13, 13, 610, 610, 610, + 14, 611, 612, 14, 613, 613, 14, 43, - 43, 14, 14, 14, 613, 16, 17, 614, - 615, 615, 432, 432, 432, 432, 616, 616, - 616, 616, 185, 617, 618, 619, 620, 616, - 620, 620, 620, 620, 619, 620, 620, 621, + 43, 14, 14, 14, 614, 16, 17, 615, + 616, 616, 432, 432, 432, 432, 617, 617, + 617, 617, 185, 618, 619, 620, 621, 617, + 621, 621, 621, 621, 620, 621, 621, 622, - 622, 623, 623, 623, 160, 160, 160, 160, - 160, 160, 624, 624, 624, 624, 624, 624, - 625, 626, 160, 160, 627, 628, 629, 630, - 631, 632, 633, 633, 36, 16, 17, 50, + 623, 624, 624, 624, 160, 160, 160, 160, + 160, 160, 625, 625, 625, 625, 625, 625, + 626, 627, 160, 160, 628, 629, 630, 631, + 632, 633, 634, 634, 36, 16, 17, 50, - 625, 60, 55, 56, 627, 628, 629, 630, - 631, 632, 633, 633, 36, 16, 17, 160, + 626, 60, 55, 56, 628, 629, 630, 631, + 632, 633, 634, 634, 36, 16, 17, 160, 484, 484, 484, 484, 484, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 12, 12, 12, 12, 12, 12, 12, 48, - 12, 12, 12, 634, 635, 429, 429, 429, - 636, 636, 637, 637, 637, 637, 160, 160, + 12, 12, 12, 635, 636, 429, 429, 429, + 637, 637, 638, 638, 638, 638, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -1820,32 +1820,32 @@ static const unsigned short uc_property_trie[] = { 139, 139, 144, 144, 139, 139, 139, 139, 144, 144, 144, 139, 139, 273, 273, 273, - 273, 139, 195, 195, 638, 639, 639, 159, - 640, 159, 639, 641, 299, 299, 299, 299, + 273, 139, 195, 195, 639, 640, 640, 159, + 641, 159, 640, 642, 299, 299, 299, 299, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 49, 49, 175, 642, 49, 49, 49, 175, - 49, 642, 50, 175, 175, 175, 50, 50, - 175, 175, 175, 50, 49, 175, 643, 49, + 49, 49, 175, 643, 49, 49, 49, 175, + 49, 643, 50, 175, 175, 175, 50, 50, + 175, 175, 175, 50, 49, 175, 644, 49, 49, 175, 175, 175, 175, 175, 49, 49, - 49, 49, 49, 49, 175, 49, 644, 49, - 175, 49, 645, 646, 175, 175, 647, 50, - 175, 175, 648, 175, 50, 90, 90, 90, - 90, 131, 649, 239, 103, 626, 650, 650, + 49, 49, 49, 49, 175, 49, 645, 49, + 175, 49, 646, 647, 175, 175, 648, 50, + 175, 175, 649, 175, 50, 90, 90, 90, + 90, 131, 650, 239, 103, 627, 651, 651, - 185, 185, 185, 185, 185, 650, 626, 626, - 626, 626, 651, 185, 418, 301, 652, 160, + 185, 185, 185, 185, 185, 651, 627, 627, + 627, 627, 652, 185, 418, 301, 653, 160, 160, 160, 160, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 653, 653, 653, 653, 653, 653, 653, 653, - 653, 653, 653, 653, 653, 653, 653, 653, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, - 655, 655, 655, 99, 109, 160, 160, 160, + 656, 656, 656, 99, 109, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 36, 36, 49, 49, 49, 49, @@ -1861,52 +1861,52 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 185, 185, 185, 185, + 49, 49, 49, 650, 650, 650, 650, 650, + 650, 650, 650, 650, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 36, 36, 36, 36, 36, 36, 36, 36, - 656, 656, 656, 657, 657, 657, 36, 36, - 36, 36, 18, 54, 36, 658, 36, 36, + 657, 657, 657, 658, 658, 658, 36, 36, + 36, 36, 18, 54, 36, 659, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 659, 660, 36, 36, + 36, 36, 36, 36, 660, 661, 36, 36, - 36, 36, 36, 661, 36, 36, 36, 36, + 36, 36, 36, 662, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 659, 660, 659, 660, 36, 36, + 36, 36, 660, 661, 660, 661, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 659, 660, 659, 660, - 659, 660, 659, 660, 36, 36, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, + 36, 36, 36, 36, 660, 661, 660, 661, + 660, 661, 660, 661, 36, 36, 660, 661, + 660, 661, 660, 661, 660, 661, 660, 661, + 660, 661, 660, 661, 660, 661, 660, 661, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 36, 36, 36, 659, - 660, 659, 660, 36, 36, 36, 36, 36, - 662, 36, 36, 36, 36, 36, 36, 36, + 660, 661, 660, 661, 660, 661, 660, 661, + 660, 661, 660, 661, 36, 36, 36, 660, + 661, 660, 661, 36, 36, 36, 36, 36, + 663, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 659, 660, 36, 36, 663, 36, - 664, 665, 36, 665, 36, 36, 36, 36, - 659, 660, 659, 660, 659, 660, 659, 660, + 36, 36, 660, 661, 36, 36, 664, 36, + 665, 666, 36, 666, 36, 36, 36, 36, + 660, 661, 660, 661, 660, 661, 660, 661, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 659, 660, 659, 660, 666, 36, 36, - 659, 660, 36, 36, 36, 36, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, + 36, 660, 661, 660, 661, 667, 36, 36, + 660, 661, 36, 36, 36, 36, 660, 661, + 660, 661, 660, 661, 660, 661, 660, 661, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 659, 660, 36, 36, - 659, 660, 667, 667, 667, 185, 668, 668, - 185, 185, 669, 669, 669, 670, 670, 185, + 660, 661, 660, 661, 660, 661, 660, 661, + 660, 661, 660, 661, 660, 661, 36, 36, + 660, 661, 668, 668, 668, 185, 669, 669, + 185, 185, 670, 670, 670, 671, 671, 185, - 49, 649, 49, 49, 49, 49, 49, 49, - 659, 660, 659, 660, 49, 49, 49, 49, + 49, 650, 49, 49, 49, 49, 49, 49, + 660, 661, 660, 661, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, @@ -1923,24 +1923,24 @@ static const unsigned short uc_property_trie[] = { 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 649, 185, 649, 649, 649, + 194, 194, 194, 650, 185, 650, 650, 650, - 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 649, 381, 649, 649, - 649, 649, 649, 185, 185, 185, 185, 185, + 650, 650, 650, 650, 650, 650, 650, 650, + 650, 650, 650, 650, 650, 650, 650, 650, + 650, 650, 650, 650, 650, 381, 650, 650, + 650, 650, 650, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 651, + 185, 185, 185, 185, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 652, - 651, 651, 651, 651, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 239, + 652, 652, 652, 652, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 239, 239, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 671, 671, 671, 671, + 418, 418, 418, 418, 672, 672, 672, 672, - 671, 671, 301, 301, 301, 301, 301, 301, + 672, 672, 301, 301, 301, 301, 301, 301, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -1950,7 +1950,7 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 649, 649, 160, + 49, 49, 49, 49, 49, 650, 650, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -1960,35 +1960,35 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 672, 673, 674, 675, - 676, 677, 678, 679, 680, 62, 62, 62, + 673, 674, 675, 676, 677, 678, 679, 680, + 681, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 60, 55, 56, 627, 628, 629, 630, 631, - 632, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 194, 194, 194, 194, + 60, 55, 56, 628, 629, 630, 631, 632, + 633, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, - - 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, - 683, 683, 683, 683, 683, 683, 683, 683, + 194, 194, 194, 194, 194, 194, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, - 683, 683, 684, 685, 685, 685, 685, 685, - 685, 685, 685, 685, 685, 686, 687, 688, - 689, 690, 691, 692, 693, 694, 685, 695, + 683, 683, 683, 683, 683, 683, 683, 683, + 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, + + 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 685, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 686, 696, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 651, + 49, 49, 49, 49, 49, 49, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 652, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, @@ -2002,21 +2002,21 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 649, 649, 649, 649, 649, 649, 649, 649, + 650, 650, 650, 650, 650, 650, 650, 650, 185, 185, 185, 185, 185, 185, 185, 185, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 239, 239, 651, 651, - 418, 649, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 239, 239, 652, 652, + 418, 650, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 36, - 649, 649, 651, 651, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 418, 418, + 650, 650, 652, 652, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 418, 418, - 651, 651, 651, 651, 651, 651, 651, 651, - 651, 651, 239, 239, 239, 239, 239, 239, + 652, 652, 652, 652, 652, 652, 652, 652, + 652, 652, 239, 239, 239, 239, 239, 239, 239, 239, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 160, 160, 160, @@ -2038,16 +2038,16 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 160, 49, 160, 49, 49, 49, 49, 160, 160, 160, 49, 160, - 49, 49, 49, 696, 696, 696, 696, 160, + 49, 49, 49, 697, 697, 697, 697, 160, - 160, 49, 697, 697, 49, 49, 49, 49, - 698, 699, 698, 699, 698, 699, 698, 699, - 698, 699, 698, 699, 698, 699, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 62, + 160, 49, 698, 698, 49, 49, 49, 49, + 699, 700, 699, 700, 699, 700, 699, 700, + 699, 700, 699, 700, 699, 700, 673, 674, + 675, 676, 677, 678, 679, 680, 681, 62, - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 62, 672, 673, 674, 675, 676, 677, - 678, 679, 680, 62, 49, 160, 160, 160, + 673, 674, 675, 676, 677, 678, 679, 680, + 681, 62, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 62, 49, 160, 160, 160, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, @@ -2055,13 +2055,13 @@ static const unsigned short uc_property_trie[] = { 160, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 160, - 700, 700, 700, 701, 702, 703, 704, 671, - 671, 671, 671, 160, 160, 160, 160, 160, - 185, 185, 185, 185, 185, 705, 706, 185, - 185, 185, 185, 185, 185, 705, 706, 185, + 701, 701, 701, 702, 703, 704, 705, 672, + 672, 672, 672, 160, 160, 160, 160, 160, + 185, 185, 185, 185, 185, 706, 707, 185, + 185, 185, 185, 185, 185, 706, 707, 185, - 185, 185, 705, 706, 705, 706, 698, 699, - 698, 699, 698, 699, 160, 160, 160, 160, + 185, 185, 706, 707, 706, 707, 699, 700, + 699, 700, 699, 700, 160, 160, 160, 160, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, @@ -2075,55 +2075,55 @@ static const unsigned short uc_property_trie[] = { 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 698, 699, 698, 699, 698, - 699, 698, 699, 698, 699, 707, 708, 709, - 710, 698, 699, 698, 699, 698, 699, 698, - 699, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 699, 700, 699, 700, 699, + 700, 699, 700, 699, 700, 708, 709, 710, + 711, 699, 700, 699, 700, 699, 700, 699, + 700, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 711, 185, 185, 185, 185, 185, 185, 185, + 712, 185, 185, 185, 185, 185, 185, 185, - 705, 706, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 705, - 706, 705, 706, 185, 705, 706, 185, 185, - 698, 699, 698, 699, 185, 185, 185, 185, + 706, 707, 185, 185, 706, 707, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 706, + 707, 706, 707, 185, 706, 707, 185, 185, + 699, 700, 699, 700, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 712, 185, 185, - 705, 706, 185, 185, 698, 699, 185, 185, + 185, 185, 185, 185, 185, 713, 185, 185, + 706, 707, 185, 185, 699, 700, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 706, 707, 706, 707, 185, + 185, 185, 185, 185, 706, 707, 185, 185, + 185, 185, 185, 185, 706, 707, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 185, 706, 707, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 705, 706, 185, 185, 705, 706, 705, + 185, 706, 707, 185, 185, 706, 707, 706, - 706, 705, 706, 705, 706, 185, 185, 185, - 185, 185, 185, 705, 706, 185, 185, 185, - 185, 705, 706, 705, 706, 705, 706, 705, - 706, 705, 706, 705, 706, 185, 185, 185, + 707, 706, 707, 706, 707, 185, 185, 185, + 185, 185, 185, 706, 707, 185, 185, 185, + 185, 706, 707, 706, 707, 706, 707, 706, + 707, 706, 707, 706, 707, 185, 185, 185, - 185, 705, 706, 185, 185, 185, 705, 706, - 705, 706, 705, 706, 705, 706, 185, 705, - 706, 185, 185, 705, 706, 185, 185, 185, - 185, 185, 185, 705, 706, 705, 706, 705, + 185, 706, 707, 185, 185, 185, 706, 707, + 706, 707, 706, 707, 706, 707, 185, 706, + 707, 185, 185, 706, 707, 185, 185, 185, + 185, 185, 185, 706, 707, 706, 707, 706, - 706, 705, 706, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 185, 705, 706, 705, - 706, 705, 706, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 185, 185, 713, 185, + 707, 706, 707, 706, 707, 706, 707, 185, + 185, 185, 185, 185, 185, 706, 707, 706, + 707, 706, 707, 706, 707, 706, 707, 185, + 185, 185, 185, 185, 185, 185, 714, 185, - 185, 185, 185, 714, 715, 714, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 705, - 706, 705, 706, 185, 185, 185, 185, 185, + 185, 185, 185, 715, 716, 715, 185, 185, + 185, 185, 185, 185, 706, 707, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 706, + 707, 706, 707, 185, 185, 185, 185, 185, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 418, 418, @@ -2135,24 +2135,24 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 160, + 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 160, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, - 113, 109, 718, 719, 720, 721, 722, 113, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 160, + + 113, 109, 719, 720, 721, 722, 723, 113, 109, 113, 109, 113, 109, 160, 160, 160, - 160, 160, 160, 160, 723, 113, 109, 723, + 160, 160, 160, 160, 724, 113, 109, 724, 160, 160, 160, 160, 160, 160, 160, 160, 105, 106, 105, 106, 105, 106, 105, 106, @@ -2163,14 +2163,14 @@ static const unsigned short uc_property_trie[] = { 105, 106, 105, 106, 103, 418, 418, 418, 418, 418, 418, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 620, 620, 620, 620, 724, 620, 620, + 160, 621, 621, 621, 621, 725, 621, 621, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, + 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 726, 726, 726, - 725, 725, 725, 725, 725, 725, 160, 160, + 726, 726, 726, 726, 726, 726, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, @@ -2195,227 +2195,227 @@ static const unsigned short uc_property_trie[] = { 323, 323, 323, 323, 323, 323, 323, 160, 323, 323, 323, 323, 323, 323, 323, 160, - 726, 726, 727, 728, 727, 728, 726, 726, - 726, 727, 728, 726, 727, 728, 620, 620, - 620, 620, 620, 620, 620, 620, 619, 729, - 160, 160, 160, 160, 727, 728, 160, 160, + 727, 727, 728, 729, 728, 729, 727, 727, + 727, 728, 729, 727, 728, 729, 621, 621, + 621, 621, 621, 621, 621, 621, 620, 730, + 160, 160, 160, 160, 728, 729, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 160, 730, 730, 730, 730, 730, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 160, 731, 731, 731, 731, 731, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 160, 160, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 160, 160, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 160, 160, 160, 160, - 731, 732, 733, 734, 735, 736, 737, 738, + 732, 733, 734, 735, 736, 737, 738, 739, 16, 17, 16, 17, 16, 17, 16, 17, - 16, 17, 735, 735, 16, 17, 16, 17, - 16, 17, 16, 17, 739, 16, 17, 740, + 16, 17, 736, 736, 16, 17, 16, 17, + 16, 17, 16, 17, 740, 598, 741, 741, - 735, 738, 738, 738, 738, 738, 738, 738, - 738, 738, 741, 742, 140, 743, 744, 744, - 745, 746, 746, 746, 746, 746, 735, 735, - 747, 747, 747, 748, 749, 750, 730, 735, + 736, 739, 739, 739, 739, 739, 739, 739, + 739, 739, 742, 743, 140, 744, 745, 745, + 746, 747, 747, 747, 747, 747, 736, 736, + 748, 748, 748, 749, 750, 751, 731, 736, - 160, 751, 737, 751, 737, 751, 737, 751, - 737, 751, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, + 160, 752, 738, 752, 738, 752, 738, 752, + 738, 752, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, - 737, 737, 737, 751, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, + 738, 738, 738, 752, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, - 737, 737, 737, 751, 737, 751, 737, 751, - 737, 737, 737, 737, 737, 737, 751, 737, - 737, 737, 737, 737, 737, 752, 752, 160, - 160, 753, 753, 754, 754, 755, 755, 756, + 738, 738, 738, 752, 738, 752, 738, 752, + 738, 738, 738, 738, 738, 738, 752, 738, + 738, 738, 738, 738, 738, 753, 753, 160, + 160, 754, 754, 755, 755, 756, 756, 757, - 757, 758, 759, 758, 759, 758, 759, 758, - 759, 758, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, + 758, 759, 760, 759, 760, 759, 760, 759, + 760, 759, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, - 759, 759, 759, 758, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, + 760, 760, 760, 759, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, - 759, 759, 759, 758, 759, 758, 759, 758, - 759, 759, 759, 759, 759, 759, 758, 759, - 759, 759, 759, 759, 759, 758, 758, 759, - 759, 759, 759, 760, 761, 761, 761, 762, + 760, 760, 760, 759, 760, 759, 760, 759, + 760, 760, 760, 760, 760, 760, 759, 760, + 760, 760, 760, 760, 760, 759, 759, 760, + 760, 760, 760, 761, 762, 762, 762, 763, - 160, 160, 160, 160, 160, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 160, 160, 160, - 160, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 160, - 764, 764, 765, 765, 765, 765, 764, 764, + 160, 160, 160, 160, 160, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, - - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 160, 160, 160, 160, 160, 160, 160, 160, - - 767, 767, 767, 767, 767, 767, 767, 767, - 767, 767, 767, 767, 767, 767, 767, 767, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 769, 769, 160, - - 765, 765, 765, 765, 765, 765, 765, 765, - 765, 765, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 769, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 769, 769, 767, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 769, 769, 769, 769, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 160, 160, 160, + 160, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, + + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 160, + 765, 765, 766, 766, 766, 766, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 769, - 769, 769, 769, 764, 764, 764, 764, 764, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 769, 769, - - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 769, - - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 160, 160, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, 160, 160, 160, 160, 160, 160, 160, 160, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, + 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 769, 769, 769, 769, 769, 769, 769, 769, + 769, 769, 769, 769, 769, 769, 769, 769, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 770, 770, 160, + + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + + 765, 765, 765, 765, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 770, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 770, 770, 768, 765, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 770, 770, 770, 770, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 160, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 770, + 770, 770, 770, 765, 765, 765, 765, 765, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 770, 770, + + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 770, - 737, 737, 737, 737, 737, 737, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 160, 160, 160, 160, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 773, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, + 738, 738, 738, 738, 738, 738, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 160, 160, 160, 160, - 730, 730, 774, 774, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 774, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 774, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, - 730, 774, 730, 730, 730, 774, 730, 160, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 160, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + + 731, 731, 775, 775, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 775, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + + 731, 775, 731, 731, 731, 775, 731, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 776, - 776, 776, 776, 160, 160, 160, 160, 160, + 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 777, + 777, 777, 777, 160, 160, 160, 160, 160, - 777, 777, 160, 160, 160, 160, 160, 160, + 778, 778, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 323, 323, 778, 323, 323, 323, 779, 323, - 323, 323, 323, 780, 323, 323, 323, 323, + 323, 323, 779, 323, 323, 323, 780, 323, + 323, 323, 323, 781, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 464, 464, 780, 780, 464, + 323, 323, 323, 464, 464, 781, 781, 464, 418, 418, 418, 418, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2427,91 +2427,91 @@ static const unsigned short uc_property_trie[] = { 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 781, 781, 304, 304, + 322, 322, 322, 322, 782, 782, 304, 304, 160, 160, 160, 160, 160, 160, 160, 160, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - - 783, 783, 783, 783, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 783, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 783, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 783, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + + 784, 784, 784, 784, 784, 784, 784, 784, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + + 784, 784, 784, 784, 783, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + + 784, 784, 784, 784, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 160, 160, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 160, 160, 160, 160, 160, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 160, 160, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 160, 160, 160, 160, 160, 160, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 160, 160, 160, 160, 160, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, - 787, 788, 789, 790, 791, 792, 792, 160, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 160, 160, 160, 160, 160, 160, + + 788, 789, 790, 791, 792, 793, 793, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 793, 794, 795, 796, 797, - 160, 160, 160, 160, 160, 798, 799, 231, + 160, 160, 160, 794, 795, 796, 797, 798, + 160, 160, 160, 160, 160, 799, 800, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 633, 231, 231, 231, 231, 231, 231, + 231, 634, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 205, 231, 231, 231, 231, 231, 205, 231, 205, @@ -2538,7 +2538,7 @@ static const unsigned short uc_property_trie[] = { 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 598, 740, + 243, 243, 243, 243, 243, 243, 598, 741, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, @@ -2552,63 +2552,63 @@ static const unsigned short uc_property_trie[] = { 243, 243, 243, 243, 243, 243, 243, 243, 235, 235, 235, 235, 235, 235, 235, 235, - 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 800, + 801, 801, 801, 801, 801, 801, 801, 801, + 801, 801, 801, 801, 801, 801, 801, 801, - 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 800, + 801, 801, 801, 801, 801, 801, 801, 801, + 801, 801, 801, 801, 801, 801, 801, 801, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 801, 239, 235, 235, + 243, 243, 243, 243, 802, 239, 235, 235, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, - 802, 803, 803, 802, 802, 804, 804, 805, - 806, 807, 160, 160, 160, 160, 160, 160, + 803, 804, 804, 803, 803, 805, 805, 806, + 807, 808, 160, 160, 160, 160, 160, 160, 139, 139, 139, 139, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 734, 745, 745, 808, 808, 598, 740, 598, - 740, 598, 740, 598, 740, 598, 740, 598, + 735, 746, 746, 809, 809, 598, 741, 598, + 741, 598, 741, 598, 741, 598, 741, 598, - 740, 598, 740, 598, 740, 750, 750, 809, - 810, 734, 734, 734, 734, 808, 808, 808, - 811, 734, 812, 160, 760, 813, 9, 9, - 745, 16, 17, 16, 17, 16, 17, 814, + 741, 598, 741, 598, 741, 751, 751, 810, + 811, 735, 735, 735, 735, 809, 809, 809, + 812, 735, 813, 160, 761, 814, 9, 9, + 746, 16, 17, 16, 17, 16, 17, 815, - 734, 734, 815, 816, 817, 818, 819, 160, - 734, 12, 13, 734, 160, 160, 160, 160, + 735, 735, 816, 817, 818, 819, 820, 160, + 735, 12, 13, 735, 160, 160, 160, 160, 243, 243, 243, 286, 243, 235, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 235, 235, 820, + 243, 243, 243, 243, 243, 235, 235, 821, - 160, 9, 734, 814, 12, 13, 734, 734, - 16, 17, 734, 815, 811, 816, 812, 821, - 822, 823, 824, 825, 826, 827, 828, 829, - 830, 831, 813, 760, 832, 819, 833, 9, + 160, 9, 735, 815, 12, 13, 735, 735, + 16, 17, 735, 816, 812, 817, 813, 822, + 823, 824, 825, 826, 827, 828, 829, 830, + 831, 832, 814, 761, 833, 820, 834, 9, - 734, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 39, 734, 41, 835, 808, - - 835, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 39, 819, 41, 819, 698, - - 699, 733, 16, 17, 732, 760, 837, 758, - 758, 758, 758, 758, 758, 758, 758, 758, - 761, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, + 735, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 39, 735, 41, 836, 809, + 836, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 761, 761, + 837, 837, 837, 39, 820, 41, 820, 699, + + 700, 734, 16, 17, 733, 761, 838, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + 762, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 762, 762, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, @@ -2620,10 +2620,10 @@ static const unsigned short uc_property_trie[] = { 160, 160, 90, 90, 90, 90, 90, 90, 160, 160, 90, 90, 90, 160, 160, 160, - 48, 12, 819, 835, 735, 12, 12, 160, + 48, 12, 820, 836, 736, 12, 12, 160, 49, 36, 36, 36, 36, 49, 49, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 838, 838, 838, 839, 49, 840, 840, + 160, 839, 839, 839, 840, 49, 841, 841, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 160, 308, 308, 308, @@ -2650,68 +2650,68 @@ static const unsigned short uc_property_trie[] = { 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 160, 160, 160, 160, 160, - 841, 842, 843, 160, 160, 160, 160, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 160, 160, 160, 845, + 842, 843, 844, 160, 160, 160, 160, 845, + 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, + 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 160, 160, 160, 846, 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 724, 724, 724, - 724, 418, 418, 418, 418, 418, 418, 418, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 725, 725, 725, + 725, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 724, 160, 160, 160, 160, 160, + 418, 418, 725, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 160, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 160, - 848, 848, 848, 848, 160, 160, 160, 160, + 849, 849, 849, 849, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, - 847, 849, 847, 847, 847, 847, 847, 847, - 847, 847, 849, 160, 160, 160, 160, 160, + 848, 850, 848, 848, 848, 848, 848, 848, + 848, 848, 850, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 160, 841, + 308, 308, 308, 308, 308, 308, 160, 842, 323, 323, 323, 323, 160, 160, 160, 160, 323, 323, 323, 323, 323, 323, 323, 323, - 465, 850, 850, 850, 850, 850, 160, 160, + 465, 851, 851, 851, 851, 851, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, + 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, - 851, 851, 851, 851, 851, 851, 852, 852, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 853, 853, + 852, 852, 852, 852, 852, 852, 853, 853, + 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 855, 855, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, @@ -2725,35 +2725,35 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 855, 855, 855, 855, 855, 855, 205, 205, - 855, 205, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 205, 855, - 855, 205, 205, 205, 855, 205, 205, 855, + 856, 856, 856, 856, 856, 856, 205, 205, + 856, 205, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, - 856, 856, 856, 856, 856, 856, 857, 857, - 857, 857, 205, 205, 205, 205, 205, 858, + 856, 856, 856, 856, 856, 856, 205, 856, + 856, 205, 205, 205, 856, 205, 205, 856, - 859, 780, 780, 780, 205, 780, 780, 205, - 205, 205, 205, 205, 780, 152, 780, 153, - 859, 859, 859, 859, 205, 859, 859, 859, - 205, 859, 859, 859, 859, 859, 859, 859, + 857, 857, 857, 857, 857, 857, 857, 857, + 857, 857, 857, 857, 857, 857, 857, 857, + 857, 857, 857, 857, 857, 857, 858, 858, + 858, 858, 205, 205, 205, 205, 205, 859, - 859, 859, 859, 859, 859, 859, 859, 859, - 859, 859, 859, 859, 859, 859, 859, 859, - 859, 859, 859, 859, 205, 205, 205, 205, - 153, 641, 152, 205, 205, 205, 205, 779, + 860, 781, 781, 781, 205, 781, 781, 205, + 205, 205, 205, 205, 781, 152, 781, 153, + 860, 860, 860, 860, 205, 860, 860, 860, + 205, 860, 860, 860, 860, 860, 860, 860, - 860, 861, 862, 863, 864, 864, 864, 864, + 860, 860, 860, 860, 860, 860, 860, 860, + 860, 860, 860, 860, 860, 860, 860, 860, + 860, 860, 860, 860, 205, 205, 205, 205, + 153, 642, 152, 205, 205, 205, 205, 780, + + 861, 862, 863, 864, 865, 865, 865, 865, 205, 205, 205, 205, 205, 205, 205, 205, - 865, 865, 865, 865, 865, 865, 865, 865, - 866, 205, 205, 205, 205, 205, 205, 205, + 866, 866, 866, 866, 866, 866, 866, 866, + 867, 205, 205, 205, 205, 205, 205, 205, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2854,19 +2854,19 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 160, 160, 160, 160, 160, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 481, 481, 481, 481, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2887,67 +2887,67 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 160, 160, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 160, - 160, 160, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 869, 870, 871, - 871, 871, 868, 868, 868, 872, 869, 869, - 869, 869, 869, 873, 873, 873, 873, 873, - 873, 873, 873, 874, 874, 874, 874, 874, - 874, 874, 874, 868, 868, 875, 875, 875, - 875, 875, 874, 874, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 875, 875, 875, 875, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 160, 160, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 160, + 160, 160, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 870, 871, 872, + 872, 872, 869, 869, 869, 873, 870, 870, + 870, 870, 870, 874, 874, 874, 874, 874, + 874, 874, 874, 875, 875, 875, 875, 875, + 875, 875, 875, 869, 869, 876, 876, 876, + 876, 876, 875, 875, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 876, 876, 876, 876, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2998,9 +2998,9 @@ static const unsigned short uc_property_trie[] = { 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 160, 160, 160, 160, 160, 160, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -3019,137 +3019,137 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 160, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 160, 878, 878, + 160, 160, 878, 160, 160, 878, 878, 160, + 160, 878, 878, 878, 878, 160, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 160, 879, 160, 879, 879, 879, + 879, 102, 879, 879, 160, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + + 879, 879, 879, 879, 878, 878, 160, 878, + 878, 878, 878, 160, 160, 878, 878, 878, 878, 878, 878, 878, 878, 160, 878, 878, + 878, 878, 878, 878, 878, 160, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 878, 878, 160, 878, 878, 878, 878, 160, + 878, 878, 878, 878, 878, 160, 878, 160, + 160, 160, 878, 878, 878, 878, 878, 878, + 878, 160, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 160, 877, 877, - 160, 160, 877, 160, 160, 877, 877, 160, - 160, 877, 877, 877, 877, 160, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 160, 878, 160, 878, 878, 878, - 878, 102, 878, 878, 160, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, - 878, 878, 878, 878, 877, 877, 160, 877, - 877, 877, 877, 160, 160, 877, 877, 877, - 877, 877, 877, 877, 877, 160, 877, 877, - 877, 877, 877, 877, 877, 160, 878, 878, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 160, 877, 877, 877, 877, 160, - 877, 877, 877, 877, 877, 160, 877, 160, - 160, 160, 877, 877, 877, 877, 877, 877, - 877, 160, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 103, 103, 160, 160, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 880, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 880, 879, 879, 879, 879, + 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 880, 879, 879, 879, 879, - 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 880, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, + 878, 878, 878, 878, 878, 880, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 880, + 879, 879, 879, 879, 879, 879, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 880, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 880, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 103, 103, 160, 160, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 879, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 879, 878, 878, 878, 878, - 878, 878, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 879, 878, 878, 878, 878, - - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 879, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 879, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 879, - 878, 878, 878, 878, 878, 878, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 879, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 879, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 879, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 879, 878, 878, 878, 878, - 878, 878, 880, 723, 160, 160, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, - 881, 882, 883, 884, 885, 886, 887, 888, - 889, 890, 881, 882, 883, 884, 885, 886, - 887, 888, 889, 890, 881, 882, 883, 884, - 885, 886, 887, 888, 889, 890, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, + 878, 880, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 880, 879, 879, 879, 879, + 879, 879, 881, 724, 160, 160, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, + 882, 883, 884, 885, 886, 887, 888, 889, + 890, 891, 882, 883, 884, 885, 886, 887, + 888, 889, 890, 891, 882, 883, 884, 885, + 886, 887, 888, 889, 890, 891, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -3182,172 +3182,7 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 891, 891, - - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 160, 873, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, - - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 326, - 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 892, 892, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, @@ -3408,12 +3243,177 @@ static const unsigned short uc_property_trie[] = { 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 891, 891, + 893, 893, 893, 893, 893, 893, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 160, 874, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, 326, 326, 326, + 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, + + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 892, 892, }; #define GET_PROP_INDEX(ucs4) \ @@ -4021,11 +4021,10 @@ static const QUnicodeTables::Properties uc_properties[] = { { 20, 3, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 20, 17, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 20, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 23, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, - { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 4, 10 }, - { 21, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, { 23, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, - { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10 }, + { 21, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, { 25, 13, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 25, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 }, { 7, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1 }, @@ -4037,6 +4036,8 @@ static const QUnicodeTables::Properties uc_properties[] = { { 10, 19, 15, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 }, { 6, 3, 6, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, { 25, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 23, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, { 25, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 }, { 25, 4, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, @@ -8029,6 +8030,7 @@ static const NormalizationCorrection uc_normalization_corrections[] = { }; enum { NumNormalizationCorrections = 6 }; +enum { NormalizationCorrectionsVersionMax = 7 }; enum { UnicodeBlockCount = 512 }; // number of unicode blocks enum { UnicodeBlockSize = 128 }; // size of each block diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index 013a1a83b0b..7dcbcf508f5 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include // jpeglib needs this to be pre-included @@ -321,27 +322,31 @@ static bool read_jpeg_image(QImage *outImage, } // Determine the scale factor to pass to libjpeg for quick downscaling. - if (!scaledSize.isEmpty()) { + if (!scaledSize.isEmpty() && info->image_width && info->image_height) { if (clipRect.isEmpty()) { - info->scale_denom = - qMin(info->image_width / scaledSize.width(), - info->image_height / scaledSize.height()); - } else { - info->scale_denom = - qMin(clipRect.width() / scaledSize.width(), - clipRect.height() / scaledSize.height()); - } - if (info->scale_denom < 2) { - info->scale_denom = 1; - } else if (info->scale_denom < 4) { - info->scale_denom = 2; - } else if (info->scale_denom < 8) { - info->scale_denom = 4; - } else { + double f = qMin(double(info->image_width) / scaledSize.width(), + double(info->image_height) / scaledSize.height()); + + // libjpeg supports M/8 scaling with M=[1,16]. All downscaling factors + // are a speed improvement, but upscaling during decode is slower. + info->scale_num = qBound(1, qCeil(8/f), 8); info->scale_denom = 8; - } - info->scale_num = 1; - if (!clipRect.isEmpty()) { + } else { + info->scale_denom = qMin(clipRect.width() / scaledSize.width(), + clipRect.height() / scaledSize.height()); + + // Only scale by powers of two when clipping so we can + // keep the exact pixel boundaries + if (info->scale_denom < 2) + info->scale_denom = 1; + else if (info->scale_denom < 4) + info->scale_denom = 2; + else if (info->scale_denom < 8) + info->scale_denom = 4; + else + info->scale_denom = 8; + info->scale_num = 1; + // Correct the scale factor so that we clip accurately. // It is recommended that the clip rectangle be aligned // on an 8-pixel boundary for best performance. diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 7c7c4652e3b..27f472d8428 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -151,7 +151,7 @@ void QRasterPlatformPixmap::fromImageReader(QImageReader *imageReader, createPixmapForImage(image, flags, /* inplace = */true); } -// from qwindowsurface.cpp +// from qbackingstore.cpp extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset); void QRasterPlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 6a93ef4d094..36b2d261e4f 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -114,7 +114,6 @@ enum ApplicationResourceFlags static unsigned applicationResourceFlags = 0; QString *QGuiApplicationPrivate::platform_name = 0; -bool QGuiApplicationPrivate::app_do_modal = false; QPalette *QGuiApplicationPrivate::app_pal = 0; // default application palette @@ -380,6 +379,132 @@ QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags application_type = QCoreApplication::GuiClient; } +/*! + Returns the most recently shown modal window. If no modal windows are + visible, this function returns zero. + + A modal window is a window which has its + \l{QWindow::windowModality}{windowModality} property set to Qt::WindowModal + or Qt::ApplicationModal. A modal window must be closed before the user can + continue with other parts of the program. + + Modal window are organized in a stack. This function returns the modal + window at the top of the stack. + + \sa Qt::WindowModality, QWindow::setWindowModality() +*/ +QWindow *QGuiApplication::modalWindow() +{ + if (QGuiApplicationPrivate::self->modalWindowList.isEmpty()) + return 0; + return QGuiApplicationPrivate::self->modalWindowList.first(); +} + +void QGuiApplicationPrivate::showModalWindow(QWindow *window) +{ + self->modalWindowList.prepend(window); + + QEvent e(QEvent::WindowBlocked); + QWindowList windows = QGuiApplication::topLevelWindows(); + for (int i = 0; i < windows.count(); ++i) { + QWindow *window = windows.at(i); + if (!window->d_func()->blockedByModalWindow && window->windowType() != Qt::Tool && self->isWindowBlocked(window)) { + window->d_func()->blockedByModalWindow = true; + QGuiApplication::sendEvent(window, &e); + } + } +} + +void QGuiApplicationPrivate::hideModalWindow(QWindow *window) +{ + self->modalWindowList.removeAll(window); + + QEvent e(QEvent::WindowUnblocked); + QWindowList windows = QGuiApplication::topLevelWindows(); + for (int i = 0; i < windows.count(); ++i) { + QWindow *window = windows.at(i); + if (window->d_func()->blockedByModalWindow && window->windowType() != Qt::Tool && !self->isWindowBlocked(window)) { + window->d_func()->blockedByModalWindow = false; + QGuiApplication::sendEvent(window, &e); + } + } +} + +/* + Returns true if \a window is blocked by a modal window. If \a + blockingWindow is non-zero, *blockingWindow will be set to the blocking + window (or to zero if \a window is not blocked). +*/ +bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const +{ + QWindow *unused = 0; + if (!blockingWindow) + blockingWindow = &unused; + + if (modalWindowList.isEmpty()) { + *blockingWindow = 0; + return false; + } + + for (int i = 0; i < modalWindowList.count(); ++i) { + QWindow *modalWindow = modalWindowList.at(i); + + { + // check if the modal window is our window or a (transient) parent of our window + QWindow *w = window; + while (w) { + if (w == modalWindow) { + *blockingWindow = 0; + return false; + } + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; + } + } + + Qt::WindowModality windowModality = modalWindow->windowModality(); + switch (windowModality) { + case Qt::ApplicationModal: + { + if (modalWindow != window) { + *blockingWindow = modalWindow; + return true; + } + break; + } + case Qt::WindowModal: + { + QWindow *w = window; + do { + QWindow *m = modalWindow; + do { + if (m == w) { + *blockingWindow = m; + return true; + } + QWindow *p = m->parent(); + if (!p) + p = m->transientParent(); + m = p; + } while (m); + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; + } while (w); + break; + } + default: + Q_ASSERT_X(false, "QGuiApplication", "internal error, a modal widget cannot be modeless"); + break; + } + } + *blockingWindow = 0; + return false; +} + /*! Returns the QWindow that receives events tied to focus, such as key events. @@ -1049,6 +1174,11 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo } if (window) { + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow mouse events through + return; + } + QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers); ev.setTimestamp(e->timestamp); #ifndef QT_NO_CURSOR @@ -1111,6 +1241,11 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh QWindow *window = e->window.data(); if (window) { + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow wheel events through + return; + } + QWheelEvent ev(e->localPos, e->globalPos, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers); ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(window, &ev); @@ -1128,6 +1263,10 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE window = QGuiApplication::activeWindow(); if (!window) return; + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow key events through + return; + } QKeyEvent ev(e->keyType, e->key, e->modifiers, e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, @@ -1140,6 +1279,10 @@ void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::En { if (!e->enter) return; + if (e->enter.data()->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow enter events through + return; + } QEvent event(QEvent::Enter); QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event); @@ -1149,6 +1292,10 @@ void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Le { if (!e->leave) return; + if (e->leave.data()->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow leave events through + return; + } QEvent event(QEvent::Leave); QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event); @@ -1263,6 +1410,10 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl { if (e->window.isNull()) return; + if (e->window.data()->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow close events through + return; + } QCloseEvent event; QGuiApplication::sendSpontaneousEvent(e->window.data(), &event); @@ -1451,6 +1602,11 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; } + if (w->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow touch events through + continue; + } + QTouchEvent touchEvent(eventType, e->device, e->modifiers, diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index b58720db133..8ae0e6dfc54 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGUIAPPLICATION_QPA_H -#define QGUIAPPLICATION_QPA_H +#ifndef QGUIAPPLICATION_H +#define QGUIAPPLICATION_H #include #include @@ -88,6 +88,8 @@ public: static QString platformName(); + static QWindow *modalWindow(); + #ifdef QT_DEPRECATED static QT_DEPRECATED QWindow *activeWindow() { return focusWindow(); } #endif @@ -168,4 +170,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QGUIAPPLICATION_QPA_H +#endif // QGUIAPPLICATION_H diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 352917f2dbc..435994cdd36 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGUIAPPLICATION_QPA_P_H -#define QGUIAPPLICATION_QPA_P_H +#ifndef QGUIAPPLICATION_P_H +#define QGUIAPPLICATION_P_H #include @@ -147,7 +147,11 @@ public: static QGuiApplicationPrivate *instance() { return self; } static QString *platform_name; - static bool app_do_modal; + + QWindowList modalWindowList; + static void showModalWindow(QWindow *window); + static void hideModalWindow(QWindow *window); + virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const; static Qt::MouseButtons buttons; static ulong mousePressTime; @@ -226,4 +230,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QGUIAPPLICATION_QPA_P_H +#endif // QGUIAPPLICATION_P_H diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index b0200335d77..c616681b64d 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -55,14 +55,14 @@ #endif #include "qvariant.h" -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) #include #include #endif QT_BEGIN_NAMESPACE -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static bool qt_sequence_no_mnemonics = true; struct MacSpecialKey { int key; @@ -966,7 +966,7 @@ QKeySequence::QKeySequence(const QKeySequence& keysequence) d->ref.ref(); } -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static inline int maybeSwapShortcut(int shortcut) { if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { @@ -998,7 +998,7 @@ QList QKeySequence::keyBindings(StandardKey key) QKeyBinding keyBinding = QKeySequencePrivate::keyBindings[i]; if (keyBinding.standardKey == key && (keyBinding.platform & platform)) { uint shortcut = -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) maybeSwapShortcut(QKeySequencePrivate::keyBindings[i].shortcut); #else QKeySequencePrivate::keyBindings[i].shortcut; @@ -1200,7 +1200,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence if (nativeText) { gmodifs = globalModifs(); if (gmodifs->isEmpty()) { -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) const bool dontSwap = qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta); if (dontSwap) *gmodifs << QModifKeyName(Qt::META, QChar(kCommandUnicode)); @@ -1240,7 +1240,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence modifs += *gmodifs; // Test non-translated ones last QString sl = accel; -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) for (int i = 0; i < modifs.size(); ++i) { const QModifKeyName &mkf = modifs.at(i); if (sl.contains(mkf.name)) { @@ -1292,7 +1292,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence int fnum = 0; if (accel.length() == 1) { -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) int qtKey = qtkeyForMacSymbol(accel[0]); if (qtKey != -1) { ret |= qtKey; @@ -1371,7 +1371,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat if (key == -1 || key == Qt::Key_unknown) return s; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (nativeText) { // On Mac OS X the order (by default) is Meta, Alt, Shift, Control. // If the AA_MacDontSwapCtrlAndMeta is enabled, then the order @@ -1427,7 +1427,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat : QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1); } else if (key) { int i=0; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (nativeText) { QChar ch = qt_macSymbolForQtKey(key); if (!ch.isNull()) @@ -1437,7 +1437,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat } else #endif { -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) NonSymbol: #endif while (keyname[i].name) { @@ -1463,7 +1463,7 @@ NonSymbol: } } -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (nativeText) s += p; else diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index efb65ae3e7e..b9a47a54b85 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -51,9 +51,11 @@ #include #ifdef __GLEW_H__ +#if defined(Q_CC_GNU) #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined #warning To use GLEW with Qt, do not include or after glew.h #endif +#endif #include diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor_qpa.h index e29cf87d03a..c1a572b27da 100644 --- a/src/gui/kernel/qplatformcursor_qpa.h +++ b/src/gui/kernel/qplatformcursor_qpa.h @@ -38,8 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QGRAPHICSSYSTEMCURSOR_H -#define QGRAPHICSSYSTEMCURSOR_H +#ifndef QPLATFORMCURSOR_QPA_H +#define QPLATFORMCURSOR_QPA_H #include #include @@ -60,7 +60,7 @@ public: QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY) { set(data, mask, width, height, hotX, hotY); } QImage * image() { return &cursorImage; } - QPoint hotspot() { return hot; } + QPoint hotspot() const { return hot; } void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY); void set(const QImage &image, int hx, int hy); void set(Qt::CursorShape); @@ -97,4 +97,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QGRAPHICSSYSTEMCURSOR_H +#endif // QPLATFORMCURSOR_QPA_H diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index 227059e24e9..a9dfbba788c 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -329,7 +329,7 @@ bool QPlatformWindow::setMouseGrabEnabled(bool grab) However, it is not concerned with how Qt renders into the window it represents. Visible QWindows will always have a QPlatformWindow. However, it is not necessary for - all windows to have a QWindowSurface. This is the case for QOpenGLWidget. And could be the case for + all windows to have a QBackingStore. This is the case for QOpenGLWidget. And could be the case for windows where some 3.party renders into it. The platform specific window handle can be retrieved by the winId function. @@ -340,7 +340,7 @@ bool QPlatformWindow::setMouseGrabEnabled(bool grab) The only way to retrieve a QPlatformOpenGLContext in QPA is by calling the glContext() function on QPlatformWindow. - \sa QWindowSurface, QWindow + \sa QBackingStore, QWindow */ QT_END_NAMESPACE diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp index 534135cc2fb..8b71fc35362 100644 --- a/src/gui/kernel/qsurface.cpp +++ b/src/gui/kernel/qsurface.cpp @@ -88,7 +88,9 @@ QSurface::QSurface(SurfaceClass type) { } - +QSurface::~QSurface() +{ +} QSurface::SurfaceClass QSurface::surfaceClass() const { diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index d65998ce49b..b0422830718 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -193,10 +193,6 @@ QWindow::~QWindow() destroy(); } -QSurface::~QSurface() -{ -} - /*! Set the \a surfaceType of the window. @@ -253,6 +249,13 @@ void QWindow::setVisible(bool visible) QGuiApplication::sendEvent(this, &showEvent); } + if (isModal()) { + if (visible) + QGuiApplicationPrivate::showModalWindow(this); + else + QGuiApplicationPrivate::hideModalWindow(this); + } + d->platformWindow->setVisible(visible); if (!visible) { @@ -1396,7 +1399,7 @@ void QWindow::resizeEvent(QResizeEvent *ev) /*! Override this to handle show events. - The show event is called when the window has requested becoming visible. + The function is called when the window has requested becoming visible. If the window is successfully shown by the windowing system, this will be followed by a resize and an expose event. @@ -1409,7 +1412,7 @@ void QWindow::showEvent(QShowEvent *ev) /*! Override this to handle hide evens. - The hide event is called when the window has requested being hidden in the + The function is called when the window has requested being hidden in the windowing system. */ void QWindow::hideEvent(QHideEvent *ev) diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 5cf6b413ba7..aacd3ed82f0 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QWINDOW_QPA_H -#define QWINDOW_QPA_H +#ifndef QWINDOW_H +#define QWINDOW_H #include #include @@ -254,7 +254,6 @@ public Q_SLOTS: } Q_SIGNALS: - void backBufferReady(); void screenChanged(QScreen *screen); void windowModalityChanged(Qt::WindowModality windowModality); @@ -311,4 +310,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QWINDOW_QPA_H +#endif // QWINDOW_H diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 03b3b92a25e..375bd1e7299 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QWINDOW_QPA_P_H -#define QWINDOW_QPA_P_H +#ifndef QWINDOW_P_H +#define QWINDOW_P_H #include #include @@ -81,6 +81,7 @@ public: , windowOrientation(Qt::PrimaryOrientation) , maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX) , modality(Qt::NonModal) + , blockedByModalWindow(false) , transientParent(0) , screen(0) { @@ -123,6 +124,8 @@ public: QSize sizeIncrement; Qt::WindowModality modality; + bool blockedByModalWindow; + QPointer transientParent; QScreen *screen; }; @@ -132,4 +135,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QWINDOW_QPA_P_H +#endif // QWINDOW_P_H diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index ce36a821b6d..87029849e3b 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -45,9 +45,11 @@ #ifndef QT_NO_OPENGL #ifdef __GLEW_H__ +#if defined(Q_CC_GNU) #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined #warning To use GLEW with Qt, do not include or after glew.h #endif +#endif #include #include diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index d1dd246e9cb..a8f6a5bf8fb 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -53,7 +53,6 @@ SOURCES += \ painting/qoutlinemapper.cpp \ painting/qpagedpaintdevice.cpp \ painting/qpaintdevice.cpp \ - painting/qpaintdevice_qpa.cpp \ painting/qpaintengine.cpp \ painting/qpaintengineex.cpp \ painting/qpainter.cpp \ diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index f531565fb98..75122571d6b 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -2260,7 +2260,7 @@ QColor QColor::light(int factor) const QColor hsv = toHsv(); int s = hsv.ct.ahsv.saturation; - int v = hsv.ct.ahsv.value; + uint v = hsv.ct.ahsv.value; v = (factor*v)/100; if (v > USHRT_MAX) { diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index ced2e4548cd..c26d7e5d980 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -44,6 +44,7 @@ #include "qmatrix.h" #include "qregion.h" #include "qpainterpath.h" +#include "qpainterpath_p.h" #include "qvariant.h" #include diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp index d1dfa7001fd..afbd86601d0 100644 --- a/src/gui/painting/qpaintdevice.cpp +++ b/src/gui/painting/qpaintdevice.cpp @@ -76,4 +76,20 @@ Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice return device->metric(metric); } +int QPaintDevice::metric(PaintDeviceMetric m) const +{ + qWarning("QPaintDevice::metrics: Device has no metric information"); + if (m == PdmDpiX) { + return 72; + } else if (m == PdmDpiY) { + return 72; + } else if (m == PdmNumColors) { + // FIXME: does this need to be a real value? + return 256; + } else { + qDebug("Unrecognised metric %d!",m); + return 0; + } +} + QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index 31c6b30ec47..dd2f5076533 100644 --- a/src/gui/painting/qpaintengineex_p.h +++ b/src/gui/painting/qpaintengineex_p.h @@ -150,7 +150,6 @@ public: virtual void beginNativePainting() {} virtual void endNativePainting() {} - // ### Qt5: remove, once QtGui is merged into QtGui and QtWidgets // Return a pixmap filter of "type" that can render the parameters // in "prototype". The returned filter is owned by the engine and // will be destroyed when the engine is destroyed. The "prototype" diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e098e7c7613..0e8811b934c 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -478,14 +478,26 @@ static void qt_debug_path(const QPainterPath &path) \sa ElementType, elementAt(), isEmpty() */ +int QPainterPath::elementCount() const +{ + return d_ptr ? d_ptr->elements.size() : 0; +} + /*! - \fn const QPainterPath::Element &QPainterPath::elementAt(int index) const + \fn QPainterPath::Element QPainterPath::elementAt(int index) const Returns the element at the given \a index in the painter path. \sa ElementType, elementCount(), isEmpty() */ +QPainterPath::Element QPainterPath::elementAt(int i) const +{ + Q_ASSERT(d_ptr); + Q_ASSERT(i >= 0 && i < elementCount()); + return d_ptr->elements.at(i); +} + /*! \fn void QPainterPath::setElementPositionAt(int index, qreal x, qreal y) \since 4.2 @@ -494,6 +506,17 @@ static void qt_debug_path(const QPainterPath &path) x and \a y. */ +void QPainterPath::setElementPositionAt(int i, qreal x, qreal y) +{ + Q_ASSERT(d_ptr); + Q_ASSERT(i >= 0 && i < elementCount()); + detach(); + QPainterPath::Element &e = d_ptr->elements[i]; + e.x = x; + e.y = y; +} + + /*### \fn QPainterPath &QPainterPath::operator +=(const QPainterPath &other) @@ -535,6 +558,13 @@ QPainterPath::QPainterPath(const QPointF &startPoint) d_func()->elements << e; } +void QPainterPath::detach() +{ + if (d_ptr->ref.load() != 1) + detach_helper(); + setDirty(true); +} + /*! \internal */ @@ -1451,6 +1481,11 @@ QRectF QPainterPath::controlPointRect() const \sa elementCount() */ +bool QPainterPath::isEmpty() const +{ + return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement); +} + /*! Creates and returns a reversed copy of the path. diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 40456bc163b..7bb52f41255 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -165,7 +165,7 @@ public: Qt::FillRule fillRule() const; void setFillRule(Qt::FillRule fillRule); - inline bool isEmpty() const; + bool isEmpty() const; QPainterPath toReversed() const; QList toSubpathPolygons(const QMatrix &matrix = QMatrix()) const; @@ -175,9 +175,9 @@ public: QList toFillPolygons(const QTransform &matrix) const; QPolygonF toFillPolygon(const QTransform &matrix) const; - inline int elementCount() const; - inline const QPainterPath::Element &elementAt(int i) const; - inline void setElementPositionAt(int i, qreal x, qreal y); + int elementCount() const; + QPainterPath::Element elementAt(int i) const; + void setElementPositionAt(int i, qreal x, qreal y); qreal length() const; qreal percentAtLength(qreal t) const; @@ -211,7 +211,7 @@ private: inline void ensureData() { if (!d_ptr) ensureData_helper(); } void ensureData_helper(); - inline void detach(); + void detach(); void detach_helper(); void setDirty(bool); void computeBoundingRect() const; @@ -233,29 +233,6 @@ private: #endif }; -class QPainterPathPrivate -{ -public: - friend class QPainterPath; - friend class QPainterPathData; - friend class QPainterPathStroker; - friend class QPainterPathStrokerPrivate; - friend class QMatrix; - friend class QTransform; - friend class QVectorPath; - friend struct QPainterPathPrivateDeleter; -#ifndef QT_NO_DATASTREAM - friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); - friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); -#endif - - QPainterPathPrivate() : ref(1) {} - -private: - QAtomicInt ref; - QVector elements; -}; - Q_DECLARE_TYPEINFO(QPainterPath::Element, Q_PRIMITIVE_TYPE); #ifndef QT_NO_DATASTREAM @@ -391,40 +368,6 @@ inline void QPainterPath::translate(const QPointF &offset) inline QPainterPath QPainterPath::translated(const QPointF &offset) const { return translated(offset.x(), offset.y()); } -inline bool QPainterPath::isEmpty() const -{ - return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement); -} - -inline int QPainterPath::elementCount() const -{ - return d_ptr ? d_ptr->elements.size() : 0; -} - -inline const QPainterPath::Element &QPainterPath::elementAt(int i) const -{ - Q_ASSERT(d_ptr); - Q_ASSERT(i >= 0 && i < elementCount()); - return d_ptr->elements.at(i); -} - -inline void QPainterPath::setElementPositionAt(int i, qreal x, qreal y) -{ - Q_ASSERT(d_ptr); - Q_ASSERT(i >= 0 && i < elementCount()); - detach(); - QPainterPath::Element &e = d_ptr->elements[i]; - e.x = x; - e.y = y; -} - - -inline void QPainterPath::detach() -{ - if (d_ptr->ref.load() != 1) - detach_helper(); - setDirty(true); -} #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QPainterPath &); diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index a9068f38558..116ea634259 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -65,6 +65,29 @@ QT_BEGIN_NAMESPACE +class QPainterPathPrivate +{ +public: + friend class QPainterPath; + friend class QPainterPathData; + friend class QPainterPathStroker; + friend class QPainterPathStrokerPrivate; + friend class QMatrix; + friend class QTransform; + friend class QVectorPath; + friend struct QPainterPathPrivateDeleter; +#ifndef QT_NO_DATASTREAM + friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); + friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); +#endif + + QPainterPathPrivate() : ref(1) {} + +private: + QAtomicInt ref; + QVector elements; +}; + class QPainterPathStrokerPrivate { public: diff --git a/src/gui/painting/qplatformbackingstore_qpa.cpp b/src/gui/painting/qplatformbackingstore_qpa.cpp index ff7d91cceaf..485190d301a 100644 --- a/src/gui/painting/qplatformbackingstore_qpa.cpp +++ b/src/gui/painting/qplatformbackingstore_qpa.cpp @@ -114,9 +114,6 @@ QWindow* QPlatformBackingStore::window() const This function is called before painting onto the surface begins, with the \a region in which the painting will occur. - \note A platform providing a backing store with an alpha channel - needs to properly initialize the region to be painted. - \sa endPaint(), paintDevice() */ diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index e5c41efc157..ba971d454dc 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -45,6 +45,7 @@ #include "qmatrix.h" #include "qregion.h" #include "qpainterpath.h" +#include "qpainterpath_p.h" #include "qvariant.h" #include #include diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp index 6576f237c40..b73b03025b4 100644 --- a/src/gui/text/qfont_qpa.cpp +++ b/src/gui/text/qfont_qpa.cpp @@ -75,35 +75,12 @@ void QFont::setRawName(const QString &) QString QFont::defaultFamily() const { - QString familyName; - switch(d->request.styleHint) { - case QFont::SansSerif: - familyName = QString::fromLatin1("sans-serif"); - break; - case QFont::Serif: - familyName = QString::fromLatin1("serif"); - break; - case QFont::TypeWriter: - case QFont::Monospace: - familyName = QString::fromLatin1("monospace"); - break; - case QFont::Cursive: - familyName = QString::fromLatin1("cursive"); - break; - case QFont::Fantasy: - familyName = QString::fromLatin1("fantasy"); - break; - case QFont::Decorative: - familyName = QString::fromLatin1("decorative"); - break; - case QFont::System: - default: - familyName = QString(); - break; - } - - return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->resolveFontFamilyAlias(familyName); - + QPlatformFontDatabase *fontDB = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); + const QStringList fallbacks = fontDB->fallbacksForFamily(QString(), QFont::StyleNormal + , QFont::StyleHint(d->request.styleHint), QUnicodeTables::Common); + if (!fallbacks.isEmpty()) + return fallbacks.first(); + return QString(); } QString QFont::lastResortFamily() const diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 468d029cf2b..a1af8569926 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -735,12 +735,13 @@ static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDe fontDef->family += QLatin1Char(']'); } - if (desc.style->smoothScalable) + if (desc.style->smoothScalable + || QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable() + || (desc.style->bitmapScalable && (request.styleStrategy & QFont::PreferMatch))) { fontDef->pixelSize = request.pixelSize; - else if ((desc.style->bitmapScalable && (request.styleStrategy & QFont::PreferMatch))) - fontDef->pixelSize = request.pixelSize; - else + } else { fontDef->pixelSize = desc.size->pixelSize; + } fontDef->styleHint = request.styleHint; fontDef->styleStrategy = request.styleStrategy; @@ -1534,6 +1535,9 @@ bool QFontDatabase::isScalable(const QString &family, QList QFontDatabase::pointSizes(const QString &family, const QString &styleName) { + if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()) + return standardSizes(); + bool smoothScalable = false; QString familyName, foundryName; parseFontName(family, foundryName, familyName); @@ -1634,6 +1638,9 @@ QFont QFontDatabase::font(const QString &family, const QString &style, QList QFontDatabase::smoothSizes(const QString &family, const QString &styleName) { + if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()) + return standardSizes(); + bool smoothScalable = false; QString familyName, foundryName; parseFontName(family, foundryName, familyName); @@ -1689,12 +1696,7 @@ QList QFontDatabase::smoothSizes(const QString &family, */ QList QFontDatabase::standardSizes() { - QList ret; - static const unsigned short standard[] = - { 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 0 }; - const unsigned short *sizes = standard; - while (*sizes) ret << *sizes++; - return ret; + return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->standardSizes(); } diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h index b30f7da48dc..f0830f2a41e 100644 --- a/src/gui/text/qfontdatabase.h +++ b/src/gui/text/qfontdatabase.h @@ -46,8 +46,6 @@ #include #include -class tst_QFont; - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -162,9 +160,6 @@ private: friend class QFontEngineMultiXLFD; friend class QFontEngineMultiQWS; friend class QFontEngineMultiQPA; -#ifdef QT_BUILD_INTERNAL - friend class ::tst_QFont; -#endif QFontDatabasePrivate *d; }; diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 0014efc4507..c2a3aa97228 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -161,9 +161,12 @@ QFontEngine *loadSingleEngine(int script, Q_UNUSED(foundry); Q_ASSERT(size); + QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); int pixelSize = size->pixelSize; - if (!pixelSize || (style->smoothScalable && pixelSize == SMOOTH_SCALABLE)) + if (!pixelSize || (style->smoothScalable && pixelSize == SMOOTH_SCALABLE) + || pfdb->fontsAlwaysScalable()) { pixelSize = request.pixelSize; + } QFontDef def = request; def.pixelSize = pixelSize; @@ -171,7 +174,6 @@ QFontEngine *loadSingleEngine(int script, QFontCache::Key key(def,script); QFontEngine *engine = QFontCache::instance()->findEngine(key); if (!engine) { - QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); engine = pfdb->fontEngine(def,QUnicodeTables::Script(script),size->handle); if (engine) { QFontCache::Key key(def,script); diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 6af0398f006..f6d82802f7b 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -384,6 +384,35 @@ QString QPlatformFontDatabase::resolveFontFamilyAlias(const QString &family) con return family; } +/*! + Return true if all fonts are considered scalable when using this font database. + Defaults to false. + + \since 5.0 + */ + +bool QPlatformFontDatabase::fontsAlwaysScalable() const +{ + return false; +} + +/*! + Return list of standard font sizes when using this font database. + + \since 5.0 + */ + + QList QPlatformFontDatabase::standardSizes() const +{ + QList ret; + static const unsigned short standard[] = + { 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 0 }; + ret.reserve(int(sizeof(standard) / sizeof(standard[0]))); + const unsigned short *sizes = standard; + while (*sizes) ret << *sizes++; + return ret; +} + /*! \class QPlatformFontDatabase \brief The QPlatformFontDatabase class makes it possible to customize how fonts diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h index 3810b75dbfe..9fe3b0380df 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.h +++ b/src/gui/text/qplatformfontdatabase_qpa.h @@ -102,6 +102,8 @@ public: virtual QFont defaultFont() const; virtual QString resolveFontFamilyAlias(const QString &family) const; + virtual bool fontsAlwaysScalable() const; + virtual QList standardSizes() const; //callback static void registerQPF2Font(const QByteArray &dataArray, void *handle); diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index c5c6b2e621a..793ea4aa9e2 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2185,7 +2185,7 @@ int QTextEngine::formatIndex(const QScriptItem *si) const int pos = si->position; if (specialData && si->position >= specialData->preeditPosition) { if (si->position < specialData->preeditPosition + specialData->preeditText.length()) - pos = qMax(specialData->preeditPosition - 1, 0); + pos = qMax(qMin(block.length(), specialData->preeditPosition) - 1, 0); else pos -= specialData->preeditText.length(); } diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index a7e68a41c28..9a38b1f0b2f 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -3010,7 +3010,6 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt) */ -// ### Qt5 qreal replace with a QTextLength /*! \fn qreal QTextImageFormat::width() const @@ -3029,7 +3028,6 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt) */ -// ### Qt5 qreal replace with a QTextLength /*! \fn qreal QTextImageFormat::height() const diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index da08c4e4681..7005fca9024 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1051,7 +1051,7 @@ void QTextHtmlParserNode::initializeProperties(const QTextHtmlParserNode *parent && !attributes.at(i + 1).isEmpty()) { hasHref = true; charFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); - charFormat.setForeground(Qt::blue); // ### Qt5: QApplication::palette().link()); + charFormat.setForeground(Qt::blue); } } diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp index b3b4c90d79e..25760de0dc8 100644 --- a/src/gui/text/qtextoption.cpp +++ b/src/gui/text/qtextoption.cpp @@ -145,7 +145,7 @@ QTextOption &QTextOption::operator=(const QTextOption &o) \sa tabArray(), setTabStop(), setTabs() */ -void QTextOption::setTabArray(QList tabStops) // Qt5: const ref +void QTextOption::setTabArray(const QList &tabStops) { if (!d) d = new QTextOptionPrivate; @@ -165,7 +165,7 @@ void QTextOption::setTabArray(QList tabStops) // Qt5: const ref \sa tabStops() */ -void QTextOption::setTabs(QList tabStops) // Qt5: const ref +void QTextOption::setTabs(const QList &tabStops) { if (!d) d = new QTextOptionPrivate; diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h index 96a0cdda9b2..44dc79e255a 100644 --- a/src/gui/text/qtextoption.h +++ b/src/gui/text/qtextoption.h @@ -122,10 +122,10 @@ public: inline void setTabStop(qreal tabStop); inline qreal tabStop() const { return tab; } - void setTabArray(QList tabStops); + void setTabArray(const QList &tabStops); QList tabArray() const; - void setTabs(QList tabStops); + void setTabs(const QList &tabStops); QList tabs() const; void setUseDesignMetrics(bool b) { design = b; } diff --git a/src/network/access/access.pri b/src/network/access/access.pri index e0a0253b6c2..590a37bf15e 100644 --- a/src/network/access/access.pri +++ b/src/network/access/access.pri @@ -65,3 +65,5 @@ SOURCES += \ access/qhttpmultipart.cpp include($$PWD/../../3rdparty/zlib_dependency.pri) + +mac:LIBS_PRIVATE += -framework Security diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 7f1f8194362..8d68f439f19 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -82,6 +82,64 @@ Q_GLOBAL_STATIC(QNetworkAccessFtpBackendFactory, ftpBackend) Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend) #endif +#ifdef Q_OS_MAC + +#include +#include +#include + +bool getProxyAuth(const QString& proxyHostname, const QString &scheme, QString& username, QString& password) +{ + OSStatus err; + SecKeychainItemRef itemRef; + bool retValue = false; + SecProtocolType protocolType = kSecProtocolTypeAny; + if (scheme.compare(QLatin1String("ftp"),Qt::CaseInsensitive)==0) { + protocolType = kSecProtocolTypeFTP; + } else if (scheme.compare(QLatin1String("http"),Qt::CaseInsensitive)==0) { + protocolType = kSecProtocolTypeHTTP; + } else if (scheme.compare(QLatin1String("https"),Qt::CaseInsensitive)==0) { + protocolType = kSecProtocolTypeHTTPS; + } + QByteArray proxyHostnameUtf8(proxyHostname.toUtf8()); + err = SecKeychainFindInternetPassword(NULL, + proxyHostnameUtf8.length(), proxyHostnameUtf8.constData(), + 0,NULL, + 0, NULL, + 0, NULL, + 0, + protocolType, + kSecAuthenticationTypeAny, + 0, NULL, + &itemRef); + if (err == noErr) { + + SecKeychainAttribute attr; + SecKeychainAttributeList attrList; + UInt32 length; + void *outData; + + attr.tag = kSecAccountItemAttr; + attr.length = 0; + attr.data = NULL; + + attrList.count = 1; + attrList.attr = &attr; + + if (SecKeychainItemCopyContent(itemRef, NULL, &attrList, &length, &outData) == noErr) { + username = QString::fromUtf8((const char*)attr.data, attr.length); + password = QString::fromUtf8((const char*)outData, length); + SecKeychainItemFreeContent(&attrList,outData); + retValue = true; + } + CFRelease(itemRef); + } + return retValue; +} +#endif + + + static void ensureInitialized() { #ifndef QT_NO_FTP @@ -1128,6 +1186,18 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QAuthenticator *authen return; } } +#ifdef Q_OS_MAC + //now we try to get the username and password from keychain + //if not successful signal will be emitted + QString username; + QString password; + if (getProxyAuth(proxy.hostName(),reply->request().url().scheme(),username,password)) { + authenticator->setUser(username); + authenticator->setPassword(password); + authenticationManager->cacheProxyCredentials(proxy, authenticator); + return; + } +#endif // if we emit a signal here in synchronous mode, the user might spin // an event loop, which might recurse and lead to problems diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index fbddd989980..0ac3e26adae 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -513,69 +513,71 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h QDateTime currentDateTime = QDateTime::currentDateTime(); QDateTime expirationDate = metaData.expirationDate(); -#if 0 - /* - * age_value - * is the value of Age: header received by the cache with - * this response. - * date_value - * is the value of the origin server's Date: header - * request_time - * is the (local) time when the cache made the request - * that resulted in this cached response - * response_time - * is the (local) time when the cache received the - * response - * now - * is the current (local) time - */ - int age_value = 0; - it = cacheHeaders.findRawHeader("age"); - if (it != cacheHeaders.rawHeaders.constEnd()) - age_value = it->second.toInt(); - - QDateTime dateHeader; - int date_value = 0; - it = cacheHeaders.findRawHeader("date"); - if (it != cacheHeaders.rawHeaders.constEnd()) { - dateHeader = QNetworkHeadersPrivate::fromHttpDate(it->second); - date_value = dateHeader.toTime_t(); - } - - int now = currentDateTime.toUTC().toTime_t(); - int request_time = now; - int response_time = now; - - // Algorithm from RFC 2616 section 13.2.3 - int apparent_age = qMax(0, response_time - date_value); - int corrected_received_age = qMax(apparent_age, age_value); - int response_delay = response_time - request_time; - int corrected_initial_age = corrected_received_age + response_delay; - int resident_time = now - response_time; - int current_age = corrected_initial_age + resident_time; - - // RFC 2616 13.2.4 Expiration Calculations + bool response_is_fresh; if (!expirationDate.isValid()) { - if (lastModified.isValid()) { - int diff = currentDateTime.secsTo(lastModified); - expirationDate = lastModified; - expirationDate.addSecs(diff / 10); - if (httpRequest.headerField("Warning").isEmpty()) { - QDateTime dt; - dt.setTime_t(current_age); - if (dt.daysTo(currentDateTime) > 1) - httpRequest.setHeaderField("Warning", "113"); + /* + * age_value + * is the value of Age: header received by the cache with + * this response. + * date_value + * is the value of the origin server's Date: header + * request_time + * is the (local) time when the cache made the request + * that resulted in this cached response + * response_time + * is the (local) time when the cache received the + * response + * now + * is the current (local) time + */ + int age_value = 0; + it = cacheHeaders.findRawHeader("age"); + if (it != cacheHeaders.rawHeaders.constEnd()) + age_value = it->second.toInt(); + + QDateTime dateHeader; + int date_value = 0; + it = cacheHeaders.findRawHeader("date"); + if (it != cacheHeaders.rawHeaders.constEnd()) { + dateHeader = QNetworkHeadersPrivate::fromHttpDate(it->second); + date_value = dateHeader.toTime_t(); + } + + int now = currentDateTime.toUTC().toTime_t(); + int request_time = now; + int response_time = now; + + // Algorithm from RFC 2616 section 13.2.3 + int apparent_age = qMax(0, response_time - date_value); + int corrected_received_age = qMax(apparent_age, age_value); + int response_delay = response_time - request_time; + int corrected_initial_age = corrected_received_age + response_delay; + int resident_time = now - response_time; + int current_age = corrected_initial_age + resident_time; + + // RFC 2616 13.2.4 Expiration Calculations + if (!expirationDate.isValid()) { + if (lastModified.isValid()) { + int diff = currentDateTime.secsTo(lastModified); + expirationDate = lastModified; + expirationDate.addSecs(diff / 10); + if (httpRequest.headerField("Warning").isEmpty()) { + QDateTime dt; + dt.setTime_t(current_age); + if (dt.daysTo(currentDateTime) > 1) + httpRequest.setHeaderField("Warning", "113"); + } } } - } - // the cache-saving code below sets the expirationDate with date+max_age - // if "max-age" is present, or to Expires otherwise - int freshness_lifetime = dateHeader.secsTo(expirationDate); - bool response_is_fresh = (freshness_lifetime > current_age); -#else - bool response_is_fresh = currentDateTime.secsTo(expirationDate) >= 0; -#endif + // the cache-saving code below sets the expirationDate with date+max_age + // if "max-age" is present, or to Expires otherwise + int freshness_lifetime = dateHeader.secsTo(expirationDate); + response_is_fresh = (freshness_lifetime > current_age); + } else { + // expiration date was calculated earlier (e.g. when storing object to the cache) + response_is_fresh = currentDateTime.secsTo(expirationDate) >= 0; + } if (!response_is_fresh) return false; diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index a5508af31f8..f38980910d9 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -33,7 +33,7 @@ win32: { } integrity:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp -mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation -mac:SOURCES += kernel/qnetworkproxy_mac.cpp +mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation -framework CoreServices +mac:contains(QT_CONFIG, coreservices):SOURCES += kernel/qnetworkproxy_mac.cpp else:win32:SOURCES += kernel/qnetworkproxy_win.cpp else:SOURCES += kernel/qnetworkproxy_generic.cpp diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp index 63f4377dfce..c798020f343 100644 --- a/src/network/kernel/qdnslookup_win.cpp +++ b/src/network/kernel/qdnslookup_win.cpp @@ -55,7 +55,8 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN { // Perform DNS query. PDNS_RECORD dns_records = 0; - const DNS_STATUS status = DnsQuery_UTF8(requestName, requestType, DNS_QUERY_STANDARD, NULL, &dns_records, NULL); + const QString requestNameUtf16 = QString::fromUtf8(requestName.data(), requestName.size()); + const DNS_STATUS status = DnsQuery_W(reinterpret_cast(requestNameUtf16.utf16()), requestType, DNS_QUERY_STANDARD, NULL, &dns_records, NULL); switch (status) { case ERROR_SUCCESS: break; @@ -83,7 +84,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN // Extract results. for (PDNS_RECORD ptr = dns_records; ptr != NULL; ptr = ptr->pNext) { - const QString name = QUrl::fromAce((char*)ptr->pName); + const QString name = QUrl::fromAce( QString::fromWCharArray( ptr->pName ).toLatin1() ); if (ptr->wType == QDnsLookup::A) { QDnsHostAddressRecord record; record.d->name = name; @@ -103,12 +104,12 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN QDnsDomainNameRecord record; record.d->name = name; record.d->timeToLive = ptr->dwTtl; - record.d->value = QUrl::fromAce((char*)ptr->Data.Cname.pNameHost); + record.d->value = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Cname.pNameHost).toLatin1()); reply->canonicalNameRecords.append(record); } else if (ptr->wType == QDnsLookup::MX) { QDnsMailExchangeRecord record; record.d->name = name; - record.d->exchange = QUrl::fromAce((char*)ptr->Data.Mx.pNameExchange); + record.d->exchange = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Mx.pNameExchange).toLatin1()); record.d->preference = ptr->Data.Mx.wPreference; record.d->timeToLive = ptr->dwTtl; reply->mailExchangeRecords.append(record); @@ -116,18 +117,18 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN QDnsDomainNameRecord record; record.d->name = name; record.d->timeToLive = ptr->dwTtl; - record.d->value = QUrl::fromAce((char*)ptr->Data.Ns.pNameHost); + record.d->value = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Ns.pNameHost).toLatin1()); reply->nameServerRecords.append(record); } else if (ptr->wType == QDnsLookup::PTR) { QDnsDomainNameRecord record; record.d->name = name; record.d->timeToLive = ptr->dwTtl; - record.d->value = QUrl::fromAce((char*)ptr->Data.Ptr.pNameHost); + record.d->value = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Ptr.pNameHost).toLatin1()); reply->pointerRecords.append(record); } else if (ptr->wType == QDnsLookup::SRV) { QDnsServiceRecord record; record.d->name = name; - record.d->target = QUrl::fromAce((char*)ptr->Data.Srv.pNameTarget); + record.d->target = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Srv.pNameTarget).toLatin1()); record.d->port = ptr->Data.Srv.wPort; record.d->priority = ptr->Data.Srv.wPriority; record.d->timeToLive = ptr->dwTtl; @@ -138,7 +139,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN record.d->name = name; record.d->timeToLive = ptr->dwTtl; for (unsigned int i = 0; i < ptr->Data.Txt.dwStringCount; ++i) { - record.d->values << QByteArray((char*)ptr->Data.Txt.pStringArray[i]); + record.d->values << QString::fromWCharArray((ptr->Data.Txt.pStringArray[i])).toLatin1();; } reply->textRecords.append(record); } diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp index d25917ee476..3e62c0f8670 100644 --- a/src/network/kernel/qnetworkproxy_mac.cpp +++ b/src/network/kernel/qnetworkproxy_mac.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include "private/qcore_mac_p.h" @@ -146,6 +147,66 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict, QNetworkProxy::Pr return QNetworkProxy(); } + +static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict) +{ + QNetworkProxy::ProxyType proxyType = QNetworkProxy::DefaultProxy; + QString hostName; + quint16 port = 0; + QString user; + QString password; + + CFStringRef cfProxyType = (CFStringRef)CFDictionaryGetValue(dict, kCFProxyTypeKey); + if (CFStringCompare(cfProxyType, kCFProxyTypeNone, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::NoProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeFTP, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::FtpCachingProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeHTTP, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::HttpProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeHTTPS, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::HttpProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeSOCKS, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::Socks5Proxy; + } + + hostName = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyHostNameKey)); + user = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyUsernameKey)); + password = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyPasswordKey)); + + CFNumberRef portNumber = (CFNumberRef)CFDictionaryGetValue(dict, kCFProxyPortNumberKey); + if (portNumber) { + CFNumberGetValue(portNumber, kCFNumberSInt16Type, &port); + } + + return QNetworkProxy(proxyType, hostName, port, user, password); +} + +const char * cfurlErrorDescription(SInt32 errorCode) +{ + switch (errorCode) { + case kCFURLUnknownError: + return "Unknown Error"; + case kCFURLUnknownSchemeError: + return "Unknown Scheme"; + case kCFURLResourceNotFoundError: + return "Resource Not Found"; + case kCFURLResourceAccessViolationError: + return "Resource Access Violation"; + case kCFURLRemoteHostUnavailableError: + return "Remote Host Unavailable"; + case kCFURLImproperArgumentsError: + return "Improper Arguments"; + case kCFURLUnknownPropertyKeyError: + return "Unknown Property Key"; + case kCFURLPropertyKeyUnavailableError: + return "Property Key Unavailable"; + case kCFURLTimeoutError: + return "Timeout"; + default: + return "Really Unknown Error"; + } +} + QList macQueryInternal(const QNetworkProxyQuery &query) { QList result; @@ -168,11 +229,58 @@ QList macQueryInternal(const QNetworkProxyQuery &query) int enabled; if (CFNumberGetValue(pacEnabled, kCFNumberIntType, &enabled) && enabled) { // PAC is enabled - CFStringRef pacUrl = - (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString); - QString url = QCFString::toQString(pacUrl); + CFStringRef cfPacLocation = (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString); - // ### TODO: Use PAC somehow +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { + QCFType pacData; + QCFType pacUrl = CFURLCreateWithString(kCFAllocatorDefault, cfPacLocation, NULL); + SInt32 errorCode; + if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, pacUrl, &pacData, NULL, NULL, &errorCode)) { + QString pacLocation = QCFString::toQString(cfPacLocation); + qWarning("Unable to get the PAC script at \"%s\" (%s)", qPrintable(pacLocation), cfurlErrorDescription(errorCode)); + return result; + } + + QCFType pacScript = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, pacData, kCFStringEncodingISOLatin1); + if (!pacScript) { + // This should never happen, but the documentation says it may return NULL if there was a problem creating the object. + QString pacLocation = QCFString::toQString(cfPacLocation); + qWarning("Unable to read the PAC script at \"%s\"", qPrintable(pacLocation)); + return result; + } + + QByteArray encodedURL = query.url().toEncoded(); // converted to UTF-8 + if (encodedURL.isEmpty()) { + return result; // Invalid URL, abort + } + + QCFType targetURL = CFURLCreateWithBytes(kCFAllocatorDefault, (UInt8*)encodedURL.data(), encodedURL.size(), kCFStringEncodingUTF8, NULL); + if (!targetURL) { + return result; // URL creation problem, abort + } + + QCFType pacError; + QCFType proxies = CFNetworkCopyProxiesForAutoConfigurationScript(pacScript, targetURL, &pacError); + if (!proxies) { + QString pacLocation = QCFString::toQString(cfPacLocation); + QCFType pacErrorDescription = CFErrorCopyDescription(pacError); + qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QCFString::toQString(pacErrorDescription))); + return result; + } + + CFIndex size = CFArrayGetCount(proxies); + for (CFIndex i = 0; i < size; ++i) { + CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(proxies, i); + result << proxyFromDictionary(proxy); + } + return result; + } else +#endif + { + QString pacLocation = QCFString::toQString(cfPacLocation); + qWarning("Mac system proxy: PAC script at \"%s\" not handled", qPrintable(pacLocation)); + } } } diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index f67ab5f25dd..195cbdf7c7e 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -213,6 +213,9 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_flushWriteBuffer()) Q_PRIVATE_SLOT(d_func(), void _q_flushReadBuffer()) Q_PRIVATE_SLOT(d_func(), void _q_resumeImplementation()) +#ifdef Q_OS_WIN + Q_PRIVATE_SLOT(d_func(), void _q_caRootLoaded(QSslCertificate,QSslCertificate)) +#endif friend class QSslSocketBackendPrivate; }; diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index df60a0fccee..44d579995bd 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) #define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0; PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0; @@ -612,7 +612,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded() resetDefaultCiphers(); //load symbols needed to receive certificates from system store -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security"); if (securityLib.load()) { ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData"); @@ -661,6 +661,15 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded() // if on-demand loading was not enabled, load the certs now if (!s_loadRootCertsOnDemand) setDefaultCaCertificates(systemCaCertificates()); +#ifdef Q_OS_WIN + //Enabled for fetching additional root certs from windows update on windows 6+ + //This flag is set false by setDefaultCaCertificates() indicating the app uses + //its own cert bundle rather than the system one. + //Same logic that disables the unix on demand cert loading. + //Unlike unix, we do preload the certificates from the cert store. + if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0) + s_loadRootCertsOnDemand = true; +#endif } /*! @@ -736,7 +745,7 @@ QList QSslSocketPrivate::systemCaCertificates() timer.start(); #endif QList systemCerts; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) CFArrayRef cfCerts; OSStatus status = 1; @@ -1221,22 +1230,28 @@ bool QSslSocketBackendPrivate::startHandshake() if (!errors.isEmpty()) { sslErrors = errors; - emit q->sslErrors(errors); - bool doEmitSslError = !verifyErrorsHaveBeenIgnored(); - // check whether we need to emit an SSL handshake error - if (doVerifyPeer && doEmitSslError) { - if (q->pauseMode() & QAbstractSocket::PauseOnNotify) { - pauseSocketNotifiers(q); - paused = true; - } else { - q->setErrorString(sslErrors.first().errorString()); - q->setSocketError(QAbstractSocket::SslHandshakeFailedError); - emit q->error(QAbstractSocket::SslHandshakeFailedError); - plainSocket->disconnectFromHost(); +#ifdef Q_OS_WIN + //Skip this if not using system CAs, or if the SSL errors are configured in advance to be ignorable + if (s_loadRootCertsOnDemand + && allowRootCertOnDemandLoading + && !verifyErrorsHaveBeenIgnored()) { + //Windows desktop versions starting from vista ship with minimal set of roots + //and download on demand from the windows update server CA roots that are + //trusted by MS. + //However, this is only transparent if using WinINET - we have to trigger it + //ourselves. + for (int i=0; i< sslErrors.count(); i++) { + if (sslErrors.at(i).error() == QSslError::UnableToGetLocalIssuerCertificate) { + fetchCaRootForCert(sslErrors.at(i).certificate()); + return false; + } } - return false; } +#endif + + if (!checkSslErrors()) + return false; } else { sslErrors.clear(); } @@ -1245,6 +1260,201 @@ bool QSslSocketBackendPrivate::startHandshake() return true; } +bool QSslSocketBackendPrivate::checkSslErrors() +{ + Q_Q(QSslSocket); + if (sslErrors.isEmpty()) + return true; + + emit q->sslErrors(sslErrors); + + bool doVerifyPeer = configuration.peerVerifyMode == QSslSocket::VerifyPeer + || (configuration.peerVerifyMode == QSslSocket::AutoVerifyPeer + && mode == QSslSocket::SslClientMode); + bool doEmitSslError = !verifyErrorsHaveBeenIgnored(); + // check whether we need to emit an SSL handshake error + if (doVerifyPeer && doEmitSslError) { + if (q->pauseMode() & QAbstractSocket::PauseOnNotify) { + pauseSocketNotifiers(q); + paused = true; + } else { + q->setErrorString(sslErrors.first().errorString()); + q->setSocketError(QAbstractSocket::SslHandshakeFailedError); + emit q->error(QAbstractSocket::SslHandshakeFailedError); + plainSocket->disconnectFromHost(); + } + return false; + } + return true; +} + +#ifdef Q_OS_WIN + +void QSslSocketBackendPrivate::fetchCaRootForCert(const QSslCertificate &cert) +{ + Q_Q(QSslSocket); + //The root certificate is downloaded from windows update, which blocks for 15 seconds in the worst case + //so the request is done in a worker thread. + QWindowsCaRootFetcher *fetcher = new QWindowsCaRootFetcher(cert, mode); + QObject::connect(fetcher, SIGNAL(finished(QSslCertificate,QSslCertificate)), q, SLOT(_q_caRootLoaded(QSslCertificate,QSslCertificate)), Qt::QueuedConnection); + QMetaObject::invokeMethod(fetcher, "start", Qt::QueuedConnection); + pauseSocketNotifiers(q); + paused = true; +} + +//This is the callback from QWindowsCaRootFetcher, trustedRoot will be invalid (default constructed) if it failed. +void QSslSocketBackendPrivate::_q_caRootLoaded(QSslCertificate cert, QSslCertificate trustedRoot) +{ + Q_Q(QSslSocket); + if (trustedRoot.isValid()) { + if (s_loadRootCertsOnDemand) { + //Add the new root cert to default cert list for use by future sockets + QSslSocket::addDefaultCaCertificate(trustedRoot); + } + //Add the new root cert to this socket for future connections + q->addCaCertificate(trustedRoot); + //Remove the broken chain ssl errors (as chain is verified by windows) + for (int i=sslErrors.count() - 1; i >= 0; --i) { + if (sslErrors.at(i).certificate() == cert) { + switch (sslErrors.at(i).error()) { + case QSslError::UnableToGetLocalIssuerCertificate: + case QSslError::CertificateUntrusted: + case QSslError::UnableToVerifyFirstCertificate: + // error can be ignored if OS says the chain is trusted + sslErrors.removeAt(i); + break; + default: + // error cannot be ignored + break; + } + } + } + } + // Continue with remaining errors + if (plainSocket) + plainSocket->resume(); + paused = false; + if (checkSslErrors()) + continueHandshake(); +} + +Q_DECLARE_METATYPE(QSslCertificate); + +class QWindowsCaRootFetcherThread : public QThread +{ +public: + QWindowsCaRootFetcherThread() + { + qRegisterMetaType(); + setObjectName(QStringLiteral("QWindowsCaRootFetcher")); + start(); + } + ~QWindowsCaRootFetcherThread() + { + quit(); + wait(15500); // worst case, a running request can block for 15 seconds + } +}; + +Q_GLOBAL_STATIC(QWindowsCaRootFetcherThread, windowsCaRootFetcherThread); + +QWindowsCaRootFetcher::QWindowsCaRootFetcher(const QSslCertificate &certificate, QSslSocket::SslMode sslMode) + : cert(certificate), mode(sslMode) +{ + moveToThread(windowsCaRootFetcherThread()); +} + +QWindowsCaRootFetcher::~QWindowsCaRootFetcher() +{ +} + +void QWindowsCaRootFetcher::start() +{ + QByteArray der = cert.toDer(); + PCCERT_CONTEXT wincert = CertCreateCertificateContext(X509_ASN_ENCODING, (const BYTE *)der.constData(), der.length()); + if (!wincert) { +#ifdef QSSLSOCKET_DEBUG + qDebug("QWindowsCaRootFetcher failed to convert certificate to windows form"); +#endif + emit finished(cert, QSslCertificate()); + deleteLater(); + return; + } + + CERT_CHAIN_PARA parameters; + memset(¶meters, 0, sizeof(parameters)); + parameters.cbSize = sizeof(parameters); + // set key usage constraint + parameters.RequestedUsage.dwType = USAGE_MATCH_TYPE_AND; + parameters.RequestedUsage.Usage.cUsageIdentifier = 1; + LPSTR oid = (mode == QSslSocket::SslClientMode ? szOID_PKIX_KP_SERVER_AUTH : szOID_PKIX_KP_CLIENT_AUTH); + parameters.RequestedUsage.Usage.rgpszUsageIdentifier = &oid; + +#ifdef QSSLSOCKET_DEBUG + QElapsedTimer stopwatch; + stopwatch.start(); +#endif + PCCERT_CHAIN_CONTEXT chain; + BOOL result = CertGetCertificateChain( + 0, //default engine + wincert, + 0, //current date/time + 0, //default store + ¶meters, + 0, //default dwFlags + 0, //reserved + &chain); +#ifdef QSSLSOCKET_DEBUG + qDebug() << "QWindowsCaRootFetcher" << stopwatch.elapsed() << "ms to get chain"; +#endif + + QSslCertificate trustedRoot; + if (result) { +#ifdef QSSLSOCKET_DEBUG + qDebug() << "QWindowsCaRootFetcher - examining windows chains"; + if (chain->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR) + qDebug() << " - TRUSTED"; + else + qDebug() << " - NOT TRUSTED" << chain->TrustStatus.dwErrorStatus; + if (chain->TrustStatus.dwInfoStatus & CERT_TRUST_IS_SELF_SIGNED) + qDebug() << " - SELF SIGNED"; + qDebug() << "QSslSocketBackendPrivate::fetchCaRootForCert - dumping simple chains"; + for (unsigned int i = 0; i < chain->cChain; i++) { + if (chain->rgpChain[i]->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR) + qDebug() << " - TRUSTED SIMPLE CHAIN" << i; + else + qDebug() << " - UNTRUSTED SIMPLE CHAIN" << i << "reason:" << chain->rgpChain[i]->TrustStatus.dwErrorStatus; + for (unsigned int j = 0; j < chain->rgpChain[i]->cElement; j++) { + QSslCertificate foundCert(QByteArray((const char *)chain->rgpChain[i]->rgpElement[j]->pCertContext->pbCertEncoded + , chain->rgpChain[i]->rgpElement[j]->pCertContext->cbCertEncoded), QSsl::Der); + qDebug() << " - " << foundCert; + } + } + qDebug() << " - and" << chain->cLowerQualityChainContext << "low quality chains"; //expect 0, we haven't asked for them +#endif + + //based on http://msdn.microsoft.com/en-us/library/windows/desktop/aa377182%28v=vs.85%29.aspx + //about the final chain rgpChain[cChain-1] which must begin with a trusted root to be valid + if (chain->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR + && chain->cChain > 0) { + const PCERT_SIMPLE_CHAIN finalChain = chain->rgpChain[chain->cChain - 1]; + // http://msdn.microsoft.com/en-us/library/windows/desktop/aa377544%28v=vs.85%29.aspx + // rgpElement[0] is the end certificate chain element. rgpElement[cElement-1] is the self-signed "root" certificate element. + if (finalChain->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR + && finalChain->cElement > 0) { + trustedRoot = QSslCertificate(QByteArray((const char *)finalChain->rgpElement[finalChain->cElement - 1]->pCertContext->pbCertEncoded + , finalChain->rgpElement[finalChain->cElement - 1]->pCertContext->cbCertEncoded), QSsl::Der); + } + } + CertFreeCertificateChain(chain); + } + CertFreeCertificateContext(wincert); + + emit finished(cert, trustedRoot); + deleteLater(); +} +#endif + void QSslSocketBackendPrivate::disconnectFromHost() { if (ssl) { diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index b31eae9c97d..deeceb8d85b 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -117,6 +117,11 @@ public: void disconnected(); QSslCipher sessionCipher() const; void continueHandshake(); + bool checkSslErrors(); +#ifdef Q_OS_WIN + void fetchCaRootForCert(const QSslCertificate &cert); + void _q_caRootLoaded(QSslCertificate,QSslCertificate); +#endif Q_AUTOTEST_EXPORT static long setupOpenSslOptions(QSsl::SslProtocol protocol, QSsl::SslOptions sslOptions); static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher); @@ -127,6 +132,23 @@ public: static QString getErrorsFromOpenSsl(); }; +#ifdef Q_OS_WIN +class QWindowsCaRootFetcher : public QObject +{ + Q_OBJECT; +public: + QWindowsCaRootFetcher(const QSslCertificate &certificate, QSslSocket::SslMode sslMode); + ~QWindowsCaRootFetcher(); +public slots: + void start(); +signals: + void finished(QSslCertificate brokenChain, QSslCertificate caroot); +private: + QSslCertificate cert; + QSslSocket::SslMode mode; +}; +#endif + QT_END_NAMESPACE #endif diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 44114481df9..aab29a84ba5 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -69,9 +69,11 @@ QT_BEGIN_NAMESPACE #if defined(Q_OS_MAC) #include #include +#ifndef QT_NO_CORESERVICES typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR); typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*); typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*); +#endif #elif defined(Q_OS_WIN) #include #include @@ -134,7 +136,7 @@ public: static void addDefaultCaCertificate(const QSslCertificate &cert); static void addDefaultCaCertificates(const QList &certs); -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static PtrSecCertificateGetData ptrSecCertificateGetData; static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates; static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates; @@ -160,6 +162,9 @@ public: void _q_flushWriteBuffer(); void _q_flushReadBuffer(); void _q_resumeImplementation(); +#ifdef Q_OS_WIN + virtual void _q_caRootLoaded(QSslCertificate,QSslCertificate) = 0; +#endif // Platform specific functions virtual void startClientEncryption() = 0; diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 87bcc9378a2..c81e461d3f3 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -28,4 +28,6 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { # Add optional SSL libs LIBS_PRIVATE += $$OPENSSL_LIBS + + windows:LIBS += -lcrypt32 } diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index caa5b96cdc9..031bdf3317a 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -59,25 +59,26 @@ QT_BEGIN_HEADER #endif #if defined(Q_OS_MAC) +# if !defined(QT_NO_CORESERVICES) # include -#elif defined(QT_OPENGL_ES_2) -# if defined(Q_OS_MAC) -# include # else -# include +# if defined(QT_OPENGL_ES_2) +# include +# endif # endif +#elif defined(QT_OPENGL_ES_2) +# include +# else +# include +# endif + +#if defined(QT_OPENGL_ES_2) # ifndef GL_DOUBLE # define GL_DOUBLE GL_FLOAT # endif # ifndef GLdouble typedef GLfloat GLdouble; # endif -#else -# if defined(Q_OS_MAC) -# include -# else -# include -# endif #endif QT_BEGIN_NAMESPACE @@ -277,7 +278,6 @@ public: QGLFormat requestedFormat() const; void setFormat(const QGLFormat& format); - // ### Qt 5: return bools + maybe remove virtuals virtual void makeCurrent(); virtual void doneCurrent(); @@ -340,7 +340,7 @@ protected: void setWindowCreated(bool on); bool initialized() const; void setInitialized(bool on); - void generateFontDisplayLists(const QFont & fnt, int listBase); // ### Qt 5: remove + void generateFontDisplayLists(const QFont & fnt, int listBase); uint colorIndex(const QColor& c) const; void setValid(bool valid); @@ -402,7 +402,6 @@ public: bool isValid() const; bool isSharing() const; - // ### Qt 5: return bools void makeCurrent(); void doneCurrent(); @@ -474,7 +473,7 @@ protected: virtual void glInit(); virtual void glDraw(); - int fontDisplayListBase(const QFont & fnt, int listBase = 2000); // ### Qt 5: remove + int fontDisplayListBase(const QFont & fnt, int listBase = 2000); QGLWidget(QGLWidgetPrivate &dd, const QGLFormat &format = QGLFormat(), diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 86645fd5c17..fb503a31f19 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -402,7 +402,6 @@ private slots: } }; -// ### make QGLContext a QObject in 5.0 and remove the proxy stuff class Q_OPENGL_EXPORT QGLSignalProxy : public QObject { Q_OBJECT diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h index da3ce7db4d3..0cb0b712bab 100644 --- a/src/opengl/qglfunctions.h +++ b/src/opengl/qglfunctions.h @@ -43,9 +43,11 @@ #define QGLFUNCTIONS_H #ifdef __GLEW_H__ +#if defined(Q_CC_GNU) #warning qglfunctions.h is not compatible with GLEW, GLEW defines will be undefined #warning To use GLEW with Qt, do not include or after glew.h #endif +#endif #include #include diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 66a97a2ea56..dc77c0fbbb7 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -76,8 +76,7 @@ void QGLPaintDevice::beginPaint() { // Make sure our context is the current one: QGLContext *ctx = context(); - if (ctx != QGLContext::currentContext()) - ctx->makeCurrent(); + ctx->makeCurrent(); // Record the currently bound FBO so we can restore it again // in endPaint() and bind this device's FBO diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index 5c57457e87b..325f5c5770b 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -89,6 +89,18 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format) attrs.append(NSOpenGLPFADoubleBuffer); + if (format.profile() == QSurfaceFormat::CoreProfile) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if ((format.majorVersion() == 3 && format.minorVersion() >= 2) + || format.majorVersion() > 3 ) { + attrs << NSOpenGLPFAOpenGLProfile; + attrs << NSOpenGLProfileVersion3_2Core; + } +#else + qWarning("Mac OSX >= 10.7 is needed for OpenGL Core Profile support"); +#endif + } + if (format.depthBufferSize() > 0) attrs << NSOpenGLPFADepthSize << format.depthBufferSize(); if (format.stencilBufferSize() > 0) diff --git a/src/platformsupport/cglconvenience/cglconvenience.pri b/src/platformsupport/cglconvenience/cglconvenience.pri index a367e4d0536..d4c149404fd 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.pri +++ b/src/platformsupport/cglconvenience/cglconvenience.pri @@ -1,4 +1,4 @@ -mac { +mac:contains(QT_CONFIG, coreservices) { INCLUDEPATH += $$PWD HEADERS += \ diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri index f8500e2de0a..db3ec206856 100644 --- a/src/platformsupport/eglconvenience/eglconvenience.pri +++ b/src/platformsupport/eglconvenience/eglconvenience.pri @@ -1,10 +1,12 @@ contains(QT_CONFIG,opengles2) { - HEADERS += \ - $$PWD/qeglconvenience_p.h \ - $$PWD/qeglplatformcontext_p.h - SOURCES += \ - $$PWD/qeglconvenience.cpp \ - $$PWD/qeglplatformcontext.cpp + contains(QT_CONFIG,egl) { + HEADERS += \ + $$PWD/qeglconvenience_p.h \ + $$PWD/qeglplatformcontext_p.h + SOURCES += \ + $$PWD/qeglconvenience.cpp \ + $$PWD/qeglplatformcontext.cpp + } contains(QT_CONFIG,xlib) { HEADERS += \ diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index bf05433b226..9ad9b96d150 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -291,8 +291,15 @@ static const char *getFcFamilyForStyleHint(const QFont::StyleHint style) stylehint = "serif"; break; case QFont::TypeWriter: + case QFont::Monospace: stylehint = "monospace"; break; + case QFont::Cursive: + stylehint = "cursive"; + break; + case QFont::Fantasy: + stylehint = "fantasy"; + break; default: break; } diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index c42320889a8..a774a6940ed 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -39,8 +39,10 @@ ** ****************************************************************************/ +#ifndef QT_NO_CORESERVICES #import #import +#endif #include "qcoretextfontdatabase_p.h" #include "qfontengine_coretext_p.h" @@ -118,6 +120,7 @@ static NSInteger languageMapSort(id obj1, id obj2, void *context) QCoreTextFontDatabase::QCoreTextFontDatabase() { +#ifndef QT_NO_CORESERVICES QSettings appleSettings(QLatin1String("apple.com")); QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold")); if (appleValue.isValid()) @@ -152,6 +155,9 @@ QCoreTextFontDatabase::QCoreTextFontDatabase() QCoreTextFontEngine::defaultGlyphFormat = (font_smoothing > 0 ? QFontEngineGlyphCache::Raster_RGBMask : QFontEngineGlyphCache::Raster_A8); +#else + QCoreTextFontEngine::defaultGlyphFormat = QFontEngineGlyphCache::Raster_A8; +#endif } QCoreTextFontDatabase::~QCoreTextFontDatabase() @@ -342,6 +348,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString family, cons return fallbackLists[styleHint]; } +#ifndef QT_NO_CORESERVICES OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref); QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName) { @@ -382,6 +389,7 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData return QStringList(); } +#endif QFont QCoreTextFontDatabase::defaultFont() const { @@ -393,5 +401,16 @@ QFont QCoreTextFontDatabase::defaultFont() const return QFont(defaultFontName); } +QList QCoreTextFontDatabase::standardSizes() const +{ + QList ret; + static const unsigned short standard[] = + { 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, 64, 72, 96, 144, 288, 0 }; + ret.reserve(int(sizeof(standard) / sizeof(standard[0]))); + const unsigned short *sizes = standard; + while (*sizes) ret << *sizes++; + return ret; +} + QT_END_NAMESPACE diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index adcfeebf0b6..cbe1b28db8a 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -55,9 +55,13 @@ public: QFontEngine *fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle); QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference); QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const; +#ifndef QT_NO_CORESERVICES QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); +#endif void releaseHandle(void *handle); QFont defaultFont() const; + QList standardSizes() const; + private: mutable QString defaultFontName; QHash fallbackLists; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index a02361be21f..df6becc5e35 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -413,7 +413,11 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32); im.fill(0); +#ifndef QT_NO_CORESERVICES CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); +#else + CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); +#endif uint cgflags = kCGImageAlphaNoneSkipFirst; #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version cgflags |= kCGBitmapByteOrder32Host; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index 3d286c86252..e1435c8b632 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -44,7 +44,13 @@ #include #include + +#ifndef QT_NO_CORESERVICES #include +#else +#include +#include +#endif #if !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp index a2fe2cb7fd2..c0a8ec42863 100644 --- a/src/plugins/accessible/widgets/itemviews.cpp +++ b/src/plugins/accessible/widgets/itemviews.cpp @@ -67,6 +67,12 @@ TABLE/LIST/TREE ... */ + +QAbstractItemView *QAccessibleTable::view() const +{ + return qobject_cast(object()); +} + int QAccessibleTable::logicalIndex(const QModelIndex &index) const { if (!index.isValid()) @@ -79,11 +85,14 @@ int QAccessibleTable::logicalIndex(const QModelIndex &index) const QAccessibleInterface *QAccessibleTable::childFromLogical(int logicalIndex) const { + if (!isValid()) + return 0; + logicalIndex--; // one based counting ftw int vHeader = verticalHeader() ? 1 : 0; int hHeader = horizontalHeader() ? 1 : 0; - int columns = view->model()->columnCount() + vHeader; + int columns = view()->model()->columnCount() + vHeader; int row = logicalIndex / columns; int column = logicalIndex % columns; @@ -91,32 +100,31 @@ QAccessibleInterface *QAccessibleTable::childFromLogical(int logicalIndex) const if (vHeader) { if (column == 0) { if (row == 0) { - return new QAccessibleTableCornerButton(view); + return new QAccessibleTableCornerButton(view()); } - return new QAccessibleTableHeaderCell(view, row-1, Qt::Vertical); + return new QAccessibleTableHeaderCell(view(), row-1, Qt::Vertical); } --column; } if (hHeader) { if (row == 0) { - return new QAccessibleTableHeaderCell(view, column, Qt::Horizontal); + return new QAccessibleTableHeaderCell(view(), column, Qt::Horizontal); } --row; } - return new QAccessibleTableCell(view, view->model()->index(row, column), cellRole()); + return new QAccessibleTableCell(view(), view()->model()->index(row, column), cellRole()); } QAccessibleTable::QAccessibleTable(QWidget *w) : QAccessibleObject(w) { - view = qobject_cast(w); - Q_ASSERT(view); + Q_ASSERT(view()); - if (qobject_cast(view)) { + if (qobject_cast(view())) { m_role = QAccessible::Table; - } else if (qobject_cast(view)) { + } else if (qobject_cast(view())) { m_role = QAccessible::Tree; - } else if (qobject_cast(view)) { + } else if (qobject_cast(view())) { m_role = QAccessible::List; } else { // is this our best guess? @@ -133,11 +141,11 @@ QHeaderView *QAccessibleTable::horizontalHeader() const QHeaderView *header = 0; if (false) { #ifndef QT_NO_TABLEVIEW - } else if (const QTableView *tv = qobject_cast(view)) { + } else if (const QTableView *tv = qobject_cast(view())) { header = tv->horizontalHeader(); #endif #ifndef QT_NO_TREEVIEW - } else if (const QTreeView *tv = qobject_cast(view)) { + } else if (const QTreeView *tv = qobject_cast(view())) { header = tv->header(); #endif } @@ -149,7 +157,7 @@ QHeaderView *QAccessibleTable::verticalHeader() const QHeaderView *header = 0; if (false) { #ifndef QT_NO_TABLEVIEW - } else if (const QTableView *tv = qobject_cast(view)) { + } else if (const QTableView *tv = qobject_cast(view())) { header = tv->verticalHeader(); #endif } @@ -159,16 +167,16 @@ QHeaderView *QAccessibleTable::verticalHeader() const QAccessibleTableCell *QAccessibleTable::cell(const QModelIndex &index) const { if (index.isValid()) - return new QAccessibleTableCell(view, index, cellRole()); + return new QAccessibleTableCell(view(), index, cellRole()); return 0; } QAccessibleInterface *QAccessibleTable::cellAt(int row, int column) const { Q_ASSERT(role() != QAccessible::Tree); - QModelIndex index = view->model()->index(row, column); + QModelIndex index = view()->model()->index(row, column); if (!index.isValid()) { - qWarning() << "QAccessibleTable::cellAt: invalid index: " << index << " for " << view; + qWarning() << "QAccessibleTable::cellAt: invalid index: " << index << " for " << view(); return 0; } return cell(index); @@ -181,43 +189,43 @@ QAccessibleInterface *QAccessibleTable::caption() const QString QAccessibleTable::columnDescription(int column) const { - return view->model()->headerData(column, Qt::Horizontal).toString(); + return view()->model()->headerData(column, Qt::Horizontal).toString(); } int QAccessibleTable::columnCount() const { - return view->model()->columnCount(); + return view()->model()->columnCount(); } int QAccessibleTable::rowCount() const { - return view->model()->rowCount(); + return view()->model()->rowCount(); } int QAccessibleTable::selectedCellCount() const { - return view->selectionModel()->selectedIndexes().count(); + return view()->selectionModel()->selectedIndexes().count(); } int QAccessibleTable::selectedColumnCount() const { - return view->selectionModel()->selectedColumns().count(); + return view()->selectionModel()->selectedColumns().count(); } int QAccessibleTable::selectedRowCount() const { - return view->selectionModel()->selectedRows().count(); + return view()->selectionModel()->selectedRows().count(); } QString QAccessibleTable::rowDescription(int row) const { - return view->model()->headerData(row, Qt::Vertical).toString(); + return view()->model()->headerData(row, Qt::Vertical).toString(); } QList QAccessibleTable::selectedCells() const { QList cells; - Q_FOREACH (const QModelIndex &index, view->selectionModel()->selectedIndexes()) { + Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedIndexes()) { cells.append(cell(index)); } return cells; @@ -226,7 +234,7 @@ QList QAccessibleTable::selectedCells() const QList QAccessibleTable::selectedColumns() const { QList columns; - Q_FOREACH (const QModelIndex &index, view->selectionModel()->selectedColumns()) { + Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedColumns()) { columns.append(index.column()); } return columns; @@ -235,7 +243,7 @@ QList QAccessibleTable::selectedColumns() const QList QAccessibleTable::selectedRows() const { QList rows; - Q_FOREACH (const QModelIndex &index, view->selectionModel()->selectedRows()) { + Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedRows()) { rows.append(index.row()); } return rows; @@ -248,47 +256,47 @@ QAccessibleInterface *QAccessibleTable::summary() const bool QAccessibleTable::isColumnSelected(int column) const { - return view->selectionModel()->isColumnSelected(column, QModelIndex()); + return view()->selectionModel()->isColumnSelected(column, QModelIndex()); } bool QAccessibleTable::isRowSelected(int row) const { - return view->selectionModel()->isRowSelected(row, QModelIndex()); + return view()->selectionModel()->isRowSelected(row, QModelIndex()); } bool QAccessibleTable::selectRow(int row) { - QModelIndex index = view->model()->index(row, 0); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(row, 0); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Select); + view()->selectionModel()->select(index, QItemSelectionModel::Select); return true; } bool QAccessibleTable::selectColumn(int column) { - QModelIndex index = view->model()->index(0, column); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(0, column); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Select); + view()->selectionModel()->select(index, QItemSelectionModel::Select); return true; } bool QAccessibleTable::unselectRow(int row) { - QModelIndex index = view->model()->index(row, 0); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(row, 0); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Deselect); + view()->selectionModel()->select(index, QItemSelectionModel::Deselect); return true; } bool QAccessibleTable::unselectColumn(int column) { - QModelIndex index = view->model()->index(0, column); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(0, column); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect); + view()->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect); return true; } @@ -304,11 +312,11 @@ QAccessible::State QAccessibleTable::state() const QAccessibleInterface *QAccessibleTable::childAt(int x, int y) const { - QPoint viewportOffset = view->viewport()->mapTo(view, QPoint(0,0)); - QPoint indexPosition = view->mapFromGlobal(QPoint(x, y) - viewportOffset); + QPoint viewportOffset = view()->viewport()->mapTo(view(), QPoint(0,0)); + QPoint indexPosition = view()->mapFromGlobal(QPoint(x, y) - viewportOffset); // FIXME: if indexPosition < 0 in one coordinate, return header - QModelIndex index = view->indexAt(indexPosition); + QModelIndex index = view()->indexAt(indexPosition); if (index.isValid()) { return childFromLogical(logicalIndex(index)); } @@ -317,11 +325,11 @@ QAccessibleInterface *QAccessibleTable::childAt(int x, int y) const int QAccessibleTable::childCount() const { - if (!view->model()) + if (!view()->model()) return 0; int vHeader = verticalHeader() ? 1 : 0; int hHeader = horizontalHeader() ? 1 : 0; - return (view->model()->rowCount()+hHeader) * (view->model()->columnCount()+vHeader); + return (view()->model()->rowCount()+hHeader) * (view()->model()->columnCount()+vHeader); } int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const @@ -335,7 +343,7 @@ int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const return cell->index + (verticalHeader() ? 1 : 0); } else if (iface->role() == QAccessible::RowHeader){ const QAccessibleTableHeaderCell* cell = static_cast(iface); - return (cell->index+1) * (view->model()->rowCount()+1); + return (cell->index+1) * (view()->model()->rowCount()+1); } else if (iface->role() == QAccessible::Pane) { return 0; // corner button } else { @@ -349,25 +357,25 @@ int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const QString QAccessibleTable::text(QAccessible::Text t) const { if (t == QAccessible::Description) - return view->accessibleDescription(); - return view->accessibleName(); + return view()->accessibleDescription(); + return view()->accessibleName(); } QRect QAccessibleTable::rect() const { - if (!view->isVisible()) + if (!view()->isVisible()) return QRect(); - QPoint pos = view->mapToGlobal(QPoint(0, 0)); - return QRect(pos.x(), pos.y(), view->width(), view->height()); + QPoint pos = view()->mapToGlobal(QPoint(0, 0)); + return QRect(pos.x(), pos.y(), view()->width(), view()->height()); } QAccessibleInterface *QAccessibleTable::parent() const { - if (view->parent()) { - if (qstrcmp("QComboBoxPrivateContainer", view->parent()->metaObject()->className()) == 0) { - return QAccessible::queryAccessibleInterface(view->parent()->parent()); + if (view()->parent()) { + if (qstrcmp("QComboBoxPrivateContainer", view()->parent()->metaObject()->className()) == 0) { + return QAccessible::queryAccessibleInterface(view()->parent()->parent()); } - return QAccessible::queryAccessibleInterface(view->parent()); + return QAccessible::queryAccessibleInterface(view()->parent()); } return 0; } @@ -389,42 +397,45 @@ void *QAccessibleTable::interface_cast(QAccessible::InterfaceType t) QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const { - const QTreeView *treeView = qobject_cast(view); + if (!isValid()) + return QModelIndex(); + + const QTreeView *treeView = qobject_cast(view()); QModelIndex modelIndex = treeView->d_func()->viewItems.at(row).index; if (modelIndex.isValid() && column > 0) { - modelIndex = view->model()->index(modelIndex.row(), column, modelIndex.parent()); + modelIndex = view()->model()->index(modelIndex.row(), column, modelIndex.parent()); } return modelIndex; } QAccessibleInterface *QAccessibleTree::childAt(int x, int y) const { - QPoint viewportOffset = view->viewport()->mapTo(view, QPoint(0,0)); - QPoint indexPosition = view->mapFromGlobal(QPoint(x, y) - viewportOffset); + QPoint viewportOffset = view()->viewport()->mapTo(view(), QPoint(0,0)); + QPoint indexPosition = view()->mapFromGlobal(QPoint(x, y) - viewportOffset); - QModelIndex index = view->indexAt(indexPosition); + QModelIndex index = view()->indexAt(indexPosition); if (!index.isValid()) return 0; - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); int row = treeView->d_func()->viewIndex(index) + (horizontalHeader() ? 1 : 0); int column = index.column(); - int i = row * view->model()->columnCount() + column + 1; - Q_ASSERT(i > view->model()->columnCount()); + int i = row * view()->model()->columnCount() + column + 1; + Q_ASSERT(i > view()->model()->columnCount()); return child(i - 1); } int QAccessibleTree::childCount() const { - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); Q_ASSERT(treeView); - if (!view->model()) + if (!view()->model()) return 0; int hHeader = horizontalHeader() ? 1 : 0; - return (treeView->d_func()->viewItems.count() + hHeader)* view->model()->columnCount(); + return (treeView->d_func()->viewItems.count() + hHeader)* view()->model()->columnCount(); } @@ -434,15 +445,15 @@ QAccessibleInterface *QAccessibleTree::child(int index) const int hHeader = horizontalHeader() ? 1 : 0; if (hHeader) { - if (index < view->model()->columnCount()) { - return new QAccessibleTableHeaderCell(view, index, Qt::Horizontal); + if (index < view()->model()->columnCount()) { + return new QAccessibleTableHeaderCell(view(), index, Qt::Horizontal); } else { - index -= view->model()->columnCount(); + index -= view()->model()->columnCount(); } } - int row = index / view->model()->columnCount(); - int column = index % view->model()->columnCount(); + int row = index / view()->model()->columnCount(); + int column = index % view()->model()->columnCount(); QModelIndex modelIndex = indexFromLogical(row, column); if (modelIndex.isValid()) { return cell(modelIndex); @@ -452,7 +463,7 @@ QAccessibleInterface *QAccessibleTree::child(int index) const int QAccessibleTree::rowCount() const { - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); Q_ASSERT(treeView); return treeView->d_func()->viewItems.count(); } @@ -461,12 +472,12 @@ int QAccessibleTree::indexOfChild(const QAccessibleInterface *iface) const { if (iface->role() == QAccessible::TreeItem) { const QAccessibleTableCell* cell = static_cast(iface); - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); Q_ASSERT(treeView); int row = treeView->d_func()->viewIndex(cell->m_index) + (horizontalHeader() ? 1 : 0); int column = cell->m_index.column(); - int index = row * view->model()->columnCount() + column; + int index = row * view()->model()->columnCount() + column; //qDebug() << "QAccessibleTree::indexOfChild r " << row << " c " << column << "index " << index; Q_ASSERT(index >= treeView->model()->columnCount()); return index; @@ -489,7 +500,7 @@ QAccessibleInterface *QAccessibleTree::cellAt(int row, int column) const qWarning() << "Requested invalid tree cell: " << row << column; return 0; } - return new QAccessibleTableCell(view, index, cellRole()); + return new QAccessibleTableCell(view(), index, cellRole()); } QString QAccessibleTree::rowDescription(int) const @@ -500,15 +511,15 @@ QString QAccessibleTree::rowDescription(int) const bool QAccessibleTree::isRowSelected(int row) const { QModelIndex index = indexFromLogical(row); - return view->selectionModel()->isRowSelected(index.row(), index.parent()); + return view()->selectionModel()->isRowSelected(index.row(), index.parent()); } bool QAccessibleTree::selectRow(int row) { QModelIndex index = indexFromLogical(row); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Select); + view()->selectionModel()->select(index, QItemSelectionModel::Select); return true; } diff --git a/src/plugins/accessible/widgets/itemviews.h b/src/plugins/accessible/widgets/itemviews.h index 2672cd4a16f..1d42c511f0c 100644 --- a/src/plugins/accessible/widgets/itemviews.h +++ b/src/plugins/accessible/widgets/itemviews.h @@ -42,11 +42,12 @@ #ifndef ACCESSIBLE_ITEMVIEWS_H #define ACCESSIBLE_ITEMVIEWS_H -#include -#include +#include "QtCore/qpointer.h" #include #include #include +#include +#include QT_BEGIN_NAMESPACE @@ -65,7 +66,6 @@ public: virtual ~QAccessibleTable(); - QObject *object() const { return view; } QAccessible::Role role() const; QAccessible::State state() const; QString text(QAccessible::Text t) const; @@ -103,9 +103,11 @@ public: virtual bool unselectRow(int row); virtual bool unselectColumn(int column); + QAbstractItemView *view() const; + protected: - QAbstractItemView* view; inline QAccessibleTableCell *cell(const QModelIndex &index) const; + inline QAccessible::Role cellRole() const { switch (m_role) { case QAccessible::List: @@ -193,7 +195,7 @@ public: private: QHeaderView *verticalHeader() const; QHeaderView *horizontalHeader() const; - QAbstractItemView *view; + QPointer view; QModelIndex m_index; QAccessible::Role m_role; diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp index d3ca1629bd0..6009d25977d 100644 --- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp +++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp @@ -249,7 +249,7 @@ QAccessible::State QAccessibleMenuItem::state() const QAccessible::State s; QWidget *own = owner(); - if (own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) { + if (own && own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) { s.invisible = true; } @@ -262,7 +262,7 @@ QAccessible::State QAccessibleMenuItem::state() const s.focused = true; #endif } - if (own->style()->styleHint(QStyle::SH_Menu_MouseTracking)) + if (own && own->style()->styleHint(QStyle::SH_Menu_MouseTracking)) s.hotTracked = true; if (m_action->isSeparator() || !m_action->isEnabled()) s.disabled = true; diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index 82a514fb148..b60dac907c1 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -5,7 +5,7 @@ QT = core-private network-private LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { - isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk") { + !contains(QMAKE_MAC_SDK, ".*MacOSX10\\.[345]\\.sdk") { LIBS += -framework CoreWLAN -framework Security } } diff --git a/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro b/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro index 21e4bf63ee4..b632e5b7ec9 100644 --- a/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro +++ b/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro @@ -19,4 +19,6 @@ SOURCES = main.cpp \ OTHER_FILES += \ evdevkeyboard.json -LIBS += $$QMAKE_LIBS_LIBUDEV +contains(QT_CONFIG, libudev) { + LIBS += $$QMAKE_LIBS_LIBUDEV +} diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp index 73aa6419d36..eb29b853e78 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -168,16 +168,20 @@ void QEvdevKeyboardHandler::readKeycode() int n = 0; forever { - n = qt_safe_read(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + int result = qt_safe_read(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); - if (n == 0) { + if (result == 0) { qWarning("Got EOF from the input device."); return; - } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { - qWarning("Could not read from input device: %s", strerror(errno)); - return; - } else if (n % sizeof(buffer[0]) == 0) { - break; + } else if (result < 0) { + if (errno != EINTR && errno != EAGAIN) { + qWarning("Could not read from input device: %s", strerror(errno)); + return; + } + } else { + n += result; + if (n % sizeof(buffer[0]) == 0) + break; } } diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp index 0938fdc2e44..697556c4ac8 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp @@ -56,7 +56,11 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & { Q_UNUSED(key); +#ifndef QT_NO_LIBUDEV bool useUDev = true; +#else + bool useUDev = false; +#endif // QT_NO_LIBUDEV QStringList args = specification.split(QLatin1Char(':')); QStringList devices; @@ -77,6 +81,7 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & foreach (const QString &device, devices) addKeyboard(device); +#ifndef QT_NO_LIBUDEV if (useUDev) { #ifdef QT_QPA_KEYMAP_DEBUG qWarning() << "Use UDev for device discovery"; @@ -94,6 +99,7 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & connect(m_udeviceHelper, SIGNAL(deviceRemoved(QString,QUDeviceTypes)), this, SLOT(removeKeyboard(QString))); } } +#endif // QT_NO_LIBUDEV } QEvdevKeyboardManager::~QEvdevKeyboardManager() diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h index c776af2ec5f..a505ce834e7 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h @@ -44,7 +44,9 @@ #include "qevdevkeyboardhandler.h" +#ifndef QT_NO_LIBUDEV #include +#endif // QT_NO_LIBUDEV #include #include @@ -68,7 +70,9 @@ private slots: private: QString m_spec; QHash m_keyboards; +#ifndef QT_NO_LIBUDEV QUDeviceHelper *m_udeviceHelper; +#endif // QT_NO_LIBUDEV }; QT_END_HEADER diff --git a/src/plugins/generic/evdevmouse/evdevmouse.pro b/src/plugins/generic/evdevmouse/evdevmouse.pro index f322a5bd1a9..fb9c0e71b8e 100644 --- a/src/plugins/generic/evdevmouse/evdevmouse.pro +++ b/src/plugins/generic/evdevmouse/evdevmouse.pro @@ -17,4 +17,6 @@ SOURCES = main.cpp \ OTHER_FILES += \ evdevmouse.json -LIBS += $$QMAKE_LIBS_LIBUDEV +contains(QT_CONFIG, libudev) { + LIBS += $$QMAKE_LIBS_LIBUDEV +} diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp index 1821c2b06ba..5e2911a806e 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp @@ -48,7 +48,6 @@ #include #include // overrides QT_OPEN -#include #include @@ -146,16 +145,20 @@ void QEvdevMouseHandler::readMouseData() bool pendingMouseEvent = false; int eventCompressCount = 0; forever { - n = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + int result = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); - if (n == 0) { + if (result == 0) { qWarning("Got EOF from the input device."); return; - } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { - qWarning("Could not read from input device: %s", strerror(errno)); - return; - } else if (n % sizeof(buffer[0]) == 0) { - break; + } else if (result < 0) { + if (errno != EINTR && errno != EAGAIN) { + qWarning("Could not read from input device: %s", strerror(errno)); + return; + } + } else { + n += result; + if (n % sizeof(buffer[0]) == 0) + break; } } diff --git a/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp b/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp index f8e77abe558..2120b1540f6 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp @@ -56,7 +56,11 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif { Q_UNUSED(key); +#ifndef QT_NO_LIBUDEV bool useUDev = true; +#else + bool useUDev = false; +#endif // QT_NO_LIBUDEV QStringList args = specification.split(QLatin1Char(':')); QStringList devices; @@ -77,6 +81,9 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif foreach (const QString &device, devices) addMouse(device); +#ifdef QT_NO_LIBUDEV + Q_UNUSED(useUDev) +#else if (useUDev) { #ifdef QT_QPA_MOUSEMANAGER_DEBUG qWarning() << "Use UDev for device discovery"; @@ -94,6 +101,7 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif connect(m_udeviceHelper, SIGNAL(deviceRemoved(QString,QUDeviceTypes)), this, SLOT(removeMouse(QString))); } } +#endif // QT_NO_LIBUDEV } QEvdevMouseManager::~QEvdevMouseManager() diff --git a/src/plugins/generic/evdevmouse/qevdevmousemanager.h b/src/plugins/generic/evdevmouse/qevdevmousemanager.h index a42257b6a28..f51bd455e8d 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousemanager.h +++ b/src/plugins/generic/evdevmouse/qevdevmousemanager.h @@ -44,7 +44,9 @@ #include "qevdevmousehandler.h" +#ifndef QT_NO_LIBUDEV #include +#endif // QT_NO_LIBUDEV #include #include @@ -68,7 +70,9 @@ private slots: private: QString m_spec; QHash m_mice; +#ifndef QT_NO_LIBUDEV QUDeviceHelper *m_udeviceHelper; +#endif // QT_NO_LIBUDEV }; QT_END_HEADER diff --git a/src/plugins/generic/evdevtouch/evdevtouch.pro b/src/plugins/generic/evdevtouch/evdevtouch.pro index 192a87c2a39..c7d298d5347 100644 --- a/src/plugins/generic/evdevtouch/evdevtouch.pro +++ b/src/plugins/generic/evdevtouch/evdevtouch.pro @@ -16,7 +16,9 @@ QT += core-private platformsupport-private OTHER_FILES += \ evdevtouch.json -LIBS += $$QMAKE_LIBS_LIBUDEV +contains(QT_CONFIG, libudev) { + LIBS += $$QMAKE_LIBS_LIBUDEV +} # DEFINES += USE_MTDEV diff --git a/src/plugins/generic/evdevtouch/qevdevtouch.cpp b/src/plugins/generic/evdevtouch/qevdevtouch.cpp index b702807cabb..1c3e8952e96 100644 --- a/src/plugins/generic/evdevtouch/qevdevtouch.cpp +++ b/src/plugins/generic/evdevtouch/qevdevtouch.cpp @@ -46,7 +46,9 @@ #include #include #include +#ifndef QT_NO_LIBUDEV #include +#endif // QT_NO_LIBUDEV #include #ifdef USE_MTDEV @@ -147,6 +149,7 @@ QTouchScreenHandler::QTouchScreenHandler(const QString &spec) QString dev; +#ifndef QT_NO_LIBUDEV // try to let udev scan for already connected devices QScopedPointer udeviceHelper(QUDeviceHelper::createUDeviceHelper(QUDeviceHelper::UDev_Touchpad | QUDeviceHelper::UDev_Touchscreen, this)); if (udeviceHelper) { @@ -156,6 +159,7 @@ QTouchScreenHandler::QTouchScreenHandler(const QString &spec) if (devices.size() > 0) dev = devices[0]; } +#endif // QT_NO_LIBUDEV if (dev.isEmpty()) dev = QLatin1String("/dev/input/event0"); @@ -249,26 +253,30 @@ void QTouchScreenHandler::readData() int n = 0; for (; ;) { #ifdef USE_MTDEV - n = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); - if (n > 0) - n *= sizeof(::input_event); + int result = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); + if (result > 0) + result *= sizeof(::input_event); #else - n = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + int result = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); #endif - if (!n) { + if (!result) { qWarning("Got EOF from input device"); return; - } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { - qWarning("Could not read from input device: %s", strerror(errno)); - if (errno == ENODEV) { // device got disconnected -> stop reading - delete m_notify; - m_notify = 0; - QT_CLOSE(m_fd); - m_fd = -1; + } else if (result < 0) { + if (errno != EINTR && errno != EAGAIN) { + qWarning("Could not read from input device: %s", strerror(errno)); + if (errno == ENODEV) { // device got disconnected -> stop reading + delete m_notify; + m_notify = 0; + QT_CLOSE(m_fd); + m_fd = -1; + } + return; } - return; - } else if (n % sizeof(::input_event) == 0) { - break; + } else { + n += result; + if (n % sizeof(::input_event) == 0) + break; } } diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro index 06bc0091f48..86b529b39ef 100644 --- a/src/plugins/generic/generic.pro +++ b/src/plugins/generic/generic.pro @@ -3,7 +3,5 @@ TEMPLATE = subdirs linux-g++-maemo: SUBDIRS += meego contains(QT_CONFIG, evdev) { - contains(QT_CONFIG, libudev) { - SUBDIRS += evdevmouse evdevtouch evdevkeyboard - } + SUBDIRS += evdevmouse evdevtouch evdevkeyboard } diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index 2ae39dd16cb..f149a6775bc 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -36,6 +36,7 @@ OBJECTIVE_SOURCES += main.mm \ qpaintengine_mac.mm \ qprintengine_mac.mm \ qcocoaprintersupport.mm \ + qcocoaservices.mm \ HEADERS += qcocoaintegration.h \ qcocoatheme.h \ @@ -69,6 +70,7 @@ HEADERS += qcocoaintegration.h \ qpaintengine_mac_p.h \ qprintengine_mac_p.h \ qcocoaprintersupport.h \ + qcocoaservices.h \ FORMS += $$PWD/../../../widgets/dialogs/qfiledialog.ui RESOURCES += qcocoaresources.qrc diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index fd4d6605a97..405cacee01c 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -395,6 +395,8 @@ void QCocoaColorDialogHelper::hide_sys() QCocoaColorDialogHelper::DialogCode QCocoaColorDialogHelper::dialogResultCode_sys() { + if (!mDelegate) + return QPlatformDialogHelper::Rejected; QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast(mDelegate); return [delegate dialogResultCode]; } @@ -429,6 +431,8 @@ void QCocoaColorDialogHelper::setCurrentColor_sys(const QColor &color) QColor QCocoaColorDialogHelper::currentColor_sys() const { + if (!mDelegate) + return QColor(); return reinterpret_cast(mDelegate)->mQtColor; } diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index d05a0156b13..1e892707753 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -414,6 +414,8 @@ void QCocoaFontDialogHelper::hide_sys() QCocoaFontDialogHelper::DialogCode QCocoaFontDialogHelper::dialogResultCode_sys() { + if (!mDelegate) + return QPlatformDialogHelper::Rejected; QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *delegate = static_cast(mDelegate); return [delegate dialogResultCode]; } @@ -448,6 +450,8 @@ void QCocoaFontDialogHelper::setCurrentFont_sys(const QFont &font) QFont QCocoaFontDialogHelper::currentFont_sys() const { + if (!mDelegate) + return QFont(); return reinterpret_cast(mDelegate)->mQtFont; } diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index fb3ee3290e3..a001b6234a0 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -48,6 +48,7 @@ #include "qcocoacursor.h" #include "qcocoaclipboard.h" #include "qcocoadrag.h" +#include "qcocoaservices.h" #include #include @@ -99,6 +100,7 @@ public: QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; + QPlatformServices *services() const; private: @@ -111,6 +113,8 @@ private: QList mScreens; QCocoaClipboard *mCocoaClipboard; QScopedPointer mCocoaDrag; + QScopedPointer mNativeInterface; + QScopedPointer mServices; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index f91351ad467..0b87773deeb 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -99,6 +99,8 @@ QCocoaIntegration::QCocoaIntegration() , mAccessibility(new QPlatformAccessibility) , mCocoaClipboard(new QCocoaClipboard) , mCocoaDrag(new QCocoaDrag) + , mNativeInterface(new QCocoaNativeInterface) + , mServices(new QCocoaServices) { QCocoaAutoReleasePool pool; @@ -204,7 +206,7 @@ QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const QPlatformNativeInterface *QCocoaIntegration::nativeInterface() const { - return new QCocoaNativeInterface(); + return mNativeInterface.data(); } QPlatformInputContext *QCocoaIntegration::inputContext() const @@ -239,4 +241,9 @@ QPlatformTheme *QCocoaIntegration::createPlatformTheme(const QString &name) cons return QPlatformIntegration::createPlatformTheme(name); } +QPlatformServices *QCocoaIntegration::services() const +{ + return mServices.data(); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.h b/src/plugins/platforms/cocoa/qcocoamenuloader.h index 128792410b5..b0d61fa5415 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.h +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.h @@ -88,6 +88,7 @@ - (IBAction)qtDispatcherToQAction:(id)sender; - (void)qtUpdateMenubar; - (void)orderFrontCharacterPalette:(id)sender; +- (BOOL)validateMenuItem:(NSMenuItem*)menuItem; @end void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader); diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm index 4993937b91a..2fdc28de1e0 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm @@ -310,4 +310,16 @@ void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader) { [NSApp orderFrontCharacterPalette:sender]; } + +- (BOOL)validateMenuItem:(NSMenuItem*)menuItem +{ + if ([menuItem action] == @selector(hide:) + || [menuItem action] == @selector(hideOtherApplications:) + || [menuItem action] == @selector(unhideAllApplications:)) { + return [NSApp validateMenuItem:menuItem]; + } else { + return [menuItem isEnabled]; + } +} + @end diff --git a/src/plugins/platforms/cocoa/qcocoaservices.h b/src/plugins/platforms/cocoa/qcocoaservices.h new file mode 100644 index 00000000000..022c39dc57c --- /dev/null +++ b/src/plugins/platforms/cocoa/qcocoaservices.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOCOADESKTOPSERVICES_H +#define QCOCOADESKTOPSERVICES_H + +#include + +QT_BEGIN_NAMESPACE + +class QCocoaServices : public QPlatformServices +{ +public: + bool openUrl(const QUrl &url); + bool openDocument(const QUrl &url); +}; + +QT_END_NAMESPACE + +#endif // QCOCOADESKTOPSERVICES_H diff --git a/src/plugins/platforms/cocoa/qcocoaservices.mm b/src/plugins/platforms/cocoa/qcocoaservices.mm new file mode 100644 index 00000000000..60bd62eef8a --- /dev/null +++ b/src/plugins/platforms/cocoa/qcocoaservices.mm @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qcocoaservices.h" + +#include "qt_mac_p.h" + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +bool QCocoaServices::openUrl(const QUrl &url) +{ + const QString scheme = url.scheme(); + if (scheme.isEmpty()) + return openDocument(url); + return [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:QT_PREPEND_NAMESPACE(QCFString::toNSString)(url.toString())]]; +} + +bool QCocoaServices::openDocument(const QUrl &url) +{ + if (!url.isValid()) + return false; + + return [[NSWorkspace sharedWorkspace] openFile:QT_PREPEND_NAMESPACE(QCFString::toNSString)(url.toLocalFile())]; +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib b/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib index 3edb0ed2ebf..67207ca6283 100644 Binary files a/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib and b/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib differ diff --git a/src/plugins/platforms/directfb/directfb.pro b/src/plugins/platforms/directfb/directfb.pro index ae47ec397b5..5dfddeb225e 100644 --- a/src/plugins/platforms/directfb/directfb.pro +++ b/src/plugins/platforms/directfb/directfb.pro @@ -4,15 +4,8 @@ DESTDIR = $$QT.gui.plugins/platforms QT += core-private gui-private platformsupport-private -isEmpty(DIRECTFB_LIBS) { - DIRECTFB_LIBS = -ldirectfb -lfusion -ldirect -lpthread -} -isEmpty(DIRECTFB_INCLUDEPATH) { - DIRECTFB_INCLUDEPATH = /usr/include/directfb -} - -INCLUDEPATH += $$DIRECTFB_INCLUDEPATH -LIBS += $$DIRECTFB_LIBS +LIBS += $$QMAKE_LIBS_DIRECTFB +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DIRECTFB SOURCES = main.cpp \ qdirectfbintegration.cpp \ @@ -30,15 +23,27 @@ HEADERS = qdirectfbintegration.h \ qdirectfbinput.h \ qdirectfbcursor.h \ qdirectfbwindow.h \ - qdirectfbscreen.h + qdirectfbscreen.h \ + qdirectfbeglhooks.h # ### port the GL context -directfbegl: { +directfb_egl { HEADERS += qdirectfb_egl.h SOURCES += qdirectfb_egl.cpp DEFINES += DIRECTFB_GL_EGL } +!isEmpty(DIRECTFB_PLATFORM_HOOKS_SOURCES) { + HEADERS += $$DIRECTFB_PLATFORM_HOOKS_HEADERS + SOURCES += $$DIRECTFB_PLATFORM_HOOKS_SOURCES + DEFINES += DIRECTFB_PLATFORM_HOOKS + LIBS += $$DIRECTFB_PLATFORM_HOOKS_LIBS + QMAKE_LIBDIR += $$DIRECTFB_PLATFORM_HOOKS_LIBDIR + INCLUDEPATH += $$DIRECTFB_PLATFORM_HOOKS_INCLUDEPATH +} else { + SOURCES += qdirectfbeglhooks_stub.cpp +} + CONFIG += qpa/genericunixfontdatabase target.path += $$[QT_INSTALL_PLUGINS]/platforms diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp index ee0cbbae952..ac9142c0f4b 100644 --- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp +++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp @@ -42,6 +42,7 @@ #include "qdirectfb_egl.h" #include "qdirectfbwindow.h" #include "qdirectfbscreen.h" +#include "qdirectfbeglhooks.h" #include #include @@ -54,6 +55,13 @@ QT_BEGIN_NAMESPACE +#ifdef DIRECTFB_PLATFORM_HOOKS +extern QDirectFBEGLHooks platform_hook; +static QDirectFBEGLHooks *hooks = &platform_hook; +#else +static QDirectFBEGLHooks *hooks = 0; +#endif + /** * This provides OpenGL ES 2.0 integration with DirectFB. It assumes that * one can adapt a DirectFBSurface as a EGLSurface. It might need some vendor @@ -137,12 +145,14 @@ void QDirectFbScreenEGL::initializeEGL() void QDirectFbScreenEGL::platformInit() { - // Place vendor init code here. + if (hooks) + hooks->platformInit(); } void QDirectFbScreenEGL::platformDestroy() { - // Place vendor finalize code here. + if (hooks) + hooks->platformDestroy(); } QDirectFbWindowEGL::QDirectFbWindowEGL(QWindow *tlw, QDirectFbInput *input) @@ -209,4 +219,12 @@ void QDirectFbIntegrationEGL::initializeScreen() screenAdded(m_primaryScreen.data()); } +bool QDirectFbIntegrationEGL::hasCapability(QPlatformIntegration::Capability cap) const +{ + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + return QDirectFbIntegration::hasCapability(cap); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.h b/src/plugins/platforms/directfb/qdirectfb_egl.h index 88f7e60e994..7781b17831b 100644 --- a/src/plugins/platforms/directfb/qdirectfb_egl.h +++ b/src/plugins/platforms/directfb/qdirectfb_egl.h @@ -53,6 +53,8 @@ public: QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; + bool hasCapability(QPlatformIntegration::Capability cap) const; + protected: void initializeScreen(); }; diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks.h b/src/plugins/platforms/directfb/qdirectfbeglhooks.h similarity index 86% rename from src/plugins/platforms/eglfs/qeglfs_hooks.h rename to src/plugins/platforms/directfb/qdirectfbeglhooks.h index a30af9409ff..d0711b62dd9 100644 --- a/src/plugins/platforms/eglfs/qeglfs_hooks.h +++ b/src/plugins/platforms/directfb/qdirectfbeglhooks.h @@ -39,21 +39,17 @@ ** ****************************************************************************/ -#ifndef QEGLFS_HOOKS_H -#define QEGLFS_HOOKS_H +#ifndef QDIRECTFBEGL_HOOKS_H +#define QDIRECTFBEGL_HOOKS_H #include "qplatformintegration_qpa.h" -#include QT_BEGIN_NAMESPACE -struct QEglFSHooks { +struct QDirectFBEGLHooks { void platformInit(); void platformDestroy(); - EGLNativeDisplayType platformDisplay() const; - QSize screenSize() const; - EGLNativeWindowType createNativeWindow(const QSize &size); - void destroyNativeWindow(EGLNativeWindowType window); + bool hasCapability(QPlatformIntegration::Capability) const; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp b/src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp new file mode 100644 index 00000000000..753a9d43725 --- /dev/null +++ b/src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdirectfbeglhooks.h" + +/** + * This file is compiled in case there is no platform specific hook. On an + * optimizing compiler these functions should never be called. + */ + +void QDirectFBEGLHooks::platformInit() +{ +} + +void QDirectFBEGLHooks::platformDestroy() +{ +} + +bool QDirectFBEGLHooks::hasCapability(QPlatformIntegration::Capability) const +{ + return false; +} + diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro index 89d56efc822..421bbd55610 100644 --- a/src/plugins/platforms/eglfs/eglfs.pro +++ b/src/plugins/platforms/eglfs/eglfs.pro @@ -12,17 +12,22 @@ DESTDIR = $$QT.gui.plugins/platforms #Avoid X11 header collision DEFINES += MESA_EGL_NO_X11_HEADERS +#To test the hooks on x11 (xlib), comment the above define too +#EGLFS_PLATFORM_HOOKS_SOURCES += qeglfshooks_x11.cpp +#LIBS += -lX11 + SOURCES = main.cpp \ qeglfsintegration.cpp \ qeglfswindow.cpp \ qeglfsbackingstore.cpp \ - qeglfsscreen.cpp + qeglfsscreen.cpp \ + qeglfshooks_stub.cpp HEADERS = qeglfsintegration.h \ qeglfswindow.h \ qeglfsbackingstore.h \ qeglfsscreen.h \ - qeglfs_hooks.h + qeglfshooks.h QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h new file mode 100644 index 00000000000..a56c80261b2 --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfshooks.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QEGLFSHOOKS_H +#define QEGLFSHOOKS_H + +#include "qplatformintegration_qpa.h" +#include + +QT_BEGIN_NAMESPACE + +class QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +#ifdef EGLFS_PLATFORM_HOOKS +extern QEglFSHooks *platformHooks; +static QEglFSHooks *hooks = platformHooks; +#else +extern QEglFSHooks stubHooks; +static QEglFSHooks *hooks = &stubHooks; +#endif + +QT_END_NAMESPACE + +#endif // QEGLFSHOOKS_H diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp new file mode 100644 index 00000000000..7cc3527a0c9 --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfshooks.h" + +void QEglFSHooks::platformInit() +{ +} + +void QEglFSHooks::platformDestroy() +{ +} + +EGLNativeDisplayType QEglFSHooks::platformDisplay() const +{ + return EGL_DEFAULT_DISPLAY; +} + +QSize QEglFSHooks::screenSize() const +{ + return QSize(); +} + +EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +{ + Q_UNUSED(size); + return 0; +} + +void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +{ + Q_UNUSED(window); +} + +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + Q_UNUSED(cap); + return false; +} + +#ifndef EGLFS_PLATFORM_HOOKS +QEglFSHooks stubHooks; +#endif diff --git a/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp new file mode 100644 index 00000000000..cb788c52f28 --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfshooks.h" + +#include + +class QEglFSX11Hooks : public QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +static Display *display = 0; + +void QEglFSX11Hooks::platformInit() +{ + display = XOpenDisplay(NULL); + if (!display) + qFatal("Could not open display"); +} + +void QEglFSX11Hooks::platformDestroy() +{ + XCloseDisplay(display); +} + +EGLNativeDisplayType QEglFSX11Hooks::platformDisplay() const +{ + return display; +} + +QSize QEglFSX11Hooks::screenSize() const +{ + QList env = qgetenv("EGLFS_X11_SIZE").split('x'); + if (env.length() != 2) + return QSize(640, 480); + return QSize(env.at(0).toInt(), env.at(1).toInt()); +} + +EGLNativeWindowType QEglFSX11Hooks::createNativeWindow(const QSize &size) +{ + Window root = DefaultRootWindow(display); + XSetWindowAttributes swa; + memset(&swa, 0, sizeof(swa)); + Window win = XCreateWindow(display, root, 0, 0, size.width(), size.height(), 0, CopyFromParent, + InputOutput, CopyFromParent, CWEventMask, &swa); + XMapWindow(display, win); + XStoreName(display, win, "EGLFS"); + return win; +} + +void QEglFSX11Hooks::destroyNativeWindow(EGLNativeWindowType window) +{ + XDestroyWindow(display, window); +} + +bool QEglFSX11Hooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + Q_UNUSED(cap); + return false; +} + +static QEglFSX11Hooks eglFSX11Hooks; +QEglFSHooks *platformHooks = &eglFSX11Hooks; + diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index d9214f87fec..9b7d9246f96 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -43,7 +43,7 @@ #include "qeglfswindow.h" #include "qeglfsbackingstore.h" -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include #include @@ -74,6 +74,10 @@ QEglFSIntegration::~QEglFSIntegration() bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const { + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + switch (cap) { case ThreadedPixmaps: return true; case OpenGL: return true; diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index c7e983b0fb6..ea939a98210 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -41,7 +41,7 @@ #include "qeglfsscreen.h" #include "qeglfswindow.h" -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include #include @@ -53,13 +53,6 @@ QT_BEGIN_NAMESPACE -#ifdef EGLFS_PLATFORM_HOOKS -extern QEglFSHooks platform_hooks; -static QEglFSHooks *hooks = &platform_hooks; -#else -static QEglFSHooks *hooks = 0; -#endif - // #define QEGL_EXTRA_DEBUG #ifdef QEGL_EXTRA_DEBUG diff --git a/src/plugins/platforms/kms/kms.json b/src/plugins/platforms/kms/kms.json new file mode 100644 index 00000000000..be662226ae7 --- /dev/null +++ b/src/plugins/platforms/kms/kms.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "kms" ] +} diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro index 73a3fa04180..f97973b1a12 100644 --- a/src/plugins/platforms/kms/kms.pro +++ b/src/plugins/platforms/kms/kms.pro @@ -1,13 +1,14 @@ TARGET = qkms - load(qt_plugin) -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms -QT = core-private gui-private platformsupport-private opengl-private +QT += core-private gui-private platformsupport-private opengl-private +DESTDIR = $$QT.gui.plugins/platforms -CONFIG += link_pkgconfig qpa/genericunixfontdatabase +DEFINES += MESA_EGL_NO_X11_HEADERS -PKGCONFIG += libdrm egl gbm glesv2 +CONFIG += link_pkgconfig egl qpa/genericunixfontdatabase + +PKGCONFIG += libdrm libudev egl gbm glesv2 SOURCES = main.cpp \ qkmsintegration.cpp \ @@ -17,7 +18,11 @@ SOURCES = main.cpp \ qkmscursor.cpp \ qkmsdevice.cpp \ qkmsbuffermanager.cpp \ - qkmsbackingstore.cpp + qkmsbackingstore.cpp \ + qkmsnativeinterface.cpp \ + qkmsudevlistener.cpp \ + qkmsudevhandler.cpp \ + qkmsudevdrmhandler.cpp HEADERS = qkmsintegration.h \ qkmsscreen.h \ qkmscontext.h \ @@ -25,18 +30,14 @@ HEADERS = qkmsintegration.h \ qkmscursor.h \ qkmsdevice.h \ qkmsbuffermanager.h \ - qkmsbackingstore.h + qkmsbackingstore.h \ + qkmsnativeinterface.h \ + qkmsudevlistener.h \ + qkmsudevhandler.h \ + qkmsudevdrmhandler.h target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target - - - - - - - - - - +OTHER_FILES += \ + kms.json diff --git a/src/plugins/platforms/kms/main.cpp b/src/plugins/platforms/kms/main.cpp index d79d0d240fc..422fc5fba66 100644 --- a/src/plugins/platforms/kms/main.cpp +++ b/src/plugins/platforms/kms/main.cpp @@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE class QKmsIntegrationPlugin : public QPlatformIntegrationPlugin { + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "kms.json") public: QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); @@ -67,6 +69,6 @@ QPlatformIntegration *QKmsIntegrationPlugin::create(const QString& system, const return 0; } -Q_EXPORT_PLUGIN2(kms, QKmsIntegrationPlugin) - QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/platforms/kms/qkmsbuffermanager.cpp b/src/plugins/platforms/kms/qkmsbuffermanager.cpp index 5c231e6bebd..05da957af00 100644 --- a/src/plugins/platforms/kms/qkmsbuffermanager.cpp +++ b/src/plugins/platforms/kms/qkmsbuffermanager.cpp @@ -121,6 +121,8 @@ void QKmsBufferManager::setupBuffersForMode(const drmModeModeInfo &mode, int num GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, this->renderTargetBuffer()); + + eglMakeCurrent(m_screen->device()->eglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } void QKmsBufferManager::clearBuffers() diff --git a/src/plugins/platforms/kms/qkmscontext.cpp b/src/plugins/platforms/kms/qkmscontext.cpp index 66829bc73ac..4ae5325ca75 100644 --- a/src/plugins/platforms/kms/qkmscontext.cpp +++ b/src/plugins/platforms/kms/qkmscontext.cpp @@ -110,4 +110,11 @@ QSurfaceFormat QKmsContext::format() const return QSurfaceFormat(); } +GLuint QKmsContext::defaultFramebufferObject(QPlatformSurface *surface) const +{ + QPlatformWindow *window = static_cast(surface); + QKmsScreen *screen = static_cast (QPlatformScreen::platformScreenForWindow(window->window())); + return screen->framebufferObject(); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmscontext.h b/src/plugins/platforms/kms/qkmscontext.h index 57f3a1a8e5b..6378780f347 100644 --- a/src/plugins/platforms/kms/qkmscontext.h +++ b/src/plugins/platforms/kms/qkmscontext.h @@ -65,6 +65,8 @@ public: EGLContext eglContext() const; + GLuint defaultFramebufferObject(QPlatformSurface *surface) const; + private: QKmsDevice *m_device; diff --git a/src/plugins/platforms/kms/qkmsintegration.cpp b/src/plugins/platforms/kms/qkmsintegration.cpp index c495ca26f94..04053306170 100644 --- a/src/plugins/platforms/kms/qkmsintegration.cpp +++ b/src/plugins/platforms/kms/qkmsintegration.cpp @@ -45,6 +45,9 @@ #include "qkmswindow.h" #include "qkmsbackingstore.h" #include "qkmscontext.h" +#include "qkmsnativeinterface.h" +#include "qkmsudevlistener.h" +#include "qkmsudevdrmhandler.h" #include #include @@ -58,14 +61,14 @@ QT_BEGIN_NAMESPACE QKmsIntegration::QKmsIntegration() : QPlatformIntegration(), m_fontDatabase(new QGenericUnixFontDatabase()), - m_eventDispatcher(createUnixEventDispatcher()) + m_eventDispatcher(createUnixEventDispatcher()), + m_nativeInterface(new QKmsNativeInterface), + m_udevListener(new QKmsUdevListener) { QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher); setenv("EGL_PLATFORM", "drm",1); - QStringList drmDevices = findDrmDevices(); - foreach (QString path, drmDevices) { - m_devices.append(new QKmsDevice(path, this)); - } + m_drmHandler = new QKmsUdevDRMHandler(this); + m_udevListener->addHandler(m_drmHandler); } QKmsIntegration::~QKmsIntegration() @@ -77,6 +80,14 @@ QKmsIntegration::~QKmsIntegration() delete screen; } delete m_fontDatabase; + delete m_udevListener; +} + +QObject *QKmsIntegration::createDevice(const char *path) +{ + QKmsDevice *device = new QKmsDevice(path, this); + m_devices.append(device); + return device; } bool QKmsIntegration::hasCapability(QPlatformIntegration::Capability cap) const @@ -110,14 +121,6 @@ QPlatformFontDatabase *QKmsIntegration::fontDatabase() const return m_fontDatabase; } -QStringList QKmsIntegration::findDrmDevices() -{ - //Return a list addresses of DRM supported devices - //Hardcoded now, but could use udev to return a list - //of multiple devices. - return QStringList(QString::fromLatin1("/dev/dri/card0")); -} - void QKmsIntegration::addScreen(QKmsScreen *screen) { m_screens.append(screen); @@ -129,4 +132,9 @@ QAbstractEventDispatcher *QKmsIntegration::guiThreadEventDispatcher() const return m_eventDispatcher; } +QPlatformNativeInterface *QKmsIntegration::nativeInterface() const +{ + return m_nativeInterface; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsintegration.h b/src/plugins/platforms/kms/qkmsintegration.h index 57244712958..03fc5080a68 100644 --- a/src/plugins/platforms/kms/qkmsintegration.h +++ b/src/plugins/platforms/kms/qkmsintegration.h @@ -43,11 +43,14 @@ #define QPLATFORMINTEGRATION_KMS_H #include +#include QT_BEGIN_NAMESPACE class QKmsScreen; class QKmsDevice; +class QKmsUdevListener; +class QKmsUdevDRMHandler; class QKmsIntegration : public QPlatformIntegration { @@ -64,7 +67,10 @@ public: QPlatformFontDatabase *fontDatabase() const; QAbstractEventDispatcher *guiThreadEventDispatcher() const; + QPlatformNativeInterface *nativeInterface() const; + void addScreen(QKmsScreen *screen); + QObject *createDevice(const char *); private: QStringList findDrmDevices(); @@ -73,6 +79,9 @@ private: QList m_devices; QPlatformFontDatabase *m_fontDatabase; QAbstractEventDispatcher *m_eventDispatcher; + QPlatformNativeInterface *m_nativeInterface; + QKmsUdevListener *m_udevListener; + QKmsUdevDRMHandler *m_drmHandler; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.cpp b/src/plugins/platforms/kms/qkmsnativeinterface.cpp new file mode 100644 index 00000000000..8e026b25030 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsnativeinterface.cpp @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "qkmsnativeinterface.h" +#include "qkmsdevice.h" + +#include "qscreen.h" + +class QKmsResourceMap : public QMap +{ +public: + QKmsResourceMap() + :QMap() + { + insert("egldisplay", QKmsNativeInterface::EglDisplay); + insert("eglcontext", QKmsNativeInterface::EglContext); + } +}; + +Q_GLOBAL_STATIC(QKmsResourceMap, qKmsResourceMap) + +void *QKmsNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) +{ + QByteArray lowerCaseResource = resourceString.toLower(); + ResourceType resource = qKmsResourceMap()->value(lowerCaseResource); + void *result = 0; + switch (resource) { + case EglDisplay: + result = eglDisplayForWindow(window); + break; + case EglContext: + result = eglContextForWindow(window); + break; + default: + result = 0; + } + return result; +} + +void *QKmsNativeInterface::eglDisplayForWindow(QWindow *window) +{ + QKmsScreen *screen = qPlatformScreenForWindow(window); + if (!screen) + return 0; + QKmsDevice *device = screen->device(); + if (!device) + return 0; + return device->eglDisplay(); +} + +void *QKmsNativeInterface::eglContextForWindow(QWindow *window) +{ + QKmsScreen *screen = qPlatformScreenForWindow(window); + if (!screen) + return 0; + QKmsDevice *device = screen->device(); + if (!device) + return 0; + return device->eglContext(); +} + +QKmsScreen *QKmsNativeInterface::qPlatformScreenForWindow(QWindow *window) +{ + QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen(); + return static_cast(screen->handle()); +} diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.h b/src/plugins/platforms/kms/qkmsnativeinterface.h new file mode 100644 index 00000000000..77a95732505 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsnativeinterface.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSNATIVEINTERFACE_H +#define QKMSNATIVEINTERFACE_H + +#include "qkmsscreen.h" + +#include + +class QKmsNativeInterface : public QPlatformNativeInterface +{ +public: + enum ResourceType { + EglDisplay, + EglContext + }; + + void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); + + void *eglDisplayForWindow(QWindow *window); + void *eglContextForWindow(QWindow *window); + +private: + static QKmsScreen *qPlatformScreenForWindow(QWindow *window); +}; + + +#endif // QKMSNATIVEINTERFACE_H diff --git a/src/gui/painting/qpaintdevice_qpa.cpp b/src/plugins/platforms/kms/qkmsudevdrmhandler.cpp similarity index 75% rename from src/gui/painting/qpaintdevice_qpa.cpp rename to src/plugins/platforms/kms/qkmsudevdrmhandler.cpp index e469a5f10fd..0f59de4cef4 100644 --- a/src/gui/painting/qpaintdevice_qpa.cpp +++ b/src/plugins/platforms/kms/qkmsudevdrmhandler.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage @@ -39,27 +39,28 @@ ** ****************************************************************************/ -#include "qpaintdevice.h" -#include "qpainter.h" -#include "qbitmap.h" -#include "qguiapplication.h" +#include + +#include +#include QT_BEGIN_NAMESPACE -int QPaintDevice::metric(PaintDeviceMetric m) const +QKmsUdevDRMHandler::QKmsUdevDRMHandler(QKmsIntegration *integration) + : m_integration(integration) { - qWarning("QPaintDevice::metrics: Device has no metric information"); - if (m == PdmDpiX) { - return 72; - } else if (m == PdmDpiY) { - return 72; - } else if (m == PdmNumColors) { - // FIXME: does this need to be a real value? - return 256; - } else { - qDebug("Unrecognised metric %d!",m); +} + +QObject *QKmsUdevDRMHandler::create(struct udev_device *device) +{ + if (strcmp(udev_device_get_subsystem(device), "drm")) return 0; - } + + QRegExp regexp("^card\\d+$"); + if (!regexp.exactMatch(udev_device_get_sysname(device))) + return 0; + + return m_integration->createDevice(udev_device_get_devnode(device)); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevdrmhandler.h b/src/plugins/platforms/kms/qkmsudevdrmhandler.h new file mode 100644 index 00000000000..d627fec1c67 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevdrmhandler.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSUDEVDRMHANDLER_H +#define QKMSUDEVDRMHANDLER_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QKmsIntegration; + +class QKmsUdevDRMHandler : public QKmsUdevHandler +{ +public: + QKmsUdevDRMHandler(QKmsIntegration *integration); + + QObject *create(struct udev_device *device); + +private: + QKmsIntegration *m_integration; +}; + +QT_END_NAMESPACE + +#endif // QKMSUDEVDRMHANDLER_H diff --git a/src/plugins/platforms/kms/qkmsudevhandler.cpp b/src/plugins/platforms/kms/qkmsudevhandler.cpp new file mode 100644 index 00000000000..c0ec4c4ba1e --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevhandler.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +QKmsUdevHandler::QKmsUdevHandler(QObject *parent) + : QObject(parent) +{ +} + +QKmsUdevHandler::~QKmsUdevHandler() +{ +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevhandler.h b/src/plugins/platforms/kms/qkmsudevhandler.h new file mode 100644 index 00000000000..48708099273 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevhandler.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSUDEVHANDLER_H +#define QKMSUDEVHANDLER_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QKmsUdevHandler : public QObject +{ + Q_OBJECT + +public: + QKmsUdevHandler(QObject *parent = 0); + virtual ~QKmsUdevHandler(); + + virtual QObject *create(struct udev_device *) = 0; +}; + +QT_END_NAMESPACE + +#endif // QKMSUDEVHANDLER_H diff --git a/src/plugins/platforms/kms/qkmsudevlistener.cpp b/src/plugins/platforms/kms/qkmsudevlistener.cpp new file mode 100644 index 00000000000..c0a933b57bb --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevlistener.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +QKmsUdevListener::QKmsUdevListener(QObject *parent) + : QObject(parent) +{ + m_udev = udev_new(); +} + +QKmsUdevListener::~QKmsUdevListener() +{ + udev_unref(m_udev); +} + +void QKmsUdevListener::addHandler(QKmsUdevHandler *handler) +{ + m_handlers.removeAll((QKmsUdevHandler *) 0); + m_handlers.removeAll(handler); + m_handlers.prepend(handler); + + scan(); +} + +bool QKmsUdevListener::create(struct udev_device *device) +{ + foreach (QKmsUdevHandler *handler, m_handlers) { + if (!handler) + continue; + + QObject *obj = handler->create(device); + if (obj) { + m_devices[udev_device_get_syspath(device)] = obj; + return true; + } + } + + return false; +} + +void QKmsUdevListener::scan() +{ + struct udev_enumerate *e; + struct udev_list_entry *entry; + + e = udev_enumerate_new(m_udev); + udev_enumerate_scan_devices(e); + udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { + const char *path = udev_list_entry_get_name(entry); + if (m_devices.contains(path)) + continue; + + struct udev_device *device = udev_device_new_from_syspath(m_udev, path); + create(device); + udev_device_unref(device); + } + udev_enumerate_unref(e); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevlistener.h b/src/plugins/platforms/kms/qkmsudevlistener.h new file mode 100644 index 00000000000..3d87cfe662a --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevlistener.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSUDEVLISTENER_H +#define QKMSUDEVLISTENER_H + +#include +#include +#include +#include +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QKmsUdevListener : public QObject +{ + Q_OBJECT + +public: + QKmsUdevListener(QObject *parent = 0); + ~QKmsUdevListener(); + + void addHandler(QKmsUdevHandler *); + +private: + QList > m_handlers; + QMap > m_devices; + struct udev *m_udev; + + void scan(); + bool create(struct udev_device *); +}; + +QT_END_NAMESPACE + +#endif // QKMSUDEVLISTENER_H diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 442390f6a60..51de06f9103 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -6,9 +6,7 @@ contains(QT_CONFIG, xcb) { SUBDIRS += xcb } -mac { - SUBDIRS += cocoa -} +mac:contains(QT_CONFIG, coreservices): SUBDIRS += cocoa win32: SUBDIRS += windows @@ -19,3 +17,7 @@ qnx { contains(QT_CONFIG, eglfs) { SUBDIRS += eglfs } + +contains(QT_CONFIG, directfb) { + SUBDIRS += directfb +} diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro index bdc8c386148..82c3b201c92 100644 --- a/src/plugins/platforms/qnx/qnx.pro +++ b/src/plugins/platforms/qnx/qnx.pro @@ -17,6 +17,7 @@ QT += opengl opengl-private platformsupport platformsupport-private widgets-priv #DEFINES += QQNXINPUTCONTEXT_IMF_EVENT_DEBUG #DEFINES += QQNXINTEGRATION_DEBUG #DEFINES += QQNXNAVIGATOREVENTHANDLER_DEBUG +#DEFINES += QQNXNAVIGATOREVENTNOTIFIER_DEBUG #DEFINES += QQNXRASTERBACKINGSTORE_DEBUG #DEFINES += QQNXROOTWINDOW_DEBUG #DEFINES += QQNXSCREEN_DEBUG @@ -31,6 +32,7 @@ SOURCES = main.cpp \ qqnxglbackingstore.cpp \ qqnxintegration.cpp \ qqnxnavigatoreventhandler.cpp \ + qqnxnavigatoreventnotifier.cpp \ qqnxscreen.cpp \ qqnxwindow.cpp \ qqnxrasterbackingstore.cpp \ @@ -46,6 +48,7 @@ HEADERS = qqnxbuffer.h \ qqnxkeytranslator.h \ qqnxintegration.h \ qqnxnavigatoreventhandler.h \ + qqnxnavigatoreventnotifier.h \ qqnxglcontext.h \ qqnxglbackingstore.h \ qqnxscreen.h \ diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index f12073e367c..b4112999b6e 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -45,6 +45,7 @@ #include "qqnxglcontext.h" #include "qqnxnativeinterface.h" #include "qqnxnavigatoreventhandler.h" +#include "qqnxnavigatoreventnotifier.h" #include "qqnxrasterbackingstore.h" #include "qqnxscreen.h" #include "qqnxscreeneventhandler.h" @@ -80,7 +81,8 @@ QMutex QQnxIntegration::ms_windowMapperMutex; QQnxIntegration::QQnxIntegration() : QPlatformIntegration() , m_eventThread(0) - , m_navigatorEventHandler(0) + , m_navigatorEventHandler(new QQnxNavigatorEventHandler()) + , m_navigatorEventNotifier(0) , m_virtualKeyboard(0) , m_inputContext(0) , m_fontDatabase(new QGenericUnixFontDatabase()) @@ -103,12 +105,12 @@ QQnxIntegration::QQnxIntegration() qFatal("QQnx: failed to connect to composition manager, errno=%d", errno); } - // Create/start navigator event handler - m_navigatorEventHandler = new QQnxNavigatorEventHandler; + // Create/start navigator event notifier + m_navigatorEventNotifier = new QQnxNavigatorEventNotifier(m_navigatorEventHandler); // delay invocation of start() to the time the event loop is up and running // needed to have the QThread internals of the main thread properly initialized - QMetaObject::invokeMethod(m_navigatorEventHandler, "start", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection); // Create displays for all possible screens (which may not be attached) createDisplays(); @@ -160,12 +162,12 @@ QQnxIntegration::~QQnxIntegration() delete m_clipboard; #endif - // Stop/destroy event thread - delete m_eventThread; - - // Stop/destroy navigator thread + // Stop/destroy navigator event notifier + delete m_navigatorEventNotifier; delete m_navigatorEventHandler; + // Stop/destroy event thread + delete m_eventThread; delete m_screenEventHandler; // Destroy all displays diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h index f29baf13235..801bd7b6e57 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.h +++ b/src/plugins/platforms/qnx/qqnxintegration.h @@ -54,6 +54,7 @@ class QQnxEventThread; class QQnxInputContext; class QQnxNativeInterface; class QQnxNavigatorEventHandler; +class QQnxNavigatorEventNotifier; class QQnxAbstractVirtualKeyboard; class QQnxWindow; class QQnxServices; @@ -112,6 +113,7 @@ private: screen_context_t m_screenContext; QQnxEventThread *m_eventThread; QQnxNavigatorEventHandler *m_navigatorEventHandler; + QQnxNavigatorEventNotifier *m_navigatorEventNotifier; QQnxAbstractVirtualKeyboard *m_virtualKeyboard; QQnxInputContext *m_inputContext; QPlatformFontDatabase *m_fontDatabase; diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp index 9527a57ca37..72227c60891 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp @@ -1,6 +1,6 @@ /*************************************************************************** ** -** Copyright (C) 2011 - 2012 Research In Motion +** Copyright (C) 2012 Research In Motion ** Contact: http://www.qt-project.org/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -41,216 +41,58 @@ #include "qqnxnavigatoreventhandler.h" -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -static const char *navigatorControlPath = "/pps/services/navigator/control"; -static const int ppsBufferSize = 4096; +QT_BEGIN_NAMESPACE QQnxNavigatorEventHandler::QQnxNavigatorEventHandler(QObject *parent) - : QObject(parent), - m_fd(-1), - m_readNotifier(0) + : QObject(parent) { } -QQnxNavigatorEventHandler::~QQnxNavigatorEventHandler() +bool QQnxNavigatorEventHandler::handleOrientationCheck(int angle) { - delete m_readNotifier; - - // close connection to navigator - if (m_fd != -1) - close(m_fd); - + // reply to navigator that (any) orientation is acceptable #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "QQNX: navigator event handler stopped"; + qDebug() << Q_FUNC_INFO << "angle=" << angle; #endif + + // TODO: check if top window flags prohibit orientation change + return true; } -void QQnxNavigatorEventHandler::start() +void QQnxNavigatorEventHandler::handleOrientationChange(int angle) { + // update screen geometry and reply to navigator that we're ready #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "QQNX: navigator event handler started"; + qDebug() << Q_FUNC_INFO << "angle=" << angle; #endif - // open connection to navigator - errno = 0; - m_fd = open(navigatorControlPath, O_RDWR); - if (m_fd == -1) { - qWarning("QQNX: failed to open navigator pps, errno=%d", errno); - return; - } - - m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); - connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readData())); + emit rotationChanged(angle); } -void QQnxNavigatorEventHandler::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) +void QQnxNavigatorEventHandler::handleSwipeDown() { + // simulate menu key press #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: data=" << ppsData; + qDebug() << Q_FUNC_INFO; #endif - // tokenize pps data into lines - QList lines = ppsData.split('\n'); - - // validate pps object - if (lines.size() == 0 || lines.at(0) != "@control") { - qFatal("QQNX: unrecognized pps object, data=%s", ppsData.constData()); - } - - // parse pps object attributes and extract values - for (int i = 1; i < lines.size(); i++) { - - // tokenize current attribute - const QByteArray &attr = lines.at(i); - -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: attr=" << attr; -#endif - - int firstColon = attr.indexOf(':'); - if (firstColon == -1) { - // abort - malformed attribute - continue; - } - - int secondColon = attr.indexOf(':', firstColon + 1); - if (secondColon == -1) { - // abort - malformed attribute - continue; - } - - QByteArray key = attr.left(firstColon); - QByteArray value = attr.mid(secondColon + 1); - -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: key=" << key; - qDebug() << "PPS: val=" << value; -#endif - - // save attribute value - if (key == "msg") { - msg = value; - } else if (key == "dat") { - dat = value; - } else if (key == "id") { - id = value; - } else { - qFatal("QQNX: unrecognized pps attribute, attr=%s", key.constData()); - } - } + QWindow *w = QGuiApplication::focusWindow(); + QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyPress, Qt::Key_Menu, Qt::NoModifier); + QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyRelease, Qt::Key_Menu, Qt::NoModifier); } -void QQnxNavigatorEventHandler::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat) +void QQnxNavigatorEventHandler::handleExit() { - // construct pps message - QByteArray ppsData = "res::"; - ppsData += res; - ppsData += "\nid::"; - ppsData += id; - if (!dat.isEmpty()) { - ppsData += "\ndat::"; - ppsData += dat; - } - ppsData += "\n"; - + // shutdown everything #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS reply=" << ppsData; + qDebug() << Q_FUNC_INFO; #endif - // send pps message to navigator - errno = 0; - int bytes = write(m_fd, ppsData.constData(), ppsData.size()); - if (bytes == -1) { - qFatal("QQNX: failed to write navigator pps, errno=%d", errno); - } + QCoreApplication::quit(); } -void QQnxNavigatorEventHandler::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id) -{ -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: msg=" << msg << ", dat=" << dat << ", id=" << id; -#endif - - // check message type - if (msg == "orientationCheck") { - - // reply to navigator that (any) orientation is acceptable -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: orientation check, o=" << dat; -#endif - replyPPS(msg, id, "true"); - - } else if (msg == "orientation") { - - // update screen geometry and reply to navigator that we're ready -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: orientation, o=" << dat; -#endif - Q_EMIT rotationChanged(dat.toInt()); - replyPPS(msg, id, ""); - - } else if (msg == "SWIPE_DOWN") { - - // simulate menu key press -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: menu"; -#endif - QWindow *w = QGuiApplication::focusWindow(); - QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyPress, Qt::Key_Menu, Qt::NoModifier); - QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyRelease, Qt::Key_Menu, Qt::NoModifier); - - } else if (msg == "exit") { - - // shutdown everything -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: exit"; -#endif - QCoreApplication::quit(); - } -} - -void QQnxNavigatorEventHandler::readData() -{ -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "QQNX: reading navigator data"; -#endif - // allocate buffer for pps data - char buffer[ppsBufferSize]; - - // attempt to read pps data - errno = 0; - int bytes = qt_safe_read(m_fd, buffer, ppsBufferSize - 1); - if (bytes == -1) { - qFatal("QQNX: failed to read navigator pps, errno=%d", errno); - } - - // check if pps data was received - if (bytes > 0) { - - // ensure data is null terminated - buffer[bytes] = '\0'; - - // process received message - QByteArray ppsData(buffer); - QByteArray msg; - QByteArray dat; - QByteArray id; - parsePPS(ppsData, msg, dat, id); - handleMessage(msg, dat, id); - } -} +QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h index 8084eba1d9c..58a1ac8cb3b 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h @@ -1,6 +1,6 @@ /*************************************************************************** ** -** Copyright (C) 2011 - 2012 Research In Motion +** Copyright (C) 2012 Research In Motion ** Contact: http://www.qt-project.org/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -46,31 +46,19 @@ QT_BEGIN_NAMESPACE -class QSocketNotifier; - class QQnxNavigatorEventHandler : public QObject { Q_OBJECT public: explicit QQnxNavigatorEventHandler(QObject *parent = 0); - ~QQnxNavigatorEventHandler(); + + bool handleOrientationCheck(int angle); + void handleOrientationChange(int angle); + void handleSwipeDown(); + void handleExit(); Q_SIGNALS: void rotationChanged(int angle); - -public Q_SLOTS: - void start(); - -private Q_SLOTS: - void readData(); - -private: - void parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id); - void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat); - void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id); - - int m_fd; - QSocketNotifier *m_readNotifier; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp new file mode 100644 index 00000000000..d5220c936e8 --- /dev/null +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp @@ -0,0 +1,233 @@ +/*************************************************************************** +** +** Copyright (C) 2011 - 2012 Research In Motion +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqnxnavigatoreventnotifier.h" + +#include "qqnxnavigatoreventhandler.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static const char *navigatorControlPath = "/pps/services/navigator/control"; +static const int ppsBufferSize = 4096; + +QT_BEGIN_NAMESPACE + +QQnxNavigatorEventNotifier::QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent) + : QObject(parent), + m_fd(-1), + m_readNotifier(0), + m_eventHandler(eventHandler) +{ +} + +QQnxNavigatorEventNotifier::~QQnxNavigatorEventNotifier() +{ + delete m_readNotifier; + + // close connection to navigator + if (m_fd != -1) + close(m_fd); + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "QQNX: navigator event notifier stopped"; +#endif +} + +void QQnxNavigatorEventNotifier::start() +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "QQNX: navigator event notifier started"; +#endif + + // open connection to navigator + errno = 0; + m_fd = open(navigatorControlPath, O_RDWR); + if (m_fd == -1) { + qWarning("QQNX: failed to open navigator pps, errno=%d", errno); + return; + } + + m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); + connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readData())); +} + +void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: data=" << ppsData; +#endif + + // tokenize pps data into lines + QList lines = ppsData.split('\n'); + + // validate pps object + if (lines.size() == 0 || lines.at(0) != "@control") + qFatal("QQNX: unrecognized pps object, data=%s", ppsData.constData()); + + // parse pps object attributes and extract values + for (int i = 1; i < lines.size(); ++i) { + + // tokenize current attribute + const QByteArray &attr = lines.at(i); + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: attr=" << attr; +#endif + + int firstColon = attr.indexOf(':'); + if (firstColon == -1) { + // abort - malformed attribute + continue; + } + + int secondColon = attr.indexOf(':', firstColon + 1); + if (secondColon == -1) { + // abort - malformed attribute + continue; + } + + QByteArray key = attr.left(firstColon); + QByteArray value = attr.mid(secondColon + 1); + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: key=" << key; + qDebug() << "PPS: val=" << value; +#endif + + // save attribute value + if (key == "msg") + msg = value; + else if (key == "dat") + dat = value; + else if (key == "id") + id = value; + else + qFatal("QQNX: unrecognized pps attribute, attr=%s", key.constData()); + } +} + +void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat) +{ + // construct pps message + QByteArray ppsData = "res::"; + ppsData += res; + ppsData += "\nid::"; + ppsData += id; + if (!dat.isEmpty()) { + ppsData += "\ndat::"; + ppsData += dat; + } + ppsData += "\n"; + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS reply=" << ppsData; +#endif + + // send pps message to navigator + errno = 0; + int bytes = write(m_fd, ppsData.constData(), ppsData.size()); + if (bytes == -1) + qFatal("QQNX: failed to write navigator pps, errno=%d", errno); +} + +void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id) +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: msg=" << msg << ", dat=" << dat << ", id=" << id; +#endif + + // check message type + if (msg == "orientationCheck") { + const bool response = m_eventHandler->handleOrientationCheck(dat.toInt()); + + // reply to navigator that (any) orientation is acceptable + replyPPS(msg, id, response ? "true" : "false"); + } else if (msg == "orientation") { + m_eventHandler->handleOrientationChange(dat.toInt()); + replyPPS(msg, id, ""); + } else if (msg == "SWIPE_DOWN") { + m_eventHandler->handleSwipeDown(); + } else if (msg == "exit") { + m_eventHandler->handleExit(); + } +} + +void QQnxNavigatorEventNotifier::readData() +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "QQNX: reading navigator data"; +#endif + // allocate buffer for pps data + char buffer[ppsBufferSize]; + + // attempt to read pps data + errno = 0; + int bytes = qt_safe_read(m_fd, buffer, ppsBufferSize - 1); + if (bytes == -1) + qFatal("QQNX: failed to read navigator pps, errno=%d", errno); + + // check if pps data was received + if (bytes > 0) { + + // ensure data is null terminated + buffer[bytes] = '\0'; + + // process received message + QByteArray ppsData(buffer); + QByteArray msg; + QByteArray dat; + QByteArray id; + parsePPS(ppsData, msg, dat, id); + handleMessage(msg, dat, id); + } +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h new file mode 100644 index 00000000000..bdf1220b567 --- /dev/null +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h @@ -0,0 +1,77 @@ +/*************************************************************************** +** +** Copyright (C) 2011 - 2012 Research In Motion +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQNXNAVIGATOREVENTNOTIFIER_H +#define QQNXNAVIGATOREVENTNOTIFIER_H + +#include + +QT_BEGIN_NAMESPACE + +class QQnxNavigatorEventHandler; +class QSocketNotifier; + +class QQnxNavigatorEventNotifier : public QObject +{ + Q_OBJECT +public: + explicit QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent = 0); + ~QQnxNavigatorEventNotifier(); + +public Q_SLOTS: + void start(); + +private Q_SLOTS: + void readData(); + +private: + void parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id); + void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat); + void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id); + + int m_fd; + QSocketNotifier *m_readNotifier; + QQnxNavigatorEventHandler *m_eventHandler; +}; + +QT_END_NAMESPACE + +#endif // QQNXNAVIGATOREVENTNOTIFIER_H diff --git a/src/plugins/platforms/windows/accessible/accessible.pri b/src/plugins/platforms/windows/accessible/accessible.pri index 3069c2dda39..1a409cb87e0 100644 --- a/src/plugins/platforms/windows/accessible/accessible.pri +++ b/src/plugins/platforms/windows/accessible/accessible.pri @@ -8,7 +8,7 @@ HEADERS += \ $$PWD/qwindowsaccessibility.h \ $$PWD/comutils.h -!*g++: { +!win32-g++*: { SOURCES += $$PWD/iaccessible2.cpp HEADERS += $$PWD/iaccessible2.h include(../../../../3rdparty/iaccessible2/iaccessible2.pri) diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp index be680e7d486..ddab3cb0f27 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp +++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp @@ -114,6 +114,68 @@ HRESULT STDMETHODCALLTYPE AccessibleApplication::get_toolkitVersion(/* [retval][ } +/**************************************************************\ + * AccessibleRelation * + **************************************************************/ +AccessibleRelation::AccessibleRelation(const QList &targets, + QAccessible::Relation relation) + : m_targets(targets), m_relation(relation), m_ref(1) +{ + Q_ASSERT(m_targets.count()); +} + +/* IUnknown */ +HRESULT STDMETHODCALLTYPE AccessibleRelation::QueryInterface(REFIID id, LPVOID *iface) +{ + *iface = 0; + if (id == IID_IUnknown) + *iface = (IUnknown*)this; + + if (*iface) { + AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE AccessibleRelation::AddRef() +{ + return ++m_ref; +} + +ULONG STDMETHODCALLTYPE AccessibleRelation::Release() +{ + if (!--m_ref) { + delete this; + return 0; + } + return m_ref; +} + +/* IAccessibleRelation */ +HRESULT STDMETHODCALLTYPE AccessibleRelation::get_relationType( + /* [retval][out] */ BSTR *relationType) +{ + *relationType = relationToBSTR(m_relation); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE AccessibleRelation::get_localizedRelationType( + /* [retval][out] */ BSTR *localizedRelationType) +{ + // Who ever needs this??? + *localizedRelationType = relationToBSTR(m_relation); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE AccessibleRelation::get_nTargets( + /* [retval][out] */ long *nTargets) +{ + // ### always one target + *nTargets = m_targets.count(); + return S_OK; +} /*! \internal @@ -140,7 +202,7 @@ HRESULT STDMETHODCALLTYPE AccessibleRelation::get_target( (see "Special Consideration when using Arrays", in Accessible2.idl) */ HRESULT STDMETHODCALLTYPE AccessibleRelation::get_targets( - /* [in] */ long maxTargets, // Hmmm, ignore ??? + /* [in] */ long maxTargets, /* [length_is][size_is][out] */ IUnknown **targets, /* [retval][out] */ long *nTargets) { @@ -215,6 +277,10 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryInterface(REFIID id, LPVOI return hr; } + +/* Note that IUnknown is inherited from several interfaces. Therefore we must reimplement all its + functions in the concrete class to avoid ambiguity. +*/ ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::AddRef() { return QWindowsMsaaAccessible::AddRef(); diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.h b/src/plugins/platforms/windows/accessible/iaccessible2.h index 9b8a1ad3a69..0f9d3b3c41f 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.h +++ b/src/plugins/platforms/windows/accessible/iaccessible2.h @@ -298,83 +298,27 @@ private: /**************************************************************\ - * IAccessibleRelation * + * AccessibleRelation * **************************************************************/ -struct AccessibleRelation : public IAccessibleRelation +class AccessibleRelation : public IAccessibleRelation { +public: AccessibleRelation(const QList &targets, - QAccessible::Relation relation) - : m_targets(targets), m_relation(relation), m_ref(1) - { - Q_ASSERT(m_targets.count()); - } + QAccessible::Relation relation); + virtual ~AccessibleRelation() {} /* IUnknown */ - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) - { - *iface = 0; - if (id == IID_IUnknown) - *iface = (IUnknown*)this; - - if (*iface) { - AddRef(); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - return ++m_ref; - } - - ULONG STDMETHODCALLTYPE Release() - { - if (!--m_ref) { - delete this; - return 0; - } - return m_ref; - } + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface); + ULONG STDMETHODCALLTYPE AddRef(); + ULONG STDMETHODCALLTYPE Release(); /* IAccessibleRelation */ - HRESULT STDMETHODCALLTYPE get_relationType( - /* [retval][out] */ BSTR *relationType) - { - *relationType = relationToBSTR(m_relation); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE get_localizedRelationType( - /* [retval][out] */ BSTR *localizedRelationType) - { - // Who ever needs this??? - *localizedRelationType = relationToBSTR(m_relation); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE get_nTargets( - /* [retval][out] */ long *nTargets) - { - // ### always one target - *nTargets = m_targets.count(); - return S_OK; - } - + HRESULT STDMETHODCALLTYPE get_relationType(BSTR *relationType); + HRESULT STDMETHODCALLTYPE get_localizedRelationType(BSTR *localizedRelationType); + HRESULT STDMETHODCALLTYPE get_nTargets(long *nTargets); HRESULT STDMETHODCALLTYPE get_target(long targetIndex, IUnknown **target); - - - /*! - \internal - Client allocates and deallocates \a targets array - (see "Special Consideration when using Arrays", in Accessible2.idl) - */ - HRESULT STDMETHODCALLTYPE get_targets( - /* [in] */ long maxTargets, // Hmmm, ignore ??? - /* [length_is][size_is][out] */ IUnknown **targets, - /* [retval][out] */ long *nTargets); + HRESULT STDMETHODCALLTYPE get_targets(long maxTargets, IUnknown **targets, long *nTargets); private: static BSTR relationToBSTR(QAccessible::Relation relation) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 17420d271d4..c5b1dcce9f2 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -276,7 +277,7 @@ QWindowsContext::QWindowsContext() : # pragma warning( disable : 4996 ) #endif m_instance = this; - if (const char *v = getenv("QT_LIGHTHOUSE_WINDOWS_VERBOSE")) { + if (const char *v = getenv("QT_QPA_VERBOSE")) { QWindowsContext::verboseIntegration = componentVerbose(v, "integration"); QWindowsContext::verboseWindows = componentVerbose(v, "windows"); QWindowsContext::verboseEvents = componentVerbose(v, "events"); @@ -791,6 +792,11 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, if (QWindowsTheme *theme = QWindowsTheme::instance()) theme->windowsThemeChanged(platformWindow->window()); return true; + case QtWindows::ActivateWindowEvent: + if (platformWindow->testFlag(QWindowsWindow::BlockedByModal)) + if (const QWindow *modalWindow = QGuiApplication::modalWindow()) + QWindowsWindow::baseWindowOf(modalWindow)->alertWindow(); + break; default: break; } diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index 337ba9ab27e..ebcf1172db6 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -369,8 +369,6 @@ QPoint QWindowsCursor::mousePosition() { POINT p; GetCursorPos(&p); - if (QWindowsContext::verboseWindows) - qDebug("%s %ld,%ld", __FUNCTION__, p.x, p.y); return QPoint(p.x, p.y); } diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 9621846284e..a6bde741035 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -116,6 +116,7 @@ typedef struct _COMDLG_FILTERSPEC #define FOS_DEFAULTNOMINIMODE 0x20000000 #define FOS_FORCEPREVIEWPANEON 0x40000000 +#if !defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 2) typedef int GETPROPERTYSTOREFLAGS; #define GPS_DEFAULT 0x00000000 #define GPS_HANDLERPROPERTIESONLY 0x00000001 @@ -126,6 +127,7 @@ typedef int GETPROPERTYSTOREFLAGS; #define GPS_DELAYCREATION 0x00000020 #define GPS_BESTEFFORT 0x00000040 #define GPS_MASK_VALID 0x0000007F +#endif typedef int (QT_WIN_CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); // message from browser @@ -288,7 +290,9 @@ DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog) STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE; }; +#if !defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 2) typedef IUnknown IPropertyStore; +#endif typedef IUnknown IFileOperationProgressSink; DECLARE_INTERFACE_(IFileSaveDialog, IFileDialog) diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index c1c25dd6863..979b2a028bc 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -698,6 +698,32 @@ QStringList QWindowsFontDatabase::fallbacksForFamily(const QString family, const QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script); if (!result.isEmpty()) return result; + + switch (styleHint) { + case QFont::Times: + result << QString::fromLatin1("Times New Roman"); + break; + case QFont::Courier: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Monospace: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Cursive: + result << QString::fromLatin1("Comic Sans MS"); + break; + case QFont::Fantasy: + result << QString::fromLatin1("Impact"); + break; + case QFont::Decorative: + result << QString::fromLatin1("Old English"); + break; + case QFont::Helvetica: + case QFont::System: + default: + result << QString::fromLatin1("Arial"); + } + if (QWindowsContext::verboseFonts) qDebug() << __FUNCTION__ << family << style << styleHint << script << result << m_families.size(); @@ -874,6 +900,11 @@ QString QWindowsFontDatabase::fontDir() const return result; } +bool QWindowsFontDatabase::fontsAlwaysScalable() const +{ + return true; +} + HFONT QWindowsFontDatabase::systemFont() { static const HFONT stock_sysfont = (HFONT)GetStockObject(SYSTEM_FONT); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h index 2fa615253eb..39219927756 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.h +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h @@ -86,6 +86,8 @@ public: virtual QString fontDir() const; virtual QFont defaultFont() const { return systemDefaultFont(); } + virtual bool fontsAlwaysScalable() const; + static QFont systemDefaultFont(); static QFontEngine *createEngine(int script, const QFontDef &request, diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index e84f0c76301..246b5b37105 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -422,6 +422,31 @@ QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString family, con QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script); if (!result.isEmpty()) return result; + + switch (styleHint) { + case QFont::Times: + result << QString::fromLatin1("Times New Roman"); + break; + case QFont::Courier: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Monospace: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Cursive: + result << QString::fromLatin1("Comic Sans MS"); + break; + case QFont::Fantasy: + result << QString::fromLatin1("Impact"); + break; + case QFont::Decorative: + result << QString::fromLatin1("Old English"); + break; + case QFont::Helvetica: + case QFont::System: + default: + result << QString::fromLatin1("Arial"); + } if (QWindowsContext::verboseFonts) qDebug() << __FUNCTION__ << family << style << styleHint << script << result << m_families; diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 007f6d597a5..94072622eb1 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -179,14 +179,14 @@ void QWindowsFontEngine::getCMap() } } - +// ### Qt 5.1: replace with QStringIterator inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { + uint uc = str[i].unicode(); + if (QChar::isHighSurrogate(uc) && i < len-1) { uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; + if (QChar::isLowSurrogate(low)) { + uc = QChar::surrogateToUcs4(uc, low); ++i; } } @@ -402,7 +402,7 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::Shape if (!ttf) { QChar ch[2] = { ushort(glyph), 0 }; int chrLen = 1; - if (glyph > 0xffff) { + if (QChar::requiresSurrogates(glyph)) { ch[0] = QChar::highSurrogate(glyph); ch[1] = QChar::lowSurrogate(glyph); ++chrLen; diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index c8906bd3c95..4dbb2cf65bc 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -295,13 +295,14 @@ QFixed QWindowsFontEngineDirectWrite::emSquareSize() const return QFontEngine::emSquareSize(); } +// ### Qt 5.1: replace with QStringIterator inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { + uint uc = str[i].unicode(); + if (QChar::isHighSurrogate(uc) && i < len-1) { uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; + if (QChar::isLowSurrogate(low)) { + uc = QChar::surrogateToUcs4(uc, low); ++i; } } diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 47d6a2f11a1..d8d04fc1b6f 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -228,8 +228,6 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co QPlatformPixmap *QWindowsIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const { - if (QWindowsContext::verboseIntegration) - qDebug() << __FUNCTION__ << type; return new QRasterPlatformPixmap(type); } @@ -279,17 +277,44 @@ QPlatformOpenGLContext return 0; } +/* Workaround for QTBUG-24205: In 'Auto', pick the FreeType engine for + * QML2 applications. */ + +enum FontDatabaseOption { + FontDatabaseAuto, + FontDatabaseFreeType, + FontDatabaseNative +}; + +static inline FontDatabaseOption fontDatabaseOption(const QObject &nativeInterface) +{ + const QVariant argumentV = nativeInterface.property("fontengine"); + if (argumentV.isValid()) { + const QString argument = argumentV.toString(); + if (argument == QLatin1String("freetype")) + return FontDatabaseFreeType; + if (argument == QLatin1String("native")) + return FontDatabaseNative; + } + return FontDatabaseAuto; +} + QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const { if (!d->m_fontDatabase) { -#ifndef QT_NO_FREETYPE - const QVariant argument = d->m_nativeInterface.property("fontengine"); - if (argument.isValid() && argument.toString() == QLatin1String("freetype")) - d->m_fontDatabase = new QWindowsFontDatabaseFT(); - else - d->m_fontDatabase = new QWindowsFontDatabase(); -#else +#ifdef QT_NO_FREETYPE d->m_fontDatabase = new QWindowsFontDatabase(); +#else + FontDatabaseOption option = fontDatabaseOption(d->m_nativeInterface); + if (option == FontDatabaseAuto) { + option = QCoreApplication::applicationName() == QStringLiteral("QtQmlViewer") ? + FontDatabaseFreeType : FontDatabaseNative; + } + if (option == FontDatabaseFreeType) { + d->m_fontDatabase = new QWindowsFontDatabaseFT; + } else { + d->m_fontDatabase = new QWindowsFontDatabase; + } #endif } return d->m_fontDatabase; diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6ff854805c4..38a44e2b5a7 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -704,8 +704,11 @@ void QWindowsWindow::setVisible(bool visible) if (m_data.hwnd) { if (visible) { show_sys(); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), + QRect(QPoint(), geometry().size())); } else { hide_sys(); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRegion()); } } } @@ -1191,6 +1194,22 @@ void QWindowsWindow::lower() SetWindowPos(m_data.hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } +void QWindowsWindow::windowEvent(QEvent *event) +{ + switch (event->type()) { + case QEvent::WindowBlocked: // Blocked by another modal window. + setEnabled(false); + setFlag(BlockedByModal); + break; + case QEvent::WindowUnblocked: + setEnabled(true); + clearFlag(BlockedByModal); + break; + default: + break; + } +} + void QWindowsWindow::propagateSizeHints() { if (QWindowsContext::verboseWindows) @@ -1351,6 +1370,50 @@ QWindowsWindow *QWindowsWindow::childAt(const QPoint &clientPoint, unsigned cwex return 0; } +void QWindowsWindow::alertWindow(int durationMs) +{ + DWORD timeOutMs = GetCaretBlinkTime(); + if (!timeOutMs || timeOutMs == INFINITE) + timeOutMs = 250; + + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = m_data.hwnd; + info.dwFlags = FLASHW_TRAY; + info.dwTimeout = timeOutMs; + info.uCount = durationMs == 0 ? 10 : durationMs / timeOutMs; + FlashWindowEx(&info); +} + +void QWindowsWindow::stopAlertWindow() +{ + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = m_data.hwnd; + info.dwFlags = FLASHW_STOP; + info.dwTimeout = 0; + info.uCount = 0; + FlashWindowEx(&info); +} + +bool QWindowsWindow::isEnabled() const +{ + return (style() & WS_DISABLED) == 0; +} + +void QWindowsWindow::setEnabled(bool enabled) +{ + const unsigned oldStyle = style(); + unsigned newStyle = oldStyle; + if (enabled) { + newStyle &= ~WS_DISABLED; + } else { + newStyle |= WS_DISABLED; + } + if (newStyle != oldStyle) + setStyle(newStyle); +} + QByteArray QWindowsWindow::debugWindowFlags(Qt::WindowFlags wf) { const int iwf = int(wf); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index e3336d1c3a1..badc2297184 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -100,7 +100,8 @@ public: FrameDirty = 0x4, //! Frame outdated by setStyle, recalculate in next query. OpenGLSurface = 0x10, OpenGLDoubleBuffered = 0x20, - OpenGlPixelFormatInitialized = 0x40 + OpenGlPixelFormatInitialized = 0x40, + BlockedByModal = 0x80 }; struct WindowData @@ -137,6 +138,8 @@ public: virtual void raise(); virtual void lower(); + void windowEvent(QEvent *event); + virtual void propagateSizeHints(); virtual QMargins frameMargins() const; @@ -189,6 +192,12 @@ public: inline void setFlag(unsigned f) const { m_flags |= f; } inline void clearFlag(unsigned f) const { m_flags &= ~f; } + void setEnabled(bool enabled); + bool isEnabled() const; + + void alertWindow(int durationMs = 0); + void stopAlertWindow(); + private: inline void show_sys() const; inline void hide_sys() const; diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index f328c2f2f8b..6996c87f3fe 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -149,6 +149,7 @@ QXcbWindow::QXcbWindow(QWindow *window) #if defined(XCB_USE_EGL) , m_eglSurface(0) #endif + , m_lastWindowStateEvent(-1) { m_screen = static_cast(window->screen()->handle()); @@ -638,29 +639,9 @@ static void setMotifWmHints(QXcbConnection *c, xcb_window_t window, const QtMoti } } -void QXcbWindow::printNetWmState(const QVector &state) +QXcbWindow::NetWmStates QXcbWindow::netWmStates() { - printf("_NET_WM_STATE (%d): ", state.size()); - for (int i = 0; i < state.size(); ++i) { -#define CHECK_WM_STATE(state_atom) \ - if (state.at(i) == atom(QXcbAtom::state_atom))\ - printf(#state_atom " "); - CHECK_WM_STATE(_NET_WM_STATE_ABOVE) - CHECK_WM_STATE(_NET_WM_STATE_BELOW) - CHECK_WM_STATE(_NET_WM_STATE_FULLSCREEN) - CHECK_WM_STATE(_NET_WM_STATE_MAXIMIZED_HORZ) - CHECK_WM_STATE(_NET_WM_STATE_MAXIMIZED_VERT) - CHECK_WM_STATE(_NET_WM_STATE_MODAL) - CHECK_WM_STATE(_NET_WM_STATE_STAYS_ON_TOP) - CHECK_WM_STATE(_NET_WM_STATE_DEMANDS_ATTENTION) -#undef CHECK_WM_STATE - } - printf("\n"); -} - -QVector QXcbWindow::getNetWmState() -{ - QVector result; + NetWmStates result(0); xcb_get_property_cookie_t get_cookie = xcb_get_property_unchecked(xcb_connection(), 0, m_window, atom(QXcbAtom::_NET_WM_STATE), @@ -670,15 +651,24 @@ QVector QXcbWindow::getNetWmState() xcb_get_property_reply(xcb_connection(), get_cookie, NULL); if (reply && reply->format == 32 && reply->type == XCB_ATOM_ATOM) { - result.resize(reply->length); - - memcpy(result.data(), xcb_get_property_value(reply), reply->length * sizeof(xcb_atom_t)); - -#ifdef NET_WM_STATE_DEBUG - printf("getting net wm state (%x)\n", m_window); - printNetWmState(result); -#endif - + const xcb_atom_t *states = static_cast(xcb_get_property_value(reply)); + const xcb_atom_t *statesEnd = states + reply->length; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_ABOVE))) + result |= NetWmStateAbove; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_BELOW))) + result |= NetWmStateBelow; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN))) + result |= NetWmStateFullScreen; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ))) + result |= NetWmStateMaximizedHorz; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT))) + result |= NetWmStateMaximizedVert; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_MODAL))) + result |= NetWmStateModal; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP))) + result |= NetWmStateStaysOnTop; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_DEMANDS_ATTENTION))) + result |= NetWmStateDemandsAttention; free(reply); } else { #ifdef NET_WM_STATE_DEBUG @@ -689,8 +679,26 @@ QVector QXcbWindow::getNetWmState() return result; } -void QXcbWindow::setNetWmState(const QVector &atoms) +void QXcbWindow::setNetWmStates(NetWmStates states) { + QVector atoms; + if (states & NetWmStateAbove) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_ABOVE)); + if (states & NetWmStateBelow) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_BELOW)); + if (states & NetWmStateFullScreen) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN)); + if (states & NetWmStateMaximizedHorz) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ)); + if (states & NetWmStateMaximizedVert) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT)); + if (states & NetWmStateModal) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_MODAL)); + if (states & NetWmStateStaysOnTop) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP)); + if (states & NetWmStateDemandsAttention) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_DEMANDS_ATTENTION)); + if (atoms.isEmpty()) { Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_STATE))); } else { @@ -701,7 +709,6 @@ void QXcbWindow::setNetWmState(const QVector &atoms) xcb_flush(xcb_connection()); } - Qt::WindowFlags QXcbWindow::setWindowFlags(Qt::WindowFlags flags) { Qt::WindowType type = static_cast(int(flags & Qt::WindowType_Mask)); @@ -968,30 +975,28 @@ void QXcbWindow::updateMotifWmHintsBeforeMap() void QXcbWindow::updateNetWmStateBeforeMap() { - QVector netWmState; + NetWmStates states(0); - Qt::WindowFlags flags = window()->windowFlags(); + const Qt::WindowFlags flags = window()->windowFlags(); if (flags & Qt::WindowStaysOnTopHint) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_ABOVE)); - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP)); + states |= NetWmStateAbove; + states |= NetWmStateStaysOnTop; } else if (flags & Qt::WindowStaysOnBottomHint) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_BELOW)); + states |= NetWmStateBelow; } - if (window()->windowState() & Qt::WindowFullScreen) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN)); - } + if (window()->windowState() & Qt::WindowFullScreen) + states |= NetWmStateFullScreen; if (window()->windowState() & Qt::WindowMaximized) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ)); - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT)); + states |= NetWmStateMaximizedHorz; + states |= NetWmStateMaximizedVert; } - if (window()->windowModality() != Qt::NonModal) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_MODAL)); - } + if (window()->windowModality() != Qt::NonModal) + states |= NetWmStateModal; - setNetWmState(netWmState); + setNetWmStates(states); } void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp) @@ -1469,41 +1474,42 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev { connection()->setTime(event->time); - bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; + const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; + const xcb_atom_t netWmStateAtom = atom(QXcbAtom::_NET_WM_STATE); + const xcb_atom_t wmStateAtom = atom(QXcbAtom::WM_STATE); - if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { + if (event->atom == netWmStateAtom || event->atom == wmStateAtom) { if (propertyDeleted) return; - xcb_get_property_cookie_t get_cookie = - xcb_get_property(xcb_connection(), 0, m_window, atom(QXcbAtom::WM_STATE), - XCB_ATOM_ANY, 0, 1024); + Qt::WindowState newState = Qt::WindowNoState; + if (event->atom == wmStateAtom) { // WM_STATE: Quick check for 'Minimize'. + const xcb_get_property_cookie_t get_cookie = + xcb_get_property(xcb_connection(), 0, m_window, wmStateAtom, + XCB_ATOM_ANY, 0, 1024); - xcb_get_property_reply_t *reply = - xcb_get_property_reply(xcb_connection(), get_cookie, NULL); + xcb_get_property_reply_t *reply = + xcb_get_property_reply(xcb_connection(), get_cookie, NULL); - xcb_atom_t wm_state = XCB_WM_STATE_WITHDRAWN; - if (reply && reply->format == 32 && reply->type == atom(QXcbAtom::WM_STATE)) { - if (reply->length != 0) - wm_state = ((long *)xcb_get_property_value(reply))[0]; - free(reply); + if (reply && reply->format == 32 && reply->type == wmStateAtom) { + const long *data = (const long *)xcb_get_property_value(reply); + if (reply->length != 0 && XCB_WM_STATE_ICONIC == data[0]) + newState = Qt::WindowMinimized; + free(reply); + } + } // WM_STATE: Quick check for 'Minimize'. + if (newState != Qt::WindowMinimized) { // Something else changed, get _NET_WM_STATE. + const NetWmStates states = netWmStates(); + if ((states & NetWmStateMaximizedHorz) && (states & NetWmStateMaximizedVert)) + newState = Qt::WindowMaximized; + else if (states & NetWmStateFullScreen) + newState = Qt::WindowFullScreen; + } + // Send Window state, compress events in case other flags (modality, etc) are changed. + if (m_lastWindowStateEvent != newState) { + QWindowSystemInterface::handleWindowStateChanged(window(), newState); + m_lastWindowStateEvent = newState; } - - QVector netWmState = getNetWmState(); - - bool maximized = netWmState.contains(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ)) - && netWmState.contains(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT)); - bool fullscreen = netWmState.contains(atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN)); - - Qt::WindowState state = Qt::WindowNoState; - if (wm_state == XCB_WM_STATE_ICONIC) - state = Qt::WindowMinimized; - else if (maximized) - state = Qt::WindowMaximized; - else if (fullscreen) - state = Qt::WindowFullScreen; - - QWindowSystemInterface::handleWindowStateChanged(window(), state); } } diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 37e0bdb8d33..c8999de83d5 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -59,6 +59,19 @@ class QXcbEGLSurface; class QXcbWindow : public QXcbObject, public QPlatformWindow { public: + enum NetWmState { + NetWmStateAbove = 0x1, + NetWmStateBelow = 0x2, + NetWmStateFullScreen = 0x4, + NetWmStateMaximizedHorz = 0x8, + NetWmStateMaximizedVert = 0x10, + NetWmStateModal = 0x20, + NetWmStateStaysOnTop = 0x40, + NetWmStateDemandsAttention = 0x80 + }; + + Q_DECLARE_FLAGS(NetWmStates, NetWmState) + QXcbWindow(QWindow *window); ~QXcbWindow(); @@ -123,9 +136,8 @@ public: private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); - QVector getNetWmState(); - void setNetWmState(const QVector &atoms); - void printNetWmState(const QVector &state); + NetWmStates netWmStates(); + void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); @@ -173,6 +185,7 @@ private: QRegion m_exposeRegion; xcb_visualid_t m_visualId; + int m_lastWindowStateEvent; }; QT_END_NAMESPACE diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm index e387a586070..1dded4f9057 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm @@ -179,8 +179,12 @@ void QPageSetupDialog::setVisible(bool visible) QDialog::setVisible(visible); if (visible) { - d->openCocoaPageLayout(parentWidget() ? Qt::WindowModal - : Qt::ApplicationModal); + Qt::WindowModality modality = windowModality(); + if (modality == Qt::NonModal) { + // NSPrintPanels can only be modal, so we must pick a type + modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal; + } + d->openCocoaPageLayout(modality); return; } else { if (d->pageLayout) { diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 8ea3c9a11dd..e1d85eed59a 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -296,8 +296,12 @@ void QPrintDialog::setVisible(bool visible) QDialog::setVisible(visible); if (visible) { - d->openCocoaPrintPanel(parentWidget() ? Qt::WindowModal - : Qt::ApplicationModal); + Qt::WindowModality modality = windowModality(); + if (modality == Qt::NonModal) { + // NSPrintPanels can only be modal, so we must pick a type + modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal; + } + d->openCocoaPrintPanel(modality); return; } else { if (d->printPanel) { diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 4c576749303..70471d0c660 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -573,6 +573,11 @@ static QSqlField qMakeFieldInfo(const SQLHANDLE hStmt, const QODBCDriverPrivate* QString fname = qGetStringData(hStmt, 3, -1, p->unicode); int type = qGetIntData(hStmt, 4).toInt(); // column type QSqlField f(fname, qDecodeODBCType(type, p)); + QVariant var = qGetIntData(hStmt, 6); + f.setLength(var.isNull() ? -1 : var.toInt()); // column size + var = qGetIntData(hStmt, 8).toInt(); + f.setPrecision(var.isNull() ? -1 : var.toInt()); // precision + f.setSqlType(type); int required = qGetIntData(hStmt, 10).toInt(); // nullable-flag // required can be SQL_NO_NULLS, SQL_NULLABLE or SQL_NULLABLE_UNKNOWN if (required == SQL_NO_NULLS) @@ -580,11 +585,6 @@ static QSqlField qMakeFieldInfo(const SQLHANDLE hStmt, const QODBCDriverPrivate* else if (required == SQL_NULLABLE) f.setRequired(false); // else we don't know - QVariant var = qGetIntData(hStmt, 6); - f.setLength(var.isNull() ? -1 : var.toInt()); // column size - var = qGetIntData(hStmt, 8).toInt(); - f.setPrecision(var.isNull() ? -1 : var.toInt()); // precision - f.setSqlType(type); return f; } diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index cc66ca9963e..74cdc5874c5 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1213,8 +1213,14 @@ void Generator::generateSignal(FunctionDef *def,int index) fprintf(out, "%s _t%d%s", a.type.name.constData(), offset++, a.rightType.constData()); } fprintf(out, ")%s\n{\n", constQualifier); - if (def->type.name.size() && def->normalizedType != "void") - fprintf(out, " %s _t0 = %s();\n", noRef(def->normalizedType).constData(), noRef(def->normalizedType).constData()); + if (def->type.name.size() && def->normalizedType != "void") { + QByteArray returnType = noRef(def->normalizedType); + if (returnType.endsWith('*')) { + fprintf(out, " %s _t0 = 0;\n", returnType.constData()); + } else { + fprintf(out, " %s _t0 = %s();\n", returnType.constData(), returnType.constData()); + } + } fprintf(out, " void *_a[] = { "); if (def->normalizedType == "void") { diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 696b32c7280..d88c9f29508 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -915,6 +915,8 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed) case PP_ENDIF: until(PP_NEWLINE); continue; + case PP_NEWLINE: + continue; case SIGNALS: case SLOTS: { Symbol sym = symbol(); diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index aea8ed2119d..165a235a86d 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -1258,8 +1258,20 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, NodeList::ConstIterator c = qcn->childNodes().begin(); while (c != qcn->childNodes().end()) { if ((*c)->subType() == Node::QmlPropertyGroup) { + bool attached = false; const QmlPropGroupNode* pgn = static_cast(*c); - if (pgn->isAttached()) + NodeList::ConstIterator C = pgn->childNodes().begin(); + while (C != pgn->childNodes().end()) { + if ((*C)->type() == Node::QmlProperty) { + const QmlPropertyNode* pn = static_cast(*C); + if (pn->isAttached()) { + attached = true; + break; + } + } + ++C; + } + if (attached) insert(qmlattachedproperties,*c,style,Okay); else insert(qmlproperties,*c,style,Okay); diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index b08c6f901c9..d8367b3e09f 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -689,9 +689,11 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, return node; } else if (command == COMMAND_EXAMPLE) { - ExampleNode* en = new ExampleNode(tree_->root(), arg); - createExampleFileNodes(en); - return en; + if (Config::generateExamples) { + ExampleNode* en = new ExampleNode(tree_->root(), arg); + createExampleFileNodes(en); + return en; + } } else if (command == COMMAND_EXTERNALPAGE) { return new FakeNode(tree_->root(), arg, Node::ExternalPage, Node::ArticlePage); @@ -937,7 +939,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) { QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element); if (qmlClass) { - qmlPropGroup = new QmlPropGroupNode(qmlClass,property,attached); + qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached); } } if (qmlPropGroup) { @@ -950,7 +952,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, } if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); - qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable())); } ++arg; while (arg != args.end()) { @@ -961,7 +963,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, attached); if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); - qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable())); } } ++arg; @@ -1117,7 +1119,14 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) { QmlPropGroupNode* qpgn = static_cast(node); - qpgn->setDefault(); + NodeList::ConstIterator p = qpgn->childNodes().begin(); + while (p != qpgn->childNodes().end()) { + if ((*p)->type() == Node::QmlProperty) { + QmlPropertyNode* qpn = static_cast(*p); + qpn->setDefault(); + } + ++p; + } } } else if (command == COMMAND_QMLREADONLY) { @@ -1127,7 +1136,6 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) { QmlPropGroupNode* qpgn = static_cast(node); - qpgn->setReadOnly(1); NodeList::ConstIterator p = qpgn->childNodes().begin(); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 3f1e8c02e9b..1f986e35ffe 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -249,6 +249,14 @@ QString DitaXmlGenerator::ditaTags[] = "" }; +void DitaXmlGenerator::debugPara(const QString& t) +{ + writeStartTag(DT_p); + xmlWriter().writeAttribute("outputclass",t); + xmlWriter().writeCharacters(t); + writeEndTag(); //

+} + static bool showBrokenLinks = false; /*! @@ -693,6 +701,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, static bool in_para = false; QString guid, hc, attr; +#if 0 + // Leave this here for debugging. + if (outFileName() == "modules.dita") { + QString comment = "ATOM:" + atom->typeString(); + xmlWriter().writeComment(comment); + } +#endif switch (atom->type()) { case Atom::AbstractLeft: break; @@ -721,6 +736,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, { Node::Type t = relative->type(); if (inSection()) { + in_para = true; writeStartTag(DT_p); xmlWriter().writeAttribute("outputclass","brief"); } @@ -756,6 +772,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::BriefRight: // if (relative->type() != Node::Fake) writeEndTag(); // or

+ if (in_para) + in_para = false; noLinks = false; break; case Atom::C: @@ -769,13 +787,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeEndTag(); // see writeStartElement() above break; case Atom::Code: - { - writeStartTag(DT_codeblock); - xmlWriter().writeAttribute("outputclass","cpp"); - QString chars = trimmedTrailing(atom->string()); - writeText(chars, marker, relative); - writeEndTag(); // - } + { + writeStartTag(DT_codeblock); + xmlWriter().writeAttribute("outputclass","cpp"); + QString chars = trimmedTrailing(atom->string()); + writeText(chars, marker, relative); + writeEndTag(); // + } break; case Atom::Qml: writeStartTag(DT_codeblock); @@ -866,71 +884,71 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::FormatIf: break; case Atom::FormattingLeft: - { - DitaTag t = DT_LAST; - if (atom->string() == ATOM_FORMATTING_BOLD) - t = DT_b; - else if (atom->string() == ATOM_FORMATTING_PARAMETER) - t = DT_i; - else if (atom->string() == ATOM_FORMATTING_ITALIC) - t = DT_i; - else if (atom->string() == ATOM_FORMATTING_TELETYPE) - t = DT_tt; - else if (atom->string().startsWith("span ")) { - t = DT_keyword; - } - else if (atom->string() == ATOM_FORMATTING_UICONTROL) - t = DT_uicontrol; - else if (atom->string() == ATOM_FORMATTING_UNDERLINE) - t = DT_u; - else if (atom->string() == ATOM_FORMATTING_INDEX) - t = DT_comment; - else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT) - t = DT_sub; - else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT) - t = DT_sup; - else - qDebug() << "DT_LAST"; - writeStartTag(t); - if (atom->string() == ATOM_FORMATTING_PARAMETER) { - if (atom->next() != 0 && atom->next()->type() == Atom::String) { - QRegExp subscriptRegExp("([a-z]+)_([0-9n])"); - if (subscriptRegExp.exactMatch(atom->next()->string())) { - xmlWriter().writeCharacters(subscriptRegExp.cap(1)); - writeStartTag(DT_sub); - xmlWriter().writeCharacters(subscriptRegExp.cap(2)); - writeEndTag(); // - skipAhead = 1; + { + DitaTag t = DT_LAST; + if (atom->string() == ATOM_FORMATTING_BOLD) + t = DT_b; + else if (atom->string() == ATOM_FORMATTING_PARAMETER) + t = DT_i; + else if (atom->string() == ATOM_FORMATTING_ITALIC) + t = DT_i; + else if (atom->string() == ATOM_FORMATTING_TELETYPE) + t = DT_tt; + else if (atom->string().startsWith("span ")) { + t = DT_keyword; + } + else if (atom->string() == ATOM_FORMATTING_UICONTROL) + t = DT_uicontrol; + else if (atom->string() == ATOM_FORMATTING_UNDERLINE) + t = DT_u; + else if (atom->string() == ATOM_FORMATTING_INDEX) + t = DT_comment; + else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT) + t = DT_sub; + else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT) + t = DT_sup; + else + qDebug() << "DT_LAST"; + writeStartTag(t); + if (atom->string() == ATOM_FORMATTING_PARAMETER) { + if (atom->next() != 0 && atom->next()->type() == Atom::String) { + QRegExp subscriptRegExp("([a-z]+)_([0-9n])"); + if (subscriptRegExp.exactMatch(atom->next()->string())) { + xmlWriter().writeCharacters(subscriptRegExp.cap(1)); + writeStartTag(DT_sub); + xmlWriter().writeCharacters(subscriptRegExp.cap(2)); + writeEndTag(); // + skipAhead = 1; + } } } - } - else if (t == DT_keyword) { - QString attr = atom->string().mid(5); - if (!attr.isEmpty()) { - if (attr.contains('=')) { - int index = 0; - int from = 0; - QString values; - while (index >= 0) { - index = attr.indexOf('"',from); - if (index >= 0) { - ++index; - from = index; + else if (t == DT_keyword) { + QString attr = atom->string().mid(5); + if (!attr.isEmpty()) { + if (attr.contains('=')) { + int index = 0; + int from = 0; + QString values; + while (index >= 0) { index = attr.indexOf('"',from); - if (index > from) { - if (!values.isEmpty()) - values.append(' '); - values += attr.mid(from,index-from); - from = index+1; + if (index >= 0) { + ++index; + from = index; + index = attr.indexOf('"',from); + if (index > from) { + if (!values.isEmpty()) + values.append(' '); + values += attr.mid(from,index-from); + from = index+1; + } } } + attr = values; } - attr = values; } + xmlWriter().writeAttribute("outputclass", attr); } - xmlWriter().writeAttribute("outputclass", attr); } - } break; case Atom::FormattingRight: if (atom->string() == ATOM_FORMATTING_LINK) { @@ -941,17 +959,17 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::AnnotatedList: - { - QList values = tree_->groups().values(atom->string()); - NodeMap nodeMap; - for (int i = 0; i < values.size(); ++i) { - const Node* n = values.at(i); - if ((n->status() != Node::Internal) && (n->access() != Node::Private)) { - nodeMap.insert(n->nameForLists(),n); + { + QList values = tree_->groups().values(atom->string()); + NodeMap nodeMap; + for (int i = 0; i < values.size(); ++i) { + const Node* n = values.at(i); + if ((n->status() != Node::Internal) && (n->access() != Node::Private)) { + nodeMap.insert(n->nameForLists(),n); + } } + generateAnnotatedList(relative, marker, nodeMap); } - generateAnnotatedList(relative, marker, nodeMap); - } break; case Atom::GeneratedList: if (atom->string() == "annotatedclasses") { @@ -1206,6 +1224,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (fileName.isEmpty()) { + relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string()))); QString images = "images"; if (!baseDir().isEmpty()) images.prepend("../"); @@ -1269,34 +1288,34 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, //xmlWriter().writeEmptyElement("br"); break; case Atom::Link: - { - const Node *node = 0; - QString myLink = getLink(atom, relative, marker, &node); - if (myLink.isEmpty()) { - myLink = getCollisionLink(atom); + { + const Node *node = 0; + QString myLink = getLink(atom, relative, marker, &node); + if (myLink.isEmpty()) { + myLink = getCollisionLink(atom); + } + if (myLink.isEmpty()) { + relative->doc().location().warning(tr("Can't link to '%1'") + .arg(atom->string())); + } + else if (!inSectionHeading) { + beginLink(myLink); + } + skipAhead = 1; } - if (myLink.isEmpty()) { - relative->doc().location().warning(tr("Can't link to '%1'") - .arg(atom->string())); - } - else if (!inSectionHeading) { - beginLink(myLink); - } - skipAhead = 1; - } break; case Atom::GuidLink: - { - beginLink(atom->string()); - skipAhead = 1; - } + { + beginLink(atom->string()); + skipAhead = 1; + } break; case Atom::LinkNode: - { - const Node* node = CodeMarker::nodeForString(atom->string()); - beginLink(linkForNode(node, relative)); - skipAhead = 1; - } + { + const Node* node = CodeMarker::nodeForString(atom->string()); + beginLink(linkForNode(node, relative)); + skipAhead = 1; + } break; case Atom::ListLeft: if (in_para) { @@ -1352,8 +1371,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, else // (atom->string() == ATOM_LIST_NUMERIC) xmlWriter().writeAttribute("outputclass","numeric"); if (atom->next() != 0 && atom->next()->string().toInt() != 1) { - // I don't think this attribute is supported. - xmlWriter().writeAttribute("start",atom->next()->string()); + /* + This attribute is not supported in DITA, and at the + moment, including it is causing a validation error + wherever it is used. I think it is onlym used in the + qdoc manual. + */ + //xmlWriter().writeAttribute("start",atom->next()->string()); } } break; @@ -1628,47 +1652,48 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeEndTag(); // break; case Atom::TableItemLeft: - { - QString values; - writeStartTag(DT_entry); - for (int i=0; icount(); ++i) { - attr = atom->string(i); - if (attr.contains('=')) { - int index = 0; - int from = 0; - while (index >= 0) { - index = attr.indexOf('"',from); - if (index >= 0) { - ++index; - from = index; + { + QString values; + writeStartTag(DT_entry); + for (int i=0; icount(); ++i) { + attr = atom->string(i); + if (attr.contains('=')) { + int index = 0; + int from = 0; + while (index >= 0) { index = attr.indexOf('"',from); - if (index > from) { - if (!values.isEmpty()) - values.append(' '); - values += attr.mid(from,index-from); - from = index+1; + if (index >= 0) { + ++index; + from = index; + index = attr.indexOf('"',from); + if (index > from) { + if (!values.isEmpty()) + values.append(' '); + values += attr.mid(from,index-from); + from = index+1; + } + } + } + } + else { + QStringList spans = attr.split(QLatin1Char(',')); + if (spans.size() == 2) { + if ((spans[0].toInt()>1) || (spans[1].toInt()>1)) { + values += "span(" + spans[0] + QLatin1Char(',') + spans[1] + QLatin1Char(')'); } } } } - else { - QStringList spans = attr.split(QLatin1Char(',')); - if (spans.size() == 2) { - if ((spans[0].toInt()>1) || (spans[1].toInt()>1)) { - values += "span(" + spans[0] + QLatin1Char(',') + spans[1] + QLatin1Char(')'); - } - } - } + if (!values.isEmpty()) + xmlWriter().writeAttribute("outputclass",values); + if (matchAhead(atom, Atom::ParaLeft)) + skipAhead = 1; } - if (!values.isEmpty()) - xmlWriter().writeAttribute("outputclass",values); - if (matchAhead(atom, Atom::ParaLeft)) - skipAhead = 1; - } break; case Atom::TableItemRight: - if (inTableHeader) + if (inTableHeader) { writeEndTag(); // + } else { writeEndTag(); // } @@ -1676,33 +1701,33 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead = 1; break; case Atom::TableOfContents: - { - int numColumns = 1; - const Node* node = relative; + { + int numColumns = 1; + const Node* node = relative; - Doc::Sections sectionUnit = Doc::Section4; - QStringList params = atom->string().split(QLatin1Char(',')); - QString columnText = params.at(0); - QStringList pieces = columnText.split(QLatin1Char(' '), QString::SkipEmptyParts); - if (pieces.size() >= 2) { - columnText = pieces.at(0); - pieces.pop_front(); - QString path = pieces.join(" ").trimmed(); - node = findNodeForTarget(path, relative, marker, atom); + Doc::Sections sectionUnit = Doc::Section4; + QStringList params = atom->string().split(QLatin1Char(',')); + QString columnText = params.at(0); + QStringList pieces = columnText.split(QLatin1Char(' '), QString::SkipEmptyParts); + if (pieces.size() >= 2) { + columnText = pieces.at(0); + pieces.pop_front(); + QString path = pieces.join(" ").trimmed(); + node = findNodeForTarget(path, relative, marker, atom); + } + + if (params.size() == 2) { + numColumns = qMax(columnText.toInt(), numColumns); + sectionUnit = (Doc::Sections)params.at(1).toInt(); + } + + if (node) + generateTableOfContents(node, + marker, + sectionUnit, + numColumns, + relative); } - - if (params.size() == 2) { - numColumns = qMax(columnText.toInt(), numColumns); - sectionUnit = (Doc::Sections)params.at(1).toInt(); - } - - if (node) - generateTableOfContents(node, - marker, - sectionUnit, - numColumns, - relative); - } break; case Atom::Target: if (in_para) { @@ -2277,7 +2302,7 @@ void DitaXmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) writeProlog(fake); writeStartTag(DT_body); - enterSection(QString(),QString()); + enterSection("",""); if (fake->subType() == Node::Module) { generateStatus(fake, marker); if (moduleNamespaceMap.contains(fake->name())) { @@ -4420,14 +4445,11 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node, writeStartTag(DT_li); writeGuidAttribute((Node*)qpn); QString attr; - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) - attr = "read-only"; - } - else if (ro > 0) + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) attr = "read-only"; - if (qpgn->isDefault()) { + if (qpn->isDefault()) { if (!attr.isEmpty()) attr += QLatin1Char(' '); attr += "default"; @@ -4462,13 +4484,11 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node, writeStartTag(DT_li); writeGuidAttribute((Node*)qpn); QString attr; - int ro = qpn->getReadOnly(); - if (ro < 0) { - const ClassNode* cn = qpn->declarativeCppNode(); - if (cn && !qpn->isWritable(tree_)) - attr = "read-only"; + if (!qpn->isReadOnlySet()) { + if (qpn->declarativeCppNode()) + qpn->setReadOnly(!qpn->isWritable(tree_)); } - else if (ro > 0) + if (qpn->isReadOnly()) attr = "read-only"; if (qpn->isDefault()) { if (!attr.isEmpty()) @@ -4495,12 +4515,9 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node, writeStartTag(DT_li); writeGuidAttribute((Node*)q); QString attr; - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) - attr = "read-only"; - } - else if (ro > 0) + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) attr = "read-only"; if (qpn->isDefault()) { if (!attr.isEmpty()) @@ -6000,9 +6017,10 @@ void DitaXmlGenerator::writeTopicrefs(NodeMultiMap* nmm, const QString& navtitle for (int count = 0; count < dmNode->map().count(); count++) { if (dmNode->map().at(count)->navtitle() == i.key()) { foundInDitaMap = true; + break; } - ++mapIterator; } + ++mapIterator; } if (!foundInDitaMap) { writeStartTag(DT_topicref); @@ -6418,7 +6436,7 @@ void DitaXmlGenerator::generateCollisionPages() generateHeader(ncn, ditaTitle); writeProlog(ncn); writeStartTag(DT_body); - enterSection(QString(),QString()); + enterSection("",""); NodeMap nm; for (int i=0; idoc().location().warning( tr("No such enum item '%1' in %2").arg(*a).arg(marker->plainFullName(node)), details); + if (*a == "Void") + qDebug() << "VOID:" << node->name() << definedItems; } else if (!documentedItems.contains(*a)) { node->doc().location().warning( diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 9434ced42f1..24dd31e0b55 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -775,6 +775,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (atom->type() == Atom::Image) out() << "

"; if (fileName.isEmpty()) { + relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string()))); out() << "[Missing image " << protectEnc(atom->string()) << "]"; } @@ -4072,16 +4073,11 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << "

"; out() << ""; - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) { - out() << "read-only"; - } - } - else if (ro > 0) { + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) out() << "read-only"; - } - if (qpgn->isDefault()) + if (qpn->isDefault()) out() << "default"; generateQmlItem(qpn, relative, marker, false); out() << "

"; @@ -4113,16 +4109,12 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << ""; out() << "

"; out() << ""; - int ro = qpn->getReadOnly(); - if (ro < 0) { - const ClassNode* cn = qpn->declarativeCppNode(); - if (cn && !qpn->isWritable(tree_)) { - out() << "read-only"; - } + if (!qpn->isReadOnlySet()) { + if (qpn->declarativeCppNode()) + qpn->setReadOnly(!qpn->isWritable(tree_)); } - else if (ro > 0) { + if (qpn->isReadOnly()) out() << "read-only"; - } if (qpn->isDefault()) out() << "default"; generateQmlItem(qpn, relative, marker, false); @@ -4145,16 +4137,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << ""; out() << "

"; out() << ""; - - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) { - out() << "read-only"; - } - } - else if (ro > 0) { + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) out() << "read-only"; - } if (qpn->isDefault()) out() << "default"; generateQmlItem(q, relative, marker, false); diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index de268e11779..f7985bd389a 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -115,13 +115,13 @@ static void printHelp() " -highlighting " "Turn on syntax highlighting (makes qdoc run slower)\n" " -no-examples " - "Do not generate documentation for examples" + "Do not generate documentation for examples\n" " -obsoletelinks " "Report links from obsolete items to non-obsolete items\n" " -outputdir " "Specify output directory, overrides setting in qdocconf file\n" " -outputformat " - "Specify output format, overrides setting in qdocconf file" + "Specify output format, overrides setting in qdocconf file\n" " -showinternal " "Include content marked internal\n" " -version " diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 703c0735549..24c0006dae7 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -327,6 +327,38 @@ void Node::setPageType(const QString& t) pageType_ = DitaMapPage; } +/*! Converts the boolean value \a b to an enum representation + of the boolean type, which includes an enum value for the + \e {default value} of the item, i.e. true, false, or default. + */ +Node::FlagValue Node::toFlagValue(bool b) +{ + return b ? FlagValueTrue : FlagValueFalse; +} + +/*! + Converts the enum \a fv back to a boolean value. + If \a fv is neither the true enum value nor the + false enum value, the boolean value returned is + \a defaultValue. + + Note that runtimeDesignabilityFunction() should be called + first. If that function returns the name of a function, it + means the function must be called at runtime to determine + whether the property is Designable. + */ +bool Node::fromFlagValue(FlagValue fv, bool defaultValue) +{ + switch (fv) { + case FlagValueTrue: + return true; + case FlagValueFalse: + return false; + default: + return defaultValue; + } +} + /*! Sets the pointer to the node that this node relates to. */ @@ -1876,11 +1908,11 @@ void FunctionNode::debug() const */ PropertyNode::PropertyNode(InnerNode *parent, const QString& name) : LeafNode(Property, parent, name), - sto(Trool_Default), - des(Trool_Default), - scr(Trool_Default), - wri(Trool_Default), - usr(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), + scriptable_(FlagValueDefault), + writable_(FlagValueDefault), + user_(FlagValueDefault), cst(false), fnl(false), rev(-1), @@ -1905,16 +1937,16 @@ void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty) if (funcs[i].isEmpty()) funcs[i] = baseProperty->funcs[i]; } - if (sto == Trool_Default) - sto = baseProperty->sto; - if (des == Trool_Default) - des = baseProperty->des; - if (scr == Trool_Default) - scr = baseProperty->scr; - if (wri == Trool_Default) - wri = baseProperty->wri; - if (usr == Trool_Default) - usr = baseProperty->usr; + if (stored_ == FlagValueDefault) + stored_ = baseProperty->stored_; + if (designable_ == FlagValueDefault) + designable_ = baseProperty->designable_; + if (scriptable_ == FlagValueDefault) + scriptable_ = baseProperty->scriptable_; + if (writable_ == FlagValueDefault) + writable_ = baseProperty->writable_; + if (user_ == FlagValueDefault) + user_ = baseProperty->user_; overrides = baseProperty; } @@ -1940,38 +1972,6 @@ QString PropertyNode::qualifiedDataType() const } } -/*! Converts the \a boolean value to an enum representation - of the boolean type, which includes an enum value for the - \e {default value} of the item, i.e. true, false, or default. - */ -PropertyNode::Trool PropertyNode::toTrool(bool boolean) -{ - return boolean ? Trool_True : Trool_False; -} - -/*! - Converts the enum \a troolean back to a boolean value. - If \a troolean is neither the true enum value nor the - false enum value, the boolean value returned is - \a defaultValue. - - Note that runtimeDesignabilityFunction() should be called - first. If that function returns the name of a function, it - means the function must be called at runtime to determine - whether the property is Designable. - */ -bool PropertyNode::fromTrool(Trool troolean, bool defaultValue) -{ - switch (troolean) { - case Trool_True: - return true; - case Trool_False: - return false; - default: - return defaultValue; - } -} - bool QmlClassNode::qmlOnly = false; QMultiMap QmlClassNode::inheritedBy; QMap QmlClassNode::moduleMap; @@ -2181,13 +2181,14 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ -QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, - const QString& name, - bool attached) - : FakeNode(parent, name, QmlPropertyGroup, Node::ApiPage), +QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) + //bool attached) + : FakeNode(parent, name, QmlPropertyGroup, Node::ApiPage) +#if 0 isdefault_(false), attached_(attached), readOnly_(-1) +#endif { // nothing. } @@ -2207,11 +2208,11 @@ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent, bool attached) : LeafNode(QmlProperty, parent, name), type_(type), - sto(Trool_Default), - des(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), isdefault_(false), attached_(attached), - readOnly_(-1) + readOnly_(FlagValueDefault) { setPageType(ApiPage); } @@ -2226,11 +2227,11 @@ QmlPropertyNode::QmlPropertyNode(QmlClassNode *parent, bool attached) : LeafNode(QmlProperty, parent, name), type_(type), - sto(Trool_Default), - des(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), isdefault_(false), attached_(attached), - readOnly_(-1) + readOnly_(FlagValueDefault) { setPageType(ApiPage); } @@ -2252,38 +2253,15 @@ QmlPropertyNode::QmlPropertyNode(QmlPropertyNode* parent, bool attached) : LeafNode(parent->parent(), QmlProperty, name), type_(type), - sto(Trool_Default), - des(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), isdefault_(false), attached_(attached), - readOnly_(-1) + readOnly_(FlagValueDefault) { setPageType(ApiPage); } -/*! - I don't know what this is. - */ -QmlPropertyNode::Trool QmlPropertyNode::toTrool(bool boolean) -{ - return boolean ? Trool_True : Trool_False; -} - -/*! - I don't know what this is either. - */ -bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) -{ - switch (troolean) { - case Trool_True: - return true; - case Trool_False: - return false; - default: - return defaultValue; - } -} - /*! Returns true if a QML property or attached property is read-only. The algorithm for figuring this out is long @@ -2293,14 +2271,16 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) */ bool QmlPropertyNode::isWritable(Tree* tree) { - if (wri != Trool_Default) - return fromTrool(wri, false); + if (readOnly_ != FlagValueDefault) { + return !fromFlagValue(readOnly_, false); + } PropertyNode* pn = correspondingProperty(tree); - if (pn) + if (pn) { return pn->isWritable(); + } else { - location().warning(tr("Can't determine read-only status of QML property %1; writable assumed.").arg(name())); + location().warning(tr("Can't detect if QML property %1 is read-only; writable assumed.").arg(name())); return true; } } diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index cfd446dd895..45b5ded640b 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -156,6 +156,12 @@ public: OnBeyondZebra }; + enum FlagValue { + FlagValueDefault = -1, + FlagValueFalse = 0, + FlagValueTrue = 1 + }; + virtual ~Node(); void setAccess(Access access) { access_ = access; } @@ -239,6 +245,9 @@ public: static QString cleanId(QString str); QString idForNode() const; + static FlagValue toFlagValue(bool b); + static bool fromFlagValue(FlagValue fv, bool defaultValue); + static QString pageTypeString(unsigned t); static QString nodeTypeString(unsigned t); static QString nodeSubtypeString(unsigned t); @@ -553,9 +562,8 @@ public: class QmlPropGroupNode : public FakeNode { public: - QmlPropGroupNode(QmlClassNode* parent, - const QString& name, - bool attached); + QmlPropGroupNode(QmlClassNode* parent, const QString& name); + //bool attached); virtual ~QmlPropGroupNode() { } virtual bool isQmlNode() const { return true; } virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); } @@ -564,6 +572,7 @@ public: virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); } const QString& element() const { return parent()->name(); } +#if 0 void setDefault() { isdefault_ = true; } void setReadOnly(int ro) { readOnly_ = ro; } int getReadOnly() const { return readOnly_; } @@ -575,6 +584,7 @@ private: bool isdefault_; bool attached_; int readOnly_; +#endif }; class QmlPropertyNode; @@ -597,21 +607,20 @@ public: virtual ~QmlPropertyNode() { } void setDataType(const QString& dataType) { type_ = dataType; } - void setStored(bool stored) { sto = toTrool(stored); } - void setDesignable(bool designable) { des = toTrool(designable); } - void setWritable(bool writable) { wri = toTrool(writable); } + void setStored(bool stored) { stored_ = toFlagValue(stored); } + void setDesignable(bool designable) { designable_ = toFlagValue(designable); } + void setReadOnly(bool ro) { readOnly_ = toFlagValue(ro); } + void setDefault() { isdefault_ = true; } const QString &dataType() const { return type_; } QString qualifiedDataType() const { return type_; } - void setDefault() { isdefault_ = true; } - void setReadOnly(int ro) { readOnly_ = ro; } - int getReadOnly() const { return readOnly_; } + bool isReadOnlySet() const { return (readOnly_ != FlagValueDefault); } bool isDefault() const { return isdefault_; } - bool isStored() const { return fromTrool(sto,true); } - bool isDesignable() const { return fromTrool(des,false); } + bool isStored() const { return fromFlagValue(stored_,true); } + bool isDesignable() const { return fromFlagValue(designable_,false); } bool isWritable(Tree* tree); bool isAttached() const { return attached_; } - bool isReadOnly() const { return (readOnly_ > 0); } + bool isReadOnly() const { return fromFlagValue(readOnly_,false); } virtual bool isQmlNode() const { return true; } virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); } virtual QString qmlModuleName() const { return parent()->qmlModuleName(); } @@ -625,18 +634,12 @@ public: const NodeList& qmlPropNodes() const { return qmlPropNodes_; } private: - enum Trool { Trool_True, Trool_False, Trool_Default }; - - static Trool toTrool(bool boolean); - static bool fromTrool(Trool troolean, bool defaultValue); - QString type_; - Trool sto; - Trool des; - Trool wri; + FlagValue stored_; + FlagValue designable_; bool isdefault_; bool attached_; - int readOnly_; + FlagValue readOnly_; NodeList qmlPropNodes_; }; @@ -842,11 +845,11 @@ public: void setDataType(const QString& dataType) { type_ = dataType; } void addFunction(FunctionNode* function, FunctionRole role); void addSignal(FunctionNode* function, FunctionRole role); - void setStored(bool stored) { sto = toTrool(stored); } - void setDesignable(bool designable) { des = toTrool(designable); } - void setScriptable(bool scriptable) { scr = toTrool(scriptable); } - void setWritable(bool writable) { wri = toTrool(writable); } - void setUser(bool user) { usr = toTrool(user); } + void setStored(bool stored) { stored_ = toFlagValue(stored); } + void setDesignable(bool designable) { designable_ = toFlagValue(designable); } + void setScriptable(bool scriptable) { scriptable_ = toFlagValue(scriptable); } + void setWritable(bool writable) { writable_ = toFlagValue(writable); } + void setUser(bool user) { user_ = toFlagValue(user); } void setOverriddenFrom(const PropertyNode* baseProperty); void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; } void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; } @@ -862,13 +865,13 @@ public: NodeList setters() const { return functions(Setter); } NodeList resetters() const { return functions(Resetter); } NodeList notifiers() const { return functions(Notifier); } - bool isStored() const { return fromTrool(sto, storedDefault()); } - bool isDesignable() const { return fromTrool(des, designableDefault()); } - bool isScriptable() const { return fromTrool(scr, scriptableDefault()); } + bool isStored() const { return fromFlagValue(stored_, storedDefault()); } + bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); } + bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); } const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; } const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; } - bool isWritable() const { return fromTrool(wri, writableDefault()); } - bool isUser() const { return fromTrool(usr, userDefault()); } + bool isWritable() const { return fromFlagValue(writable_, writableDefault()); } + bool isUser() const { return fromFlagValue(user_, userDefault()); } bool isConstant() const { return cst; } bool isFinal() const { return fnl; } const PropertyNode* overriddenFrom() const { return overrides; } @@ -880,20 +883,15 @@ public: bool writableDefault() const { return !setters().isEmpty(); } private: - enum Trool { Trool_True, Trool_False, Trool_Default }; - - static Trool toTrool(bool boolean); - static bool fromTrool(Trool troolean, bool defaultValue); - QString type_; QString runtimeDesFunc; QString runtimeScrFunc; NodeList funcs[NumFunctionRoles]; - Trool sto; - Trool des; - Trool scr; - Trool wri; - Trool usr; + FlagValue stored_; + FlagValue designable_; + FlagValue scriptable_; + FlagValue writable_; + FlagValue user_; bool cst; bool fnl; int rev; diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index ae050ac6430..796ce421185 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -100,16 +100,14 @@ static QString buddyString(const QWidget *widget) return QString(); } -QString Q_WIDGETS_EXPORT qt_accStripAmp(const QString &text) -{ - return QString(text).remove(QLatin1Char('&')); -} - -QString Q_WIDGETS_EXPORT qt_accHotKey(const QString &text) +/* This function will return the offset of the '&' in the text that would be + preceding the accelerator character. + If this text does not have an accelerator, -1 will be returned. */ +static int qt_accAmpIndex(const QString &text) { #ifndef QT_NO_SHORTCUT if (text.isEmpty()) - return text; + return -1; int fa = 0; QChar ac; @@ -118,23 +116,42 @@ QString Q_WIDGETS_EXPORT qt_accHotKey(const QString &text) if (fa < text.length()) { // ignore "&&" if (text.at(fa) == QLatin1Char('&')) { + ++fa; continue; } else { - ac = text.at(fa); + return fa - 1; break; } } } - if (ac.isNull()) - return QString(); - return QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + ac.toUpper(); + + return -1; #else Q_UNUSED(text); - return QString(); + return -1; #endif } +QString Q_WIDGETS_EXPORT qt_accStripAmp(const QString &text) +{ + QString newText(text); + int ampIndex = qt_accAmpIndex(newText); + if (ampIndex != -1) + newText.remove(ampIndex, 1); + + return newText.replace(QLatin1String("&&"), QLatin1String("&")); +} + +QString Q_WIDGETS_EXPORT qt_accHotKey(const QString &text) +{ + int ampIndex = qt_accAmpIndex(text); + if (ampIndex != -1) + return (QString)QKeySequence(Qt::ALT) + text.at(ampIndex + 1); + + return QString(); +} + class QAccessibleWidgetPrivate { public: diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h index caa9d5e648e..c9d791653b1 100644 --- a/src/widgets/dialogs/qwizard.h +++ b/src/widgets/dialogs/qwizard.h @@ -130,7 +130,7 @@ public: void removePage(int id); QWizardPage *page(int id) const; bool hasVisitedPage(int id) const; - QList visitedPages() const; // ### visitedIds()? + QList visitedPages() const; // ### Qt 6: visitedIds()? QList pageIds() const; void setStartId(int id); int startId() const; diff --git a/src/widgets/graphicsview/qgraphicslayoutitem.h b/src/widgets/graphicsview/qgraphicslayoutitem.h index ef391f01a04..38f09743c0b 100644 --- a/src/widgets/graphicsview/qgraphicslayoutitem.h +++ b/src/widgets/graphicsview/qgraphicslayoutitem.h @@ -96,13 +96,12 @@ public: QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - virtual void updateGeometry(); //### rename to sizeHintChanged() + virtual void updateGeometry(); QGraphicsLayoutItem *parentLayoutItem() const; void setParentLayoutItem(QGraphicsLayoutItem *parent); bool isLayout() const; - // ###Qt5: Make automatic reparenting work regardless of item/object/widget type. QGraphicsItem *graphicsItem() const; bool ownedByLayout() const; diff --git a/src/widgets/graphicsview/qgraphicswidget.h b/src/widgets/graphicsview/qgraphicswidget.h index e0bb591231a..01e3efcc58a 100644 --- a/src/widgets/graphicsview/qgraphicswidget.h +++ b/src/widgets/graphicsview/qgraphicswidget.h @@ -171,7 +171,6 @@ public: void dumpFocusChain(); #endif - // ### Qt 5: Disambiguate #ifdef Q_NO_USING_KEYWORD const QObjectList &children() const { return QObject::children(); } #else diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 95c5edca6f2..9b6b2368c95 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -67,15 +67,15 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_DATASTREAM -QDataStream &operator<<(QDataStream &out, const QHeaderViewPrivate::SectionSpan &span) +QDataStream &operator<<(QDataStream &out, const QHeaderViewPrivate::SectionItem §ion) { - span.write(out); + section.write(out); return out; } -QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span) +QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem §ion) { - span.read(in); + section.read(in); return in; } #endif // QT_NO_DATASTREAM @@ -777,18 +777,18 @@ void QHeaderView::moveSection(int from, int to) //Q_ASSERT(oldHeaderLength == length()); // move sizes - // ### check for spans of section sizes here + // ### check for items of section sizes here if (to > from) { for (visual = from; visual <= to; ++visual) { int size = sizes[visual - from]; ResizeMode mode = modes[visual - from]; - d->createSectionSpan(visual, visual, size, mode); + d->createSectionItems(visual, visual, size, mode); } } else { for (visual = to; visual <= from; ++visual) { int size = sizes[visual - to]; ResizeMode mode = modes[visual - to]; - d->createSectionSpan(visual, visual, size, mode); + d->createSectionItems(visual, visual, size, mode); } } //Q_ASSERT(d->headerLength() == length()); @@ -827,8 +827,8 @@ void QHeaderView::swapSections(int first, int second) ResizeMode secondMode = d->headerSectionResizeMode(second); int secondLogical = d->logicalIndex(second); - d->createSectionSpan(second, second, firstSize, firstMode); - d->createSectionSpan(first, first, secondSize, secondMode); + d->createSectionItems(second, second, firstSize, firstMode); + d->createSectionItems(first, first, secondSize, secondMode); d->initializeIndexMapping(); @@ -886,7 +886,7 @@ void QHeaderView::resizeSection(int logical, int size) if (stretchLastSection() && visual == d->lastVisibleVisualIndex()) d->lastSectionSize = size; - d->createSectionSpan(visual, visual, size, d->headerSectionResizeMode(visual)); + d->createSectionItems(visual, visual, size, d->headerSectionResizeMode(visual)); if (!updatesEnabled()) { if (d->hasAutoResizeSections()) @@ -1707,18 +1707,18 @@ void QHeaderView::sectionsInserted(const QModelIndex &parent, int insertAt = logicalFirst; int insertCount = logicalLast - logicalFirst + 1; - QHeaderViewPrivate::SectionSpan span(d->defaultSectionSize, d->globalResizeMode); + QHeaderViewPrivate::SectionItem section(d->defaultSectionSize, d->globalResizeMode); d->sectionStartposRecalc = true; - if (d->sectionSpans.isEmpty() || insertAt >= d->sectionSpans.count()) { + if (d->sectionItems.isEmpty() || insertAt >= d->sectionItems.count()) { int insertLength = d->defaultSectionSize * insertCount; d->length += insertLength; - d->sectionSpans.insert(d->sectionSpans.count(), insertCount, span); // append + d->sectionItems.insert(d->sectionItems.count(), insertCount, section); // append } else { - // separate them out into their own spans + // separate them out into their own sections int insertLength = d->defaultSectionSize * insertCount; d->length += insertLength; - d->sectionSpans.insert(insertAt, insertCount, span); + d->sectionItems.insert(insertAt, insertCount, section); } // update sorting column @@ -1840,7 +1840,7 @@ void QHeaderViewPrivate::_q_sectionsRemoved(const QModelIndex &parent, if (visualIndices.isEmpty() && logicalIndices.isEmpty()) { //Q_ASSERT(headerSectionCount() == sectionCount); - removeSectionsFromSpans(logicalFirst, logicalLast); + removeSectionsFromSectionItems(logicalFirst, logicalLast); } else { if (logicalFirst == logicalLast) { // Remove just one index. int l = logicalFirst; @@ -1857,21 +1857,21 @@ void QHeaderViewPrivate::_q_sectionsRemoved(const QModelIndex &parent, logicalIndices.remove(visual); visualIndices.remove(l); //Q_ASSERT(headerSectionCount() == sectionCount); - removeSectionsFromSpans(visual, visual); + removeSectionsFromSectionItems(visual, visual); } else { sectionStartposRecalc = true; // We will need to recalc positions after removing items - for (int u = 0; u < sectionSpans.count(); ++u) // Store spans info - sectionSpans.at(u).tmpLogIdx = logicalIndices.at(u); - for (int v = sectionSpans.count() - 1; v >= 0; --v) { // Remove the sections - if (logicalFirst <= sectionSpans.at(v).tmpLogIdx && sectionSpans.at(v).tmpLogIdx <= logicalLast) - removeSectionsFromSpans(v, v); // Invalidates the spans variable + for (int u = 0; u < sectionItems.count(); ++u) // Store section info + sectionItems.at(u).tmpLogIdx = logicalIndices.at(u); + for (int v = sectionItems.count() - 1; v >= 0; --v) { // Remove the sections + if (logicalFirst <= sectionItems.at(v).tmpLogIdx && sectionItems.at(v).tmpLogIdx <= logicalLast) + removeSectionsFromSectionItems(v, v); } - visualIndices.resize(sectionSpans.count()); - logicalIndices.resize(sectionSpans.count()); + visualIndices.resize(sectionItems.count()); + logicalIndices.resize(sectionItems.count()); int* visual_data = visualIndices.data(); int* logical_data = logicalIndices.data(); - for (int w = 0; w < sectionSpans.count(); ++w) { // Restore visual and logical indexes - int logindex = sectionSpans.at(w).tmpLogIdx; + for (int w = 0; w < sectionItems.count(); ++w) { // Restore visual and logical indexes + int logindex = sectionItems.at(w).tmpLogIdx; if (logindex > logicalFirst) logindex -= changeCount; visual_data[logindex] = w; @@ -1993,7 +1993,7 @@ void QHeaderView::initializeSections(int start, int end) if (end + 1 < d->sectionCount()) { int newCount = end + 1; - d->removeSectionsFromSpans(newCount, d->sectionCount() - 1); + d->removeSectionsFromSectionItems(newCount, d->sectionCount() - 1); if (!d->hiddenSectionSize.isEmpty()) { if (oldCount - newCount > d->hiddenSectionSize.count()) { for (int i = end + 1; i < d->sectionCount(); ++i) @@ -2043,7 +2043,7 @@ void QHeaderView::initializeSections(int start, int end) d->sectionHidden.resize(newSectionCount); if (newSectionCount > oldCount) - d->createSectionSpan(start, end, (end - start + 1) * d->defaultSectionSize, d->globalResizeMode); + d->createSectionItems(start, end, (end - start + 1) * d->defaultSectionSize, d->globalResizeMode); //Q_ASSERT(d->headerLength() == d->length); if (d->sectionCount() != oldCount) @@ -2212,14 +2212,14 @@ void QHeaderView::paintEvent(QPaintEvent *e) } #if 0 - // ### visualize section spans - for (int a = 0, i = 0; i < d->sectionSpans.count(); ++i) { + // ### visualize sections + for (int a = 0, i = 0; i < d->sectionItems.count(); ++i) { QColor color((i & 4 ? 255 : 0), (i & 2 ? 255 : 0), (i & 1 ? 255 : 0)); if (d->orientation == Qt::Horizontal) - painter.fillRect(a - d->offset, 0, d->sectionSpans.at(i).size, 4, color); + painter.fillRect(a - d->offset, 0, d->sectionItems.at(i).size, 4, color); else - painter.fillRect(0, a - d->offset, 4, d->sectionSpans.at(i).size, color); - a += d->sectionSpans.at(i).size; + painter.fillRect(0, a - d->offset, 4, d->sectionItems.at(i).size, color); + a += d->sectionItems.at(i).size; } #endif @@ -3096,6 +3096,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool pixelReminder = lengthToStrech % numberOfStretchedSections; } + // ### The code below would be nicer if it was cleaned up a bit (since spans has been replaced with items) int spanStartSection = 0; int previousSectionLength = 0; @@ -3137,7 +3138,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool if ((previousSectionResizeMode != newSectionResizeMode || previousSectionLength != newSectionLength) && i > 0) { int spanLength = (i - spanStartSection) * previousSectionLength; - createSectionSpan(spanStartSection, i - 1, spanLength, previousSectionResizeMode); + createSectionItems(spanStartSection, i - 1, spanLength, previousSectionResizeMode); //Q_ASSERT(headerLength() == length); spanStartSection = i; } @@ -3149,7 +3150,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool previousSectionResizeMode = newSectionResizeMode; } - createSectionSpan(spanStartSection, sectionCount() - 1, + createSectionItems(spanStartSection, sectionCount() - 1, (sectionCount() - spanStartSection) * previousSectionLength, previousSectionResizeMode); //Q_ASSERT(headerLength() == length); @@ -3157,14 +3158,14 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool viewport->update(); } -void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeaderView::ResizeMode mode) +void QHeaderViewPrivate::createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode) { int sizePerSection = size / (end - start + 1); - if (end >= sectionSpans.count()) { - sectionSpans.resize(end + 1); + if (end >= sectionItems.count()) { + sectionItems.resize(end + 1); sectionStartposRecalc = true; } - SectionSpan *sectiondata = sectionSpans.data(); + SectionItem *sectiondata = sectionItems.data(); for (int i = start; i <= end; ++i) { length += (sizePerSection - sectiondata[i].size); sectionStartposRecalc |= (sectiondata[i].size != sizePerSection); @@ -3173,15 +3174,15 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader } } -void QHeaderViewPrivate::removeSectionsFromSpans(int start, int end) +void QHeaderViewPrivate::removeSectionsFromSectionItems(int start, int end) { // remove sections - sectionStartposRecalc |= (end != sectionSpans.count() - 1); + sectionStartposRecalc |= (end != sectionItems.count() - 1); int removedlength = 0; for (int u = start; u <= end; ++u) - removedlength += sectionSpans.at(u).size; + removedlength += sectionItems.at(u).size; length -= removedlength; - sectionSpans.remove(start, end - start + 1); + sectionItems.remove(start, end - start + 1); } void QHeaderViewPrivate::clear() @@ -3193,7 +3194,7 @@ void QHeaderViewPrivate::clear() sectionSelected.clear(); sectionHidden.clear(); hiddenSectionSize.clear(); - sectionSpans.clear(); + sectionItems.clear(); } } @@ -3230,7 +3231,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) int originalSectionSize = cascadingSectionSize.value(i); if (currentSectionSize < originalSectionSize) { int newSectionSize = currentSectionSize + delta; - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); if (newSectionSize >= originalSectionSize && false) cascadingSectionSize.remove(i); // the section is now restored sectionResized = true; @@ -3244,7 +3245,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) if (!sectionResized) { newSize = qMax(newSize, minimumSize); if (oldSize != newSize) - resizeSectionSpan(visual, oldSize, newSize); + resizeSectionItem(visual, oldSize, newSize); } // cascade the section size change @@ -3256,7 +3257,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) continue; int newSectionSize = qMax(currentSectionSize - delta, minimumSize); //qDebug() << "### cascading to" << i << newSectionSize - currentSectionSize << delta; - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); saveCascadingSectionSize(i, currentSectionSize); delta = delta - (currentSectionSize - newSectionSize); //qDebug() << "new delta" << delta; @@ -3276,7 +3277,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) if (currentSectionSize >= originalSectionSize) continue; int newSectionSize = currentSectionSize - delta; - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); if (newSectionSize >= originalSectionSize && false) { //qDebug() << "section" << i << "restored to" << originalSectionSize; cascadingSectionSize.remove(i); // the section is now restored @@ -3286,7 +3287,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) } // resize the section - resizeSectionSpan(visual, oldSize, qMax(newSize, minimumSize)); + resizeSectionItem(visual, oldSize, qMax(newSize, minimumSize)); // cascade the section size change if (delta < 0 && newSize < minimumSize) { @@ -3296,7 +3297,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) int sectionSize = headerSectionSize(i); if (sectionSize <= minimumSize) continue; - resizeSectionSpan(i, sectionSize, qMax(sectionSize + delta, minimumSize)); + resizeSectionItem(i, sectionSize, qMax(sectionSize + delta, minimumSize)); saveCascadingSectionSize(i, sectionSize); break; } @@ -3309,7 +3310,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) continue; int currentSectionSize = headerSectionSize(i); int newSectionSize = qMax(currentSectionSize - delta, minimumSize); - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); break; } } @@ -3325,14 +3326,14 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size) { Q_Q(QHeaderView); defaultSectionSize = size; - for (int i = 0; i < sectionSpans.count(); ++i) { - QHeaderViewPrivate::SectionSpan &span = sectionSpans[i]; + for (int i = 0; i < sectionItems.count(); ++i) { + QHeaderViewPrivate::SectionItem §ion = sectionItems[i]; if (sectionHidden.isEmpty() || !sectionHidden.testBit(i)) { // resize on not hidden. const int newSize = size; - if (newSize != span.size) { - length += newSize - span.size; //the whole length is changed - const int oldSectionSize = span.sectionSize(); - span.size = size; + if (newSize != section.size) { + length += newSize - section.size; //the whole length is changed + const int oldSectionSize = section.sectionSize(); + section.size = size; emit q->sectionResized(logicalIndex(i), oldSectionSize, size); } } @@ -3342,25 +3343,25 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size) void QHeaderViewPrivate::recalcSectionStartPos() const // linear (but fast) { int pixelpos = 0; - for (QVector::const_iterator i = sectionSpans.constBegin(); i != sectionSpans.constEnd(); ++i) { + for (QVector::const_iterator i = sectionItems.constBegin(); i != sectionItems.constEnd(); ++i) { i->calculated_startpos = pixelpos; // write into const mutable pixelpos += i->size; } sectionStartposRecalc = false; } -void QHeaderViewPrivate::resizeSectionSpan(int visualIndex, int oldSize, int newSize) +void QHeaderViewPrivate::resizeSectionItem(int visualIndex, int oldSize, int newSize) { Q_Q(QHeaderView); QHeaderView::ResizeMode mode = headerSectionResizeMode(visualIndex); - createSectionSpan(visualIndex, visualIndex, newSize, mode); + createSectionItems(visualIndex, visualIndex, newSize, mode); emit q->sectionResized(logicalIndex(visualIndex), oldSize, newSize); } int QHeaderViewPrivate::headerSectionSize(int visual) const { if (visual < sectionCount() && visual >= 0) - return sectionSpans.at(visual).sectionSize(); + return sectionItems.at(visual).sectionSize(); return -1; } @@ -3369,7 +3370,7 @@ int QHeaderViewPrivate::headerSectionPosition(int visual) const if (visual < sectionCount() && visual >= 0) { if (sectionStartposRecalc) recalcSectionStartPos(); - return sectionSpans.at(visual).calculated_startpos; + return sectionItems.at(visual).calculated_startpos; } return -1; } @@ -3379,13 +3380,13 @@ int QHeaderViewPrivate::headerVisualIndexAt(int position) const if (sectionStartposRecalc) recalcSectionStartPos(); int startidx = 0; - int endidx = sectionSpans.count() - 1; + int endidx = sectionItems.count() - 1; while (startidx <= endidx) { int middle = (endidx + startidx) / 2; - if (sectionSpans.at(middle).calculated_startpos > position) { + if (sectionItems.at(middle).calculated_startpos > position) { endidx = middle - 1; } else { - if (sectionSpans.at(middle).calculatedEndPos() <= position) + if (sectionItems.at(middle).calculatedEndPos() <= position) startidx = middle + 1; else // we found it. return middle; @@ -3397,22 +3398,21 @@ int QHeaderViewPrivate::headerVisualIndexAt(int position) const void QHeaderViewPrivate::setHeaderSectionResizeMode(int visual, QHeaderView::ResizeMode mode) { int size = headerSectionSize(visual); - createSectionSpan(visual, visual, size, mode); + createSectionItems(visual, visual, size, mode); } QHeaderView::ResizeMode QHeaderViewPrivate::headerSectionResizeMode(int visual) const { - int span = sectionSpanIndex(visual); - if (span == -1) + if (visual < 0 || visual >= sectionItems.count()) return globalResizeMode; - return sectionSpans.at(span).resizeMode; + return sectionItems.at(visual).resizeMode; } void QHeaderViewPrivate::setGlobalHeaderResizeMode(QHeaderView::ResizeMode mode) { globalResizeMode = mode; - for (int i = 0; i < sectionSpans.count(); ++i) - sectionSpans[i].resizeMode = mode; + for (int i = 0; i < sectionItems.count(); ++i) + sectionItems[i].resizeMode = mode; } int QHeaderViewPrivate::viewSectionSizeHint(int logical) const @@ -3430,7 +3430,7 @@ int QHeaderViewPrivate::adjustedVisualIndex(int visualIndex) const if (!sectionHidden.isEmpty()) { int adjustedVisualIndex = visualIndex; int currentVisualIndex = 0; - for (int i = 0; i < sectionSpans.count(); ++i) { + for (int i = 0; i < sectionItems.count(); ++i) { if (sectionHidden.testBit(i)) ++adjustedVisualIndex; else @@ -3472,7 +3472,7 @@ void QHeaderViewPrivate::write(QDataStream &out) const out << int(defaultAlignment); out << int(globalResizeMode); - out << sectionSpans; + out << sectionItems; } bool QHeaderViewPrivate::read(QDataStream &in) @@ -3512,15 +3512,17 @@ bool QHeaderViewPrivate::read(QDataStream &in) in >> global; globalResizeMode = (QHeaderView::ResizeMode)global; - in >> sectionSpans; - // Spans in Qt5 only contains one element - but for backward compability with Qt4 we do the following - QVector newSectionSpans; - for (int u = 0; u < sectionSpans.count(); ++u) { - int count = sectionSpans.at(u).tmpDataStreamSectionCount; + in >> sectionItems; + // In Qt4 we had a vector of spans where one span could hold information on more sections. + // Now we have an itemvector where one items contains information about one section + // For backward compability with Qt4 we do the following + QVector newSectionItems; + for (int u = 0; u < sectionItems.count(); ++u) { + int count = sectionItems.at(u).tmpDataStreamSectionCount; for (int n = 0; n < count; ++n) - newSectionSpans.append(sectionSpans[u]); + newSectionItems.append(sectionItems[u]); } - sectionSpans = newSectionSpans; + sectionItems = newSectionItems; recalcSectionStartPos(); return true; } diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h index a2b0ef21807..cca81b0c22a 100644 --- a/src/widgets/itemviews/qheaderview_p.h +++ b/src/widgets/itemviews/qheaderview_p.h @@ -141,7 +141,7 @@ public: else sectionSelected.fill(false); } - inline int sectionCount() const {return sectionSpans.count();} + inline int sectionCount() const {return sectionItems.count();} inline bool reverse() const { return orientation == Qt::Horizontal && q_func()->isRightToLeft(); @@ -195,7 +195,7 @@ public: } inline void clearCascadingSections() { - firstCascadingSection = sectionSpans.count(); + firstCascadingSection = sectionItems.count(); lastCascadingSection = 0; cascadingSectionSize.clear(); } @@ -283,9 +283,9 @@ public: QHeaderView::ResizeMode globalResizeMode; QList persistentHiddenSections; mutable bool sectionStartposRecalc; - // header section spans + // header sections - struct SectionSpan { + struct SectionItem { int size; union { // This union is made in order to save space and ensure good vector performance (on remove) mutable int calculated_startpos; // <- this is the primary used member. @@ -293,8 +293,8 @@ public: int tmpDataStreamSectionCount; // recalcSectionStartPos() or set sectionStartposRecalc to true }; // to ensure that calculated_startpos will be calculated afterwards. QHeaderView::ResizeMode resizeMode; - inline SectionSpan() : size(0), resizeMode(QHeaderView::Interactive) {} - inline SectionSpan(int length, QHeaderView::ResizeMode mode) + inline SectionItem() : size(0), resizeMode(QHeaderView::Interactive) {} + inline SectionItem(int length, QHeaderView::ResizeMode mode) : size(length), calculated_startpos(-1), resizeMode(mode) {} inline int sectionSize() const { return size; } inline int calculatedEndPos() const { return calculated_startpos + size; } @@ -306,39 +306,21 @@ public: #endif }; - QVector sectionSpans; + QVector sectionItems; - void createSectionSpan(int start, int end, int size, QHeaderView::ResizeMode mode); - void removeSectionsFromSpans(int start, int end); - void resizeSectionSpan(int visualIndex, int oldSize, int newSize); + void createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode); + void removeSectionsFromSectionItems(int start, int end); + void resizeSectionItem(int visualIndex, int oldSize, int newSize); void setDefaultSectionSize(int size); void recalcSectionStartPos() const; // not really const - inline int headerSectionCount() const { // for debugging - return sectionSpans.count(); - } - inline int headerLength() const { // for debugging int len = 0; - for (int i = 0; i < sectionSpans.count(); ++i) - len += sectionSpans.at(i).size; + for (int i = 0; i < sectionItems.count(); ++i) + len += sectionItems.at(i).size; return len; } - inline void removeSpans(const QList &spans) { - for (int i = spans.count() - 1; i >= 0; --i) { - length -= sectionSpans.at(spans.at(i)).size; - sectionSpans.remove(spans.at(i)); - } - } - - inline int sectionSpanIndex(int visual) const { - if (visual < sectionSpans.count() && visual >= 0) { - return visual; - } - return -1; - } - int headerSectionSize(int visual) const; int headerSectionPosition(int visual) const; int headerVisualIndexAt(int position) const; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index b910d21cb82..ee4f9bd6bb0 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -440,8 +440,6 @@ FontHash *qt_app_fonts_hash() QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus QDesktopWidget *qt_desktopWidget = 0; // root window widgets -QWidgetList * qt_modal_stack = 0; // stack of modal widgets -bool app_do_modal = false; /*! \internal @@ -743,7 +741,8 @@ QWidget *QApplication::activePopupWidget() QWidget *QApplication::activeModalWidget() { - return qt_modal_stack && !qt_modal_stack->isEmpty() ? qt_modal_stack->first() : 0; + QWidgetWindow *widgetWindow = qobject_cast(modalWindow()); + return widgetWindow ? widgetWindow->widget() : 0; } /*! @@ -2303,31 +2302,52 @@ Q_WIDGETS_EXPORT bool qt_tryModalHelper(QWidget *widget, QWidget **rettop) bool QApplicationPrivate::isBlockedByModal(QWidget *widget) { widget = widget->window(); - if (!modalState()) - return false; - if (QApplication::activePopupWidget() == widget) - return false; + return self->isWindowBlocked(widget->windowHandle()); +} - for (int i = 0; i < qt_modal_stack->size(); ++i) { - QWidget *modalWidget = qt_modal_stack->at(i); +bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const +{ + QWindow *unused = 0; + if (!blockingWindow) + blockingWindow = &unused; + + if (modalWindowList.isEmpty()) { + *blockingWindow = 0; + return false; + } + QWidget *popupWidget = QApplication::activePopupWidget(); + QWindow *popupWindow = popupWidget ? popupWidget->windowHandle() : 0; + if (popupWindow == window) { + *blockingWindow = 0; + return false; + } + + for (int i = 0; i < modalWindowList.count(); ++i) { + QWindow *modalWindow = modalWindowList.at(i); { - // check if the active modal widget is our widget or a parent of our widget - QWidget *w = widget; + // check if the modal window is our window or a (transient) parent of our window + QWindow *w = window; while (w) { - if (w == modalWidget) + if (w == modalWindow) { + *blockingWindow = 0; return false; - w = w->parentWidget(); + } + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; } } - Qt::WindowModality windowModality = modalWidget->windowModality(); + Qt::WindowModality windowModality = modalWindow->windowModality(); + QWidgetWindow *modalWidgetWindow = qobject_cast(modalWindow); if (windowModality == Qt::NonModal) { // determine the modality type if it hasn't been set on the - // modalWidget, this normally happens when waiting for a - // native dialog. use WindowModal if we are the child of a - // group leader; otherwise use ApplicationModal. - QWidget *m = modalWidget; + // modalWindow's widget, this normally happens when waiting for a + // native dialog. use WindowModal if we are the child of a group + // leader; otherwise use ApplicationModal. + QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : 0; while (m && !m->testAttribute(Qt::WA_GroupLeader)) { m = m->parentWidget(); if (m) @@ -2340,97 +2360,58 @@ bool QApplicationPrivate::isBlockedByModal(QWidget *widget) switch (windowModality) { case Qt::ApplicationModal: - { - QWidget *groupLeaderForWidget = widget; - while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader)) - groupLeaderForWidget = groupLeaderForWidget->parentWidget(); + { + QWidgetWindow *widgetWindow = qobject_cast(window); + QWidget *groupLeaderForWidget = widgetWindow ? widgetWindow->widget() : 0; + while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader)) + groupLeaderForWidget = groupLeaderForWidget->parentWidget(); - if (groupLeaderForWidget) { - // if \a widget has WA_GroupLeader, it can only be blocked by ApplicationModal children - QWidget *m = modalWidget; - while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader)) - m = m->parentWidget(); - if (m == groupLeaderForWidget) - return true; - } else if (modalWidget != widget) { + if (groupLeaderForWidget) { + // if \a widget has WA_GroupLeader, it can only be blocked by ApplicationModal children + QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : 0; + while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader)) + m = m->parentWidget(); + if (m == groupLeaderForWidget) { + *blockingWindow = m->windowHandle(); return true; } - break; + } else if (modalWindow != window) { + *blockingWindow = modalWindow; + return true; } + break; + } case Qt::WindowModal: - { - QWidget *w = widget; + { + QWindow *w = window; + do { + QWindow *m = modalWindow; do { - QWidget *m = modalWidget; - do { - if (m == w) - return true; - m = m->parentWidget(); - if (m) - m = m->window(); - } while (m); - w = w->parentWidget(); - if (w) - w = w->window(); - } while (w); - break; - } + if (m == w) { + *blockingWindow = m; + return true; + } + QWindow *p = m->parent(); + if (!p) + p = m->transientParent(); + m = p; + } while (m); + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; + } while (w); + break; + } default: - Q_ASSERT_X(false, "QApplication", "internal error, a modal widget cannot be modeless"); + Q_ASSERT_X(false, "QApplication", "internal error, a modal window cannot be modeless"); break; } } + *blockingWindow = 0; return false; } -/*!\internal - */ -void QApplicationPrivate::enterModal(QWidget *widget) -{ - QSet blocked; - QList windows = QApplication::topLevelWidgets(); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if (window->windowType() != Qt::Tool && isBlockedByModal(window)) - blocked.insert(window); - } - - enterModal_sys(widget); - - windows = QApplication::topLevelWidgets(); - QEvent e(QEvent::WindowBlocked); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if (!blocked.contains(window) && window->windowType() != Qt::Tool && isBlockedByModal(window)) - QApplication::sendEvent(window, &e); - } -} - -/*!\internal - */ -void QApplicationPrivate::leaveModal(QWidget *widget) -{ - QSet blocked; - QList windows = QApplication::topLevelWidgets(); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if (window->windowType() != Qt::Tool && isBlockedByModal(window)) - blocked.insert(window); - } - - leaveModal_sys(widget); - - windows = QApplication::topLevelWidgets(); - QEvent e(QEvent::WindowUnblocked); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if(blocked.contains(window) && window->windowType() != Qt::Tool && !isBlockedByModal(window)) - QApplication::sendEvent(window, &e); - } -} - - - /*!\internal Called from qapplication_\e{platform}.cpp, returns true diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index 7a57a913bde..206692e6d4f 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -173,8 +173,6 @@ public: static bool isEffectEnabled(Qt::UIEffect); static void setEffectEnabled(Qt::UIEffect, bool enable = true); - static QPlatformNativeInterface *platformNativeInterface(); - #ifndef QT_NO_SESSIONMANAGER // session management bool isSessionRestored() const; diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 74af3bca6da..8f67a29d847 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -198,10 +198,7 @@ public: static void dispatchEnterLeave(QWidget *enter, QWidget *leave); //modality - static void enterModal(QWidget*); - static void leaveModal(QWidget*); - static void enterModal_sys(QWidget*); - static void leaveModal_sys(QWidget*); + Q_DECL_OVERRIDE bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const; static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0); @@ -279,10 +276,6 @@ public: static bool widgetCount; // Coupled with -widgetcount switch static bool load_testability; // Coupled with -testability switch -#ifdef Q_WS_MAC - static bool native_modal_dialog_active; -#endif - static void setSystemPalette(const QPalette &pal); static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash); static void initializeWidgetPaletteHash(); diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index 74a299ba549..0651d5bf447 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -75,8 +75,6 @@ QT_BEGIN_NAMESPACE static QString appName; static QString appFont; static bool popupGrabOk; -extern bool app_do_modal; -extern QWidgetList *qt_modal_stack; extern QWidget *qt_button_down; extern QWidget *qt_popup_down; extern bool qt_replay_popup_mouse_event; @@ -126,28 +124,9 @@ bool qt_try_modal(QWidget *widget, QEvent::Type type) return !block_event; } -void QApplicationPrivate::enterModal_sys(QWidget *widget) -{ - if (!qt_modal_stack) - qt_modal_stack = new QWidgetList; - qt_modal_stack->insert(0, widget); - app_do_modal = true; -} - -void QApplicationPrivate::leaveModal_sys(QWidget *widget) -{ - if (qt_modal_stack && qt_modal_stack->removeAll(widget)) { - if (qt_modal_stack->isEmpty()) { - delete qt_modal_stack; - qt_modal_stack = 0; - } - } - app_do_modal = qt_modal_stack != 0; -} - bool QApplicationPrivate::modalState() { - return app_do_modal; + return !self->modalWindowList.isEmpty(); } QWidget *qt_tlw_for_window(QWindow *wnd) @@ -453,12 +432,6 @@ void QApplication::alert(QWidget *, int) { } -QPlatformNativeInterface *QApplication::platformNativeInterface() -{ - QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); - return pi->nativeInterface(); -} - void qt_init(QApplicationPrivate *priv, int type) { Q_UNUSED(priv); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 3ab777ad609..648b78dbf6a 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2137,7 +2137,15 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int if ((flags & DrawAsRoot) && !(q->autoFillBackground() && autoFillBrush.isOpaque())) { const QBrush bg = q->palette().brush(QPalette::Window); - fillRegion(painter, rgn, bg); + if (!(flags & DontSetCompositionMode)) { + //copy alpha straight in + QPainter::CompositionMode oldMode = painter->compositionMode(); + painter->setCompositionMode(QPainter::CompositionMode_Source); + fillRegion(painter, rgn, bg); + painter->setCompositionMode(oldMode); + } else { + fillRegion(painter, rgn, bg); + } } if (q->autoFillBackground()) @@ -5229,6 +5237,8 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, else flags |= DontSubtractOpaqueChildren; + flags |= DontSetCompositionMode; + if (target->devType() == QInternal::Printer) { QPainter p(target); render_helper(&p, targetOffset, paintRegion, renderFlags); @@ -6730,7 +6740,6 @@ void QWidget::setContentsMargins(int left, int top, int right, int bottom) else updateGeometry(); - // ### Qt 5: compat, remove if (isVisible()) { update(); QResizeEvent e(data->crect.size(), data->crect.size()); @@ -7080,12 +7089,6 @@ void QWidgetPrivate::show_helper() QShowEvent showEvent; QApplication::sendEvent(q, &showEvent); - if (!isEmbedded && q->isModal() && q->isWindow()) - // QApplicationPrivate::enterModal *before* show, otherwise the initial - // stacking might be wrong - QApplicationPrivate::enterModal(q); - - show_sys(); if (!isEmbedded && q->windowType() == Qt::Popup) @@ -7141,12 +7144,6 @@ void QWidgetPrivate::hide_helper() if (!isEmbedded && (q->windowType() == Qt::Popup)) qApp->d_func()->closePopup(q); - // Move test modal here. Otherwise, a modal dialog could get - // destroyed and we lose all access to its parent because we haven't - // left modality. (Eg. modal Progress Dialog) - if (!isEmbedded && q->isModal() && q->isWindow()) - QApplicationPrivate::leaveModal(q); - #if defined(Q_WS_WIN) if (q->isWindow() && !(q->windowType() == Qt::Popup) && q->parentWidget() && !q->parentWidget()->isHidden() && q->isActiveWindow()) @@ -10047,9 +10044,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_ShowModal: if (!on) { - if (isVisible()) - QApplicationPrivate::leaveModal(this); - // reset modality type to Modeless when clearing WA_ShowModal + // reset modality type to NonModal when clearing WA_ShowModal data->window_modality = Qt::NonModal; } else if (data->window_modality == Qt::NonModal) { // determine the modality type if it hasn't been set prior @@ -10067,10 +10062,9 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) data->window_modality = (w && w->testAttribute(Qt::WA_GroupLeader)) ? Qt::WindowModal : Qt::ApplicationModal; - // Some window managers does not allow us to enter modal after the - // window is showing. Therefore, to be consistent, we cannot call - // QApplicationPrivate::enterModal(this) here. The window must be - // hidden before changing modality. + // Some window managers do not allow us to enter modality after the + // window is visible.The window must be hidden before changing the + // windowModality property and then reshown. } if (testAttribute(Qt::WA_WState_Created)) { // don't call setModal_sys() before create_sys() diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index cf907e14cd4..b7a5e266906 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -606,7 +606,6 @@ public: QBackingStore *backingStore() const; - void setWindowHandle(QWindow *window); QWindow *windowHandle() const; friend class QDesktopScreenWidget; diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 8107b6ca749..d3fcdce6a83 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -284,7 +284,8 @@ public: DrawInvisible = 0x08, DontSubtractOpaqueChildren = 0x10, DontDrawOpaqueChildren = 0x20, - DontDrawNativeChildren = 0x40 + DontDrawNativeChildren = 0x40, + DontSetCompositionMode = 0x80 }; enum CloseMode { diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 0f556469587..63c02a557c3 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -440,9 +440,16 @@ static inline QRect positionTopLevelWindow(QRect geometry, const QScreen *screen void QWidgetPrivate::show_sys() { Q_Q(QWidget); + + QWindow *window = q->windowHandle(); + if (q->testAttribute(Qt::WA_DontShowOnScreen)) { invalidateBuffer(q->rect()); q->setAttribute(Qt::WA_Mapped); + if (q->isWindow() && q->windowModality() != Qt::NonModal && window) { + // add our window to the modal window list + QGuiApplicationPrivate::showModalWindow(window); + } return; } @@ -451,7 +458,6 @@ void QWidgetPrivate::show_sys() if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow)) return; - QWindow *window = q->windowHandle(); if (window) { QRect geomRect = q->geometry(); if (q->isWindow()) { @@ -473,9 +479,7 @@ void QWidgetPrivate::show_sys() } invalidateBuffer(q->rect()); - - if (window) - window->setVisible(true); + window->setVisible(true); } } @@ -483,6 +487,17 @@ void QWidgetPrivate::show_sys() void QWidgetPrivate::hide_sys() { Q_Q(QWidget); + + QWindow *window = q->windowHandle(); + + if (q->testAttribute(Qt::WA_DontShowOnScreen) + && q->isWindow() + && q->windowModality() != Qt::NonModal + && window) { + // remove our window from the modal window list + QGuiApplicationPrivate::hideModalWindow(window); + } + deactivateWidgetCleanup(); if (!q->isWindow()) { @@ -497,7 +512,7 @@ void QWidgetPrivate::hide_sys() if (q->testAttribute(Qt::WA_DontShowOnScreen)) { q->setAttribute(Qt::WA_Mapped, false); - } else if (QWindow *window = q->windowHandle()) { + } else if (window) { window->setVisible(false); } } diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 93c64133d6c..2c9ad14bcfe 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -57,11 +57,6 @@ #include #include -#ifdef Q_WS_QWS -#include -#include -#endif - QT_BEGIN_NAMESPACE extern QRegion qt_dirtyRegion(QWidget *); @@ -153,13 +148,6 @@ static void showYellowThing_win(QWidget *widget, const QRegion ®ion, int msec void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped) { -#ifdef Q_WS_QWS - Q_UNUSED(widget); - Q_UNUSED(unclipped); - static QWSYellowSurface surface(true); - surface.setDelay(msec); - surface.flush(widget, toBePainted, QPoint()); -#else QRegion paintRegion = toBePainted; QRect widgetRect = widget->rect(); @@ -224,7 +212,6 @@ void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePa ::usleep(1000 * msec); #endif #endif // Q_WS_WIN -#endif // Q_WS_QWS } bool QWidgetBackingStore::flushPaint(QWidget *widget, const QRegion &rgn) @@ -633,7 +620,7 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion ®ion, QWidget *widg if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty()) return; -#if defined(Q_WS_QWS) || defined(Q_WS_MAC) +#if defined(Q_WS_MAC) if (!widget->testAttribute(Qt::WA_WState_InPaintEvent)) dirtyOnScreen += region.translated(topLevelOffset); return; @@ -709,8 +696,7 @@ void QWidgetBackingStore::updateLists(QWidget *cur) } QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel) - : tlw(topLevel), dirtyOnScreenWidgets(0), hasDirtyFromPreviousSync(false) - , fullUpdatePending(0) + : tlw(topLevel), dirtyOnScreenWidgets(0), fullUpdatePending(0) { store = tlw->backingStore(); Q_ASSERT(store); @@ -751,11 +737,6 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) QPoint toplevelOffset = pw->mapTo(tlw, QPoint()); QWidgetPrivate *pd = pw->d_func(); QRect clipR(pd->clipRect()); -#ifdef Q_WS_QWS - QWidgetBackingStore *wbs = x->backingStore.data(); - QWSWindowSurface *surface = static_cast(wbs->windowSurface); - clipR = clipR.intersected(surface->clipRegion().translated(-toplevelOffset).boundingRect()); -#endif const QRect newRect(rect.translated(dx, dy)); QRect destRect = rect.intersected(clipR); if (destRect.isValid()) @@ -839,26 +820,6 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) bool accelerateScroll = accelEnv && isOpaque && !(overlapped = isOverlapped(scrollRect.translated(data.crect.topLeft()))); -#if defined(Q_WS_QWS) - QWSWindowSurface *surface; - surface = static_cast(wbs->windowSurface); - - if (accelerateScroll && !surface->isBuffered()) { - const QRegion surfaceClip = surface->clipRegion(); - const QRegion outsideClip = QRegion(rect) - surfaceClip; - if (!outsideClip.isEmpty()) { - const QVector clipped = (surfaceClip & rect).rects(); - if (clipped.size() < 8) { - for (int i = 0; i < clipped.size(); ++i) - this->scrollRect(clipped.at(i), dx, dy); - return; - } else { - accelerateScroll = false; - } - } - } -#endif // Q_WS_QWS - if (!accelerateScroll) { if (overlapped) { QRegion region(scrollRect); @@ -869,12 +830,6 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) } } else { const QPoint toplevelOffset = q->mapTo(tlw, QPoint()); -#ifdef Q_WS_QWS - QWSWindowSurface *surface = static_cast(wbs->windowSurface); - const QRegion clip = surface->clipRegion().translated(-toplevelOffset) & scrollRect; - const QRect clipBoundingRect = clip.boundingRect(); - scrollRect &= clipBoundingRect; -#endif const QRect destRect = scrollRect.translated(dx, dy) & scrollRect; const QRect sourceRect = destRect.translated(-dx, -dy); @@ -1004,9 +959,6 @@ void QWidgetBackingStore::sync() if (updatesDisabled) return; - if (hasDirtyFromPreviousSync) - dirty += dirtyFromPreviousSync; - // Contains everything that needs repaint. QRegion toClean(dirty); diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h index 7befdbeb786..7c350932ea8 100644 --- a/src/widgets/kernel/qwidgetbackingstore_p.h +++ b/src/widgets/kernel/qwidgetbackingstore_p.h @@ -85,12 +85,7 @@ public: inline bool isDirty() const { - return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !hasDirtyFromPreviousSync - && !fullUpdatePending -#if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER) - && !hasDirtyWindowDecoration() -#endif - ); + return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !fullUpdatePending); } // ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore). @@ -108,7 +103,6 @@ private: QVector *dirtyOnScreenWidgets; QList staticWidgets; QBackingStore *store; - uint hasDirtyFromPreviousSync : 1; uint fullUpdatePending : 1; QPoint tlwOffset; @@ -130,10 +124,6 @@ private: void removeDirtyWidget(QWidget *w); -#if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER) - bool hasDirtyWindowDecoration() const; - void paintWindowDecoration(); -#endif void updateLists(QWidget *widget); inline void addDirtyWidget(QWidget *widget, const QRegion &rgn) @@ -199,11 +189,7 @@ private: inline QRect topLevelRect() const { -#ifdef Q_WS_QWS - return tlw->frameGeometry(); -#else return tlw->data->crect; -#endif } inline void appendDirtyOnScreenWidget(QWidget *widget) diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp index 40b6f486bea..d124ec768a3 100644 --- a/src/widgets/kernel/qwidgetwindow_qpa.cpp +++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp @@ -451,10 +451,38 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event { // QWindow does currently not know 'active'. Qt::WindowStates eventState = event->oldState(); - if (m_widget->windowState() & Qt::WindowActive) + Qt::WindowStates widgetState = m_widget->windowState(); + if (widgetState & Qt::WindowActive) eventState |= Qt::WindowActive; - QWindowStateChangeEvent widgetEvent(eventState); - QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent); + + // Determine the new widget state, remember maximized/full screen + // during minimized. + switch (windowState()) { + case Qt::WindowNoState: + widgetState &= ~(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen); + break; + case Qt::WindowMinimized: + widgetState |= Qt::WindowMinimized; + break; + case Qt::WindowMaximized: + widgetState &= ~Qt::WindowFullScreen; + widgetState |= Qt::WindowMaximized; + break; + case Qt::WindowFullScreen: + widgetState &= ~Qt::WindowMaximized; + widgetState |= Qt::WindowFullScreen; + break; + case Qt::WindowActive: // Not handled by QWindow + break; + } + + // Sent event if the state changed (that is, it is not triggered by + // QWidget::setWindowState(), which also sends an event to the widget). + if (widgetState != m_widget->data->window_state) { + m_widget->data->window_state = widgetState; + QWindowStateChangeEvent widgetEvent(eventState); + QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent); + } } bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index 985e7a88aab..aebfea3620a 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -188,7 +188,7 @@ public: PE_IndicatorItemViewItemDrop, PE_PanelItemViewItem, - PE_PanelItemViewRow, // ### Qt 5: remove + PE_PanelItemViewRow, // ### Qt 6: remove PE_PanelStatusBar, @@ -323,7 +323,7 @@ public: SE_CheckBoxLayoutItem, SE_ComboBoxLayoutItem, SE_DateTimeEditLayoutItem, - SE_DialogButtonBoxLayoutItem, // ### remove + SE_DialogButtonBoxLayoutItem, // ### Qt 6: remove SE_LabelLayoutItem, SE_ProgressBarLayoutItem, SE_PushButtonLayoutItem, diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 0e928b13c24..89e8f593158 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -991,9 +991,8 @@ QRenderRule::QRenderRule(const QVector &declarations, const QWidget hintValue = (int) decl.colorValue().rgba(); } else if (hintName.endsWith(QLatin1String("size"))) { hintValue = decl.sizeValue(); - // ### Qt5 -// } else if (hintName.endsWith(QLatin1String("icon"))) { -// hintValue = decl.iconValue(); + } else if (hintName.endsWith(QLatin1String("icon"))) { + hintValue = cssIconValueToIcon(decl.iconValue()); } else if (hintName == QLatin1String("button-layout") && decl.d->values.count() != 0 && decl.d->values.at(0).type == Value::String) { hintValue = subControlLayout(decl.d->values.at(0).variant.toString()); diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index c911670442e..801c7f7e5cf 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -323,7 +323,7 @@ void QWindowsXPStylePrivate::cleanupHandleMap() HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd) { if (theme < 0 || theme >= NThemes || !hwnd) { - qWarning("%s: Invalid parameters #%d, %p", theme, hwnd); + qWarning("%s: Invalid parameters #%d, %p", Q_FUNC_INFO, theme, hwnd); return 0; } if (!m_themes[theme]) { diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index ef6827f74ff..8f6996cfa3f 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -37,7 +37,7 @@ contains( styles, all ) { styles = mac windows windowsxp windowsvista } -!macx-*:styles -= mac +!macx-*|!contains(QT_CONFIG, coreservices):styles -= mac x11{ QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index 4482134c7be..2c8b6177618 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -1160,11 +1161,10 @@ void QScrollerPrivate::recalcScrollingSegments(bool forceRecalc) releaseVelocity = q->velocity(); - if (forceRecalc || !scrollingSegmentsValid(Qt::Horizontal)) - createScrollingSegments(releaseVelocity.x(), contentPosition.x() + overshootPosition.x(), ppm.x(), Qt::Horizontal); - - if (forceRecalc || !scrollingSegmentsValid(Qt::Vertical)) - createScrollingSegments(releaseVelocity.y(), contentPosition.y() + overshootPosition.y(), ppm.y(), Qt::Vertical); + if (forceRecalc || + !scrollingSegmentsValid(Qt::Horizontal) || + !scrollingSegmentsValid(Qt::Vertical)) + createScrollingSegments(releaseVelocity, contentPosition + overshootPosition, ppm); } /*! \internal @@ -1256,7 +1256,9 @@ void QScrollerPrivate::createScrollToSegments(qreal v, qreal deltaTime, qreal en /*! \internal */ -void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal ppm, Qt::Orientation orientation) +void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, + qreal deltaTime, qreal deltaPos, + Qt::Orientation orientation) { const QScrollerPropertiesPrivate *sp = properties.d.data(); @@ -1287,26 +1289,20 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal pp qScrollerDebug() << "v = " << v << ", decelerationFactor = " << sp->decelerationFactor << ", curveType = " << sp->scrollingCurve.type(); - // This is only correct for QEasingCurve::OutQuad (linear velocity, - // constant deceleration), but the results look and feel ok for OutExpo - // and OutSine as well - - // v(t) = deltaTime * a * 0.5 * differentialForProgress(t / deltaTime) - // v(0) = vrelease - // v(deltaTime) = 0 - // deltaTime = (2 * vrelease) / (a * differntial(0)) - - // pos(t) = integrate(v(t)dt) - // pos(t) = vrelease * t - 0.5 * a * t * t - // pos(t) = deltaTime * a * 0.5 * progress(t / deltaTime) * deltaTime - // deltaPos = pos(deltaTime) - - qreal deltaTime = (qreal(2) * qAbs(v)) / (sp->decelerationFactor * differentialForProgress(sp->scrollingCurve, 0)); - qreal deltaPos = qSign(v) * deltaTime * deltaTime * qreal(0.5) * sp->decelerationFactor * ppm; qreal endPos = startPos + deltaPos; qScrollerDebug() << " Real Delta:" << deltaPos; + // -- check if are in overshoot and end in overshoot + if ((startPos < minPos && endPos < minPos) || + (startPos > maxPos && endPos > maxPos)) { + qreal stopPos = endPos < minPos ? minPos : maxPos; + qreal oDeltaTime = sp->overshootScrollTime; + + pushSegment(ScrollTypeOvershoot, oDeltaTime * qreal(0.7), qreal(1.0), startPos, stopPos - startPos, stopPos, sp->scrollingCurve.type(), orientation); + return; + } + // -- determine snap points qreal nextSnap = nextSnapPos(endPos, 0, orientation); qreal lowerSnapPos = nextSnapPos(startPos, -1, orientation); @@ -1320,16 +1316,6 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal pp if (nextSnap < lowerSnapPos || qIsNaN(lowerSnapPos)) lowerSnapPos = nextSnap; - // -- check if are in overshoot and end in overshoot - if ((startPos < minPos && endPos < minPos) || - (startPos > maxPos && endPos > maxPos)) { - qreal stopPos = endPos < minPos ? minPos : maxPos; - qreal oDeltaTime = sp->overshootScrollTime; - - pushSegment(ScrollTypeOvershoot, oDeltaTime * qreal(0.7), qreal(1.0), startPos, stopPos - startPos, stopPos, sp->scrollingCurve.type(), orientation); - return; - } - if (qAbs(v) < sp->minimumVelocity) { qScrollerDebug() << "### below minimum Vel" << orientation; @@ -1414,6 +1400,36 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal pp } +void QScrollerPrivate::createScrollingSegments(const QPointF &v, + const QPointF &startPos, + const QPointF &ppm) +{ + const QScrollerPropertiesPrivate *sp = properties.d.data(); + + // This is only correct for QEasingCurve::OutQuad (linear velocity, + // constant deceleration), but the results look and feel ok for OutExpo + // and OutSine as well + + // v(t) = deltaTime * a * 0.5 * differentialForProgress(t / deltaTime) + // v(0) = vrelease + // v(deltaTime) = 0 + // deltaTime = (2 * vrelease) / (a * differntial(0)) + + // pos(t) = integrate(v(t)dt) + // pos(t) = vrelease * t - 0.5 * a * t * t + // pos(t) = deltaTime * a * 0.5 * progress(t / deltaTime) * deltaTime + // deltaPos = pos(deltaTime) + + QVector2D vel(v); + qreal deltaTime = (qreal(2) * vel.length()) / (sp->decelerationFactor * differentialForProgress(sp->scrollingCurve, 0)); + QPointF deltaPos = (vel.normalized() * QVector2D(ppm)).toPointF() * deltaTime * deltaTime * qreal(0.5) * sp->decelerationFactor; + + createScrollingSegments(v.x(), startPos.x(), deltaTime, deltaPos.x(), + Qt::Horizontal); + createScrollingSegments(v.y(), startPos.y(), deltaTime, deltaPos.y(), + Qt::Vertical); +} + /*! \internal Prepares scrolling by sending a QScrollPrepareEvent to the receiver widget. Returns true if the scrolling was accepted and a target was returned. @@ -1650,8 +1666,7 @@ bool QScrollerPrivate::releaseWhileDragging(const QPointF &position, qint64 time } QPointF ppm = q->pixelPerMeter(); - createScrollingSegments(releaseVelocity.x(), contentPosition.x() + overshootPosition.x(), ppm.x(), Qt::Horizontal); - createScrollingSegments(releaseVelocity.y(), contentPosition.y() + overshootPosition.y(), ppm.y(), Qt::Vertical); + createScrollingSegments(releaseVelocity, contentPosition + overshootPosition, ppm); qScrollerDebug() << "QScroller::releaseWhileDragging() -- velocity:" << releaseVelocity << "-- minimum velocity:" << sp->minimumVelocity << "overshoot" << overshootPosition; diff --git a/src/widgets/util/qscroller_p.h b/src/widgets/util/qscroller_p.h index 6463f03573e..26bd64461fc 100644 --- a/src/widgets/util/qscroller_p.h +++ b/src/widgets/util/qscroller_p.h @@ -131,7 +131,10 @@ public: qreal scrollingSegmentsEndPos(Qt::Orientation orientation) const; bool scrollingSegmentsValid(Qt::Orientation orientation); void createScrollToSegments(qreal v, qreal deltaTime, qreal endPos, Qt::Orientation orientation, ScrollType type); - void createScrollingSegments(qreal v, qreal startPos, qreal ppm, Qt::Orientation orientation); + void createScrollingSegments(qreal v, qreal startPos, + qreal deltaTime, qreal deltaPos, + Qt::Orientation orientation); + void createScrollingSegments(const QPointF &v, const QPointF &startPos, const QPointF &ppm); void setContentPositionHelperDragging(const QPointF &deltaPos); void setContentPositionHelperScrolling(); diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 5f75bd39138..4e85eae3ff6 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -219,12 +219,6 @@ void QButtonGroup::setExclusive(bool exclusive) } -// TODO: Qt 5: Merge with addButton(QAbstractButton *button, int id) -void QButtonGroup::addButton(QAbstractButton *button) -{ - addButton(button, -1); -} - void QButtonGroup::addButton(QAbstractButton *button, int id) { Q_D(QButtonGroup); diff --git a/src/widgets/widgets/qbuttongroup.cpp b/src/widgets/widgets/qbuttongroup.cpp index 381e32d96b9..a5e96370cf9 100644 --- a/src/widgets/widgets/qbuttongroup.cpp +++ b/src/widgets/widgets/qbuttongroup.cpp @@ -175,22 +175,13 @@ */ /*! - \fn void QButtonGroup::addButton(QAbstractButton *button); + \fn void QButtonGroup::addButton(QAbstractButton *button, int id = -1); - Adds the given \a button to the end of the group's internal list - of buttons. An id will be assigned to the button by this - QButtonGroup. Automatically assigned ids are guaranteed to be - negative, starting with -2. If you are also assigning your own - ids, use positive values to avoid conflicts. - - \sa removeButton() buttons() -*/ - -/*! - \fn void QButtonGroup::addButton(QAbstractButton *button, int id); - - Adds the given \a button to the button group, with the given \a - id. It is recommended to assign only positive ids. + Adds the given \a button to the button group. If \a id is -1, + an id will be assigned to the button by this QButtonGroup. + Automatically assigned ids are guaranteed to be negative, + starting with -2. If you are assigning your own ids, use + positive values to avoid conflicts. \sa removeButton() buttons() */ diff --git a/src/widgets/widgets/qbuttongroup.h b/src/widgets/widgets/qbuttongroup.h index e24ac8bbc35..46275d9f049 100644 --- a/src/widgets/widgets/qbuttongroup.h +++ b/src/widgets/widgets/qbuttongroup.h @@ -67,8 +67,7 @@ public: void setExclusive(bool); bool exclusive() const; - void addButton(QAbstractButton *); - void addButton(QAbstractButton *, int id); + void addButton(QAbstractButton *, int id = -1); void removeButton(QAbstractButton *); QList buttons() const; diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 1442cd983e5..854ced596be 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -131,7 +131,7 @@ public: enum SizeAdjustPolicy { AdjustToContents, AdjustToContentsOnFirstShow, - AdjustToMinimumContentsLength, // ### Qt 5: remove + AdjustToMinimumContentsLength, // ### Qt 6: remove AdjustToMinimumContentsLengthWithIcon }; diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h index 21872fa4042..bd5a2c2aa4e 100644 --- a/src/widgets/widgets/qdockwidget.h +++ b/src/widgets/widgets/qdockwidget.h @@ -82,7 +82,7 @@ public: DockWidgetVerticalTitleBar = 0x08, DockWidgetFeatureMask = 0x0f, - AllDockWidgetFeatures = DockWidgetClosable|DockWidgetMovable|DockWidgetFloatable, // ### remove in 5.0 + AllDockWidgetFeatures = DockWidgetClosable|DockWidgetMovable|DockWidgetFloatable, // ### Qt 6: remove NoDockWidgetFeatures = 0x00, Reserved = 0xff diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 6cee96e717e..d1c374a6ca9 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -62,9 +62,10 @@ const int QLineEditPrivate::horizontalMargin(2); QRect QLineEditPrivate::adjustedControlRect(const QRect &rect) const { + QRect widgetRect = !rect.isEmpty() ? rect : q_func()->rect(); QRect cr = adjustedContentsRect(); int cix = cr.x() - hscroll + horizontalMargin; - return rect.translated(QPoint(cix, vscroll)); + return widgetRect.translated(QPoint(cix, vscroll)); } int QLineEditPrivate::xToPos(int x, QTextLine::CursorPosition betweenOrOn) const diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index e4e6390a9dd..e98df595d11 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -46,7 +46,6 @@ #include #include #include -#include #ifdef Q_OS_WINCE #include // for HMENU @@ -61,6 +60,7 @@ QT_BEGIN_NAMESPACE class QMenuPrivate; class QStyleOptionMenuItem; +class QPlatformMenu; class Q_WIDGETS_EXPORT QMenu : public QWidget { diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index ee6e62653fc..d637a9be8fb 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -61,6 +61,8 @@ #include "QtCore/qbasictimer.h" #include "private/qwidget_p.h" +#include + QT_BEGIN_NAMESPACE #ifndef QT_NO_MENU diff --git a/src/widgets/widgets/qmenubar.h b/src/widgets/widgets/qmenubar.h index 98185265438..c1272c45ce0 100644 --- a/src/widgets/widgets/qmenubar.h +++ b/src/widgets/widgets/qmenubar.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE class QMenuBarPrivate; class QStyleOptionMenuItem; class QWindowsStyle; +class QPlatformMenuBar; class Q_WIDGETS_EXPORT QMenuBar : public QWidget { diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 285099a4cb2..44c450ca477 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -232,14 +232,14 @@ void QSplitterHandle::resizeEvent(QResizeEvent *event) { Q_D(const QSplitterHandle); - // When splitters are only 1 pixel large we increase the + // When splitters are only 1 or 0 pixel large we increase the // actual grab area to five pixels // Note that QSplitter uses contentsRect for layouting // and ensures that handles are drawn on top of widgets // We simply use the contents margins for draggin and only // paint the mask area - bool useTinyMode = (d->s->handleWidth() == 1); + bool useTinyMode = (d->s->handleWidth() <= 1); setAttribute(Qt::WA_MouseNoMask, useTinyMode); if (useTinyMode) { if (orientation() == Qt::Horizontal) @@ -1528,14 +1528,14 @@ void QSplitter::setSizes(const QList &list) By default, this property contains a value that depends on the user's platform and style preferences. - If you set handleWidth to 1, the actual grab area will grow to overlap a + If you set handleWidth to 1 or 0, the actual grab area will grow to overlap a few pixels of it's respective widgets. */ int QSplitter::handleWidth() const { Q_D(const QSplitter); - if (d->handleWidth > 0) { + if (d->handleWidth >= 0) { return d->handleWidth; } else { return style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this); diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h index c9db6ef9af0..d9a0cdecb7b 100644 --- a/src/widgets/widgets/qsplitter_p.h +++ b/src/widgets/widgets/qsplitter_p.h @@ -83,7 +83,7 @@ class QSplitterPrivate : public QFramePrivate Q_DECLARE_PUBLIC(QSplitter) public: QSplitterPrivate() : rubberBand(0), opaque(true), firstShow(true), - childrenCollapsible(true), compatMode(false), handleWidth(0), blockChildAdd(false) {} + childrenCollapsible(true), compatMode(false), handleWidth(-1), blockChildAdd(false) {} QPointer rubberBand; mutable QList list; diff --git a/src/widgets/widgets/qstatusbar.h b/src/widgets/widgets/qstatusbar.h index b05bf627ad7..4cab706c0b9 100644 --- a/src/widgets/widgets/qstatusbar.h +++ b/src/widgets/widgets/qstatusbar.h @@ -87,7 +87,7 @@ protected: void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); - // ### Qt 5: consider making reformat() and hideOrShow() private + // ### Qt 6: consider making reformat() and hideOrShow() private void reformat(); void hideOrShow(); bool event(QEvent *); diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index c9300d3cdd9..017cbee219a 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -103,11 +103,11 @@ void QWidgetLineControl::updateDisplayText(bool forceUpdate) int cursor = m_cursor - 1; QChar uc = m_text.at(cursor); str[cursor] = uc; - if (cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (cursor > 0 && uc.isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes restore both at once uc = m_text.at(cursor - 1); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) + if (uc.isHighSurrogate()) str[cursor - 1] = uc; } } @@ -220,11 +220,11 @@ void QWidgetLineControl::backspace() if (m_maskData) m_cursor = prevMaskBlank(m_cursor); QChar uc = m_text.at(m_cursor); - if (m_cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (m_cursor > 0 && uc.isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes delete both at once uc = m_text.at(m_cursor - 1); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) { + if (uc.isHighSurrogate()) { internalDelete(true); --m_cursor; } diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index d602d6daa5d..91864b66087 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -79,6 +79,7 @@ #include #include #include +#include #ifndef QT_NO_SHORTCUT #include "private/qapplication_p.h" @@ -577,8 +578,15 @@ void QWidgetTextControlPrivate::repaintOldAndNewSelection(const QTextCursor &old void QWidgetTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=false*/) { Q_Q(QWidgetTextControl); - if (forceEmitSelectionChanged) + if (forceEmitSelectionChanged) { emit q->selectionChanged(); +#ifndef QT_NO_ACCESSIBILITY + if (q->parent()) { + QAccessibleTextSelectionEvent ev(q->parent(), cursor.anchor(), cursor.position()); + QAccessible::updateAccessibility(&ev); + } +#endif + } if (cursor.position() == lastSelectionPosition && cursor.anchor() == lastSelectionAnchor) @@ -593,9 +601,15 @@ void QWidgetTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged && (selectionStateChange || (cursor.hasSelection() && (cursor.position() != lastSelectionPosition - || cursor.anchor() != lastSelectionAnchor)))) + || cursor.anchor() != lastSelectionAnchor)))) { emit q->selectionChanged(); - +#ifndef QT_NO_ACCESSIBILITY + if (q->parent()) { + QAccessibleTextSelectionEvent ev(q->parent(), cursor.anchor(), cursor.position()); + QAccessible::updateAccessibility(&ev); + } +#endif + } emit q->microFocusChanged(); lastSelectionPosition = cursor.position(); lastSelectionAnchor = cursor.anchor(); diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 04efe43e35a..23a9db8e3a8 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -4559,14 +4559,14 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const QString qName(name); QString nsDecl(QLatin1String("")); if (!namespaceURI.isNull()) { - /** ### Qt 5: + /** ### * * If we still have QDom, optimize this so that we only declare namespaces that are not * yet declared. We loose default namespace mappings, so maybe we should rather store * the information that we get from startPrefixMapping()/endPrefixMapping() and use them. * Modifications becomes more complex then, however. * - * We cannot do this during the Qt 4 series because it would require too invasive changes, and + * We cannot do this in a patch release because it would require too invasive changes, and * hence possibly behavioral changes. */ if (prefix.isEmpty()) { diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index c2205edb40f..a5c206dc27b 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -99,7 +99,7 @@ static const signed char cltSq = 13; // ' static const signed char cltUnknown = 14; // Hack for letting QDom know where the skipped entity occurred -// ### Qt5: the use of this variable means the code isn't reentrant. +// ### the use of this variable means the code isn't reentrant. bool qt_xml_skipped_entity_in_content; // character lookup table @@ -1330,7 +1330,7 @@ QXmlInputSource::QXmlInputSource(QIODevice *dev) */ QXmlInputSource::~QXmlInputSource() { - // ### Qt 5: close the input device. See task 153111 + // ### close the input device. #ifndef QT_NO_TEXTCODEC delete d->encMapper; #endif @@ -3133,16 +3133,17 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const { const QXmlSimpleReaderPrivate *d = d_func(); - // Qt5 ###: Change these strings to qt.nokia.com if (ok != 0) *ok = true; if (name == QLatin1String("http://xml.org/sax/features/namespaces")) { return d->useNamespaces; } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) { return d->useNamespacePrefixes; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) { return d->reportWhitespaceCharData; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) { return d->reportEntities; } else { qWarning("Unknown feature %s", name.toLatin1().data()); @@ -3167,12 +3168,29 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const and attributes used for namespace declarations are reported. \row \li \e http://trolltech.com/xml/features/report-whitespace-only-CharData + \li true + \li Obsolete, use the following string instead. + If enabled, CharData that consist of + only whitespace characters are reported + using QXmlContentHandler::characters(). If disabled, whitespace is silently + discarded. + \row \li \e http://qt-project.org/xml/features/report-whitespace-only-CharData \li true \li If enabled, CharData that consist of only whitespace characters are reported using QXmlContentHandler::characters(). If disabled, whitespace is silently discarded. \row \li \e http://trolltech.com/xml/features/report-start-end-entity + \li false + \li Obsolete, use the following string instead. + If enabled, the parser reports + QXmlContentHandler::startEntity() and + QXmlContentHandler::endEntity() events, so character data + might be reported in chunks. + If disabled, the parser does not report these events, but + silently substitutes the entities, and reports the character + data in one chunk. + \row \li \e http://qt-project.org/xml/features/report-start-end-entity \li false \li If enabled, the parser reports QXmlContentHandler::startEntity() and @@ -3188,14 +3206,15 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const void QXmlSimpleReader::setFeature(const QString& name, bool enable) { Q_D(QXmlSimpleReader); - // Qt5 ###: Change these strings to qt.nokia.com if (name == QLatin1String("http://xml.org/sax/features/namespaces")) { d->useNamespaces = enable; } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) { d->useNamespacePrefixes = enable; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) { d->reportWhitespaceCharData = enable; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4 + || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { d->reportEntities = enable; } else { qWarning("Unknown feature %s", name.toLatin1().data()); @@ -3206,11 +3225,12 @@ void QXmlSimpleReader::setFeature(const QString& name, bool enable) */ bool QXmlSimpleReader::hasFeature(const QString& name) const { - // Qt5 ###: Change these strings to qt.nokia.com if (name == QLatin1String("http://xml.org/sax/features/namespaces") || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes") - || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // Shouldn't change in Qt 4 - || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4 + || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData") + || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) { return true; } else { return false; diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index 038b0c750f6..4c7daff3f7c 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -359,7 +359,7 @@ public: virtual bool internalEntityDecl(const QString& name, const QString& value) = 0; virtual bool externalEntityDecl(const QString& name, const QString& publicId, const QString& systemId) = 0; virtual QString errorString() const = 0; - // ### Qt 5: Conform to SAX by adding elementDecl + // ### Conform to SAX by adding elementDecl }; diff --git a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp index 07ea4c4545e..e513b2cea22 100644 --- a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp +++ b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp @@ -233,6 +233,38 @@ void tst_Utf8::nonCharacters_data() QTest::addColumn("utf8"); QTest::addColumn("utf16"); + // Unicode has a couple of "non-characters" that one can use internally, + // but are not allowed to be used for text interchange. + // + // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF, + // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and + // U+FDEF (inclusive) + + // U+FDD0 through U+FDEF + for (int i = 0; i < 32; ++i) { + char utf8[] = { char(0357), char(0267), char(0220 + i), 0 }; + QString utf16 = QChar(0xfdd0 + i); + QTest::newRow(qPrintable(QString::number(0xfdd0 + i, 16))) << QByteArray(utf8) << utf16; + } + + // the last two in Planes 1 through 16 + for (uint plane = 1; plane <= 16; ++plane) { + for (uint lower = 0xfffe; lower < 0x10000; ++lower) { + uint ucs4 = (plane << 16) | lower; + char utf8[] = { char(0xf0 | uchar(ucs4 >> 18)), + char(0x80 | (uchar(ucs4 >> 12) & 0x3f)), + char(0x80 | (uchar(ucs4 >> 6) & 0x3f)), + char(0x80 | (uchar(ucs4) & 0x3f)), + 0 }; + ushort utf16[] = { QChar::highSurrogate(ucs4), QChar::lowSurrogate(ucs4), 0 }; + + QTest::newRow(qPrintable(QString::number(ucs4, 16))) << QByteArray(utf8) << QString::fromUtf16(utf16); + } + } + + QTest::newRow("fffe") << QByteArray("\xEF\xBF\xBE") << QString(QChar(0xfffe)); + QTest::newRow("ffff") << QByteArray("\xEF\xBF\xBF") << QString(QChar(0xffff)); + extern void loadNonCharactersRows(); loadNonCharactersRows(); } diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index dab5e4a3a59..676762da81f 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -10,5 +10,3 @@ TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \ ../resources/file1.ext1 win32: LIBS+=-lole32 -luuid - -mac*:CONFIG+=insignificant_test diff --git a/tests/auto/corelib/io/qiodevice/qiodevice.pro b/tests/auto/corelib/io/qiodevice/qiodevice.pro index a8295ec79b2..c98e3fb8c37 100644 --- a/tests/auto/corelib/io/qiodevice/qiodevice.pro +++ b/tests/auto/corelib/io/qiodevice/qiodevice.pro @@ -5,5 +5,3 @@ SOURCES = tst_qiodevice.cpp TESTDATA += tst_qiodevice.cpp MOC_DIR=tmp - -mac: CONFIG += insignificant_test # QTBUG-22766 diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 9b1d5c0b686..29f6fe9da46 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -49,7 +49,7 @@ #include #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_BLACKBERRY) #define Q_XDG_PLATFORM #endif @@ -239,12 +239,16 @@ void tst_qstandardpaths::testDataLocation() { // On all platforms, DataLocation should be GenericDataLocation / organization name / app name // This allows one app to access the data of another app. + // Blackberry OS is an exception to this case, owing to the fact that + // applications are sandboxed. +#ifndef Q_OS_BLACKBERRY const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/tst_qstandardpaths"); QCoreApplication::instance()->setOrganizationName("Qt"); QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/tst_qstandardpaths"); QCoreApplication::instance()->setApplicationName("QtTest"); QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/QtTest"); +#endif #ifdef Q_XDG_PLATFORM setDefaultLocations(); diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro index 577f52972d7..93fb6d232fd 100644 --- a/tests/auto/corelib/io/qtextstream/test/test.pro +++ b/tests/auto/corelib/io/qtextstream/test/test.pro @@ -19,5 +19,3 @@ TESTDATA += \ ../qtextstream.qrc \ ../tst_qtextstream.cpp \ ../resources - -mac: CONFIG += insignificant_test # QTBUG-22767 diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index 4ab4b78da16..bf6a58a24bb 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -123,6 +123,8 @@ private Q_SLOTS: void testTrailingComma(); void testDetachBug(); + + void valueEquals(); private: QString testDataDir; }; @@ -1845,5 +1847,51 @@ void TestQtJson::testDetachBug() QCOMPARE(local.keys().size(), 1); } +void TestQtJson::valueEquals() +{ + QVERIFY(QJsonValue() == QJsonValue()); + QVERIFY(QJsonValue() != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue() != QJsonValue(true)); + QVERIFY(QJsonValue() != QJsonValue(1.)); + QVERIFY(QJsonValue() != QJsonValue(QJsonArray())); + QVERIFY(QJsonValue() != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(true) == QJsonValue(true)); + QVERIFY(QJsonValue(true) != QJsonValue(false)); + QVERIFY(QJsonValue(true) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(true) != QJsonValue()); + QVERIFY(QJsonValue(true) != QJsonValue(1.)); + QVERIFY(QJsonValue(true) != QJsonValue(QJsonArray())); + QVERIFY(QJsonValue(true) != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(1.) == QJsonValue(1.)); + QVERIFY(QJsonValue(1.) != QJsonValue(2.)); + QVERIFY(QJsonValue(1.) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(1.) != QJsonValue()); + QVERIFY(QJsonValue(1.) != QJsonValue(true)); + QVERIFY(QJsonValue(1.) != QJsonValue(QJsonArray())); + QVERIFY(QJsonValue(1.) != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(QJsonArray()) == QJsonValue(QJsonArray())); + QJsonArray nonEmptyArray; + nonEmptyArray.append(true); + QVERIFY(QJsonValue(QJsonArray()) != nonEmptyArray); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue()); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(true)); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(1.)); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(QJsonObject()) == QJsonValue(QJsonObject())); + QJsonObject nonEmptyObject; + nonEmptyObject.insert("Key", true); + QVERIFY(QJsonValue(QJsonObject()) != nonEmptyObject); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue()); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(true)); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(1.)); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonArray())); +} + QTEST_MAIN(TestQtJson) #include "tst_qtjson.moc" diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 90d20843e30..f429af7ce2f 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -4850,6 +4850,8 @@ signals: int returnInt(int); void returnVoid(int); CustomType returnCustomType(int); + + QObject *returnPointer(); public slots: QVariant returnVariantSlot(int i) { return i; } QString returnStringSlot(int i) { return QString::number(i); } @@ -4858,6 +4860,8 @@ public slots: void returnVoidSlot() {} int return23() { return 23; } QString returnHello() { return QStringLiteral("hello"); } + QObject *returnThisSlot1() { return this; } + ReturnValue *returnThisSlot2() { return this; } public: struct VariantFunctor { QVariant operator()(int i) { return i; } @@ -4910,6 +4914,7 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int()); emit r.returnVoid(45); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value()); + QCOMPARE((emit r.returnPointer()), static_cast(0)); } { // connected to a slot returning the same type CheckInstanceCount checker; @@ -4922,6 +4927,8 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int(45)); QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnCustomTypeSlot, type)); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType(45).value()); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot1, type)); + QCOMPARE((emit r.returnPointer()), static_cast(&receiver)); } if (!isBlockingQueued) { // connected to simple functions or functor CheckInstanceCount checker; @@ -4950,6 +4957,8 @@ void tst_QObject::returnValue() QCOMPARE((emit r.returnCustomType(48)).value(), CustomType(48).value()); QVERIFY(connect(&r, &ReturnValue::returnVoid, &receiver, &ReturnValue::returnCustomTypeSlot, type)); emit r.returnVoid(48); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot2, type)); + QCOMPARE((emit r.returnPointer()), static_cast(&receiver)); } if (!isBlockingQueued) { // connected to functor with different type CheckInstanceCount checker; @@ -4974,6 +4983,8 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int()); QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnVoidSlot, type)); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value()); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnVoidSlot, type)); + QCOMPARE((emit r.returnPointer()), static_cast(0)); } if (!isBlockingQueued) { // queued connection should not forward the return value @@ -4987,6 +4998,9 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int()); QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnCustomTypeSlot, Qt::QueuedConnection)); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value()); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot1, Qt::QueuedConnection)); + QCOMPARE((emit r.returnPointer()), static_cast(0)); + QCoreApplication::processEvents(); QVERIFY(connect(&r, &ReturnValue::returnVariant, &receiver, &ReturnValue::returnStringSlot, Qt::QueuedConnection)); diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index e72af11fbbd..14c43d00880 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -77,6 +77,7 @@ private slots: void joining(); void combiningClass(); void digitValue(); + void mirroredChar(); void decomposition(); void lineBreakClass(); void normalization_data(); @@ -523,6 +524,29 @@ void tst_QChar::digitValue() QVERIFY(QChar::digitValue((ushort)0x1040) == 0); QVERIFY(QChar::digitValue((uint)0x1049) == 9); QVERIFY(QChar::digitValue((uint)0x1040) == 0); + + QVERIFY(QChar::digitValue((ushort)0xd800) == -1); + QVERIFY(QChar::digitValue((uint)UNICODE_LAST_CODEPOINT + 1) == -1); +} + +void tst_QChar::mirroredChar() +{ + QVERIFY(QChar(0x169B).hasMirrored()); + QVERIFY(QChar(0x169B).mirroredChar() == QChar(0x169C)); + QVERIFY(QChar(0x169C).hasMirrored()); + QVERIFY(QChar(0x169C).mirroredChar() == QChar(0x169B)); + + QVERIFY(QChar(0x301A).hasMirrored()); + QVERIFY(QChar(0x301A).mirroredChar() == QChar(0x301B)); + QVERIFY(QChar(0x301B).hasMirrored()); + QVERIFY(QChar(0x301B).mirroredChar() == QChar(0x301A)); + + if (QChar::currentUnicodeVersion() <= QChar::Unicode_5_0) { + QVERIFY(!QChar(0x201C).hasMirrored()); + QVERIFY(QChar(0x201C).mirroredChar() != QChar(0x201D)); + QVERIFY(!QChar(0x201D).hasMirrored()); + QVERIFY(QChar(0x201D).mirroredChar() != QChar(0x201C)); + } } void tst_QChar::decomposition() @@ -540,10 +564,10 @@ void tst_QChar::decomposition() { QString str; - str += QChar( (0x1D157 - 0x10000) / 0x400 + 0xd800 ); - str += QChar( ((0x1D157 - 0x10000) % 0x400) + 0xdc00 ); - str += QChar( (0x1D165 - 0x10000) / 0x400 + 0xd800 ); - str += QChar( ((0x1D165 - 0x10000) % 0x400) + 0xdc00 ); + str += QChar(QChar::highSurrogate(0x1D157)); + str += QChar(QChar::lowSurrogate(0x1D157)); + str += QChar(QChar::highSurrogate(0x1D165)); + str += QChar(QChar::lowSurrogate(0x1D165)); QVERIFY(QChar::decomposition(0x1D15e) == str); } @@ -626,14 +650,12 @@ void tst_QChar::normalization_data() for (int j = 0; j < c.size(); ++j) { bool ok; uint uc = c.at(j).toInt(&ok, 16); - if (uc < 0x10000) + if (!QChar::requiresSurrogates(uc)) { columns[i].append(QChar(uc)); - else { + } else { // convert to utf16 - ushort high = QChar::highSurrogate(uc); - ushort low = QChar::lowSurrogate(uc); - columns[i].append(QChar(high)); - columns[i].append(QChar(low)); + columns[i].append(QChar(QChar::highSurrogate(uc))); + columns[i].append(QChar(QChar::lowSurrogate(uc))); } } } diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro index 24dcc0638a5..28e127e307d 100644 --- a/tests/auto/corelib/tools/qlocale/test/test.pro +++ b/tests/auto/corelib/tools/qlocale/test/test.pro @@ -17,3 +17,4 @@ load(testcase) # for target.path and installTestHelperApp() installTestHelperApp("../syslocaleapp/syslocaleapp",syslocaleapp,syslocaleapp) mac: CONFIG += insignificant_test # QTBUG-22769 +win32:CONFIG+= insignificant_test # QTBUG-25284 diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp index a4c04d6207d..f1de1722e21 100644 --- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp @@ -637,6 +637,52 @@ void tst_QRegularExpression::normalMatch_data() << 0 << QRegularExpression::MatchOptions(QRegularExpression::AnchoredMatchOption) << m; + + // *** + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678"; + QTest::newRow("negativeoffset01") << QRegularExpression("\\d+") + << "abc123def678ghi" + << -6 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678"; + QTest::newRow("negativeoffset02") << QRegularExpression("\\d+") + << "abc123def678ghi" + << -8 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678ghi" << "678" << "ghi"; + QTest::newRow("negativeoffset03") << QRegularExpression("(\\d+)(\\w+)") + << "abc123def678ghi" + << -8 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; + QTest::newRow("negativeoffset04") << QRegularExpression("\\d+") + << "abc123def678ghi" + << -3 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678"; + QTest::newRow("negativeoffset05") << QRegularExpression("^\\d+", QRegularExpression::MultilineOption) + << "a\nbc123\ndef\n678gh\ni" + << -10 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; } @@ -956,6 +1002,31 @@ void tst_QRegularExpression::globalMatch_data() << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) << matchList; + matchList.clear(); + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured = QStringList() << "ACA""GTG""CGA""AAA"; + matchList << m; + m.captured = QStringList() << "AAA"; + matchList << m; + m.captured = QStringList() << "AAG""GAA""AAG""AAA"; + matchList << m; + m.captured = QStringList() << "AAA"; + matchList << m; + QTest::newRow("globalmatch03") << QRegularExpression("\\G(?:\\w\\w\\w)*?AAA") + << "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA" + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << matchList; + + QTest::newRow("globalmatch04") << QRegularExpression("(?:\\w\\w\\w)*?AAA") + << "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA" + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::AnchoredMatchOption) + << matchList; + matchList.clear(); m.clear(); m.isValid = true; m.hasMatch = true; @@ -1103,6 +1174,46 @@ void tst_QRegularExpression::globalMatch_data() << QRegularExpression::NormalMatch << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) << matchList; + + matchList.clear(); + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured = QStringList() << "ABC"; + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + m.captured = QStringList() << "DEF"; + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + m.captured = QStringList() << "GHI"; + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + QTest::newRow("globalmatch_emptycaptures07") << QRegularExpression("[\\x{0000}-\\x{FFFF}]*") + << QString::fromUtf8("ABC""\xf0\x9d\x85\x9d""DEF""\xf0\x9d\x85\x9e""GHI") + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << matchList; + + matchList.clear(); + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured = QStringList() << QString::fromUtf8("ABC""\xc3\x80"); + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + m.captured = QStringList() << QString::fromUtf8("\xc3\x80""DEF""\xc3\x80"); + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + QTest::newRow("globalmatch_emptycaptures08") << QRegularExpression("[\\x{0000}-\\x{FFFF}]*") + << QString::fromUtf8("ABC""\xc3\x80""\xf0\x9d\x85\x9d""\xc3\x80""DEF""\xc3\x80") + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << matchList; } void tst_QRegularExpression::globalMatch() diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index 1dc2e551b47..c0242d95c58 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -56,6 +56,7 @@ private slots: void abortQuitOnShow(); void changeFocusWindow(); void keyboardModifiers(); + void modalWindow(); }; class DummyWindow : public QWindow @@ -315,5 +316,183 @@ void tst_QGuiApplication::keyboardModifiers() delete window; } +class BlockableWindow : public QWindow +{ + Q_OBJECT +public: + int blocked; + + inline BlockableWindow() + : QWindow() + { + blocked = false; + } + + bool event(QEvent *e) + { + switch (e->type()) { + case QEvent::WindowBlocked: + ++blocked; + break; + case QEvent::WindowUnblocked: + --blocked; + break; + default: + break; + } + return QWindow::event(e); + } +}; + +void tst_QGuiApplication::modalWindow() +{ + int argc = 0; + QGuiApplication app(argc, 0); + + BlockableWindow *window1 = new BlockableWindow; + + BlockableWindow *window2 = new BlockableWindow; + + BlockableWindow *windowModalWindow1 = new BlockableWindow; + windowModalWindow1->setTransientParent(window1); + windowModalWindow1->setWindowModality(Qt::WindowModal); + + BlockableWindow *windowModalWindow2 = new BlockableWindow; + windowModalWindow2->setTransientParent(windowModalWindow1); + windowModalWindow2->setWindowModality(Qt::WindowModal); + + BlockableWindow *applicationModalWindow1 = new BlockableWindow; + applicationModalWindow1->setWindowModality(Qt::ApplicationModal); + + // show the 2 windows, nothing is blocked + window1->show(); + window2->show(); + QTest::qWaitForWindowShown(window1); + QTest::qWaitForWindowShown(window2); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show applicationModalWindow1, everything is blocked + applicationModalWindow1->show(); + QCOMPARE(app.modalWindow(), applicationModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 1); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 1); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // everything is unblocked when applicationModalWindow1 is hidden + applicationModalWindow1->hide(); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show the windowModalWindow1, only window1 is blocked + windowModalWindow1->show(); + QCOMPARE(app.modalWindow(), windowModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show the windowModalWindow2, windowModalWindow1 is blocked as well + windowModalWindow2->show(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow1, nothing is unblocked + windowModalWindow1->hide(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow2, windowModalWindow1 and window1 are unblocked + windowModalWindow2->hide(); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show windowModalWindow1 again, window1 is blocked + windowModalWindow1->show(); + QCOMPARE(app.modalWindow(), windowModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show windowModalWindow2 again, windowModalWindow1 is also blocked + windowModalWindow2->show(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show applicationModalWindow1, everything is blocked + applicationModalWindow1->show(); + QCOMPARE(app.modalWindow(), applicationModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 1); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 1); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide applicationModalWindow1, windowModalWindow1 and window1 are blocked + applicationModalWindow1->hide(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow2, window1 is blocked + windowModalWindow2->hide(); + QCOMPARE(app.modalWindow(), windowModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow1, everything is unblocked + windowModalWindow1->hide(); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + window2->hide(); + window1->hide(); + + delete applicationModalWindow1; + delete windowModalWindow2; + delete windowModalWindow1; + delete window2; + delete window1; +} + QTEST_APPLESS_MAIN(tst_QGuiApplication) #include "tst_qguiapplication.moc" diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 1cedfa5c01e..ea26b9262b3 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -75,10 +75,8 @@ private slots: void serializeSpacing(); void lastResortFont(); void styleName(); -#ifdef QT_BUILD_INTERNAL void defaultFamily_data(); void defaultFamily(); -#endif }; // Testing get/set functions @@ -623,36 +621,62 @@ void tst_QFont::styleName() #endif } -#ifdef QT_BUILD_INTERNAL +QString getPlatformGenericFont(const char* genericName) +{ +#if defined(Q_OS_UNIX) && !defined(QT_NO_FONTCONFIG) + QProcess p; + p.start(QLatin1String("fc-match"), (QStringList() << "-f%{family}" << genericName)); + if (!p.waitForStarted()) + qWarning("fc-match cannot be started: %s", qPrintable(p.errorString())); + if (p.waitForFinished()) + return QString::fromLatin1(p.readAllStandardOutput()); +#endif + return QLatin1String(genericName); +} + +static inline QByteArray msgNotAcceptableFont(const QString &defaultFamily, const QStringList &acceptableFamilies) +{ + QString res = QString::fromLatin1("Font family '%1' is not one of the following accaptable results: ").arg(defaultFamily); + Q_FOREACH (const QString &family, acceptableFamilies) + res += QString::fromLatin1("\n %1").arg(family); + return res.toLocal8Bit(); +} + Q_DECLARE_METATYPE(QFont::StyleHint) void tst_QFont::defaultFamily_data() { QTest::addColumn("styleHint"); - QTest::addColumn("defaultFamily"); + QTest::addColumn("acceptableFamilies"); - QTest::newRow("serif") << QFont::Times << "serif"; - QTest::newRow("monospace") << QFont::Monospace << "monospace"; - QTest::newRow("sans-serif") << QFont::SansSerif << "sans-serif"; - QTest::newRow("cursive") << QFont::Cursive << "cursive"; - QTest::newRow("fantasy") << QFont::Fantasy << "fantasy"; - QTest::newRow("old english") << QFont::OldEnglish << "Old English"; + QTest::newRow("serif") << QFont::Serif << (QStringList() << "Times New Roman" << "Times" << getPlatformGenericFont("serif")); + QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << getPlatformGenericFont("monospace")); + QTest::newRow("cursive") << QFont::Cursive << (QStringList() << "Comic Sans MS" << "Apple Chancery" << getPlatformGenericFont("cursive")); + QTest::newRow("fantasy") << QFont::Fantasy << (QStringList() << "Impact" << "Zapfino" << getPlatformGenericFont("fantasy")); + QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << getPlatformGenericFont("sans-serif")); } void tst_QFont::defaultFamily() { QFETCH(QFont::StyleHint, styleHint); - QFETCH(QString, defaultFamily); - - QFontDatabase db; - if (!db.hasFamily(defaultFamily)) - QSKIP("Font family is not available on the system"); + QFETCH(QStringList, acceptableFamilies); QFont f; + QFontDatabase db; f.setStyleHint(styleHint); - QCOMPARE(QFontDatabase::resolveFontFamilyAlias(f.defaultFamily()), QFontDatabase::resolveFontFamilyAlias(defaultFamily)); + const QString familyForHint(f.defaultFamily()); + // it should at least return a family that is available. + QVERIFY(db.hasFamily(familyForHint)); + + bool isAcceptable = false; + Q_FOREACH (const QString& family, acceptableFamilies) { + if (!familyForHint.compare(family, Qt::CaseInsensitive)) { + isAcceptable = true; + break; + } + } + QVERIFY2(isAcceptable, msgNotAcceptableFont(familyForHint, acceptableFamilies)); } -#endif // QT_BUILD_INTERNAL QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" diff --git a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro index ef47a4b4586..69062bc0c99 100644 --- a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro @@ -6,4 +6,3 @@ SOURCES += tst_qabstractnetworkcache.cpp TESTDATA += tests/* -CONFIG += insignificant_test # QTBUG-20686; note, assumed unstable on all platforms diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro index 0f5bd5fe174..7fdf3a46f0f 100644 --- a/tests/auto/network/access/qftp/qftp.pro +++ b/tests/auto/network/access/qftp/qftp.pro @@ -14,4 +14,4 @@ wince*: { DEFINES += SRCDIR=\\\"$$PWD/\\\" } -CONFIG+=insignificant_test # uses live qt-test-server, inherently unstable +CONFIG+=insignificant_test # QTBUG-15111: uses live qt-test-server, inherently unstable diff --git a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro index 389c8ca4dcf..9e37aec5ce7 100644 --- a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro +++ b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro @@ -10,7 +10,6 @@ MOC_DIR=tmp QT = core-private network-private testlib -# QTBUG-23380 - udpTest failing on Ubuntu 11.10 x64 -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23380 requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index ee49d679f01..977013ab8c7 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1589,6 +1589,22 @@ void tst_QAccessibility::textEditTest() iface->editableTextInterface()->cutText(12, 16); QCOMPARE(QApplication::clipboard()->text(), QLatin1String("how ")); QCOMPARE(iface->textInterface()->text(12, 15), QLatin1String("are")); + + QTestAccessibility::clearEvents(); + + // select text + QTextCursor c = edit.textCursor(); + c.setPosition(2); + c.setPosition(4, QTextCursor::KeepAnchor); + edit.setTextCursor(c); + QAccessibleTextSelectionEvent sel(&edit, 2, 4); + QVERIFY_EVENT(&sel); + + edit.selectAll(); + int end = edit.textCursor().position(); + sel.setCursorPosition(end); + sel.setSelection(0, end); + QVERIFY_EVENT(&sel); } QTestAccessibility::clearEvents(); } @@ -1922,7 +1938,6 @@ void tst_QAccessibility::lineEditTest() QVERIFY_EVENT(&cursor); lineEdit->setText("foo"); - qDebug() << QTestAccessibility::events(); cursorEvent.setCursorPosition(3); QVERIFY_EVENT(&cursorEvent); diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp index 68a347ebdb5..7d34981a739 100644 --- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp +++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp @@ -129,6 +129,10 @@ void tst_QSqlDriver::record() QSqlRecord rec = db.driver()->record(tablename); QCOMPARE(rec.count(), 4); + // QTBUG-1363: QSqlField::length() always return -1 when using QODBC3 driver and QSqlDatabase::record() + if (db.driverName().startsWith("QODBC") && tst_Databases::isSqlServer(db)) + QCOMPARE(rec.field(1).length(), 20); + if (db.driverName().startsWith("QIBASE")|| db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) for(int i = 0; i < fields.count(); ++i) fields[i] = fields[i].toUpper(); diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index f7ce54959e2..78e18f9229c 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -368,6 +368,13 @@ signals: void signalInIf3(); #endif +# //QTBUG-22717 + # /* */ +# + + # \ + +// public slots: void const slotWithSillyConst() {} diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro index b32c638948b..5796cbfd73e 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro @@ -4,5 +4,3 @@ TARGET = tst_qgraphicsgridlayout QT += widgets testlib SOURCES += tst_qgraphicsgridlayout.cpp CONFIG += parallel_test -# ### fixme: QTBUG-20756 crashes on xcb -contains(QT_CONFIG,xcb):CONFIG+=insignificant_test diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro index 2f479151dc1..59ad89ed1f4 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro @@ -7,6 +7,6 @@ QT += core-private gui-private SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp DEFINES += QT_NO_CAST_TO_ASCII -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-16063 win32|mac:CONFIG += insignificant_test # QTBUG-24296 diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro index ca796647c1a..2fc45b48de0 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro @@ -6,5 +6,4 @@ QT += core-private gui-private SOURCES += tst_qgraphicswidget.cpp -# QTBUG-23616 - unstable test -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23616 diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 1158a9f06bd..1518403a642 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -1947,8 +1947,8 @@ void tst_QHeaderView::noSectionsWithNegativeSize() void tst_QHeaderView::emptySectionSpan() { - QHeaderViewPrivate::SectionSpan span; - QCOMPARE(span.sectionSize(), 0); + QHeaderViewPrivate::SectionItem section; + QCOMPARE(section.sectionSize(), 0); } void tst_QHeaderView::task236450_hidden_data() diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro index d47b3bfa313..d1a7686637b 100644 --- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro +++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro @@ -5,5 +5,4 @@ SOURCES += tst_qitemdelegate.cpp win32:!wince*: LIBS += -lUser32 -# QTBUG-23637 -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-23637 diff --git a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro index 95d1ba1c2f0..8102b6b95dd 100644 --- a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro +++ b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro @@ -4,5 +4,4 @@ QT += widgets testlib QT += widgets-private gui-private core-private SOURCES += tst_qtreeview.cpp -# QTBUG-23638 -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-23638 diff --git a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro index 03bb91f4c05..e0545630c51 100644 --- a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro +++ b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro @@ -3,5 +3,4 @@ TARGET = tst_qcombobox QT += widgets widgets-private gui-private core-private testlib SOURCES += tst_qcombobox.cpp -# QTBUG-23639 - unstable test (related QTBUG-1071) -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23639, (related QTBUG-1071) diff --git a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro index 4dd0890fc03..183210b5973 100644 --- a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro +++ b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro @@ -3,5 +3,4 @@ TARGET = tst_qdoublespinbox QT += widgets testlib SOURCES += tst_qdoublespinbox.cpp -# QTBUG-23641 - unstable test -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23641 diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 06bf929e4b7..22e05a8871e 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -271,6 +271,7 @@ private slots: void taskQTBUG_7395_readOnlyShortcut(); void QTBUG697_paletteCurrentColorGroup(); void QTBUG13520_textNotVisible(); + void QTBUG7174_inputMaskCursorBlink(); void bidiVisualMovement_data(); void bidiVisualMovement(); @@ -3693,6 +3694,30 @@ void tst_QLineEdit::QTBUG13520_textNotVisible() } +class UpdateRegionLineEdit : public QLineEdit +{ +public: + QRegion updateRegion; +protected: + void paintEvent(QPaintEvent *event) + { + updateRegion = event->region(); + } +}; + +void tst_QLineEdit::QTBUG7174_inputMaskCursorBlink() +{ + UpdateRegionLineEdit edit; + edit.setInputMask(QLatin1String("AAAA")); + edit.setFocus(); + edit.setText(QLatin1String("AAAA")); + edit.show(); + QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); + QTest::qWaitForWindowShown(&edit); + edit.updateRegion = QRegion(); + QTest::qWait(QApplication::cursorFlashTime()); + QVERIFY(edit.updateRegion.contains(cursorRect)); +} void tst_QLineEdit::bidiVisualMovement_data() { diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index 70823d92f0d..bc5100f1181 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -98,10 +98,9 @@ static inline void triggerSignal(QMdiSubWindow *window, QMdiArea *workspace, window->showMaximized(); qApp->processEvents(); window->showNormal(); - qApp->processEvents(); - QVERIFY(!window->isMinimized()); - QVERIFY(!window->isMaximized()); - QVERIFY(!window->isShaded()); + QTRY_VERIFY(!window->isMinimized()); + QTRY_VERIFY(!window->isMaximized()); + QTRY_VERIFY(!window->isShaded()); } else if (signal == SIGNAL(aboutToActivate())) { if (window->parent()) { workspace->setActiveSubWindow(window); diff --git a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro index 6bacaa0d37e..c74c9e84c19 100644 --- a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro +++ b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro @@ -3,5 +3,4 @@ TARGET = tst_qmenubar QT += widgets testlib SOURCES += tst_qmenubar.cpp -# QTBUG-4965, QTBUG-11823 - unstable tests -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-4965, QTBUG-11823 diff --git a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro index e9436eccdc4..2863dd2034b 100644 --- a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro +++ b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro @@ -2,5 +2,3 @@ CONFIG += testcase TARGET = tst_qscrollbar QT += widgets testlib SOURCES += tst_qscrollbar.cpp - -mac*:CONFIG+=insignificant_test diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index 688daf1f8a4..f568322ab76 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -99,6 +99,9 @@ void tst_QScrollBar::scrollSingleStep() QTest::mouseClick(testWidget, Qt::LeftButton, Qt::NoModifier, QPoint(sr.x(), sr.y())); QTest::qWait(510); // initial delay is 500 for setRepeatAction disconnect(testWidget, SIGNAL(actionTriggered(int)), 0, 0); +#ifdef Q_OS_MAC + QEXPECT_FAIL("", "This test fails on Mac OS X, see QTBUG-25272", Abort); +#endif QCOMPARE(testWidget->value(), testWidget->singleStep()); } @@ -136,9 +139,6 @@ void tst_QScrollBar::task_209492() QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent); // Check that the action was triggered once. -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "Fix does does not work on Mac due to paint architechure differences.", Abort); -#endif QCOMPARE(scrollArea.scrollCount, 1); QCOMPARE(spy.count(), 1); } diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro index 1c2821b2897..6e0fff17d5b 100644 --- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro +++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro @@ -2,18 +2,5 @@ CONFIG += testcase TARGET = tst_qtextedit QT += widgets widgets-private gui-private core-private testlib -INCLUDEPATH += ../ -HEADERS += -SOURCES += tst_qtextedit.cpp - -wince* { - addImages.files = fullWidthSelection/* - addImages.path = fullWidthSelection - DEPLOYMENT += addImages - DEFINES += SRCDIR=\\\"./\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} - -contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-20756 crashes on xcb +SOURCES += tst_qtextedit.cpp diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 9c5a3dbed7a..a3f58c4c0d6 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -218,6 +219,7 @@ private: QTextEdit *ed; qreal rootFrameMargin; PlatformInputContext m_platformInputContext; + const QString m_fullWidthSelectionImagesFolder; }; bool tst_QTextEdit::nativeClipboardWorking() @@ -376,13 +378,17 @@ public: int &iterationCounter; }; -tst_QTextEdit::tst_QTextEdit() -{} +tst_QTextEdit::tst_QTextEdit() : + m_fullWidthSelectionImagesFolder(QFINDTESTDATA("fullWidthSelection")) +{ + +} void tst_QTextEdit::initTestCase() { QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod()); inputMethodPrivate->testContext = &m_platformInputContext; + QVERIFY2(!m_fullWidthSelectionImagesFolder.isEmpty(), qPrintable(QString::fromLatin1("Cannot locate 'fullWidthSelection' starting from %1").arg(QDir::currentPath()))); } void tst_QTextEdit::cleanupTestCase() @@ -1934,12 +1940,18 @@ void tst_QTextEdit::fullWidthSelection_data() QTest::addColumn("cursorTo"); QTest::addColumn("imageFileName"); - QTest::newRow("centered fully selected") << 0 << 15 << QString("fullWidthSelection/centered-fully-selected.png"); - QTest::newRow("centered partly selected") << 2 << 15 << QString("fullWidthSelection/centered-partly-selected.png"); - QTest::newRow("last char on line") << 42 << 44 << QString("fullWidthSelection/last-char-on-line.png"); - QTest::newRow("last char on parag") << 545 << 548 << QString("fullWidthSelection/last-char-on-parag.png"); - QTest::newRow("multiple full width lines") << 20 << 60 << QString("fullWidthSelection/multiple-full-width-lines.png"); - QTest::newRow("single full width line") << 20 << 30 << QString("fullWidthSelection/single-full-width-line.png"); + QTest::newRow("centered fully selected") + << 0 << 15 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/centered-fully-selected.png")); + QTest::newRow("centered partly selected") + << 2 << 15 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/centered-partly-selected.png")); + QTest::newRow("last char on line") + << 42 << 44 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/last-char-on-line.png")); + QTest::newRow("last char on parag") + << 545 << 548 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/last-char-on-parag.png")); + QTest::newRow("multiple full width lines") + << 20 << 60 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/multiple-full-width-lines.png")); + QTest::newRow("single full width line") + << 20 << 30 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/single-full-width-line.png")); } void tst_QTextEdit::fullWidthSelection() @@ -2053,11 +2065,12 @@ void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imag QPainter painter(&image); widget.viewport()->render(&painter); painter.end(); - // qDebug() << "file: " << QString(SRCDIR) + imageFileName; - QImageReader reader(QString(SRCDIR) + imageFileName, "PNG"); + QImageReader reader(imageFileName, "PNG"); + QImage original = reader.read(); - QCOMPARE(original.isNull(), false); + QVERIFY2(!original.isNull(), + qPrintable(QString::fromLatin1("Unable to read image %1: %2").arg(imageFileName, reader.errorString()))); QCOMPARE(original.size(), image.size()); QCOMPARE(image.depth(), 32); QCOMPARE(original.depth(), image.depth()); diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index 1155cd0547e..bfd6ff0810c 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -1405,7 +1405,7 @@ void tst_QDom::normalizeEndOfLine() const const QString expected(QLatin1String("\nc\nc\na\na")); - // ### Qt 5: fix this, if we keep QDom at all + // ### Qt 6: fix this, if we keep QDom at all QEXPECT_FAIL("", "The parser doesn't perform newline normalization. Fixing that would change behavior.", Continue); QCOMPARE(doc.documentElement().text(), expected); } diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index 9b10e97f2b6..9f9e7e41d54 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -1944,7 +1944,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } int fromUtf8_qt47(ushort *dst, const char *chars, int len) @@ -1996,7 +1996,7 @@ int fromUtf8_qt47(ushort *dst, const char *chars, int len) bool nonCharacter; if (!headerdone && uc == 0xfeff) { // don't do anything, just skip the BOM - } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { + } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && QChar::requiresSurrogates(uc) && uc < 0x110000) { // surrogate pair //Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); *qch++ = QChar::highSurrogate(uc); @@ -2102,7 +2102,7 @@ int fromUtf8_qt47_stateless(ushort *dst, const char *chars, int len) bool nonCharacter; if (!headerdone && uc == 0xfeff) { // don't do anything, just skip the BOM - } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { + } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && QChar::requiresSurrogates(uc) && uc < 0x110000) { // surrogate pair //Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); *qch++ = QChar::highSurrogate(uc); @@ -2258,7 +2258,7 @@ static inline void extract_utf8_multibyte(ushort *&dst, const char *&chars, qptr // dst[counter] will correspond to chars[counter..counter+2], so adjust chars += 3; len -= 3; - if (trusted || (ucs >= 0x10000 && ucs < 0x110000 && !isUnicodeNonCharacter(ucs))) { + if (trusted || (QChar::requiresSurrogates(ucs) && ucs < 0x110000 && !isUnicodeNonCharacter(ucs))) { dst[counter + 0] = QChar::highSurrogate(ucs); dst[counter + 1] = QChar::lowSurrogate(ucs); counter += 2; diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp index 190be6f6b4a..68263128805 100644 --- a/tests/manual/bearerex/bearerex.cpp +++ b/tests/manual/bearerex/bearerex.cpp @@ -43,6 +43,7 @@ #include "datatransferer.h" #include +#include Q_DECLARE_METATYPE(QNetworkConfiguration) @@ -284,7 +285,7 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration, } else if (apNetworkConfiguration->type() == QNetworkConfiguration::ServiceNetwork) { snapLineEdit->setText(apNetworkConfiguration->name()+" ("+apNetworkConfiguration->identifier()+")"); } - bearerLineEdit->setText(apNetworkConfiguration->bearerName()); + bearerLineEdit->setText(apNetworkConfiguration->bearerTypeName()); sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+ QString(" / ")+ QString::number(m_NetworkSession->bytesReceived())); @@ -314,8 +315,6 @@ void SessionTab::on_createQNetworkAccessManagerButton_clicked() m_dataTransferer = new DataTransfererQNam(this); } else if (type == "QTcpSocket") { m_dataTransferer = new DataTransfererQTcp(this); - } else if (type == "QHttp") { - m_dataTransferer = new DataTransfererQHttp(this); } else { qDebug("BearerEx Warning, unknown data transfer object requested, not creating anything."); return; @@ -512,10 +511,10 @@ void SessionTab::newState(QNetworkSession::State state) QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId); if (config.isValid()) { iapLineEdit->setText(config.name()+" ("+config.identifier()+")"); - bearerLineEdit->setText(config.bearerName()); + bearerLineEdit->setText(config.bearerTypeName()); } } else { - bearerLineEdit->setText(m_NetworkSession->configuration().bearerName()); + bearerLineEdit->setText(m_NetworkSession->configuration().bearerTypeName()); } QString active; diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h index 7ab0177128d..60963e8fd28 100644 --- a/tests/manual/bearerex/bearerex.h +++ b/tests/manual/bearerex/bearerex.h @@ -42,7 +42,7 @@ #ifndef ACCESSPOINTMANAGEREX_H #define ACCESSPOINTMANAGEREX_H -#include +#include #include "ui_detailedinfodialog.h" diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro index 123038dba4a..a49c644e2ec 100644 --- a/tests/manual/bearerex/bearerex.pro +++ b/tests/manual/bearerex/bearerex.pro @@ -3,6 +3,7 @@ TARGET = BearerEx QT += core \ gui \ + widgets \ network FORMS += detailedinfodialog.ui diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp index 13806076329..648a466a30b 100644 --- a/tests/manual/bearerex/datatransferer.cpp +++ b/tests/manual/bearerex/datatransferer.cpp @@ -134,47 +134,6 @@ void DataTransfererQTcp::error(QAbstractSocket::SocketError socketError) emit finished(socketError, 0, "QAbstractSocket::SocketError"); } -// -------- Based on QHttp - -DataTransfererQHttp::DataTransfererQHttp(QObject* parent) -: DataTransferer(parent) -{ - connect(&m_qhttp, SIGNAL(done(bool)), this, SLOT(done(bool))); - qDebug("BearerEx DataTransferer QHttp created."); -} - -DataTransfererQHttp::~DataTransfererQHttp() -{ - qDebug("BearerEx DataTransferer QHttp destroyed."); -} - -bool DataTransfererQHttp::transferData() -{ - qDebug("BearerEx datatransfer for QHttp requested."); - if (m_dataTransferOngoing) { - return false; - } - QString urlstring("http://www.google.com"); - QUrl url(urlstring); - m_qhttp.setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port()); - m_qhttp.get(urlstring); - m_dataTransferOngoing = true; - return true; -} - -void DataTransfererQHttp::done(bool /*error*/ ) -{ - qDebug("BearerEx DatatransfererQHttp reply was finished (error code is type QHttp::Error)."); - qint64 dataReceived = 0; - quint32 errorCode = m_qhttp.error(); - if (m_qhttp.error() == QHttp::NoError) { - QString result(m_qhttp.readAll()); - dataReceived = result.length(); - } - m_dataTransferOngoing = false; - emit finished(errorCode, dataReceived, "QHttp::Error"); -} - // -------- Based on QNetworkAccessManager DataTransfererQNam::DataTransfererQNam(QObject* parent) diff --git a/tests/manual/bearerex/datatransferer.h b/tests/manual/bearerex/datatransferer.h index e657b20b388..4be8572a7c1 100644 --- a/tests/manual/bearerex/datatransferer.h +++ b/tests/manual/bearerex/datatransferer.h @@ -47,7 +47,6 @@ #include #include #include -#include #include // Interface-class for data transferring object @@ -111,20 +110,4 @@ private: QNetworkAccessManager m_qnam; }; -class DataTransfererQHttp : public DataTransferer -{ - Q_OBJECT -public: - DataTransfererQHttp(QObject* parent = 0); - ~DataTransfererQHttp(); - - virtual bool transferData(); - -public slots: - void done(bool error); - -private: - QHttp m_qhttp; -}; - #endif // DATATRANSFERER_H diff --git a/tests/manual/cocoa/qt_on_cocoa/window.cpp b/tests/manual/cocoa/qt_on_cocoa/window.cpp index d68e08a9f83..c1d4401eaea 100644 --- a/tests/manual/cocoa/qt_on_cocoa/window.cpp +++ b/tests/manual/cocoa/qt_on_cocoa/window.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include static int colorIndexId = 0; diff --git a/tests/manual/cocoa/wheelevent/main.cpp b/tests/manual/cocoa/wheelevent/main.cpp index 979498991d9..69c0960419f 100644 --- a/tests/manual/cocoa/wheelevent/main.cpp +++ b/tests/manual/cocoa/wheelevent/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include -#include +#include #include "window.h" diff --git a/tests/manual/cocoa/wheelevent/window.cpp b/tests/manual/cocoa/wheelevent/window.cpp index b305b057bff..66c8af0ad17 100644 --- a/tests/manual/cocoa/wheelevent/window.cpp +++ b/tests/manual/cocoa/wheelevent/window.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include static int colorIndexId = 0; diff --git a/tests/manual/gestures/gestures.pro b/tests/manual/gestures/gestures.pro new file mode 100644 index 00000000000..6ff914f5421 --- /dev/null +++ b/tests/manual/gestures/gestures.pro @@ -0,0 +1,4 @@ +TEMPLATE=subdirs + +SUBDIRS = graphicsview \ + scrollarea diff --git a/tests/manual/gestures/graphicsview/graphicsview.pro b/tests/manual/gestures/graphicsview/graphicsview.pro index c5f6fe0764e..9ecd0b372f2 100644 --- a/tests/manual/gestures/graphicsview/graphicsview.pro +++ b/tests/manual/gestures/graphicsview/graphicsview.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp \ imageitem.cpp \ gestures.cpp \ diff --git a/tests/manual/gestures/graphicsview/main.cpp b/tests/manual/gestures/graphicsview/main.cpp index ddda06ea220..465c3a2d65b 100644 --- a/tests/manual/gestures/graphicsview/main.cpp +++ b/tests/manual/gestures/graphicsview/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "imageitem.h" #include "gestures.h" diff --git a/tests/manual/gestures/scrollarea/main.cpp b/tests/manual/gestures/scrollarea/main.cpp index d77ce8e373e..190441989ef 100644 --- a/tests/manual/gestures/scrollarea/main.cpp +++ b/tests/manual/gestures/scrollarea/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "mousepangesturerecognizer.h" diff --git a/tests/manual/gestures/scrollarea/scrollarea.pro b/tests/manual/gestures/scrollarea/scrollarea.pro index 554810e0c3a..84e2af3f49e 100644 --- a/tests/manual/gestures/scrollarea/scrollarea.pro +++ b/tests/manual/gestures/scrollarea/scrollarea.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = main.cpp \ mousepangesturerecognizer.cpp HEADERS += mousepangesturerecognizer.h diff --git a/tests/manual/inputmethodhints/inputmethodhints.h b/tests/manual/inputmethodhints/inputmethodhints.h index 4746c9a11a4..82d3e7290e7 100644 --- a/tests/manual/inputmethodhints/inputmethodhints.h +++ b/tests/manual/inputmethodhints/inputmethodhints.h @@ -42,8 +42,8 @@ #ifndef INPUTMETHODHINTS_H #define INPUTMETHODHINTS_H -#include -#include "ui_tst_inputmethodhints.h" +#include +#include "ui_inputmethodhints.h" class inputmethodhints : public QMainWindow { diff --git a/tests/manual/inputmethodhints/inputmethodhints.pro b/tests/manual/inputmethodhints/inputmethodhints.pro index 171c5f17727..f253f723326 100644 --- a/tests/manual/inputmethodhints/inputmethodhints.pro +++ b/tests/manual/inputmethodhints/inputmethodhints.pro @@ -1,8 +1,7 @@ TEMPLATE = app TARGET = tst_inputmethodhints -QT += core \ - gui +QT += widgets HEADERS += inputmethodhints.h SOURCES += main.cpp \ diff --git a/tests/manual/inputmethodhints/main.cpp b/tests/manual/inputmethodhints/main.cpp index af3286df732..fcd6d168924 100644 --- a/tests/manual/inputmethodhints/main.cpp +++ b/tests/manual/inputmethodhints/main.cpp @@ -41,7 +41,7 @@ #include "inputmethodhints.h" -#include +#include #include int main(int argc, char *argv[]) diff --git a/tests/manual/keypadnavigation/keypadnavigation.pro b/tests/manual/keypadnavigation/keypadnavigation.pro index 6d12606c781..a45d38af21f 100644 --- a/tests/manual/keypadnavigation/keypadnavigation.pro +++ b/tests/manual/keypadnavigation/keypadnavigation.pro @@ -1,2 +1,3 @@ +QT += widgets SOURCES += main.cpp FORMS += keypadnavigation.ui diff --git a/tests/manual/keypadnavigation/main.cpp b/tests/manual/keypadnavigation/main.cpp index 4f7224d1350..964d46faf60 100644 --- a/tests/manual/keypadnavigation/main.cpp +++ b/tests/manual/keypadnavigation/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "ui_keypadnavigation.h" class KeypadNavigation : public QMainWindow diff --git a/tests/manual/lance/interactivewidget.cpp b/tests/manual/lance/interactivewidget.cpp index 55e60a8946f..0b9d8ee0a48 100644 --- a/tests/manual/lance/interactivewidget.cpp +++ b/tests/manual/lance/interactivewidget.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ #include "interactivewidget.h" -#include +#include InteractiveWidget::InteractiveWidget() { diff --git a/tests/manual/lance/interactivewidget.h b/tests/manual/lance/interactivewidget.h index e9e584512eb..879facac42e 100644 --- a/tests/manual/lance/interactivewidget.h +++ b/tests/manual/lance/interactivewidget.h @@ -44,7 +44,7 @@ #include "widgets.h" #include "paintcommands.h" -#include +#include #include diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro index e24d3f2fa35..4b319369e6f 100644 --- a/tests/manual/lance/lance.pro +++ b/tests/manual/lance/lance.pro @@ -1,8 +1,8 @@ -LANCELOT_DIR = $$PWD/../../auto/lancelot +LANCELOT_DIR = $$PWD/../../auto/other/lancelot CONFIG+=console moc TEMPLATE = app INCLUDEPATH += . $$LANCELOT_DIR -QT += core-private gui-private +QT += core-private gui-private widgets printsupport HEADERS += widgets.h \ interactivewidget.h \ diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp index c33cb49be95..e8bb44a221a 100644 --- a/tests/manual/lance/main.cpp +++ b/tests/manual/lance/main.cpp @@ -43,7 +43,8 @@ #include "paintcommands.h" #include -#include +#include +#include #include #include @@ -612,14 +613,11 @@ int main(int argc, char **argv) pcmd.setType(type); pcmd.setCheckersBackground(checkers_background); pcmd.setContents(content); - bool ps = type == PsType; QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); QFileInfo input(files.at(j)); - QString file = QString("%1_%2.%3") - .arg(input.baseName()) - .arg(input.suffix()) - .arg(ps ? "ps" : "pdf"); - p.setOutputFormat(ps ? QPrinter::PdfFormat : QPrinter::PostScriptFormat); + const QString file = input.baseName() + QLatin1Char('_') + + input.suffix() + QStringLiteral(".pdf"); + p.setOutputFormat(QPrinter::PdfFormat); p.setOutputFileName(file); p.setPageSize(QPrinter::A4); QPainter pt(&p); diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h index d8a67a75540..33115ad7b34 100644 --- a/tests/manual/lance/widgets.h +++ b/tests/manual/lance/widgets.h @@ -59,9 +59,6 @@ #include #include - -#include - #include const int CP_RADIUS = 10; @@ -236,12 +233,7 @@ public: } if (m_render_view.isNull()) { - - if (T::window()->windowSurface()) - m_render_view = T::window()->windowSurface()->grabWidget(this); - else - m_render_view = QPixmap::grabWidget(this); - + m_render_view = QPixmap::grabWidget(this); m_render_view.save("renderView.png"); } } diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro new file mode 100644 index 00000000000..9df151eee16 --- /dev/null +++ b/tests/manual/manual.pro @@ -0,0 +1,32 @@ +TEMPLATE=subdirs + +SUBDIRS = bearerex \ +gestures \ +inputmethodhints \ +keypadnavigation \ +lance \ +network_remote_stresstest \ +network_stresstest \ +qcursor \ +qdesktopwidget \ +qgraphicsitemgroup \ +qgraphicslayout/flicker \ +qhttpnetworkconnection \ +qimagereader \ +qlocale \ +qnetworkaccessmanager/qget \ +qnetworkconfigurationmanager \ +qnetworkreply \ +qssloptions \ +qtabletevent \ +qtbug-8933 \ +qtouchevent \ +qwidget_zorder \ +repaint \ +socketengine \ +textrendering \ +widgets/itemviews/delegate \ +windowflags \ +windowmodality + +!contains(QT_CONFIG, openssl):!contains(QT_CONFIG, openssl-linked):SUBDIRS -= qssloptions diff --git a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro index 3a581e12adc..8b52240509a 100644 --- a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro +++ b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro @@ -1,9 +1,10 @@ CONFIG += testcase TARGET = tst_network_remote_stresstest -QT = core network testlib +QT = core core-private network network-private testlib SOURCES += tst_network_remote_stresstest.cpp RESOURCES += url-list.qrc +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp index c2981c6df8c..109ecbe2aa5 100644 --- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp +++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp @@ -235,6 +235,10 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts() QElapsedTimer outerTimer; outerTimer.start(); +#ifdef QT_NO_SSL + QVERIFY(!useSslSocket); +#endif // QT_NO_SSL + for (int i = 0; i < urlList.size(); ++i) { const QUrl &url = urlList.at(i); bool isHttps = url.scheme() == "https"; @@ -243,21 +247,24 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts() timeout.start(); QSharedPointer socket; - if (useSslSocket || isHttps) { +#ifndef QT_NO_SSL + if (useSslSocket || isHttps) socket = QSharedPointer(new QSslSocket); - } else { +#endif // QT_NO_SSL + if (socket.isNull()) socket = QSharedPointer(new QTcpSocket); - } socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + url.encodedHost()); +#ifndef QT_NO_SSL if (isHttps) { static_cast(socket.data())->setProtocol(QSsl::TlsV1_0); static_cast(socket.data())->startClientEncryption(); static_cast(socket.data())->ignoreSslErrors(); QVERIFY2(static_cast(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + url.encodedHost()); } +#endif // QT_NO_SSL socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" @@ -288,6 +295,10 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() QFETCH_GLOBAL(QVector, urlList); QFETCH_GLOBAL(bool, useSslSocket); +#ifdef QT_NO_SSL + QVERIFY(!useSslSocket); +#endif // QT_NO_SSL + qint64 totalBytes = 0; QElapsedTimer outerTimer; outerTimer.start(); @@ -300,15 +311,18 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() timeout.start(); QSharedPointer socket; - if (useSslSocket || isHttps) { +#ifndef QT_NO_SSL + if (useSslSocket || isHttps) socket = QSharedPointer(new QSslSocket); - } else { +#endif // QT_NO_SSL + if (socket.isNull()) socket = QSharedPointer(new QTcpSocket); - } if (isHttps) { +#ifndef QT_NO_SSL static_cast(socket.data())->setProtocol(QSsl::TlsV1_0); static_cast(socket.data())->connectToHostEncrypted(url.host(), url.port(443)); static_cast(socket.data())->ignoreSslErrors(); +#endif // QT_NO_SSL } else { socket->connectToHost(url.host(), url.port(80)); } @@ -356,6 +370,10 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() QFETCH(int, parallelAttempts); +#ifdef QT_NO_SSL + QVERIFY(!useSslSocket); +#endif // QT_NO_SSL + qint64 totalBytes = 0; QElapsedTimer outerTimer; outerTimer.start(); @@ -371,15 +389,19 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() for (int j = 0; j < parallelAttempts && it != urlList.constEnd(); ++j, ++it) { const QUrl &url = *it; bool isHttps = url.scheme() == "https"; - QTcpSocket *socket; + QTcpSocket *socket = 0; +#ifndef QT_NO_SSL if (useSslSocket || isHttps) socket = new QSslSocket; - else +#endif // QT_NO_SSL + if (!socket) socket = new QTcpSocket; if (isHttps) { +#ifndef QT_NO_SSL static_cast(socket)->setProtocol(QSsl::TlsV1_0); static_cast(socket)->connectToHostEncrypted(url.host(), url.port(443)); static_cast(socket)->ignoreSslErrors(); +#endif // QT_NO_SSL } else { socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); } diff --git a/tests/manual/network_stresstest/minihttpserver.cpp b/tests/manual/network_stresstest/minihttpserver.cpp index e3473a3141e..1bafe9363df 100644 --- a/tests/manual/network_stresstest/minihttpserver.cpp +++ b/tests/manual/network_stresstest/minihttpserver.cpp @@ -148,7 +148,7 @@ void MiniHttpServerConnection::handlePendingRequest() return; } - QUrl uri = QUrl::fromEncoded(request.mid(4, eol - strlen(http11) - 4)); + QUrl uri = QUrl::fromEncoded(request.mid(4, eol - int(strlen(http11)) - 4)); source.setFileName(":" + uri.path()); // connection-close? diff --git a/tests/manual/network_stresstest/network_stresstest.pro b/tests/manual/network_stresstest/network_stresstest.pro index caa8436ceff..ebddf129614 100644 --- a/tests/manual/network_stresstest/network_stresstest.pro +++ b/tests/manual/network_stresstest/network_stresstest.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_network_stresstest -QT = core network testlib +QT = core-private network-private testlib SOURCES += tst_network_stresstest.cpp \ minihttpserver.cpp @@ -11,3 +11,4 @@ HEADERS += \ RESOURCES += wwwfiles.qrc QMAKE_RESOURCE_FLAGS += -no-compress +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp index 0f2673e23c1..74237ea9cc5 100644 --- a/tests/manual/network_stresstest/tst_network_stresstest.cpp +++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp @@ -338,13 +338,13 @@ void tst_NetworkStressTest::nativeNonBlockingConnectDisconnect() QVERIFY(fd != INVALID_SOCKET); // set the socket to non-blocking and start connecting - unsigned long buf = v; + unsigned long buf = 0; unsigned long outBuf; DWORD sizeWritten = 0; QVERIFY(::WSAIoctl(fd, FIONBIO, &buf, sizeof(unsigned long), &outBuf, sizeof(unsigned long), &sizeWritten, 0,0) != SOCKET_ERROR); while (true) { - int connectResult = ::WSAConnect(fd, sockAddrPtr, sockAddrSize, 0,0,0,0); + int connectResult = ::WSAConnect(fd, (sockaddr *)addr.data(), addr.size(), 0,0,0,0); if (connectResult == 0 || WSAGetLastError() == WSAEISCONN) { break; // connected } else { @@ -537,7 +537,7 @@ void tst_NetworkStressTest::blockingMultipleRequests() qWarning() << "no content-length:" << QString(buffer); break; } - pos += strlen("\r\ncontent-length: "); + pos += int(strlen("\r\ncontent-length: ")); int eol = buffer.indexOf("\r\n", pos + 2); if (eol == -1) { diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp index d693d6b67d6..32137d78e38 100644 --- a/tests/manual/qdesktopwidget/main.cpp +++ b/tests/manual/qdesktopwidget/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class DesktopView : public QGraphicsView { diff --git a/tests/manual/qdesktopwidget/qdesktopwidget.pro b/tests/manual/qdesktopwidget/qdesktopwidget.pro index 93d56eb1377..8979e7ef353 100644 --- a/tests/manual/qdesktopwidget/qdesktopwidget.pro +++ b/tests/manual/qdesktopwidget/qdesktopwidget.pro @@ -1,2 +1,3 @@ TEMPLATE = app +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/qgraphicsitemgroup/customitem.cpp b/tests/manual/qgraphicsitemgroup/customitem.cpp index 6f3f1e05228..eab218e9a09 100644 --- a/tests/manual/qgraphicsitemgroup/customitem.cpp +++ b/tests/manual/qgraphicsitemgroup/customitem.cpp @@ -80,7 +80,7 @@ CustomGroup::CustomGroup() : setFlag(QGraphicsItem::ItemIsSelectable); } -void CustomGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void CustomGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) { if (option->state & QStyle::State_Selected) painter->setOpacity(1.); diff --git a/tests/manual/qgraphicsitemgroup/main.cpp b/tests/manual/qgraphicsitemgroup/main.cpp index d60941da3a0..d76a3a6334b 100644 --- a/tests/manual/qgraphicsitemgroup/main.cpp +++ b/tests/manual/qgraphicsitemgroup/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "widget.h" int main(int argc, char *argv[]) diff --git a/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro b/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro index 6676a2e7c13..6135f74b8b4 100644 --- a/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro +++ b/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro @@ -1,4 +1,5 @@ TARGET = qgraphicsitemgroup +QT += widgets TEMPLATE = app SOURCES += main.cpp \ widget.cpp \ diff --git a/tests/manual/qgraphicslayout/flicker/flicker.pro b/tests/manual/qgraphicslayout/flicker/flicker.pro index 2e098260220..d800418f85f 100644 --- a/tests/manual/qgraphicslayout/flicker/flicker.pro +++ b/tests/manual/qgraphicslayout/flicker/flicker.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += window.h SOURCES += main.cpp window.cpp diff --git a/tests/manual/qgraphicslayout/flicker/main.cpp b/tests/manual/qgraphicslayout/flicker/main.cpp index e71915c22f7..29479308957 100644 --- a/tests/manual/qgraphicslayout/flicker/main.cpp +++ b/tests/manual/qgraphicslayout/flicker/main.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#include -#include +#include #include "window.h" int main(int argc, char **argv) diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h index 49303816414..51bf0e07339 100644 --- a/tests/manual/qgraphicslayout/flicker/window.h +++ b/tests/manual/qgraphicslayout/flicker/window.h @@ -43,11 +43,11 @@ #define WINDOW_H -#include +#include struct Statistics { - Statistics() : output(0), - setGeometryCount(0), currentBenchmarkIteration(0), relayoutClicked(false), sleepMsecs(0) + Statistics() : setGeometryCount(0), sleepMsecs(0), output(0), + currentBenchmarkIteration(0), relayoutClicked(false) { } QMap setGeometryTracker; diff --git a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro index fd210077937..8e73add2525 100644 --- a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -5,6 +5,4 @@ TARGET = tst_qhttpnetworkconnection QT -= gui QT += network testlib -CONFIG += release - SOURCES += main.cpp diff --git a/tests/manual/qimagereader/main.cpp b/tests/manual/qimagereader/main.cpp index 44cdc6ad36f..e225c1bc0bb 100644 --- a/tests/manual/qimagereader/main.cpp +++ b/tests/manual/qimagereader/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class MyWidget : public QWidget { diff --git a/tests/manual/qimagereader/qimagereader.pro b/tests/manual/qimagereader/qimagereader.pro index 28dcadcbfa2..3523257f3e2 100644 --- a/tests/manual/qimagereader/qimagereader.pro +++ b/tests/manual/qimagereader/qimagereader.pro @@ -1 +1,2 @@ +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/qlocale/calendar.cpp b/tests/manual/qlocale/calendar.cpp index e23af4fa497..122f57fa640 100644 --- a/tests/manual/qlocale/calendar.cpp +++ b/tests/manual/qlocale/calendar.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "calendar.h" diff --git a/tests/manual/qlocale/calendar.h b/tests/manual/qlocale/calendar.h index bf0d5efac36..7780e82bbfd 100644 --- a/tests/manual/qlocale/calendar.h +++ b/tests/manual/qlocale/calendar.h @@ -41,7 +41,7 @@ #ifndef CALENDAR_H #define CALENDAR_H -#include +#include class CalendarWidget : public QWidget { diff --git a/tests/manual/qlocale/currency.h b/tests/manual/qlocale/currency.h index 1d3d5365784..f7228896003 100644 --- a/tests/manual/qlocale/currency.h +++ b/tests/manual/qlocale/currency.h @@ -41,7 +41,7 @@ #ifndef CURRENCY_H #define CURRENCY_H -#include +#include class CurrencyWidget : public QWidget { diff --git a/tests/manual/qlocale/dateformats.h b/tests/manual/qlocale/dateformats.h index 78ef62343a6..93554758207 100644 --- a/tests/manual/qlocale/dateformats.h +++ b/tests/manual/qlocale/dateformats.h @@ -41,7 +41,7 @@ #ifndef DATEFORMATS_H #define DATEFORMATS_H -#include +#include class DateFormatsWidget : public QWidget { diff --git a/tests/manual/qlocale/info.h b/tests/manual/qlocale/info.h index 6cd7818feb3..0c74dfb8caf 100644 --- a/tests/manual/qlocale/info.h +++ b/tests/manual/qlocale/info.h @@ -41,7 +41,7 @@ #ifndef INFO_H #define INFO_H -#include +#include class InfoWidget : public QWidget { diff --git a/tests/manual/qlocale/languages.h b/tests/manual/qlocale/languages.h index 6723e0ffa7e..07a86f68989 100644 --- a/tests/manual/qlocale/languages.h +++ b/tests/manual/qlocale/languages.h @@ -41,7 +41,7 @@ #ifndef LANGUAGES_H #define LANGUAGES_H -#include +#include class LanguagesWidget : public QWidget { diff --git a/tests/manual/qlocale/main.cpp b/tests/manual/qlocale/main.cpp index 337dbb6ad3f..8c4e2573d57 100644 --- a/tests/manual/qlocale/main.cpp +++ b/tests/manual/qlocale/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "window.h" diff --git a/tests/manual/qlocale/miscellaneous.h b/tests/manual/qlocale/miscellaneous.h index 2548f0d8f4e..61ada8a00f7 100644 --- a/tests/manual/qlocale/miscellaneous.h +++ b/tests/manual/qlocale/miscellaneous.h @@ -41,7 +41,7 @@ #ifndef MISCELLANEOUS_H #define MISCELLANEOUS_H -#include +#include class MiscWidget : public QWidget { diff --git a/tests/manual/qlocale/numberformats.h b/tests/manual/qlocale/numberformats.h index 8243d1177ce..bcc352a818d 100644 --- a/tests/manual/qlocale/numberformats.h +++ b/tests/manual/qlocale/numberformats.h @@ -41,7 +41,7 @@ #ifndef NUMBERFORMATS_H #define NUMBERFORMATS_H -#include +#include class NumberFormatsWidget : public QWidget { diff --git a/tests/manual/qlocale/qlocale.pro b/tests/manual/qlocale/qlocale.pro index 4eaddedcf0f..a5a2766e65a 100644 --- a/tests/manual/qlocale/qlocale.pro +++ b/tests/manual/qlocale/qlocale.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += currency.h calendar.h dateformats.h numberformats.h languages.h window.h miscellaneous.h info.h SOURCES += currency.cpp main.cpp calendar.cpp dateformats.cpp numberformats.cpp languages.cpp window.cpp miscellaneous.cpp info.cpp diff --git a/tests/manual/qlocale/window.h b/tests/manual/qlocale/window.h index 1b2825aa5c2..524ed978455 100644 --- a/tests/manual/qlocale/window.h +++ b/tests/manual/qlocale/window.h @@ -41,7 +41,7 @@ #ifndef WINDOW_H #define WINDOW_H -#include +#include #include "calendar.h" #include "currency.h" diff --git a/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp b/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp index e3ba3ca88f2..5eab6d43bdb 100644 --- a/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp +++ b/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp @@ -83,7 +83,7 @@ void DownloadManager::upload(const QUrl &url, const QString &user, const QString connect(ul, SIGNAL(downloadFinished(TransferItem*)), SLOT(downloadFinished(TransferItem*))); } -void DownloadManager::finished(QNetworkReply *reply) +void DownloadManager::finished(QNetworkReply *) { } @@ -121,7 +121,7 @@ void DownloadManager::authenticationRequired(QNetworkReply *reply, QAuthenticato qDebug() << "authenticationRequired" << reply; TransferItem *transfer = findTransfer(reply); //provide the credentials exactly once, so that it fails if credentials are incorrect. - if (transfer && !transfer->user.isEmpty() || !transfer->password.isEmpty()) { + if ((transfer && !transfer->user.isEmpty()) || !transfer->password.isEmpty()) { auth->setUser(transfer->user); auth->setPassword(transfer->password); transfer->user.clear(); @@ -129,7 +129,7 @@ void DownloadManager::authenticationRequired(QNetworkReply *reply, QAuthenticato } } -void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth) +void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth) { //provide the credentials exactly once, so that it fails if credentials are incorrect. if (!proxyUser.isEmpty() || !proxyPassword.isEmpty()) { diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.h b/tests/manual/qnetworkaccessmanager/qget/qget.h index bad4f5e4d20..978212dfa89 100644 --- a/tests/manual/qnetworkaccessmanager/qget/qget.h +++ b/tests/manual/qnetworkaccessmanager/qget/qget.h @@ -113,7 +113,9 @@ private slots: void finished(QNetworkReply *reply); void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator); +#ifndef QT_NO_SSL void sslErrors(QNetworkReply *reply, const QList &errors); +#endif void downloadFinished(TransferItem *item); private: TransferItem *findTransfer(QNetworkReply *reply); diff --git a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro index 7ad271ce468..9e78f91621e 100644 --- a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro +++ b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro @@ -5,6 +5,4 @@ TARGET = tst_qnetworkconfigurationmanager QT -= gui QT += network testlib -CONFIG += release - SOURCES += main.cpp diff --git a/tests/manual/qnetworkreply/qnetworkreply.pro b/tests/manual/qnetworkreply/qnetworkreply.pro index 17f48c65443..e29ea7856c1 100644 --- a/tests/manual/qnetworkreply/qnetworkreply.pro +++ b/tests/manual/qnetworkreply/qnetworkreply.pro @@ -5,6 +5,4 @@ TARGET = tst_qnetworkreply QT -= gui QT += network testlib -CONFIG += release - SOURCES += main.cpp diff --git a/tests/manual/qtabletevent/device_information/qtabletevent.pro b/tests/manual/qtabletevent/device_information/device_information.pro similarity index 85% rename from tests/manual/qtabletevent/device_information/qtabletevent.pro rename to tests/manual/qtabletevent/device_information/device_information.pro index 8251d73094b..727ad34bc17 100644 --- a/tests/manual/qtabletevent/device_information/qtabletevent.pro +++ b/tests/manual/qtabletevent/device_information/device_information.pro @@ -1,3 +1,4 @@ +QT += widgets SOURCES += \ main.cpp \ tabletwidget.cpp diff --git a/tests/manual/qtabletevent/device_information/main.cpp b/tests/manual/qtabletevent/device_information/main.cpp index b4eea7875bc..e551ae7d8a6 100644 --- a/tests/manual/qtabletevent/device_information/main.cpp +++ b/tests/manual/qtabletevent/device_information/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "tabletwidget.h" int main(int argc, char **argv) { diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp index d12da6c886a..bc0c63bbb1d 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp +++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp @@ -94,7 +94,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev) return false; } -void TabletWidget::paintEvent(QPaintEvent *event) +void TabletWidget::paintEvent(QPaintEvent *) { QPainter painter(this); diff --git a/tests/manual/qtabletevent/event_compression/event_compression.pro b/tests/manual/qtabletevent/event_compression/event_compression.pro index fd2521e44fa..15650d61905 100644 --- a/tests/manual/qtabletevent/event_compression/event_compression.pro +++ b/tests/manual/qtabletevent/event_compression/event_compression.pro @@ -1,4 +1,4 @@ -QT += testlib +QT += widgets testlib SOURCES += main.cpp \ mousestatwidget.cpp diff --git a/tests/manual/qtabletevent/qtabletevent.pro b/tests/manual/qtabletevent/qtabletevent.pro new file mode 100644 index 00000000000..9e9fc396542 --- /dev/null +++ b/tests/manual/qtabletevent/qtabletevent.pro @@ -0,0 +1,5 @@ +TEMPLATE=subdirs + +SUBDIRS = device_information \ + event_compression \ + regular_widgets diff --git a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro index 9f0da76c11e..8f1f4342ee9 100644 --- a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro +++ b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro @@ -1,3 +1,4 @@ TEMPLATE = app +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/qtbug-8933/main.cpp b/tests/manual/qtbug-8933/main.cpp index d60941da3a0..d76a3a6334b 100644 --- a/tests/manual/qtbug-8933/main.cpp +++ b/tests/manual/qtbug-8933/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "widget.h" int main(int argc, char *argv[]) diff --git a/tests/manual/qtbug-8933/qtbug-8933.pro b/tests/manual/qtbug-8933/qtbug-8933.pro index 8b87c8346d0..4600d47cac1 100644 --- a/tests/manual/qtbug-8933/qtbug-8933.pro +++ b/tests/manual/qtbug-8933/qtbug-8933.pro @@ -6,7 +6,7 @@ TARGET = qtbug-8933 TEMPLATE = app - +QT += widgets SOURCES += main.cpp\ widget.cpp diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp index 206413bfa20..80598e477bf 100644 --- a/tests/manual/qtouchevent/main.cpp +++ b/tests/manual/qtouchevent/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include #include "ui_form.h" diff --git a/tests/manual/qtouchevent/qtouchevent.pro b/tests/manual/qtouchevent/qtouchevent.pro index de1ee06f9e8..6339bceb421 100644 --- a/tests/manual/qtouchevent/qtouchevent.pro +++ b/tests/manual/qtouchevent/qtouchevent.pro @@ -1,4 +1,4 @@ -QT += testlib +QT += widgets testlib SOURCES = main.cpp \ touchwidget.cpp FORMS += form.ui diff --git a/tests/manual/qwidget_zorder/main.cpp b/tests/manual/qwidget_zorder/main.cpp index dadc089ce42..8c92ac86d79 100644 --- a/tests/manual/qwidget_zorder/main.cpp +++ b/tests/manual/qwidget_zorder/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class Widget : public QWidget { diff --git a/tests/manual/qwidget_zorder/qwidget_zorder.pro b/tests/manual/qwidget_zorder/qwidget_zorder.pro index 28dcadcbfa2..3523257f3e2 100644 --- a/tests/manual/qwidget_zorder/qwidget_zorder.pro +++ b/tests/manual/qwidget_zorder/qwidget_zorder.pro @@ -1 +1,2 @@ +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/repaint/mainwindow/main.cpp b/tests/manual/repaint/mainwindow/main.cpp index c6f0ac646f5..08b600280ab 100644 --- a/tests/manual/repaint/mainwindow/main.cpp +++ b/tests/manual/repaint/mainwindow/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" int main(int argc, char **argv) diff --git a/tests/manual/repaint/mainwindow/mainwindow.pro b/tests/manual/repaint/mainwindow/mainwindow.pro index db6b2d280c9..f20e5fe4020 100644 --- a/tests/manual/repaint/mainwindow/mainwindow.pro +++ b/tests/manual/repaint/mainwindow/mainwindow.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/repaint.pro b/tests/manual/repaint/repaint.pro new file mode 100644 index 00000000000..7ad9d682608 --- /dev/null +++ b/tests/manual/repaint/repaint.pro @@ -0,0 +1,9 @@ +TEMPLATE=subdirs + +SUBDIRS = mainwindow \ + scrollarea \ + splitter \ + tableview \ + task141091 \ + toplevel \ + widget diff --git a/tests/manual/repaint/scrollarea/main.cpp b/tests/manual/repaint/scrollarea/main.cpp index 63fb7555106..06d598d46b8 100644 --- a/tests/manual/repaint/scrollarea/main.cpp +++ b/tests/manual/repaint/scrollarea/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" diff --git a/tests/manual/repaint/scrollarea/scrollarea.pro b/tests/manual/repaint/scrollarea/scrollarea.pro index db6b2d280c9..f20e5fe4020 100644 --- a/tests/manual/repaint/scrollarea/scrollarea.pro +++ b/tests/manual/repaint/scrollarea/scrollarea.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/shared/shared.h b/tests/manual/repaint/shared/shared.h index 861d4178aa9..3489c30cd86 100644 --- a/tests/manual/repaint/shared/shared.h +++ b/tests/manual/repaint/shared/shared.h @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class StaticWidget : public QWidget { Q_OBJECT diff --git a/tests/manual/repaint/splitter/main.cpp b/tests/manual/repaint/splitter/main.cpp index 2c4ca1d4f39..d260f00bf1d 100644 --- a/tests/manual/repaint/splitter/main.cpp +++ b/tests/manual/repaint/splitter/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" int main(int argc, char **argv) diff --git a/tests/manual/repaint/splitter/splitter.pro b/tests/manual/repaint/splitter/splitter.pro index db6b2d280c9..f20e5fe4020 100644 --- a/tests/manual/repaint/splitter/splitter.pro +++ b/tests/manual/repaint/splitter/splitter.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/tableview/main.cpp b/tests/manual/repaint/tableview/main.cpp index dc258586816..227237a5e79 100644 --- a/tests/manual/repaint/tableview/main.cpp +++ b/tests/manual/repaint/tableview/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" class CellWidget : public QWidget diff --git a/tests/manual/repaint/tableview/tableview.pro b/tests/manual/repaint/tableview/tableview.pro index 4097c957392..6a5aaad2518 100644 --- a/tests/manual/repaint/tableview/tableview.pro +++ b/tests/manual/repaint/tableview/tableview.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS +=../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/task141091/main.cpp b/tests/manual/repaint/task141091/main.cpp index b2f639d411f..9090a2a29df 100644 --- a/tests/manual/repaint/task141091/main.cpp +++ b/tests/manual/repaint/task141091/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include class MyWidget : public QWidget diff --git a/tests/manual/repaint/task141091/task141091.pro b/tests/manual/repaint/task141091/task141091.pro index 82ead4b6c22..b54299e5409 100644 --- a/tests/manual/repaint/task141091/task141091.pro +++ b/tests/manual/repaint/task141091/task141091.pro @@ -1,3 +1,3 @@ CONFIG += console - +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/repaint/toplevel/main.cpp b/tests/manual/repaint/toplevel/main.cpp index cd43fa699c5..6466fe80b2b 100644 --- a/tests/manual/repaint/toplevel/main.cpp +++ b/tests/manual/repaint/toplevel/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" int main(int argc, char **argv) diff --git a/tests/manual/repaint/toplevel/toplevel.pro b/tests/manual/repaint/toplevel/toplevel.pro index c2cc19f67dd..a881c24f56f 100644 --- a/tests/manual/repaint/toplevel/toplevel.pro +++ b/tests/manual/repaint/toplevel/toplevel.pro @@ -1,4 +1,5 @@ CONFIG += console +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/widget/main.cpp b/tests/manual/repaint/widget/main.cpp index 64b9cc8a189..3ea557a6428 100644 --- a/tests/manual/repaint/widget/main.cpp +++ b/tests/manual/repaint/widget/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" class Child : public StaticWidget diff --git a/tests/manual/repaint/widget/widget.pro b/tests/manual/repaint/widget/widget.pro index db6b2d280c9..f20e5fe4020 100644 --- a/tests/manual/repaint/widget/widget.pro +++ b/tests/manual/repaint/widget/widget.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/socketengine/main.cpp b/tests/manual/socketengine/main.cpp index 48893f062dd..349004a7d0a 100644 --- a/tests/manual/socketengine/main.cpp +++ b/tests/manual/socketengine/main.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -97,7 +96,7 @@ int main(int argc, char**argv) // disconnected exit(0); } - bzero(buf, bufsize); + qFill(buf, buf + bufsize, 0); ret = socketEngine->read(buf, available); if (ret > 0) { printf("%s", buf); diff --git a/tests/manual/socketengine/socketengine.pro b/tests/manual/socketengine/socketengine.pro index 808502c22a6..96831383ecf 100644 --- a/tests/manual/socketengine/socketengine.pro +++ b/tests/manual/socketengine/socketengine.pro @@ -3,8 +3,6 @@ TEMPLATE = app TARGET = tst_socketengine QT -= gui -QT += network testlib - -CONFIG += release +QT += network-private core-private testlib SOURCES += main.cpp diff --git a/tests/manual/textrendering/glyphshaping/glyphshaping.pro b/tests/manual/textrendering/glyphshaping/glyphshaping.pro index 1d78aa3351b..6500814423d 100644 --- a/tests/manual/textrendering/glyphshaping/glyphshaping.pro +++ b/tests/manual/textrendering/glyphshaping/glyphshaping.pro @@ -1,3 +1,4 @@ +QT += widgets SOURCES = main.cpp OTHER_FILES = glyphshaping_data.xml glyphshaping_data.path = . diff --git a/tests/manual/textrendering/glyphshaping/main.cpp b/tests/manual/textrendering/glyphshaping/main.cpp index c41301f3fcc..5a8cc4f12b3 100644 --- a/tests/manual/textrendering/glyphshaping/main.cpp +++ b/tests/manual/textrendering/glyphshaping/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include static const int fontPixelSize = 25; static const QLatin1String fontFamily("Series 60 Sans"); diff --git a/tests/manual/textrendering/textperformance/main.cpp b/tests/manual/textrendering/textperformance/main.cpp index c6a0c73849c..cff0c1afad3 100644 --- a/tests/manual/textrendering/textperformance/main.cpp +++ b/tests/manual/textrendering/textperformance/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include static const int lastMeasurementsCount = 50; diff --git a/tests/manual/textrendering/textperformance/textperformance.pro b/tests/manual/textrendering/textperformance/textperformance.pro index bba41b9c127..f07a4f02944 100644 --- a/tests/manual/textrendering/textperformance/textperformance.pro +++ b/tests/manual/textrendering/textperformance/textperformance.pro @@ -1 +1,2 @@ +QT += widgets SOURCES = main.cpp diff --git a/tests/manual/textrendering/textrendering.pro b/tests/manual/textrendering/textrendering.pro new file mode 100644 index 00000000000..92f0741bf30 --- /dev/null +++ b/tests/manual/textrendering/textrendering.pro @@ -0,0 +1,4 @@ +TEMPLATE=subdirs + +SUBDIRS = glyphshaping \ + textperformance diff --git a/tests/manual/widgets/itemviews/delegate/example.pro b/tests/manual/widgets/itemviews/delegate/delegate.pro similarity index 71% rename from tests/manual/widgets/itemviews/delegate/example.pro rename to tests/manual/widgets/itemviews/delegate/delegate.pro index e9f2189272c..e5c90f18ecc 100644 --- a/tests/manual/widgets/itemviews/delegate/example.pro +++ b/tests/manual/widgets/itemviews/delegate/delegate.pro @@ -1,2 +1,3 @@ TEMPLATE = app +QT += widgets SOURCES=example.cpp diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index 69535b28560..586691a37de 100644 --- a/tests/manual/windowflags/controllerwindow.cpp +++ b/tests/manual/windowflags/controllerwindow.cpp @@ -39,7 +39,14 @@ ** ****************************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "controllerwindow.h" @@ -72,7 +79,8 @@ ControllerWindow::ControllerWindow() mainLayout->addLayout(bottomLayout); setLayout(mainLayout); - setWindowTitle(tr("Window Flags")); + setWindowTitle(tr("Window Flags (Qt version %1, %2)") + .arg(QLatin1String(qVersion()), qApp->platformName())); updatePreview(); } diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp index 601cc50efac..684d1ee1feb 100644 --- a/tests/manual/windowflags/previewwindow.cpp +++ b/tests/manual/windowflags/previewwindow.cpp @@ -39,7 +39,9 @@ ** ****************************************************************************/ -#include +#include +#include +#include #include "previewwindow.h" diff --git a/tests/manual/windowflags/windowflags.pro b/tests/manual/windowflags/windowflags.pro index 1b45d0d8677..06def212b3c 100644 --- a/tests/manual/windowflags/windowflags.pro +++ b/tests/manual/windowflags/windowflags.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = controllerwindow.h \ previewwindow.h SOURCES = controllerwindow.cpp \ diff --git a/tests/manual/windowmodality/modality.pro b/tests/manual/windowmodality/windowmodality.pro similarity index 100% rename from tests/manual/windowmodality/modality.pro rename to tests/manual/windowmodality/windowmodality.pro diff --git a/util/unicode/data/BidiMirroring.txt b/util/unicode/data/BidiMirroring.txt index f9a09c13455..9a1b25fa4d2 100644 --- a/util/unicode/data/BidiMirroring.txt +++ b/util/unicode/data/BidiMirroring.txt @@ -1,12 +1,12 @@ # BidiMirroring-5.0.0.txt -# Date: 2006-02-16, 16:11:00 PST [KW] +# Date: 2007-08-22, 14:40:00 PDT [KW] # -# Bidi_Mirroring_Glyph Property +# Bidi_Mirroring_Glyph Property (Corrigendum #6 applied) # # This file is an informative contributory data file in the # Unicode Character Database. # -# Copyright (c) 1991-2006 Unicode, Inc. +# Copyright (c) 1991-2007 Unicode, Inc. # For terms of use, see http://www.unicode.org/terms_of_use.html # # This data file lists characters that have the mirrored property @@ -52,10 +52,6 @@ 0F3D; 0F3C # TIBETAN MARK ANG KHANG GYAS 169B; 169C # OGHAM FEATHER MARK 169C; 169B # OGHAM REVERSED FEATHER MARK -2018; 2019 # [BEST FIT] LEFT SINGLE QUOTATION MARK -2019; 2018 # [BEST FIT] RIGHT SINGLE QUOTATION MARK -201C; 201D # [BEST FIT] LEFT DOUBLE QUOTATION MARK -201D; 201C # [BEST FIT] RIGHT DOUBLE QUOTATION MARK 2039; 203A # SINGLE LEFT-POINTING ANGLE QUOTATION MARK 203A; 2039 # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 2045; 2046 # LEFT SQUARE BRACKET WITH QUILL @@ -366,8 +362,6 @@ 3019; 3018 # RIGHT WHITE TORTOISE SHELL BRACKET 301A; 301B # LEFT WHITE SQUARE BRACKET 301B; 301A # RIGHT WHITE SQUARE BRACKET -301D; 301E # REVERSED DOUBLE PRIME QUOTATION MARK -301E; 301D # DOUBLE PRIME QUOTATION MARK FE59; FE5A # SMALL LEFT PARENTHESIS FE5A; FE59 # SMALL RIGHT PARENTHESIS FE5B; FE5C # SMALL LEFT CURLY BRACKET @@ -393,10 +387,6 @@ FF63; FF62 # [BEST FIT] HALFWIDTH RIGHT CORNER BRACKET # For these characters it is up to the rendering system # to provide mirrored glyphs. -# 201A; SINGLE LOW-9 QUOTATION MARK -# 201B; SINGLE HIGH-REVERSED-9 QUOTATION MARK -# 201E; DOUBLE LOW-9 QUOTATION MARK -# 201F; DOUBLE HIGH-REVERSED-9 QUOTATION MARK # 2140; DOUBLE-STRUCK N-ARY SUMMATION # 2201; COMPLEMENT # 2202; PARTIAL DIFFERENTIAL @@ -572,7 +562,6 @@ FF63; FF62 # [BEST FIT] HALFWIDTH RIGHT CORNER BRACKET # 2AF3; PARALLEL WITH TILDE OPERATOR # 2AFB; TRIPLE SOLIDUS BINARY RELATION # 2AFD; DOUBLE SOLIDUS OPERATOR -# 301F; LOW DOUBLE PRIME QUOTATION MARK # 1D6DB; MATHEMATICAL BOLD PARTIAL DIFFERENTIAL # 1D715; MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL # 1D74F; MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL diff --git a/util/unicode/data/UnicodeData.txt b/util/unicode/data/UnicodeData.txt index 299f0e57d17..15888520046 100644 --- a/util/unicode/data/UnicodeData.txt +++ b/util/unicode/data/UnicodeData.txt @@ -6118,14 +6118,14 @@ 2015;HORIZONTAL BAR;Pd;0;ON;;;;;N;QUOTATION DASH;;;; 2016;DOUBLE VERTICAL LINE;Po;0;ON;;;;;N;DOUBLE VERTICAL BAR;;;; 2017;DOUBLE LOW LINE;Po;0;ON; 0020 0333;;;;N;SPACING DOUBLE UNDERSCORE;;;; -2018;LEFT SINGLE QUOTATION MARK;Pi;0;ON;;;;;Y;SINGLE TURNED COMMA QUOTATION MARK;;;; -2019;RIGHT SINGLE QUOTATION MARK;Pf;0;ON;;;;;Y;SINGLE COMMA QUOTATION MARK;;;; -201A;SINGLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;Y;LOW SINGLE COMMA QUOTATION MARK;;;; -201B;SINGLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;Y;SINGLE REVERSED COMMA QUOTATION MARK;;;; -201C;LEFT DOUBLE QUOTATION MARK;Pi;0;ON;;;;;Y;DOUBLE TURNED COMMA QUOTATION MARK;;;; -201D;RIGHT DOUBLE QUOTATION MARK;Pf;0;ON;;;;;Y;DOUBLE COMMA QUOTATION MARK;;;; -201E;DOUBLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;Y;LOW DOUBLE COMMA QUOTATION MARK;;;; -201F;DOUBLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;Y;DOUBLE REVERSED COMMA QUOTATION MARK;;;; +2018;LEFT SINGLE QUOTATION MARK;Pi;0;ON;;;;;N;SINGLE TURNED COMMA QUOTATION MARK;;;; +2019;RIGHT SINGLE QUOTATION MARK;Pf;0;ON;;;;;N;SINGLE COMMA QUOTATION MARK;;;; +201A;SINGLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;N;LOW SINGLE COMMA QUOTATION MARK;;;; +201B;SINGLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;N;SINGLE REVERSED COMMA QUOTATION MARK;;;; +201C;LEFT DOUBLE QUOTATION MARK;Pi;0;ON;;;;;N;DOUBLE TURNED COMMA QUOTATION MARK;;;; +201D;RIGHT DOUBLE QUOTATION MARK;Pf;0;ON;;;;;N;DOUBLE COMMA QUOTATION MARK;;;; +201E;DOUBLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;N;LOW DOUBLE COMMA QUOTATION MARK;;;; +201F;DOUBLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;N;DOUBLE REVERSED COMMA QUOTATION MARK;;;; 2020;DAGGER;Po;0;ON;;;;;N;;;;; 2021;DOUBLE DAGGER;Po;0;ON;;;;;N;;;;; 2022;BULLET;Po;0;ON;;;;;N;;;;; @@ -9480,9 +9480,9 @@ 301A;LEFT WHITE SQUARE BRACKET;Ps;0;ON;;;;;Y;OPENING WHITE SQUARE BRACKET;;;; 301B;RIGHT WHITE SQUARE BRACKET;Pe;0;ON;;;;;Y;CLOSING WHITE SQUARE BRACKET;;;; 301C;WAVE DASH;Pd;0;ON;;;;;N;;;;; -301D;REVERSED DOUBLE PRIME QUOTATION MARK;Ps;0;ON;;;;;Y;;;;; -301E;DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;Y;;;;; -301F;LOW DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;Y;;;;; +301D;REVERSED DOUBLE PRIME QUOTATION MARK;Ps;0;ON;;;;;N;;;;; +301E;DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;N;;;;; +301F;LOW DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;N;;;;; 3020;POSTAL MARK FACE;So;0;ON;;;;;N;;;;; 3021;HANGZHOU NUMERAL ONE;Nl;0;L;;;;1;N;;;;; 3022;HANGZHOU NUMERAL TWO;Nl;0;L;;;;2;N;;;;; diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index 4a11ec667be..d769176c6ff 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -465,7 +465,7 @@ static int appendToSpecialCaseMap(const QList &map) QList utf16map; for (int i = 0; i < map.size(); ++i) { int val = map.at(i); - if (val >= 0x10000) { + if (QChar::requiresSurrogates(val)) { utf16map << QChar::highSurrogate(val); utf16map << QChar::lowSurrogate(val); } else { @@ -789,7 +789,7 @@ static void readUnicodeData() qWarning() << "upperCaseDiff exceeded (" << hex << codepoint << "->" << upperCase << ")"; data.p.upperCaseDiff = diff; maxUpperCaseDiff = qMax(maxUpperCaseDiff, qAbs(diff)); - if (codepoint >= 0x10000 || upperCase >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(upperCase)) { // if the conditions below doesn't hold anymore we need to modify our upper casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(upperCase)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(upperCase)); @@ -803,7 +803,7 @@ static void readUnicodeData() qWarning() << "lowerCaseDiff exceeded (" << hex << codepoint << "->" << lowerCase << ")"; data.p.lowerCaseDiff = diff; maxLowerCaseDiff = qMax(maxLowerCaseDiff, qAbs(diff)); - if (codepoint >= 0x10000 || lowerCase >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(lowerCase)) { // if the conditions below doesn't hold anymore we need to modify our lower casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(lowerCase)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(lowerCase)); @@ -820,7 +820,7 @@ static void readUnicodeData() qWarning() << "titleCaseDiff exceeded (" << hex << codepoint << "->" << titleCase << ")"; data.p.titleCaseDiff = diff; maxTitleCaseDiff = qMax(maxTitleCaseDiff, qAbs(diff)); - if (codepoint >= 0x10000 || titleCase >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(titleCase)) { // if the conditions below doesn't hold anymore we need to modify our title casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(titleCase)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(titleCase)); @@ -1078,7 +1078,7 @@ static void readDerivedNormalizationProps() struct NormalizationCorrection { uint codepoint; uint mapped; - uint version; + int version; }; static QByteArray createNormalizationCorrections() @@ -1099,6 +1099,7 @@ static QByteArray createNormalizationCorrections() "static const NormalizationCorrection uc_normalization_corrections[] = {\n"; + int maxVersion = 0; int numCorrections = 0; while (!f.atEnd()) { QByteArray line; @@ -1135,11 +1136,13 @@ static QByteArray createNormalizationCorrections() out += " { 0x" + QByteArray::number(c.codepoint, 16) + ", 0x" + QByteArray::number(c.mapped, 16) + ", " + QString::number(c.version) + " },\n"; ++numCorrections; + maxVersion = qMax(c.version, maxVersion); } out += "};\n\n" - "enum { NumNormalizationCorrections = " + QByteArray::number(numCorrections) + " };\n\n"; + "enum { NumNormalizationCorrections = " + QByteArray::number(numCorrections) + " };\n" + "enum { NormalizationCorrectionsVersionMax = " + QByteArray::number(maxVersion) + " };\n\n"; return out; } @@ -1250,7 +1253,7 @@ static void readSpecialCasing() // if the condition below doesn't hold anymore we need to modify our // lower/upper/title casing code and case folding code - Q_ASSERT(codepoint < 0x10000); + Q_ASSERT(!QChar::requiresSurrogates(codepoint)); // qDebug() << "codepoint" << hex << codepoint; // qDebug() << line; @@ -1356,7 +1359,7 @@ static void readCaseFolding() qWarning() << "caseFoldDiff exceeded (" << hex << codepoint << "->" << caseFolded << ")"; ud.p.caseFoldDiff = diff; maxCaseFoldDiff = qMax(maxCaseFoldDiff, qAbs(diff)); - if (codepoint >= 0x10000 || caseFolded >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(caseFolded)) { // if the conditions below doesn't hold anymore we need to modify our case folding code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(caseFolded)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(caseFolded)); @@ -2314,11 +2317,11 @@ static QByteArray createCompositionInfo() if (!d.decomposition.isEmpty()) { int utf16Chars = 0; for (int j = 0; j < d.decomposition.size(); ++j) - utf16Chars += d.decomposition.at(j) >= 0x10000 ? 2 : 1; + utf16Chars += QChar::requiresSurrogates(d.decomposition.at(j)) ? 2 : 1; decompositions.append(d.decompositionType + (utf16Chars<<8)); for (int j = 0; j < d.decomposition.size(); ++j) { int code = d.decomposition.at(j); - if (code >= 0x10000) { + if (QChar::requiresSurrogates(code)) { // save as surrogate pair ushort high = QChar::highSurrogate(code); ushort low = QChar::lowSurrogate(code); @@ -2355,11 +2358,11 @@ static QByteArray createCompositionInfo() if (!d.decomposition.isEmpty()) { int utf16Chars = 0; for (int j = 0; j < d.decomposition.size(); ++j) - utf16Chars += d.decomposition.at(j) >= 0x10000 ? 2 : 1; + utf16Chars += QChar::requiresSurrogates(d.decomposition.at(j)) ? 2 : 1; decompositions.append(d.decompositionType + (utf16Chars<<8)); for (int j = 0; j < d.decomposition.size(); ++j) { int code = d.decomposition.at(j); - if (code >= 0x10000) { + if (QChar::requiresSurrogates(code)) { // save as surrogate pair ushort high = QChar::highSurrogate(code); ushort low = QChar::lowSurrogate(code);