Merge remote-tracking branch 'origin/stable' into dev

Change-Id: I059725e3b7d7ffd5a16a0931e6c17200917172b5
This commit is contained in:
Frederik Gladhorn 2013-04-22 16:35:41 +02:00
commit 4c231d5df3
202 changed files with 1958 additions and 918 deletions

View File

@ -69,7 +69,7 @@ my $normalizePath_fixDrive = ($^O eq "msys" ? 1 : 0);
sub normalizePath {
my $s = shift;
$$s =~ s=\\=/=g;
if ($normalizePath_fixDrive && $$s =~ m,^/([a-zA-Z])/(.*),) {
if ($normalizePath_fixDrive && ($$s =~ m,^/([a-zA-Z])/(.*), || $$s =~ m,^([a-zA-Z]):/(.*),)) {
$$s = lc($1) . ":/$2";
}
}
@ -1180,7 +1180,7 @@ if($check_includes) {
}
}
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
$qt_namespace_suffix = $1 // "";
$qt_namespace_suffix = defined($1) ? $1 : "";
$qt_begin_namespace_found = 1;
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
$qt_end_namespace_found = 1;

View File

@ -11,6 +11,8 @@ fi
if [ `echo $FILE | cut $CUT_ARG` = "/" ]; then
true
elif [ "$OSTYPE" = "msys" -a -z "${FILE##[a-zA-Z]:[/\\]*}" ]; then
true
else
RES="$PWD/$FILE"
test -d "$RES" && RES="$RES/"

308
configure vendored
View File

@ -440,9 +440,12 @@ if [ -d /System/Library/Frameworks/Carbon.framework ]; then
fi
BUILD_ON_MSYS=no
HOST_DIRLIST_SEP=":"
DEV_NULL=/dev/null
if [ "$OSTYPE" = "msys" ]; then
HOST_DIRLIST_SEP=";"
BUILD_ON_MSYS=yes
DEV_NULL=/tmp/empty-file
echo "" > $DEV_NULL
fi
#-------------------------------------------------------------------------------
@ -898,6 +901,7 @@ CFG_USE_GNUMAKE=no
CFG_XINPUT2=auto
CFG_XINPUT=runtime
CFG_XKB=auto
CFG_XKBCOMMON=no
CFG_XCB=auto
CFG_XCB_GLX=no
CFG_EGLFS=auto
@ -2830,6 +2834,9 @@ if [ "$CFG_FORCEDEBUGINFO" = "yes" ]; then
fi
if [ "$XPLATFORM_IOS" = "yes" ]; then
CFG_RPATH="no"
CFG_PKGCONFIG="no"
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples tests"
CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store
CFG_CXX11="no" # C++11 support disabled for now
CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtdeclarative qtquickcontrols qtwebkit qtgraphicaleffects qtdoc qtmultimedia qtwebkit-examples-and-demos qttools"
@ -3279,7 +3286,7 @@ Installation options:
(default PREFIX/include)
-libdir <dir> ......... Libraries will be installed to <dir>
(default PREFIX/lib)
-archdatadir <dir>..... Arch-dependent data used by Qt will be installed to <dir>
-archdatadir <dir> .... Arch-dependent data used by Qt will be installed to <dir>
(default PREFIX)
-plugindir <dir> ...... Plugins will be installed to <dir>
(default ARCHDATADIR/plugins)
@ -3325,7 +3332,7 @@ Configure options:
-opensource ........ Compile and link the Open-Source Edition of Qt.
-commercial ........ Compile and link the Commercial Edition of Qt.
-confirm-license.... Automatically acknowledge the license (use with
-confirm-license ... Automatically acknowledge the license (use with
either -opensource or -commercial)
-no-c++11 .......... Do not compile Qt with C++11 support enabled.
@ -3374,8 +3381,8 @@ Configure options:
-no-sse2 ........... Do not compile with use of SSE2 instructions.
-no-sse3 ........... Do not compile with use of SSE3 instructions.
-no-ssse3 .......... Do not compile with use of SSSE3 instructions.
-no-sse4.1.......... Do not compile with use of SSE4.1 instructions.
-no-sse4.2.......... Do not compile with use of SSE4.2 instructions.
-no-sse4.1 ......... Do not compile with use of SSE4.1 instructions.
-no-sse4.2 ......... Do not compile with use of SSE4.2 instructions.
-no-avx ............ Do not compile with use of AVX instructions.
-no-avx2 ........... Do not compile with use of AVX2 instructions.
-no-neon ........... Do not compile with use of NEON instructions.
@ -3385,7 +3392,7 @@ Configure options:
-qtnamespace <name> Wraps all Qt library code in 'namespace <name> {...}'.
-qtlibinfix <infix> Renames all libQt*.so to libQt*<infix>.so.
-testcocoon Instrument Qt with the TestCocoon code coverage tool.
-testcocoon ........ Instrument Qt with the TestCocoon code coverage tool.
-D <string> ........ Add an explicit define to the preprocessor.
-I <string> ........ Add an explicit include path.
@ -3549,8 +3556,8 @@ EOF
if [ "$XPLATFORM_MAEMO" = "yes" ]; then
cat << EOF
$X2N -no-xinput2......... Do not compile XInput2 support.
$X2Y -xinput2............ Compile XInput2 support.
$X2N -no-xinput2 ........ Do not compile XInput2 support.
$X2Y -xinput2 ........... Compile XInput2 support.
EOF
@ -4050,7 +4057,7 @@ fi
#-------------------------------------------------------------------------------
# Verify makespec
#-------------------------------------------------------------------------------
QMAKE_OUTPUT=`$outpath/bin/qmake -E -nocache -spec "$XQMAKESPEC" "QT=" /dev/null 2>&1 >/dev/null`
QMAKE_OUTPUT=`$outpath/bin/qmake -E -nocache -spec "$XQMAKESPEC" "QT=" $DEV_NULL 2>&1 >/dev/null`
if [ $? != "0" ]; then
echo "Failed to process makespec for platform '$XPLATFORM'"
if [ "$OPT_VERBOSE" = "yes" ]; then
@ -4066,7 +4073,7 @@ fi
#-------------------------------------------------------------------------------
if [ -z "$PKG_CONFIG" ]; then
# See if PKG_CONFIG is set in the mkspec:
PKG_CONFIG="`"$outpath/bin/qmake" -E -nocache -spec "$XQMAKESPEC" "CONFIG=" /dev/null 2>&1 | sed -n -e 's,^PKG_CONFIG = \(.*\),\1,p'`"
PKG_CONFIG="`"$outpath/bin/qmake" -E -nocache -spec "$XQMAKESPEC" "CONFIG=" $DEV_NULL 2>&1 | sed -n -e 's,^PKG_CONFIG = \(.*\),\1,p'`"
fi
if [ -z "$PKG_CONFIG" ]; then
PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null`
@ -5254,14 +5261,12 @@ if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists "xkbcommon >= 0.2.0" 2>/dev/null
QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`"
QMAKE_LIBS_XKBCOMMON="`$PKG_CONFIG --libs xkbcommon 2>/dev/null`"
QT_CONFIG="$QT_CONFIG xkbcommon"
CFG_XKBCOMMON=yes
elif [ "$CFG_XCB" != "no" ]; then
echo "WARNING: XCB support enabled but libxkbcommon 0.2.0 (or higher) not found."
echo "Not satisfying this requirement will disable the compose key functionality,"
echo "which includes text input with dead keys."
QMakeVar add DEFINES QT_NO_XKBCOMMON
fi
if [ -n "$QMAKE_CFLAGS_XKBCOMMON" ] || [ -n "$QMAKE_LIBS_XKBCOMMON" ]; then
if [ "$CFG_XKBCOMMON" != "no" ]; then
QMakeVar set QMAKE_CFLAGS_XKBCOMMON "$QMAKE_CFLAGS_XKBCOMMON"
QMakeVar set QMAKE_LIBS_XKBCOMMON "$QMAKE_LIBS_XKBCOMMON"
fi
@ -6582,17 +6587,17 @@ fi
#-------------------------------------------------------------------------------
exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
echo
echo " Configure summary"
echo
if [ "$XPLATFORM" = "$PLATFORM" ]; then
echo "Build type: $PLATFORM"
# the missing space before $CFG_FEATURES is intentional
echo "Build type: $PLATFORM ($CFG_ARCH, CPU features:${CFG_CPUFEATURES- none detected})"
else
echo "Building on: $PLATFORM"
echo "Building for: $XPLATFORM"
echo "Building on: $PLATFORM ($CFG_HOST_ARCH, CPU features:${CFG_HOST_CPUFEATURES- none detected})"
echo "Building for: $XPLATFORM ($CFG_ARCH, CPU features:${CFG_CPUFEATURES- none detected})"
fi
# the missing space before $CFG_FEATURES is intentional
echo "Architecture: $CFG_ARCH, features:$CFG_CPUFEATURES"
echo "Host architecture: $CFG_HOST_ARCH, features:$CFG_HOST_CPUFEATURES"
if [ -n "$PLATFORM_NOTES" ]; then
echo "Platform notes:"
@ -6605,150 +6610,170 @@ if [ "$OPT_VERBOSE" = "yes" ]; then
echo $ECHO_N "qmake vars .......... $ECHO_C"
cat "$QMAKE_VARS_FILE" | tr '\n' ' '
echo "qmake switches ......... $QMAKE_SWITCHES"
echo
fi
echo "Build .................. $CFG_BUILD_PARTS"
echo "Configuration .......... $QMAKE_CONFIG $QT_CONFIG"
# Build configuration
echo "Build options:"
echo $ECHO_N " Configuration .......... $ECHO_C"
echo $QMAKE_CONFIG $QT_CONFIG | tr ' ' '\n' | sort | tr '\n' ' '
echo
echo " Build parts ............ $CFG_BUILD_PARTS"
release="release"
[ "$CFG_FORCEDEBUGINFO" = "yes" ] && release="release (with debug info)"
[ "$CFG_DEBUG" = "yes" ] && build_mode="debug" || build_mode=$release
if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo "Debug .................. yes (combined)"
if [ "$CFG_DEBUG" = "yes" ]; then
echo "Default Link ........... debug"
echo " Mode ................... debug and $release; default link: $build_mode"
else
echo "Default Link ........... release"
echo " Mode ................... $build_mode"
fi
else
echo "Debug .................. $CFG_DEBUG"
unset build_mode release
echo " Using C++11 ............ $CFG_CXX11"
echo " Using PCH .............. $CFG_PRECOMPILE"
echo " Target compiler supports:"
if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then
echo " SSE2/SSE3/SSSE3 ...... ${CFG_SSE2}/${CFG_SSE3}/${CFG_SSSE3}"
echo " SSE4.1/SSE4.2 ........ ${CFG_SSE4_1}/${CFG_SSE4_2}"
echo " AVX/AVX2 ............. ${CFG_AVX}/${CFG_AVX2}"
elif [ "$CFG_ARCH" = "arm" ]; then
echo " iWMMXt/Neon .......... ${CFG_IWMMXT}/${CFG_NEON}"
elif [ "$CFG_ARCH" = "mips" ]; then
echo " DSP/DSPr2 ............ ${CFG_MIPS_DSP}/${CFG_MIPS_DSPR2}"
fi
if [ "$CFG_RELEASE" = "yes" ] || [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo "Force debug info ....... $CFG_FORCEDEBUGINFO"
fi
echo "C++11 support .......... $CFG_CXX11"
if [ -n "$PKG_CONFIG" ]; then
echo "pkg-config ............. yes"
else
echo "pkg-config ............. no"
fi
[ "$CFG_DBUS" = "no" ] && echo "Qt D-Bus module ........ no"
[ "$CFG_DBUS" = "yes" ] && echo "Qt D-Bus module ........ yes (run-time)"
[ "$CFG_DBUS" = "linked" ] && echo "Qt D-Bus module ........ yes (linked)"
echo "Qt Concurrent code ..... $CFG_CONCURRENT"
echo "Qt GUI module .......... $CFG_GUI"
echo "Qt Widgets module ...... $CFG_WIDGETS"
# Qt modules
echo
echo "Qt modules and options:"
[ "$CFG_DBUS" = "no" ] && echo " Qt D-Bus ............... no"
[ "$CFG_DBUS" = "yes" ] && echo " Qt D-Bus ............... yes (loading dbus-1 at runtime)"
[ "$CFG_DBUS" = "linked" ] && echo " Qt D-Bus ............... yes (linked to dbus-1)"
echo " Qt Concurrent .......... $CFG_CONCURRENT"
echo " Qt GUI ................. $CFG_GUI"
echo " Qt Widgets ............. $CFG_WIDGETS"
if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
echo " JavaScriptCore JIT ..... To be decided by JavaScriptCore"
else
echo " JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
fi
echo " QML debugging .......... $CFG_QML_DEBUG"
echo "PCH support ............ $CFG_PRECOMPILE"
if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then
echo "SSE2/SSE3/SSSE3......... ${CFG_SSE2}/${CFG_SSE3}/${CFG_SSSE3}"
echo "SSE4.1/SSE4.2........... ${CFG_SSSE3}/${CFG_SSE4_1}/${CFG_SSE4_2}"
echo "AVX/AVX2................ ${CFG_AVX}/${CFG_AVX2}"
elif [ "$CFG_ARCH" = "arm" ]; then
echo "iWMMXt support ......... ${CFG_IWMMXT}"
echo "NEON support ........... ${CFG_NEON}"
fi
if [ "$CFG_ARCH" = "mips" ]; then
echo "MIPS_DSP/MIPS_DSPR2..... ${CFG_MIPS_DSP}/${CFG_MIPS_DSPR2}"
fi
echo "IPv6 ifname support .... $CFG_IPV6IFNAME"
echo "getaddrinfo support .... $CFG_GETADDRINFO"
echo "getifaddrs support ..... $CFG_GETIFADDRS"
echo "Accessibility .......... $CFG_ACCESSIBILITY"
echo "NIS support ............ $CFG_NIS"
echo "CUPS support ........... $CFG_CUPS"
echo "Iconv support .......... $CFG_ICONV"
echo "Glib support ........... $CFG_GLIB"
echo "GStreamer support ...... $CFG_GSTREAMER"
echo "PulseAudio support ..... $CFG_PULSEAUDIO"
echo "Large File support ..... $CFG_LARGEFILE"
echo "GIF support ............ $CFG_GIF"
if [ "$CFG_JPEG" = "no" ]; then
echo "JPEG support ........... $CFG_JPEG"
else
echo "JPEG support ........... $CFG_JPEG ($CFG_LIBJPEG)"
fi
if [ "$CFG_PNG" = "no" ]; then
echo "PNG support ............ $CFG_PNG"
else
echo "PNG support ............ $CFG_PNG ($CFG_LIBPNG)"
fi
echo "zlib support ........... $CFG_ZLIB"
echo "Session management ..... $CFG_SM"
echo "libudev support ........ $CFG_LIBUDEV"
if [ "$XPLATFORM_QNX" = "yes" ]; then
echo "SLOG2 support .......... $CFG_SLOG2"
fi
echo " Use system proxies ..... $CFG_SYSTEM_PROXIES"
if [ "$CFG_OPENGL" = "desktop" ]; then
echo "OpenGL support ......... yes (Desktop OpenGL)"
elif [ "$CFG_OPENGL" = "es2" ]; then
echo "OpenGL support ......... yes (OpenGL ES 2.x)"
# Other things
# Please keep sorted and properly grouped! The output is quite long, so it's
# hard to find something you're searching for if it's not sorted.
echo
echo "Support enabled for:"
echo " Accessibility .......... $CFG_ACCESSIBILITY"
echo " ALSA ................... $CFG_ALSA"
echo " CUPS ................... $CFG_CUPS"
[ "$XPLATFORM_MINGW" = "yes" ] && \
echo " DirectWrite ............ $CFG_DIRECTWRITE"
echo " FontConfig ............. $CFG_FONTCONFIG"
echo " Iconv .................. $CFG_ICONV"
echo " ICU .................... $CFG_ICU"
echo " Image formats:"
echo " GIF .................. $CFG_GIF"
if [ "$CFG_JPEG" = "no" ]; then
echo " JPEG ................. $CFG_JPEG"
else
echo "OpenGL support ......... no"
echo " JPEG ................. $CFG_JPEG ($CFG_LIBJPEG)"
fi
if [ "$CFG_OPENVG" ]; then
if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
echo "OpenVG support ......... ShivaVG"
if [ "$CFG_PNG" = "no" ]; then
echo " PNG .................. $CFG_PNG"
else
echo "OpenVG support ......... $CFG_OPENVG"
echo " PNG .................. $CFG_PNG ($CFG_LIBPNG)"
fi
fi
echo "XShape support ......... $CFG_XSHAPE"
echo "XVideo support ......... $CFG_XVIDEO"
echo "XSync support .......... $CFG_XSYNC"
echo "Xinerama support ....... $CFG_XINERAMA"
echo "Xcursor support ........ $CFG_XCURSOR"
echo "Xfixes support ......... $CFG_XFIXES"
echo "Xrandr support ......... $CFG_XRANDR"
echo "Xi support ............. $CFG_XINPUT"
echo "Xi2 support ............ $CFG_XINPUT2"
echo "MIT-SHM support ........ $CFG_MITSHM"
echo "FontConfig support ..... $CFG_FONTCONFIG"
echo "XKB support ............ $CFG_XKB"
echo "GTK theme support ...... $CFG_QGTKSTYLE"
if [ "$XPLATFORM_MINGW" = "yes" ] ; then
echo "DirectWrite support .... $CFG_DIRECTWRITE"
fi
[ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support .......... $CFG_SQL_mysql"
[ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support ..... $CFG_SQL_psql"
[ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........... $CFG_SQL_odbc"
[ "$CFG_SQL_oci" != "no" ] && echo "OCI support ............ $CFG_SQL_oci"
[ "$CFG_SQL_tds" != "no" ] && echo "TDS support ............ $CFG_SQL_tds"
[ "$CFG_SQL_db2" != "no" ] && echo "DB2 support ............ $CFG_SQL_db2"
[ "$CFG_SQL_ibase" != "no" ] && echo "InterBase support ...... $CFG_SQL_ibase"
[ "$CFG_SQL_sqlite2" != "no" ] && echo "SQLite 2 support ....... $CFG_SQL_sqlite2"
[ "$CFG_SQL_sqlite" != "no" ] && echo "SQLite support ......... $CFG_SQL_sqlite ($CFG_SQLITE)"
echo " Glib ................... $CFG_GLIB"
echo " GStreamer .............. $CFG_GSTREAMER"
echo " GTK theme .............. $CFG_QGTKSTYLE"
echo " Large Files ............ $CFG_LARGEFILE"
echo " Networking:"
[ "$BUILD_ON_MAC" = "yes" ] && \
echo " CoreWlan ............. $CFG_COREWLAN"
echo " getaddrinfo .......... $CFG_GETADDRINFO"
echo " getifaddrs ........... $CFG_GETIFADDRS"
echo " IPv6 ifname .......... $CFG_IPV6IFNAME"
OPENSSL_LINKAGE=""
if [ "$CFG_OPENSSL" = "yes" ]; then
OPENSSL_LINKAGE="(run-time)"
OPENSSL_LINKAGE="(loading libraries at run-time)"
elif [ "$CFG_OPENSSL" = "linked" ]; then
OPENSSL_LINKAGE="(linked)"
OPENSSL_LINKAGE="(linked to the libraries)"
fi
echo "OpenSSL support ........ $CFG_OPENSSL $OPENSSL_LINKAGE"
echo "Alsa support ........... $CFG_ALSA"
if [ "$BUILD_ON_MAC" = "yes" ]; then
echo "CoreWlan support ....... $CFG_COREWLAN"
echo " OpenSSL .............. $CFG_OPENSSL $OPENSSL_LINKAGE"
unset OPENSSL_LINKAGE
echo " NIS .................... $CFG_NIS"
if [ "$CFG_OPENGL" = "desktop" ]; then
echo " OpenGL ................. yes (Desktop OpenGL)"
elif [ "$CFG_OPENGL" = "es2" ]; then
echo " OpenGL ................. yes (OpenGL ES 2.x)"
else
echo " OpenGL ................. no"
fi
echo "libICU support ......... $CFG_ICU"
echo "PCRE support ........... $CFG_PCRE"
echo "Xcb support ............ $CFG_XCB"
echo "Xrender support ........ $CFG_XRENDER"
if [ "$XPLATFORM_MAEMO" = "yes" ] && [ "$CFG_XCB" != "no" ]; then
echo "XInput2 support ........ $CFG_XINPUT2"
if [ "$CFG_OPENVG" ]; then
if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
echo " OpenVG ................. ShivaVG"
else
echo " OpenVG ................. $CFG_OPENVG"
fi
echo "EGLFS support .......... $CFG_EGLFS"
echo "DirectFB support ....... $CFG_DIRECTFB"
echo "LinuxFB support ........ $CFG_LINUXFB"
echo "KMS support ............ $CFG_KMS"
fi
if [ "$CFG_PCRE" = "no" ]; then
echo " PCRE ................... no"
else
pcre_sys=system
[ "$CFG_PCRE" = "qt" ] && pcre_sys=qt
echo " PCRE ................... yes ($pcre_sys)"
unset pcre_sys
fi
if [ -n "$PKG_CONFIG" ]; then
echo " pkg-config ............. yes"
else
echo " pkg-config ............. no"
fi
echo " PulseAudio ............. $CFG_PULSEAUDIO"
echo " QPA backends:"
echo " DirectFB ............. $CFG_DIRECTFB"
echo " EGLFS ................ $CFG_EGLFS"
echo " KMS .................. $CFG_KMS"
echo " LinuxFB .............. $CFG_LINUXFB"
echo " XCB .................. $CFG_XCB"
if [ "$CFG_XCB" != "no" ]; then
echo " MIT-SHM ............ $CFG_MITSHM"
echo " Xcursor ............ $CFG_XCURSOR"
echo " Xfixes ............. $CFG_XFIXES"
echo " Xi ................. $CFG_XINPUT"
echo " Xi2 ................ $CFG_XINPUT2"
echo " Xinerama ........... $CFG_XINERAMA"
echo " Xrandr ............. $CFG_XRANDR"
echo " Xrender ............ $CFG_XRENDER"
echo " XKB ................ $CFG_XKB"
echo " XShape ............. $CFG_XSHAPE"
echo " XSync .............. $CFG_XSYNC"
echo " XVideo ............. $CFG_XVIDEO"
fi
echo " Session management ..... $CFG_SM"
[ "$XPLATFORM_QNX" = "yes" ] && \
echo " SLOG2 .................. $CFG_SLOG2"
echo " SQL drivers:"
echo " DB2 .................. $CFG_SQL_db2"
echo " InterBase ............ $CFG_SQL_ibase"
echo " MySQL ................ $CFG_SQL_mysql"
echo " OCI .................. $CFG_SQL_oci"
echo " ODBC ................. $CFG_SQL_odbc"
echo " PostgreSQL ........... $CFG_SQL_psql"
echo " SQLite 2 ............. $CFG_SQL_sqlite2"
echo " SQLite ............... $CFG_SQL_sqlite ($CFG_SQLITE)"
echo " TDS .................. $CFG_SQL_tds"
echo " udev ................... $CFG_LIBUDEV"
echo " xkbcommon .............. $CFG_XKBCOMMON"
if [ "$CFG_ZLIB" = "no" ]; then
echo " zlib ................... no"
else
zlib_sys=system
[ "$CFG_ZLIB" = "yes" ] && zlib_sys=qt
echo " zlib ................... yes ($zlib_sys)"
unset zlib_sys
fi
echo
# complain about not being able to use dynamic plugins if we are using a static build
@ -6767,6 +6792,11 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then
echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked"
echo
fi
if [ "$CFG_XCB" != no ] && [ "$CFG_XKBCOMMON" = "no" ]; then
echo "WARNING: XCB support enabled but libxkbcommon 0.2.0 (or higher) not found."
echo "Not satisfying this requirement will disable the compose key functionality,"
echo "which includes text input with dead keys."
fi
exec 1>&3 3>&- # restore stdout
cat $outpath/config.summary # display config feedback to user

View File

@ -26,7 +26,6 @@
****************************************************************************/
/*! \example widgets/orientation
\group all-examples
\title Orientation Example
\brief The example shows a simple way to use different UIs depending on the screen

View File

@ -26,7 +26,6 @@
****************************************************************************/
/*! \example widgets/applicationicon
\group all-examples
\title Application Icon Example
\brief The example shows how to add an application icon to a mobile application.

View File

@ -28,7 +28,7 @@
/*!
\example tools/echoplugin
\title Echo Plugin Example
\group examples-widgets-tools
\ingroup examples-widgets-tools
\brief This example shows how to create a Qt plugin.

View File

@ -27,7 +27,6 @@
/*!
\example widgets/elidedlabel
\group all-examples
\title Elided Label Example
\brief This example creates a widget similar to QLabel, that elides the last

View File

@ -28,7 +28,7 @@
/*!
\example richtext/syntaxhighlighter
\title Syntax Highlighter Example
\group examples-richtext
\ingroup examples-richtext
\brief The Syntax Highligher example shows how to perform
simple syntax highlighing.

View File

@ -5,8 +5,8 @@ SUBDIRS = \
customcompleter \
echoplugin \
i18n \
plugandpaint \
plugandpaintplugins \
plugandpaint \
regexp \
settingseditor \
styleplugin \
@ -17,8 +17,3 @@ SUBDIRS = \
contains(DEFINES, QT_NO_TRANSLATION): SUBDIRS -= i18n
plugandpaint.depends = plugandpaintplugins
# install
sources.files = tools.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools
INSTALLS += sources

View File

@ -18,10 +18,15 @@ contains(QMAKE_HOST.os,Windows) {
# Not having sh.exe in your path causes this condition to pass
# To build Android Qt on Windows, this block must not be evaluated.
isEmpty(QMAKE_SH) {
# Override values from previously loaded shell-unix.conf
# (via unix.conf, via linux.conf).
include(../common/shell-win32.conf)
QMAKE_DEL_TREE = rmdir /s /q
QMAKE_INSTALL_FILE = copy /y
QMAKE_INSTALL_PROGRAM = copy /y
} else {
MINGW_IN_SHELL = 1
QMAKE_DIR_SEP = /
}
}

View File

@ -62,6 +62,7 @@ QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_LIBS_NETWORK = ws2.lib
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS_EGL = libEGL.lib
QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib

View File

@ -24,3 +24,19 @@ defineReplace(cmakeModuleList) {
}
return ($$join(out, ";"))
}
defineReplace(cmakeTargetPath) {
SYSR = $$[QT_SYSROOT]
!isEmpty(SYSR): path = $$relative_path($$1, $$[QT_SYSROOT])
else: path = $$1
return(/$$path)
}
defineReplace(cmakeTargetPaths) {
variable = $$1
out =
for(v, variable) {
out += \"$$cmakeTargetPath($$v)\"
}
return ($$join(out, " "))
}

View File

@ -27,19 +27,22 @@ CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
# The /lib paths are made symlinks to the /usr/lib paths. If someone searching
# for a Qt 5 package finds it in /lib/cmake/Qt5Core, although it has been
# installed in /usr/lib/cmake/Qt5Core, relative paths to the includes and
# executables will not work. So, we treat installations to /usr as non-relocatable
# packages with absolute paths.
CMAKE_INSTALL_LIBS_DIR = $$[QT_INSTALL_LIBS]
contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_FORCE_ABSOLUTE_PATHS = True
# executables will not work.
# To work around this, we insert code into the generated config files to check
# at cmake time whether package has been found via a symlink, and correct
# that to an absolute path. This is only done for installations to
# the /usr or / prefix.
CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
!isEmpty(CMAKE_FORCE_ABSOLUTE_PATHS)|contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
}
CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
!isEmpty(CMAKE_FORCE_ABSOLUTE_PATHS)|contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
CMAKE_LIB_DIR_IS_ABSOLUTE = True
} else {
@ -50,13 +53,13 @@ CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
}
CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
!isEmpty(CMAKE_FORCE_ABSOLUTE_PATHS)|contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
CMAKE_BIN_DIR_IS_ABSOLUTE = True
}
CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX])
!isEmpty(CMAKE_FORCE_ABSOLUTE_PATHS)|contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") {
contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*") {
CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA]/
CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = True
}

View File

@ -37,7 +37,7 @@ isEmpty(CMAKE_VERSION) {
CMAKE_BUILD_TYPE = Debug
CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release
win32-g++*:CMAKE_GENERATOR = -G \"MinGW Makefiles\"
win32-g++*:isEmpty(CROSS_COMPILE):CMAKE_GENERATOR = -G \"MinGW Makefiles\"
win32:equals(QT_ARCH, x86_64) {
win32-msvc2010:CMAKE_GENERATOR = -G \"Visual Studio 10 Win64\"
win32-msvc2012:CMAKE_GENERATOR = -G \"Visual Studio 11 Win64\"

View File

@ -3,7 +3,21 @@ if (CMAKE_VERSION VERSION_LESS 2.8.3)
message(FATAL_ERROR \"Qt 5 requires at least CMake version 2.8.3\")
endif()
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
# Use original install prefix when loaded through a
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
if(_realCurr STREQUAL _realOrig)
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR\" PATH)
else()
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
endif()
unset(_realOrig)
unset(_realCurr)
unset(_IMPORT_PREFIX)
!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
!!ELSE
set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")

View File

@ -31,9 +31,9 @@ for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_FIX_RPATH QMAKE_AR QMAKE_RANLIB QMAKE_
}
# We use xml as the output format instead of json since plutil on 10.6 does not have that option
QMAKE_MAC_PLATFORM_NAME = $$system("plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - | " \
QMAKE_MAC_PLATFORM_NAME = $$system("/usr/bin/plutil -convert xml1 \"$$QMAKE_MAC_SDK_PATH/SDKSettings.plist\" -o - 2>/dev/null | " \
"sed '/^<!DOCTYPE/d' | " \ # Don't look up http://www.apple.com/DTDs/PropertyList-1.0.dtd
"PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>&1 | " \
"PERL5LIB= xpath 'string(//key[.=\"PLATFORM_NAME\"]/following-sibling::*[1])' 2>/dev/null | " \
"sed 's/.*Value: \\(.*\\)/\\1/'")
isEmpty(QMAKE_MAC_PLATFORM_NAME): error("Could not resolve platform name for SDK '$$QMAKE_MAC_SDK'")

View File

@ -1 +0,0 @@
warning("CONFIG+=module is obsolete. load(qt_module) is sufficient.")

View File

@ -1,2 +0,0 @@
warning("load(qt_module_config) is obsolete. Use load(qt_module) instead.")
load(qt_module)

View File

@ -1,32 +1,68 @@
#
# Wayland-scanner extra-compiler for handling files specified in the WAYLANDSOURCES variable
# Extra-compilers for handling files specified in
# the WAYLANDSERVERSOURCES and WAYLANDCLIENTSOURCES variables
#
isEmpty(QMAKE_WAYLAND_SCANNER):error("QMAKE_WAYLAND_SCANNER not defined for this mkspec")
wayland-server-header.name = wayland ${QMAKE_FILE_BASE}
wayland-server-header.input = WAYLANDSOURCES
wayland-server-header.input = WAYLANDSERVERSOURCES
wayland-server-header.variable_out = HEADERS
wayland-server-header.output = wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)}
wayland-server-header.commands = $$QMAKE_WAYLAND_SCANNER server-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:wayland-server-header.commands = @echo Wayland server header ${QMAKE_FILE_IN} && $$wayland-server-header.commands
QMAKE_EXTRA_COMPILERS += wayland-server-header
wayland-client-header.name = wayland ${QMAKE_FILE_BASE}
wayland-client-header.input = WAYLANDSOURCES
wayland-client-header.input = WAYLANDCLIENTSOURCES
wayland-client-header.variable_out = HEADERS
wayland-client-header.output = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)}
wayland-client-header.commands = $$QMAKE_WAYLAND_SCANNER client-header < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:wayland-client-header.commands = @echo Wayland client header ${QMAKE_FILE_IN} && $$wayland-client-header.commands
QMAKE_EXTRA_COMPILERS += wayland-client-header
wayland-code.name = wayland ${QMAKE_FILE_BASE}
wayland-code.input = WAYLANDSOURCES
wayland-code.input = WAYLANDCLIENTSOURCES WAYLANDSERVERSOURCES
wayland-code.variable_out = SOURCES
wayland-code.output = wayland-${QMAKE_FILE_BASE}-protocol.c
wayland-code.commands = $$QMAKE_WAYLAND_SCANNER code < ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:wayland-code.commands = @echo Wayland code header ${QMAKE_FILE_IN} && $$wayland-code.commands
QMAKE_EXTRA_COMPILERS += wayland-code
qtPrepareTool(QMAKE_QTWAYLANDSCANNER, qtwaylandscanner)
qtwayland-client-header.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland-client-header.input = WAYLANDCLIENTSOURCES
qtwayland-client-header.variable_out = HEADERS
qtwayland-client-header.depends = wayland-${QMAKE_FILE_BASE}-client-protocol$${first(QMAKE_EXT_H)}
qtwayland-client-header.output = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland-client-header.commands = $$QMAKE_QTWAYLANDSCANNER client-header ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:qtwayland-client-header.commands = @echo QtWayland client header ${QMAKE_FILE_IN} && $$qtwayland-client-header.commands
QMAKE_EXTRA_COMPILERS += qtwayland-client-header
qtwayland-client-code.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland-client-code.input = WAYLANDCLIENTSOURCES
qtwayland-client-code.variable_out = SOURCES
qtwayland-client-code.depends = qwayland-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland-client-code.output = qwayland-${QMAKE_FILE_BASE}.cpp
qtwayland-client-code.commands = $$QMAKE_QTWAYLANDSCANNER client-code ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:qtwayland-client-code.commands = @echo QtWayland client code ${QMAKE_FILE_IN} && $$qtwayland-client-code.commands
QMAKE_EXTRA_COMPILERS += qtwayland-client-code
qtwayland-server-header.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland-server-header.input = WAYLANDSERVERSOURCES
qtwayland-server-header.variable_out = HEADERS
qtwayland-server-header.depends = wayland-${QMAKE_FILE_BASE}-server-protocol$${first(QMAKE_EXT_H)}
qtwayland-server-header.output = qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland-server-header.commands = $$QMAKE_QTWAYLANDSCANNER server-header ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:qtwayland-server-header.commands = @echo QtWayland server header ${QMAKE_FILE_IN} && $$qtwayland-server-header.commands
QMAKE_EXTRA_COMPILERS += qtwayland-server-header
qtwayland-server-code.name = qtwayland ${QMAKE_FILE_BASE}
qtwayland-server-code.input = WAYLANDSERVERSOURCES
qtwayland-server-code.variable_out = SOURCES
qtwayland-server-code.depends = qwayland-server-${QMAKE_FILE_BASE}$${first(QMAKE_EXT_H)}
qtwayland-server-code.output = qwayland-server-${QMAKE_FILE_BASE}.cpp
qtwayland-server-code.commands = $$QMAKE_QTWAYLANDSCANNER server-code ${QMAKE_FILE_IN} > ${QMAKE_FILE_OUT}
silent:qtwayland-server-code.commands = @echo QtWayland server code ${QMAKE_FILE_IN} && $$qtwayland-server-code.commands
QMAKE_EXTRA_COMPILERS += qtwayland-server-code

View File

@ -2,7 +2,7 @@
DBUS_ADAPTORS = $$PWD/xml/Cache.xml $$PWD/xml/DeviceEventController.xml
QDBUSXML2CPP_ADAPTOR_HEADER_FLAGS = -i struct_marshallers_p.h
DBUS_INTERFACES = $$PWD/xml/Socket.xml
DBUS_INTERFACES = $$PWD/xml/Socket.xml $$PWD/xml/Bus.xml
QDBUSXML2CPP_INTERFACE_HEADER_FLAGS = -i struct_marshallers_p.h
INCLUDEPATH += $$PWD

17
src/3rdparty/atspi2/xml/Bus.xml vendored Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.a11y.Status">
<property type="b" name="IsEnabled" access="readwrite">
</property>
<property type="b" name="ScreenReaderEnabled" access="readwrite">
</property>
</interface>
<interface name="org.a11y.Bus">
<method name="GetAddress">
<arg type="s" name="address" direction="out">
</arg>
</method>
</interface>
</node>

View File

@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
** version 3.7.16.1. By combining all the individual C code files into this
** version 3.7.16.2. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
@ -678,9 +678,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.7.16.1"
#define SQLITE_VERSION "3.7.16.2"
#define SQLITE_VERSION_NUMBER 3007016
#define SQLITE_SOURCE_ID "2013-03-29 13:44:34 527231bc67285f01fb18d4451b28f61da3c4e39d"
#define SQLITE_SOURCE_ID "2013-04-12 11:52:43 cbea02d93865ce0e06789db95fd9168ebac970c7"
/*
** CAPI3REF: Run-Time Library Version Numbers
@ -14238,6 +14238,10 @@ static void clearYMD_HMS_TZ(DateTime *p){
#define HAVE_LOCALTIME_S 1
#endif
#if SQLITE_OS_WINCE >= 1
struct tm *__cdecl localtime(const time_t *t);
#endif
#ifndef SQLITE_OMIT_LOCALTIME
/*
** The following routine implements the rough equivalent of localtime_r()
@ -32792,7 +32796,7 @@ static int winCheckReservedLock(sqlite3_file *id, int *pResOut){
rc = 1;
OSTRACE(("TEST WR-LOCK %d %d (local)\n", pFile->h, rc));
}else{
rc = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, RESERVED_BYTE, 0, 1, 0);
rc = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS,RESERVED_BYTE, 0, 1, 0);
if( rc ){
winUnlockFile(&pFile->h, RESERVED_BYTE, 0, 1, 0);
}

View File

@ -107,9 +107,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.7.16.1"
#define SQLITE_VERSION "3.7.16.2"
#define SQLITE_VERSION_NUMBER 3007016
#define SQLITE_SOURCE_ID "2013-03-29 13:44:34 527231bc67285f01fb18d4451b28f61da3c4e39d"
#define SQLITE_SOURCE_ID "2013-04-12 11:52:43 cbea02d93865ce0e06789db95fd9168ebac970c7"
/*
** CAPI3REF: Run-Time Library Version Numbers

View File

@ -616,7 +616,6 @@ public class QtActivityDelegate
} catch (Exception e) {
e.printStackTrace();
}
// setFullScreen(savedInstanceState.getBoolean("FullScreen"));
m_started = savedInstanceState.getBoolean("Started");
if (m_started)
m_surface.applicationStarted(true);

View File

@ -107,20 +107,6 @@ public class QtSurface extends SurfaceView implements SurfaceHolder.Callback
if (m_usesGL)
holder.setFormat(PixelFormat.RGBA_8888);
// if (!m_started)
// return;
//
// if (m_usesGL)
// QtApplication.setSurface(holder.getSurface());
// else
// {
// QtApplication.lockSurface();
// QtApplication.setSurface(null);
// m_bitmap=Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.RGB_565);
// QtApplication.setSurface(m_bitmap);
// QtApplication.unlockSurface();
// }
}
@Override

View File

@ -85,17 +85,6 @@ set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
if (NOT TARGET Qt5::WinMain)
add_library(Qt5::WinMain STATIC IMPORTED)
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::WinMain PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_DEBUG \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
!!ELSE
IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
!!ENDIF
)
!!ENDIF
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::WinMain PROPERTIES
@ -107,6 +96,17 @@ if (NOT TARGET Qt5::WinMain)
)
!!ENDIF
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::WinMain PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_DEBUG \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
!!ELSE
IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
!!ENDIF
)
!!ENDIF
if (NOT CMAKE_VERSION VERSION_LESS 2.8.11 AND NOT Qt5_NO_LINK_QTMAIN)
set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
set(_isWin32 $<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>)

View File

@ -827,8 +827,8 @@ void QAnimationDriver::start()
{
Q_D(QAnimationDriver);
if (!d->running) {
emit started();
d->running = true;
emit started();
}
}
@ -837,8 +837,8 @@ void QAnimationDriver::stop()
{
Q_D(QAnimationDriver);
if (d->running) {
emit stopped();
d->running = false;
emit stopped();
}
}

View File

@ -658,7 +658,11 @@
# define Q_COMPILER_ALIGNOF
# define Q_COMPILER_INHERITING_CONSTRUCTORS
# define Q_COMPILER_THREAD_LOCAL
# if (__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ > 1
# define Q_COMPILER_REF_QUALIFIERS
# endif
# endif
/* C++11 features are complete as of GCC 4.8.1 */
# endif
#endif

View File

@ -301,6 +301,11 @@
#define QT_NO_IM
#endif
// QImageIOPlugin
#if !defined(QT_NO_IMAGEFORMATPLUGIN) && (defined(QT_NO_LIBRARY))
#define QT_NO_IMAGEFORMATPLUGIN
#endif
// QLocalServer
#if !defined(QT_NO_LOCALSERVER) && (defined(QT_NO_TEMPORARYFILE))
#define QT_NO_LOCALSERVER

View File

@ -101,6 +101,8 @@
|| defined(__ARM_ARCH_7A__) \
|| defined(__ARM_ARCH_7R__) \
|| defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7S__) \
|| defined(_ARM_ARCH_7) \
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) \
|| (defined(_M_ARM) && _M_ARM-0 >= 7)
# define Q_PROCESSOR_ARM_V7

View File

@ -61,7 +61,6 @@ public:
QByteArray *buf;
QByteArray defaultBuf;
int ioIndex;
virtual qint64 peek(char *data, qint64 maxSize);
virtual QByteArray peek(qint64 maxSize);
@ -157,14 +156,12 @@ QBuffer::QBuffer()
{
Q_D(QBuffer);
d->buf = &d->defaultBuf;
d->ioIndex = 0;
}
QBuffer::QBuffer(QByteArray *buf)
: QIODevice(*new QBufferPrivate)
{
Q_D(QBuffer);
d->buf = buf ? buf : &d->defaultBuf;
d->ioIndex = 0;
d->defaultBuf.clear();
}
#else
@ -180,7 +177,6 @@ QBuffer::QBuffer(QObject *parent)
{
Q_D(QBuffer);
d->buf = &d->defaultBuf;
d->ioIndex = 0;
}
/*!
@ -206,7 +202,6 @@ QBuffer::QBuffer(QByteArray *byteArray, QObject *parent)
Q_D(QBuffer);
d->buf = byteArray ? byteArray : &d->defaultBuf;
d->defaultBuf.clear();
d->ioIndex = 0;
}
#endif
@ -253,7 +248,6 @@ void QBuffer::setBuffer(QByteArray *byteArray)
d->buf = &d->defaultBuf;
}
d->defaultBuf.clear();
d->ioIndex = 0;
}
/*!
@ -312,7 +306,6 @@ void QBuffer::setData(const QByteArray &data)
return;
}
*d->buf = data;
d->ioIndex = 0;
}
/*!
@ -340,9 +333,8 @@ bool QBuffer::open(OpenMode flags)
if ((flags & Truncate) == Truncate)
d->buf->resize(0);
d->ioIndex = (flags & Append) == Append ? d->buf->size() : 0;
return QIODevice::open(flags);
return QIODevice::open(flags | QIODevice::Unbuffered);
}
/*!
@ -390,7 +382,6 @@ bool QBuffer::seek(qint64 pos)
qWarning("QBuffer::seek: Invalid pos: %d", int(pos));
return false;
}
d->ioIndex = int(pos);
return QIODevice::seek(pos);
}
@ -420,10 +411,9 @@ bool QBuffer::canReadLine() const
qint64 QBuffer::readData(char *data, qint64 len)
{
Q_D(QBuffer);
if ((len = qMin(len, qint64(d->buf->size()) - d->ioIndex)) <= 0)
if ((len = qMin(len, qint64(d->buf->size()) - pos())) <= 0)
return qint64(0);
memcpy(data, d->buf->constData() + d->ioIndex, len);
d->ioIndex += int(len);
memcpy(data, d->buf->constData() + pos(), len);
return len;
}
@ -433,7 +423,7 @@ qint64 QBuffer::readData(char *data, qint64 len)
qint64 QBuffer::writeData(const char *data, qint64 len)
{
Q_D(QBuffer);
int extraBytes = d->ioIndex + len - d->buf->size();
int extraBytes = pos() + len - d->buf->size();
if (extraBytes > 0) { // overflow
int newSize = d->buf->size() + extraBytes;
d->buf->resize(newSize);
@ -443,8 +433,7 @@ qint64 QBuffer::writeData(const char *data, qint64 len)
}
}
memcpy(d->buf->data() + d->ioIndex, (uchar *)data, int(len));
d->ioIndex += int(len);
memcpy(d->buf->data() + pos(), (uchar *)data, int(len));
#ifndef QT_NO_QOBJECT
d->writtenSinceLastEmit += len;

View File

@ -520,9 +520,35 @@ bool QFSFileEngine::rename(const QString &newName)
bool QFSFileEngine::renameOverwrite(const QString &newName)
{
Q_D(QFSFileEngine);
#if defined(Q_OS_WINCE)
// Windows Embedded Compact 7 does not have MoveFileEx, simulate it with the following sequence:
// 1. DeleteAndRenameFile (Should work on RAM FS when both files exist)
// 2. DeleteFile/MoveFile (Should work on all file systems)
//
// DeleteFile/MoveFile fallback implementation violates atomicity, but it is more acceptable than
// alternative CopyFile/DeleteFile sequence for the following reasons:
//
// 1. DeleteFile/MoveFile is way faster than CopyFile/DeleteFile and thus more atomic.
// 2. Given the intended use case of this function in QSaveFile, DeleteFile/MoveFile sequence will
// delete the old content, but leave a file "filename.ext.XXXXXX" in the same directory if MoveFile fails.
// With CopyFile/DeleteFile sequence, it can happen that new data is partially copied to target file
// (because CopyFile is not atomic either), thus leaving *some* content to target file.
// This makes the need for application level recovery harder to detect than in DeleteFile/MoveFile
// sequence where target file simply does not exist.
//
bool ret = ::DeleteAndRenameFile((wchar_t*)QFileSystemEntry(newName).nativeFilePath().utf16(),
(wchar_t*)d->fileEntry.nativeFilePath().utf16()) != 0;
if (!ret) {
ret = ::DeleteFile((wchar_t*)d->fileEntry.nativeFilePath().utf16()) != 0;
if (ret)
ret = ::MoveFile((wchar_t*)d->fileEntry.nativeFilePath().utf16(),
(wchar_t*)QFileSystemEntry(newName).nativeFilePath().utf16()) != 0;
}
#else
bool ret = ::MoveFileEx((wchar_t*)d->fileEntry.nativeFilePath().utf16(),
(wchar_t*)QFileSystemEntry(newName).nativeFilePath().utf16(),
MOVEFILE_REPLACE_EXISTING) != 0;
#endif
if (!ret)
setError(QFile::RenameError, QSystemError(::GetLastError(), QSystemError::NativeError).toString());
return ret;

View File

@ -1671,8 +1671,9 @@ void QMetaMethodPrivate::getParameterTypes(int *types) const
QList<QByteArray> QMetaMethodPrivate::parameterTypes() const
{
Q_ASSERT(priv(mobj->d.data)->revision >= 7);
QList<QByteArray> list;
int argc = parameterCount();
QList<QByteArray> list;
list.reserve(argc);
int paramsIndex = parametersDataIndex();
for (int i = 0; i < argc; ++i)
list += typeNameFromTypeInfo(mobj, mobj->d.data[paramsIndex + i]);
@ -1682,8 +1683,9 @@ QList<QByteArray> QMetaMethodPrivate::parameterTypes() const
QList<QByteArray> QMetaMethodPrivate::parameterNames() const
{
Q_ASSERT(priv(mobj->d.data)->revision >= 7);
QList<QByteArray> list;
int argc = parameterCount();
QList<QByteArray> list;
list.reserve(argc);
int namesIndex = parametersDataIndex() + argc;
for (int i = 0; i < argc; ++i)
list += stringData(mobj, mobj->d.data[namesIndex + i]);

View File

@ -396,7 +396,8 @@ QLibrary::LoadHints QPluginLoader::loadHints() const
\relates QPluginLoader
\since 5.0
Registers the given \a plugin with the plugin loader.
Registers the \a plugin specified with the plugin loader, and is used
by Q_IMPORT_PLUGIN().
*/
void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin plugin)
{

View File

@ -113,10 +113,10 @@ QT_END_NAMESPACE
// New atomics
#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
# if defined(Q_CC_CLANG) && ((((__clang_major__ * 100) + __clang_minor__) < 302) \
# if defined(Q_CC_CLANG) && ((((__clang_major__ * 100) + __clang_minor__) < 303) \
|| defined(__apple_build_version__) \
)
/* Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for "stock" clang before version 3.2.
/* Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for "stock" clang before version 3.3.
Apple's version has different (higher!) version numbers, so disable it for all of them for now.
(The only way to distinguish between them seems to be a check for __apple_build_version__ .)

View File

@ -438,6 +438,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
kCFPreferencesCurrentUser,
kCFPreferencesAnyHost);
QStringList result;
if (!languages)
return QVariant(result);
CFTypeID typeId = CFGetTypeID(languages);
if (typeId == CFArrayGetTypeID()) {
const int cnt = CFArrayGetCount(languages.as<CFArrayRef>());

View File

@ -257,7 +257,9 @@ static inline QDBusError::ErrorType get(const char *name)
QDBusError::QDBusError()
: code(NoError)
{
// ### This class has an implicit (therefore inline) destructor
// so the following field cannot be used.
Q_UNUSED(unused);
}
#ifndef QT_BOOTSTRAPPED

View File

@ -0,0 +1,20 @@
!!IF !contains(QT_CONFIG, angle)
!!IF !isEmpty(CMAKE_GL_INCDIRS)
find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME
PATHS $$CMAKE_GL_INCDIRS
NO_DEFAULT_PATH)
if (NOT _qt5gui_OPENGL_INCLUDE_DIR)
message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\")
endif()
list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR})
set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR})
unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE)
!!ENDIF
!!ENDIF

View File

@ -441,7 +441,6 @@ Q_GLOBAL_STATIC(QAccessiblePluginsHash, qAccessiblePlugins);
QAccessible::UpdateHandler QAccessible::updateHandler = 0;
QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0;
static bool accessibility_active = false;
static bool cleanupAdded = false;
#ifndef QT_NO_ACCESSIBILITY
@ -584,7 +583,6 @@ Q_GLOBAL_STATIC(QAccessibleCache, qAccessibleCache)
*/
QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object)
{
accessibility_active = true;
if (!object)
return 0;
@ -699,19 +697,26 @@ QAccessibleInterface *QAccessible::accessibleInterface(Id id)
/*!
Returns true if an accessibility implementation has been requested
during the runtime of the application; otherwise returns false.
Returns true if the platform requested accessibility information.
Use this function to prevent potentially expensive notifications via
updateAccessibility().
This function will return false until a tool such as a screen reader
accessed the accessibility framework. It is still possible to use
\l QAccessible::queryAccessibleInterface even if accessibility is not
active. But there will be no notifications sent to the platform.
It is recommended to use this function to prevent expensive notifications
via updateAccessibility() when they are not needed.
*/
bool QAccessible::isActive()
{
return accessibility_active;
#ifndef QT_NO_ACCESSIBILITY
if (QPlatformAccessibility *pfAccessibility = platformAccessibility())
return pfAccessibility->isActive();
#endif
return false;
}
/*!
Sets the root object of the accessible objects of this application
to \a object. All other accessible objects are reachable using object

View File

@ -73,6 +73,7 @@ Q_GLOBAL_STATIC(QVector<QAccessibleBridge *>, bridges)
\sa QAccessible
*/
QPlatformAccessibility::QPlatformAccessibility()
: m_active(false)
{
}

View File

@ -69,6 +69,11 @@ public:
virtual void initialize();
virtual void cleanup();
inline bool isActive() const { return m_active; }
inline void setActive(bool active) { m_active = active; }
private:
bool m_active;
};
QT_END_NAMESPACE

View File

@ -35,4 +35,20 @@ include(itemmodels/itemmodels.pri)
QMAKE_LIBS += $$QMAKE_LIBS_GUI
load(cmake_functions)
!contains(QT_CONFIG, angle) {
contains(QT_CONFIG, opengles1) {
CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES1)
CMAKE_GL_HEADER_NAME = GLES/gl.h
} else:contains(QT_CONFIG, opengles2) {
CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES2)
CMAKE_GL_HEADER_NAME = GLES2/gl2.h
} else {
CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL)
CMAKE_GL_HEADER_NAME = GL/gl.h
mac: CMAKE_GL_HEADER_NAME = gl.h
}
}
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist

View File

@ -4994,12 +4994,17 @@ int QImage::metric(PaintDeviceMetric metric) const
break;
case PdmPhysicalDpiX:
return qRound(d->dpmx * 0.0254 * d->devicePixelRatio);
return qRound(d->dpmx * 0.0254);
break;
case PdmPhysicalDpiY:
return qRound(d->dpmy * 0.0254 * d->devicePixelRatio);
return qRound(d->dpmy * 0.0254);
break;
case PdmDevicePixelRatio:
return d->devicePixelRatio;
break;
default:
qWarning("QImage::metric(): Unhandled metric type %d", metric);
break;

View File

@ -1513,9 +1513,9 @@ QList<QByteArray> QImageReader::supportedMimeTypes()
for (int i = 0; i < _qt_NumFormats; ++i)
mimeTypes << _qt_BuiltInFormats[i].mimeType;
#ifndef QT_NO_LIBRARY
#ifndef QT_NO_IMAGEFORMATPLUGIN
supportedImageHandlerMimeTypes(loader(), QImageIOPlugin::CanRead, &mimeTypes);
#endif // QT_NO_LIBRARY
#endif // QT_NO_IMAGEFORMATPLUGIN
QList<QByteArray> sortedMimeTypes;
for (QSet<QByteArray>::ConstIterator it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it)

View File

@ -789,9 +789,9 @@ QList<QByteArray> QImageWriter::supportedMimeTypes()
mimeTypes << "image/jpeg";
#endif
#ifndef QT_NO_LIBRARY
#ifndef QT_NO_IMAGEFORMATPLUGIN
supportedImageHandlerMimeTypes(loader(), QImageIOPlugin::CanWrite, &mimeTypes);
#endif // QT_NO_LIBRARY
#endif // QT_NO_IMAGEFORMATPLUGIN
QList<QByteArray> sortedMimeTypes;
for (QSet<QByteArray>::ConstIterator it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it)

View File

@ -956,6 +956,9 @@ int QPicture::metric(PaintDeviceMetric m) const
case PdmDepth:
val = 24;
break;
case PdmDevicePixelRatio:
val = 1;
break;
default:
val = 0;
qWarning("QPicture::metric: Invalid metric command");

View File

@ -120,6 +120,8 @@ int QBlittablePlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) con
case QPaintDevice::PdmDpiY: // fall-through
case QPaintDevice::PdmPhysicalDpiY:
return qt_defaultDpiY();
case QPaintDevice::PdmDevicePixelRatio:
return 1;
default:
qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
break;

View File

@ -244,6 +244,7 @@ QImage QRasterPlatformPixmap::toImage(const QRect &rect) const
QImage newImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8),
clipped.width(), clipped.height(),
image.bytesPerLine(), image.format());
newImage.setDevicePixelRatio(image.devicePixelRatio());
return newImage;
} else {
return image.copy(clipped);
@ -278,11 +279,13 @@ int QRasterPlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) const
case QPaintDevice::PdmDpiX:
return qt_defaultDpiX();
case QPaintDevice::PdmPhysicalDpiX:
return qt_defaultDpiX() * image.devicePixelRatio();
return qt_defaultDpiX();
case QPaintDevice::PdmDpiY:
return qt_defaultDpiX();
case QPaintDevice::PdmPhysicalDpiY:
return qt_defaultDpiY() * image.devicePixelRatio();
return qt_defaultDpiY();
case QPaintDevice::PdmDevicePixelRatio:
return image.devicePixelRatio();
default:
qWarning("QRasterPlatformPixmap::metric(): Unhandled metric type %d", metric);
break;

View File

@ -21,6 +21,7 @@ HEADERS += \
kernel/qplatformintegrationfactory_p.h \
kernel/qplatformintegrationplugin.h \
kernel/qplatformtheme.h\
kernel/qplatformtheme_p.h \
kernel/qplatformthemefactory_p.h \
kernel/qplatformthemeplugin.h \
kernel/qplatformwindow.h \

View File

@ -180,7 +180,7 @@ static void initPalette()
if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette())
QGuiApplicationPrivate::app_pal = new QPalette(*themePalette);
if (!QGuiApplicationPrivate::app_pal)
QGuiApplicationPrivate::app_pal = new QPalette(Qt::black);
QGuiApplicationPrivate::app_pal = new QPalette(Qt::gray);
}
static inline void clearPalette()
@ -1014,6 +1014,7 @@ void QGuiApplicationPrivate::init()
// and QImage conversion functions
qInitImageConversions();
initPalette();
QFont::initialize();
#ifndef QT_NO_CURSOR
@ -1591,6 +1592,11 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
if (previous == newFocus)
return;
if (newFocus)
if (QPlatformWindow *platformWindow = newFocus->handle())
if (platformWindow->isAlertState())
platformWindow->setAlertState(false);
QObject *previousFocusObject = previous ? previous->focusObject() : 0;
if (previous) {

View File

@ -101,7 +101,7 @@ private:
QOpenGLVersionProfilePrivate* d;
};
inline uint qHash(const QOpenGLVersionProfile &v, uint seed)
inline uint qHash(const QOpenGLVersionProfile &v, uint seed = 0)
{
return qHash(static_cast<int>(v.profile() * 1000)
+ v.version().first * 100 + v.version().second * 10, seed);

View File

@ -1096,6 +1096,40 @@ void QPalette::setColorGroup(ColorGroup cg, const QBrush &foreground, const QBru
setBrush(cg, ToolTipText, toolTipText);
}
Q_GUI_EXPORT QPalette qt_fusionPalette()
{
QColor backGround(239, 235, 231);
QColor light = backGround.lighter(150);
QColor mid(backGround.darker(130));
QColor midLight = mid.lighter(110);
QColor base = Qt::white;
QColor disabledBase(backGround);
QColor dark = backGround.darker(150);
QColor darkDisabled = QColor(209, 200, 191).darker(110);
QColor text = Qt::black;
QColor hightlightedText = Qt::white;
QColor disabledText = QColor(190, 190, 190);
QColor button = backGround;
QColor shadow = dark.darker(135);
QColor disabledShadow = shadow.lighter(150);
QPalette fusionPalette(Qt::black,backGround,light,dark,mid,text,base);
fusionPalette.setBrush(QPalette::Midlight, midLight);
fusionPalette.setBrush(QPalette::Button, button);
fusionPalette.setBrush(QPalette::Shadow, shadow);
fusionPalette.setBrush(QPalette::HighlightedText, hightlightedText);
fusionPalette.setBrush(QPalette::Disabled, QPalette::Text, disabledText);
fusionPalette.setBrush(QPalette::Disabled, QPalette::Base, disabledBase);
fusionPalette.setBrush(QPalette::Disabled, QPalette::Dark, darkDisabled);
fusionPalette.setBrush(QPalette::Disabled, QPalette::Shadow, disabledShadow);
fusionPalette.setBrush(QPalette::Active, QPalette::Highlight, QColor(48, 140, 198));
fusionPalette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(145, 141, 126));
fusionPalette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 141, 126));
return fusionPalette;
}
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QPalette &)
{

View File

@ -210,6 +210,11 @@ QPlatformServices *QPlatformIntegration::services() const
\value ForeignWindows The platform allows creating QWindows which represent
native windows created by other processes or anyway created by using native
libraries.
\value NonFullScreenWindows The platform supports top-level windows which do not
fill the screen. The default implementation returns true. Returning false for
this will cause all windows, including dialogs and popups, to be resized to fill the
screen.
*/
@ -227,8 +232,7 @@ QPlatformServices *QPlatformIntegration::services() const
bool QPlatformIntegration::hasCapability(Capability cap) const
{
Q_UNUSED(cap);
return false;
return cap == NonFullScreenWindows;
}
QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const
@ -309,6 +313,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return false;
case PasswordMaskDelay:
return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay);
case PasswordMaskCharacter:
return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskCharacter);
case FontSmoothingGamma:
return qreal(1.7);
case StartDragVelocity:

View File

@ -90,7 +90,8 @@ public:
WindowMasks,
MultipleWindows,
ApplicationState,
ForeignWindows
ForeignWindows,
NonFullScreenWindows
};
virtual ~QPlatformIntegration() { }
@ -139,7 +140,8 @@ public:
FontSmoothingGamma,
StartDragVelocity,
UseRtlExtensions,
SynthesizeMouseFromTouchEvents
SynthesizeMouseFromTouchEvents,
PasswordMaskCharacter
};
virtual QVariant styleHint(StyleHint hint) const;

View File

@ -41,6 +41,8 @@
#include "qplatformtheme.h"
#include "qplatformtheme_p.h"
#include <QtCore/QVariant>
#include <QtCore/QStringList>
#include <QtCore/qfileinfo.h>
@ -137,6 +139,33 @@ QT_BEGIN_NAMESPACE
\sa themeHint(), QStyle::pixelMetric()
*/
QPlatformThemePrivate::QPlatformThemePrivate()
: systemPalette(0)
{ }
QPlatformThemePrivate::~QPlatformThemePrivate()
{
delete systemPalette;
}
Q_GUI_EXPORT QPalette qt_fusionPalette();
void QPlatformThemePrivate::initializeSystemPalette()
{
Q_ASSERT(!systemPalette);
systemPalette = new QPalette(qt_fusionPalette());
}
QPlatformTheme::QPlatformTheme()
: d_ptr(new QPlatformThemePrivate)
{
}
QPlatformTheme::QPlatformTheme(QPlatformThemePrivate *priv)
: d_ptr(priv)
{ }
QPlatformTheme::~QPlatformTheme()
{
@ -156,7 +185,12 @@ QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(DialogType typ
const QPalette *QPlatformTheme::palette(Palette type) const
{
Q_UNUSED(type)
Q_D(const QPlatformTheme);
if (type == QPlatformTheme::SystemPalette) {
if (!d->systemPalette)
const_cast<QPlatformTheme *>(this)->d_ptr->initializeSystemPalette();
return d->systemPalette;
}
return 0;
}
@ -204,6 +238,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint)
return QVariant(500);
case QPlatformTheme::PasswordMaskDelay:
return QVariant(int(0));
case QPlatformTheme::PasswordMaskCharacter:
return QVariant(QChar(0x25CF));
case QPlatformTheme::StartDragVelocity:
return QVariant(int(0)); // no limit
case QPlatformTheme::UseFullScreenForPopupMenu:

View File

@ -52,6 +52,7 @@
//
#include <QtCore/QtGlobal>
#include <QtCore/QScopedPointer>
QT_BEGIN_NAMESPACE
@ -63,6 +64,7 @@ class QPlatformMenu;
class QPlatformMenuBar;
class QPlatformDialogHelper;
class QPlatformSystemTrayIcon;
class QPlatformThemePrivate;
class QVariant;
class QPalette;
class QFont;
@ -72,6 +74,7 @@ class QFileInfo;
class Q_GUI_EXPORT QPlatformTheme
{
Q_DECLARE_PRIVATE(QPlatformTheme)
public:
enum ThemeHint {
CursorFlashTime,
@ -100,7 +103,8 @@ public:
UiEffects,
SpellCheckUnderlineStyle,
TabAllWidgets,
IconPixmapSizes
IconPixmapSizes,
PasswordMaskCharacter
};
enum DialogType {
@ -249,6 +253,7 @@ public:
AnimateToolBoxUiEffect = 0x40
};
explicit QPlatformTheme();
virtual ~QPlatformTheme();
virtual QPlatformMenuItem* createPlatformMenuItem() const;
@ -274,6 +279,12 @@ public:
virtual QIconEngine *createIconEngine(const QString &iconName) const;
static QVariant defaultThemeHint(ThemeHint hint);
protected:
explicit QPlatformTheme(QPlatformThemePrivate *priv);
QScopedPointer<QPlatformThemePrivate> d_ptr;
private:
Q_DISABLE_COPY(QPlatformTheme)
};
QT_END_NAMESPACE

View File

@ -0,0 +1,74 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QPLATFORMTHEME_P_H
#define QPLATFORMTHEME_P_H
//
// W A R N I N G
// -------------
//
// This file is part of the QPA API and is not meant to be used
// in applications. Usage of this API may make your code
// source and binary incompatible with future versions of Qt.
//
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
class QPalette;
class Q_GUI_EXPORT QPlatformThemePrivate
{
public:
QPlatformThemePrivate();
virtual ~QPlatformThemePrivate();
void initializeSystemPalette();
QPalette *systemPalette;
};
QT_END_NAMESPACE
#endif // QPLATFORMTHEME_P_H

View File

@ -462,6 +462,32 @@ QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &
return fullTitle;
}
/*!
Reimplement this method to set whether the window demands attention
(for example, by flashing the taskbar icon) depending on \a enabled.
\sa isAlertState()
\since 5.1
*/
void QPlatformWindow::setAlertState(bool enable)
{
Q_UNUSED(enable)
}
/*!
Reimplement this method return whether the window is in
an alert state.
\sa setAlertState()
\since 5.1
*/
bool QPlatformWindow::isAlertState() const
{
return false;
}
/*!
Helper function to get initial geometry on windowing systems which do not
do smart positioning and also do not provide a means of centering a

View File

@ -128,6 +128,9 @@ public:
virtual void setFrameStrutEventsEnabled(bool enabled);
virtual bool frameStrutEventsEnabled() const;
virtual void setAlertState(bool enabled);
virtual bool isAlertState() const;
static QRect initialGeometry(const QWindow *w,
const QRect &initialGeometry, int defaultWidth, int defaultHeight);

View File

@ -192,6 +192,15 @@ int QStyleHints::passwordMaskDelay() const
return themeableHint(QPlatformTheme::PasswordMaskDelay, QPlatformIntegration::PasswordMaskDelay).toInt();
}
/*!
Returns the character used to mask the characters typed into text input
fields in password mode.
*/
QChar QStyleHints::passwordMaskCharacter() const
{
return themeableHint(QPlatformTheme::PasswordMaskCharacter, QPlatformIntegration::PasswordMaskCharacter).toChar();
}
/*!
Returns the gamma value used in font smoothing.
*/

View File

@ -62,6 +62,7 @@ public:
int cursorFlashTime() const;
bool showIsFullScreen() const;
int passwordMaskDelay() const;
QChar passwordMaskCharacter() const;
qreal fontSmoothingGamma() const;
bool useRtlExtensions() const;

View File

@ -58,6 +58,7 @@
#include <private/qevent_p.h>
#include <QtCore/QTimer>
#include <QtCore/QDebug>
#include <QStyleHints>
@ -2150,6 +2151,33 @@ QWindow *QWindow::fromWinId(WId id)
return window;
}
/*!
Causes an alert to be shown for \a msec miliseconds. If \a msec is \c 0 (the
default), then the alert is shown indefinitely until the window becomes
active again.
In alert state, the window indicates that it demands attention, for example by
flashing or bouncing the taskbar entry.
\since 5.1
*/
void QWindow::alert(int msec)
{
Q_D(QWindow);
if (!d->platformWindow || d->platformWindow->isAlertState())
return;
d->platformWindow->setAlertState(true);
if (d->platformWindow->isAlertState() && msec)
QTimer::singleShot(msec, this, SLOT(_q_clearAlert()));
}
void QWindowPrivate::_q_clearAlert()
{
if (platformWindow && platformWindow->isAlertState())
platformWindow->setAlertState(false);
}
#ifndef QT_NO_CURSOR
/*!
\brief set the cursor shape for this window
@ -2233,3 +2261,5 @@ void QWindowPrivate::applyCursor()
#endif // QT_NO_CURSOR
QT_END_NAMESPACE
#include "moc_qwindow.cpp"

View File

@ -290,6 +290,8 @@ public Q_SLOTS:
Q_REVISION(1) void setMaximumWidth(int w);
Q_REVISION(1) void setMaximumHeight(int h);
void alert(int msec);
Q_SIGNALS:
void screenChanged(QScreen *screen);
void modalityChanged(Qt::WindowModality modality);
@ -346,6 +348,7 @@ protected:
QWindow(QWindowPrivate &dd, QWindow *parent);
private:
Q_PRIVATE_SLOT(d_func(), void _q_clearAlert())
QPlatformSurface *surfaceHandle() const;
Q_DISABLE_COPY(QWindow)

View File

@ -125,6 +125,7 @@ public:
virtual QWindow *eventReceiver() { Q_Q(QWindow); return q; }
void updateVisibility();
void _q_clearAlert();
QWindow::SurfaceType surfaceType;
Qt::WindowFlags windowFlags;

View File

@ -316,6 +316,8 @@ void QOpenGLBuffer::destroy()
d->guard->free();
d->guard = 0;
}
delete d->funcs;
d->funcs = 0;
}
/*!

View File

@ -282,9 +282,11 @@ int QOpenGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
case PdmDpiY:
return qRound(d_ptr->dpmy * 0.0254);
case PdmPhysicalDpiX:
return qRound(d_ptr->dpmx * 0.0254 * d_ptr->devicePixelRatio);
return qRound(d_ptr->dpmx * 0.0254);
case PdmPhysicalDpiY:
return qRound(d_ptr->dpmy * 0.0254 * d_ptr->devicePixelRatio);
return qRound(d_ptr->dpmy * 0.0254);
case PdmDevicePixelRatio:
return d_ptr->devicePixelRatio;
default:
qWarning("QOpenGLPaintDevice::metric() - metric %d not known", metric);
return 0;

View File

@ -91,7 +91,7 @@ struct QOpenGLVersionStatus
OpenGLStatus status;
};
inline uint qHash(const QOpenGLVersionStatus &v, uint seed)
inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0)
{
return qHash(static_cast<int>(v.status * 1000)
+ v.version.first * 100 + v.version.second * 10, seed);

View File

@ -169,7 +169,7 @@ void QPagedPaintDevice::setPageSize(PageSize size)
if (size >= Custom)
return;
d->pageSize = size;
d->pageSizeMM = QSizeF(pageSizes[A4].width, pageSizes[A4].height);
d->pageSizeMM = QSizeF(pageSizes[size].width, pageSizes[size].height);
}
/*!

View File

@ -95,6 +95,8 @@ int QPaintDevice::metric(PaintDeviceMetric m) const
} else if (m == PdmNumColors) {
// FIXME: does this need to be a real value?
return 256;
} else if (m == PdmDevicePixelRatio) {
return 1;
} else {
qDebug("Unrecognised metric %d!",m);
return 0;

View File

@ -65,7 +65,8 @@ public:
PdmDpiX,
PdmDpiY,
PdmPhysicalDpiX,
PdmPhysicalDpiY
PdmPhysicalDpiY,
PdmDevicePixelRatio
};
virtual ~QPaintDevice();
@ -82,6 +83,7 @@ public:
int logicalDpiY() const { return metric(PdmDpiY); }
int physicalDpiX() const { return metric(PdmPhysicalDpiX); }
int physicalDpiY() const { return metric(PdmPhysicalDpiY); }
int devicePixelRatio() const { return metric(PdmDevicePixelRatio); }
int colorCount() const { return metric(PdmNumColors); }
int depth() const { return metric(PdmDepth); }

View File

@ -114,6 +114,10 @@
\value PdmPhysicalDpiY The vertical resolution of the device in
dots per inch. See also physicalDpiY().
\value PdmDevicePixelRatio The device pixel ratio for device. Common
values are 1 for normal-dpi displays and 2 for high-dpi "retina"
displays.
\sa metric()
*/
@ -273,3 +277,12 @@
\sa physicalDpiX(), logicalDpiY()
*/
/*!
\fn int QPaintDevice::devicePixelRatio() const
Returns the device pixel ratio for device.
Common values are 1 for normal-dpi displays and 2 for high-dpi
"retina" displays.
*/

View File

@ -225,17 +225,24 @@ QTransform QPainterPrivate::viewTransform() const
return QTransform();
}
int QPainterPrivate::effectiveDevicePixelRatio() const
{
// Limited feature introduction for Qt 5.0.0, remove ifdef in a later release.
#ifdef Q_OS_MAC
// Special cases for devices that does not support PdmDevicePixelRatio go here:
if (device->devType() == QInternal::Printer)
return 1;
return qMax(1, device->metric(QPaintDevice::PdmDevicePixelRatio));
#else
return 1;
#endif
}
QTransform QPainterPrivate::hidpiScaleTransform() const
{
#ifdef Q_OS_MAC
// Limited feature introduction for Qt 5.0.0, remove ifdef in a later release.
if (device->devType() == QInternal::Printer || device->physicalDpiX() == 0 || device->logicalDpiX() == 0)
return QTransform();
const qreal deviceScale = (device->physicalDpiX() / device->logicalDpiX());
if (deviceScale > 1.0)
return QTransform::fromScale(deviceScale, deviceScale);
#endif
return QTransform();
int devicePixelRatio = effectiveDevicePixelRatio();
return QTransform::fromScale(devicePixelRatio, devicePixelRatio);
}
/*
@ -1837,14 +1844,7 @@ bool QPainter::begin(QPaintDevice *pd)
Q_ASSERT(d->engine->isActive());
#ifdef Q_OS_MAC
// Limited feature introduction for Qt 5.0.0, remove ifdef in a later release.
const bool isHighDpi = (pd->devType() == QInternal::Printer || d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ?
false : (d->device->physicalDpiX() / d->device->logicalDpiX() > 1);
#else
const bool isHighDpi = false;
#endif
if (!d->state->redirectionMatrix.isIdentity() || isHighDpi)
if (!d->state->redirectionMatrix.isIdentity() || d->effectiveDevicePixelRatio() > 1)
d->updateMatrix();
Q_ASSERT(d->engine->isActive());

View File

@ -249,6 +249,7 @@ public:
}
QTransform viewTransform() const;
int effectiveDevicePixelRatio() const;
QTransform hidpiScaleTransform() const;
static bool attachPainterPrivate(QPainter *q, QPaintDevice *pdev);
void detachPainterPrivate(QPainter *q);

View File

@ -1455,6 +1455,9 @@ int QPdfEngine::metric(QPaintDevice::PaintDeviceMetric metricType) const
case QPaintDevice::PdmDepth:
val = 32;
break;
case QPaintDevice::PdmDevicePixelRatio:
val = 1;
break;
default:
qWarning("QPdfWriter::metric: Invalid metric command");
return 0;

View File

@ -2639,18 +2639,6 @@ QFontCache::QFontCache()
QFontCache::~QFontCache()
{
clear();
{
EngineDataCache::ConstIterator it = engineDataCache.constBegin(),
end = engineDataCache.constEnd();
while (it != end) {
if (!it.value()->ref.deref())
delete it.value();
else
FC_DEBUG("QFontCache::~QFontCache: engineData %p still has refcount %d",
it.value(), it.value()->ref.load());
++it;
}
}
}
void QFontCache::clear()
@ -2669,29 +2657,47 @@ void QFontCache::clear()
data->engines[i] = 0;
}
}
if (!data->ref.deref()) {
delete data;
} else {
FC_DEBUG("QFontCache::clear: engineData %p still has refcount %d",
data, data->ref.load());
}
++it;
}
}
bool mightHaveEnginesLeftForCleanup = true;
while (mightHaveEnginesLeftForCleanup) {
engineDataCache.clear();
bool mightHaveEnginesLeftForCleanup;
do {
mightHaveEnginesLeftForCleanup = false;
for (EngineCache::Iterator it = engineCache.begin(), end = engineCache.end();
it != end; ++it) {
if (it.value().data && engineCacheCount.value(it.value().data) > 0) {
--engineCacheCount[it.value().data];
if (!it.value().data->ref.deref()) {
Q_ASSERT(engineCacheCount.value(it.value().data) == 0);
delete it.value().data;
mightHaveEnginesLeftForCleanup = true;
QFontEngine *engine = it.value().data;
if (engine) {
const int cacheCount = --engineCacheCount[engine];
Q_ASSERT(cacheCount >= 0);
if (!engine->ref.deref()) {
Q_ASSERT(cacheCount == 0);
mightHaveEnginesLeftForCleanup = engine->type() == QFontEngine::Multi;
delete engine;
} else if (cacheCount == 0) {
FC_DEBUG("QFontCache::clear: engine %p still has refcount %d",
engine, engine->ref.load());
}
it.value().data = 0;
}
}
}
} while (mightHaveEnginesLeftForCleanup);
engineCache.clear();
engineCacheCount.clear();
total_cost = 0;
max_cost = min_cost;
}

View File

@ -199,6 +199,7 @@ QFontEngine::QFontEngine()
font_(0), font_destroy_func(0),
face_(0), face_destroy_func(0)
{
cache_cost = 0;
fsType = 0;
symbol = false;
@ -263,11 +264,15 @@ void *QFontEngine::harfbuzzFont() const
{
HB_FontRec *hbFont = (HB_FontRec *)font_;
if (!hbFont->x_ppem) {
QFixed emSquare = emSquareSize();
qint64 emSquare = emSquareSize().truncate();
Q_ASSERT(emSquare == emSquareSize().toInt()); // ensure no truncation
if (emSquare == 0)
emSquare = 1000; // a fallback value suitable for Type1 fonts
hbFont->y_ppem = fontDef.pixelSize;
hbFont->x_ppem = fontDef.pixelSize * fontDef.stretch / 100;
hbFont->x_scale = (QFixed(hbFont->x_ppem * (1 << 16)) / emSquare).value();
hbFont->y_scale = (QFixed(hbFont->y_ppem * (1 << 16)) / emSquare).value();
// same as QFixed(x)/QFixed(emSquare) but without int32 overflow for x
hbFont->x_scale = (((qint64)hbFont->x_ppem << 6) * 0x10000L + (emSquare >> 1)) / emSquare;
hbFont->y_scale = (((qint64)hbFont->y_ppem << 6) * 0x10000L + (emSquare >> 1)) / emSquare;
}
return font_;
}

View File

@ -688,6 +688,7 @@ void QFontEngineMultiQPA::init(QFontEngine *fe)
fe->ref.ref();
fontDef = engines[0]->fontDef;
setObjectName(QStringLiteral("QFontEngineMultiQPA"));
cache_cost = fe->cache_cost;
}
void QFontEngineMultiQPA::loadEngine(int at)

View File

@ -325,9 +325,13 @@ bool QSslSocketBackendPrivate::initSslContext()
Q_Q(QSslSocket);
// If no external context was set (e.g. bei QHttpNetworkConnection) we will create a default context
if (!sslContextPointer)
if (!sslContextPointer) {
// create a deep copy of our configuration
QSslConfigurationPrivate *configurationCopy = new QSslConfigurationPrivate(configuration);
configurationCopy->ref.store(0); // the QSslConfiguration constructor refs up
sslContextPointer = QSharedPointer<QSslContext>(
QSslContext::fromConfiguration(mode, QSslConfiguration(&configuration), allowRootCertOnDemandLoading));
QSslContext::fromConfiguration(mode, configurationCopy, allowRootCertOnDemandLoading));
}
if (sslContextPointer->error() != QSslError::NoError) {
q->setErrorString(sslContextPointer->errorString());

View File

@ -1232,6 +1232,9 @@ int QGLFramebufferObject::metric(PaintDeviceMetric metric) const
case PdmPhysicalDpiY:
return qRound(dpmy * 0.0254);
case QPaintDevice::PdmDevicePixelRatio:
return 1;
default:
qWarning("QGLFramebufferObject::metric(), Unhandled metric type: %d.\n", metric);
break;

View File

@ -44,6 +44,7 @@
#include <private/qglpixelbuffer_p.h>
#include <private/qglframebufferobject_p.h>
#include <qopenglfunctions.h>
#include <qwindow.h>
QT_BEGIN_NAMESPACE
@ -67,6 +68,8 @@ int QGLPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const
const QGLFormat f = format();
return f.redBufferSize() + f.greenBufferSize() + f.blueBufferSize() + f.alphaBufferSize();
}
case PdmDevicePixelRatio:
return 1;
default:
qWarning("QGLPaintDevice::metric() - metric %d not known", metric);
return 0;
@ -186,7 +189,12 @@ void QGLWidgetGLPaintDevice::endPaint()
QSize QGLWidgetGLPaintDevice::size() const
{
#ifdef Q_OS_MAC
return glWidget->size() * (glWidget->windowHandle() ?
glWidget->windowHandle()->devicePixelRatio() : qApp->devicePixelRatio());
#else
return glWidget->size();
#endif
}
QGLContext* QGLWidgetGLPaintDevice::context() const

View File

@ -462,6 +462,9 @@ int QGLPixelBuffer::metric(PaintDeviceMetric metric) const
case PdmPhysicalDpiY:
return qRound(dpmy * 0.0254);
case QPaintDevice::PdmDevicePixelRatio:
return 1;
default:
qWarning("QGLPixelBuffer::metric(), Unhandled metric type: %d\n", metric);
break;

View File

@ -491,8 +491,22 @@ void QFontconfigDatabase::populateFontDatabase()
fontFile->fileName = QLatin1String((const char *)file_value);
fontFile->indexValue = indexValue;
if (isSymbolFont(fontFile))
writingSystems.setSupported(QFontDatabase::Other);
if (!writingSystems.supported(QFontDatabase::Symbol)) {
// Symbol encoding used to encode various crap in the 32..255 character
// code range, which belongs to Latin character code range.
// Symbol fonts usually don't have any other code ranges support.
bool mightBeSymbolFont = true;
for (int j = 2; j < QFontDatabase::WritingSystemsCount; ++j) {
if (writingSystems.supported(QFontDatabase::WritingSystem(j))) {
mightBeSymbolFont = false;
break;
}
}
if (mightBeSymbolFont && isSymbolFont(fontFile)) {
writingSystems.setSupported(QFontDatabase::Latin, false);
writingSystems.setSupported(QFontDatabase::Symbol);
}
}
QFont::Style style = (slant_value == FC_SLANT_ITALIC)
? QFont::StyleItalic

View File

@ -189,6 +189,8 @@ void QCoreTextFontEngine::init()
avgCharWidth = QFixed::fromReal(width * fontDef.pixelSize / emSize);
} else
avgCharWidth = QFontEngine::averageCharWidth();
cache_cost = (CTFontGetAscent(ctfont) + CTFontGetDescent(ctfont)) * avgCharWidth.toInt() * 2000;
}
bool QCoreTextFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs,

View File

@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
*/
QSpiAccessibleBridge::QSpiAccessibleBridge()
: cache(0), dec(0), dbusAdaptor(0), m_enabled(false)
: cache(0), dec(0), dbusAdaptor(0)
{
dbusConnection = new DBusConnection();
connect(dbusConnection, SIGNAL(enabledChanged(bool)), this, SLOT(enabledChanged(bool)));
@ -70,7 +70,7 @@ QSpiAccessibleBridge::QSpiAccessibleBridge()
void QSpiAccessibleBridge::enabledChanged(bool enabled)
{
m_enabled = enabled;
setActive(enabled);
updateStatus();
}
@ -87,7 +87,7 @@ QDBusConnection QSpiAccessibleBridge::dBusConnection() const
void QSpiAccessibleBridge::updateStatus()
{
// create the adaptor to handle everything if we are in enabled state
if (!dbusAdaptor && m_enabled) {
if (!dbusAdaptor && isActive()) {
qSpiInitializeStructTypes();
initializeConstantMappings();
@ -106,7 +106,7 @@ void QSpiAccessibleBridge::notifyAccessibilityUpdate(QAccessibleEvent *event)
{
if (!dbusAdaptor)
return;
if (m_enabled)
if (isActive())
dbusAdaptor->notify(event);
}

View File

@ -76,7 +76,6 @@ private:
DeviceEventControllerAdaptor *dec;
AtSpiAdaptor *dbusAdaptor;
DBusConnection* dbusConnection;
bool m_enabled;
};
QT_END_NAMESPACE

View File

@ -48,6 +48,7 @@
#include <qdebug.h>
#include <QDBusConnectionInterface>
#include "bus_interface.h"
QT_BEGIN_NAMESPACE
@ -81,31 +82,12 @@ void DBusConnection::serviceRegistered()
{
// listen to enabled changes
QDBusConnection c = QDBusConnection::sessionBus();
// FXIME check for changes of enabled state
// if (!c.connect(A11Y_SERVICE, A11Y_PATH, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("PropertiesChanged"), this, SLOT(enabledStateChanged(QDBusVariant))))
// qWarning() << "Could not listen to accessibility enabled state changes.";
OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(A11Y_SERVICE, A11Y_PATH, c, this);
// check if it's enabled right away
QDBusMessage enabledMessage = QDBusMessage::createMethodCall(A11Y_SERVICE, A11Y_PATH, QStringLiteral("org.freedesktop.DBus.Properties"), QStringLiteral("Get"));
QList<QVariant> args;
args << QStringLiteral("org.a11y.Status") << QStringLiteral("IsEnabled");
enabledMessage.setArguments(args);
c.callWithCallback(enabledMessage, this, SLOT(enabledStateCallback(QDBusVariant)), SLOT(dbusError(QDBusError)));
}
void DBusConnection::dbusError(const QDBusError &error)
{
qWarning() << "Accessibility encountered a DBus error:" << error;
}
void DBusConnection::serviceUnregistered()
{
emit enabledChanged(false);
}
void DBusConnection::enabledStateCallback(const QDBusVariant &enabled)
{
m_enabled = enabled.variant().toBool();
// a11yStatus->isEnabled() returns always true (since Gnome 3.6)
bool enabled = a11yStatus->screenReaderEnabled();
if (enabled != m_enabled) {
m_enabled = enabled;
if (m_a11yConnection.isConnected()) {
emit enabledChanged(m_enabled);
} else {
@ -117,6 +99,14 @@ void DBusConnection::enabledStateCallback(const QDBusVariant &enabled)
}
}
// connect(a11yStatus, ); QtDbus doesn't support notifications for property changes yet
}
void DBusConnection::serviceUnregistered()
{
emit enabledChanged(false);
}
void DBusConnection::connectA11yBus(const QString &address)
{
if (address.isEmpty()) {
@ -129,6 +119,11 @@ void DBusConnection::connectA11yBus(const QString &address)
emit enabledChanged(true);
}
void DBusConnection::dbusError(const QDBusError &error)
{
qWarning() << "Accessibility encountered a DBus error:" << error;
}
/*!
Returns the DBus connection that got established.
Or an invalid connection if not yet connected.

View File

@ -67,8 +67,6 @@ Q_SIGNALS:
private Q_SLOTS:
void serviceRegistered();
void serviceUnregistered();
void enabledStateCallback(const QDBusVariant &enabled);
// void enabledStateChanged(const QDBusVariant &);
void connectA11yBus(const QString &address);
void dbusError(const QDBusError &error);

View File

@ -42,6 +42,8 @@
#include "qgenericunixthemes_p.h"
#include "../../services/genericunix/qgenericunixservices_p.h"
#include "qpa/qplatformtheme_p.h"
#include <QtGui/QPalette>
#include <QtGui/QFont>
#include <QtGui/QGuiApplication>
@ -87,15 +89,27 @@ const char *QGenericUnixTheme::name = "generic";
static const char defaultSystemFontNameC[] = "Sans Serif";
enum { defaultSystemFontSize = 9 };
class QGenericUnixThemePrivate : public QPlatformThemePrivate
{
public:
QGenericUnixThemePrivate()
: QPlatformThemePrivate()
, systemFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize)
{ }
const QFont systemFont;
};
QGenericUnixTheme::QGenericUnixTheme()
: m_systemFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize)
: QPlatformTheme(new QGenericUnixThemePrivate())
{
}
const QFont *QGenericUnixTheme::font(Font type) const
{
Q_D(const QGenericUnixTheme);
if (type == QPlatformTheme::SystemFont)
return &m_systemFont;
return &d->systemFont;
return 0;
}
@ -142,6 +156,93 @@ QVariant QGenericUnixTheme::themeHint(ThemeHint hint) const
}
#ifndef QT_NO_SETTINGS
class QKdeThemePrivate : public QPlatformThemePrivate
{
public:
QKdeThemePrivate(const QString &kdeHome, int kdeVersion)
: kdeHome(kdeHome)
, kdeVersion(kdeVersion)
, toolButtonStyle(Qt::ToolButtonTextBesideIcon)
, toolBarIconSize(0)
{ }
QString globalSettingsFile() const
{
return kdeHome + QStringLiteral("/share/config/kdeglobals");
}
void refresh();
static void readKdeSystemPalette(const QSettings &kdeSettings, QPalette *pal);
static QFont *readKdeFontSetting(const QSettings &settings, const QString &key);
static QStringList kdeIconThemeSearchPaths(const QString &kdeHome);
const QString kdeHome;
const int kdeVersion;
ResourceHelper resources;
QString iconThemeName;
QString iconFallbackThemeName;
QStringList styleNames;
int toolButtonStyle;
int toolBarIconSize;
};
void QKdeThemePrivate::refresh()
{
resources.clear();
toolButtonStyle = Qt::ToolButtonTextBesideIcon;
toolBarIconSize = 0;
styleNames.clear();
styleNames << QStringLiteral("Oxygen") << QStringLiteral("fusion") << QStringLiteral("windows");
iconFallbackThemeName = iconThemeName = QStringLiteral("oxygen");
// Read settings file.
const QString settingsFile = globalSettingsFile();
if (!QFileInfo(settingsFile).isReadable())
return;
const QSettings kdeSettings(settingsFile, QSettings::IniFormat);
QPalette systemPalette = QPalette();
readKdeSystemPalette(kdeSettings, &systemPalette);
resources.palettes[QPlatformTheme::SystemPalette] = new QPalette(systemPalette);
//## TODO tooltip color
const QVariant styleValue = kdeSettings.value(QStringLiteral("widgetStyle"));
if (styleValue.isValid()) {
const QString style = styleValue.toString();
if (style != styleNames.front())
styleNames.push_front(style);
}
const QVariant themeValue = kdeSettings.value(QStringLiteral("Icons/Theme"));
if (themeValue.isValid())
iconThemeName = themeValue.toString();
const QVariant toolBarIconSizeValue = kdeSettings.value(QStringLiteral("ToolbarIcons/Size"));
if (toolBarIconSizeValue.isValid())
toolBarIconSize = toolBarIconSizeValue.toInt();
const QVariant toolbarStyleValue = kdeSettings.value(QStringLiteral("ToolButtonStyle"));
if (toolbarStyleValue.isValid()) {
const QString toolBarStyle = toolbarStyleValue.toString();
if (toolBarStyle == QStringLiteral("TextBesideIcon"))
toolButtonStyle = Qt::ToolButtonTextBesideIcon;
else if (toolBarStyle == QStringLiteral("TextOnly"))
toolButtonStyle = Qt::ToolButtonTextOnly;
else if (toolBarStyle == QStringLiteral("TextUnderIcon"))
toolButtonStyle = Qt::ToolButtonTextUnderIcon;
}
// Read system font, ignore 'fixed' 'smallestReadableFont'
if (QFont *systemFont = readKdeFontSetting(kdeSettings, QStringLiteral("font"))) {
resources.fonts[QPlatformTheme::SystemFont] = systemFont;
} else {
resources.fonts[QPlatformTheme::SystemFont] = new QFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize);
}
}
// Reads the color from the KDE configuration, and store it in the
// palette with the given color role if found.
@ -158,7 +259,7 @@ static inline bool kdeColor(QPalette *pal, QPalette::ColorRole role,
return true;
}
static inline void readKdeSystemPalette(const QSettings &kdeSettings, QPalette *pal)
void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalette *pal)
{
kdeColor(pal, QPalette::Button, kdeSettings, QStringLiteral("Colors:Button/BackgroundNormal"));
kdeColor(pal, QPalette::Window, kdeSettings, QStringLiteral("Colors:Window/BackgroundNormal"));
@ -183,14 +284,13 @@ static inline void readKdeSystemPalette(const QSettings &kdeSettings, QPalette *
const char *QKdeTheme::name = "kde";
QKdeTheme::QKdeTheme(const QString &kdeHome, int kdeVersion) :
m_kdeHome(kdeHome), m_kdeVersion(kdeVersion),
m_toolButtonStyle(Qt::ToolButtonTextBesideIcon), m_toolBarIconSize(0)
QKdeTheme::QKdeTheme(const QString &kdeHome, int kdeVersion)
: QPlatformTheme(new QKdeThemePrivate(kdeHome,kdeVersion))
{
refresh();
d_func()->refresh();
}
static inline QFont *readKdeFontSetting(const QSettings &settings, const QString &key)
QFont *QKdeThemePrivate::readKdeFontSetting(const QSettings &settings, const QString &key)
{
const QVariant fontValue = settings.value(key);
if (fontValue.isValid()) {
@ -218,68 +318,8 @@ static inline QFont *readKdeFontSetting(const QSettings &settings, const QString
return 0;
}
void QKdeTheme::refresh()
{
m_resources.clear();
m_toolButtonStyle = Qt::ToolButtonTextBesideIcon;
m_toolBarIconSize = 0;
m_styleNames.clear();
m_styleNames << QStringLiteral("Oxygen") << QStringLiteral("fusion") << QStringLiteral("windows");
m_iconFallbackThemeName = m_iconThemeName = QStringLiteral("oxygen");
// Read settings file.
const QString settingsFile = globalSettingsFile();
if (!QFileInfo(settingsFile).isReadable())
return;
const QSettings kdeSettings(settingsFile, QSettings::IniFormat);
QPalette systemPalette = QPalette();
readKdeSystemPalette(kdeSettings, &systemPalette);
m_resources.palettes[SystemPalette] = new QPalette(systemPalette);
//## TODO tooltip color
const QVariant styleValue = kdeSettings.value(QStringLiteral("widgetStyle"));
if (styleValue.isValid()) {
const QString style = styleValue.toString();
if (style != m_styleNames.front())
m_styleNames.push_front(style);
}
const QVariant themeValue = kdeSettings.value(QStringLiteral("Icons/Theme"));
if (themeValue.isValid())
m_iconThemeName = themeValue.toString();
const QVariant toolBarIconSizeValue = kdeSettings.value(QStringLiteral("ToolbarIcons/Size"));
if (toolBarIconSizeValue.isValid())
m_toolBarIconSize = toolBarIconSizeValue.toInt();
const QVariant toolbarStyleValue = kdeSettings.value(QStringLiteral("ToolButtonStyle"));
if (toolbarStyleValue.isValid()) {
const QString toolBarStyle = toolbarStyleValue.toString();
if (toolBarStyle == QStringLiteral("TextBesideIcon"))
m_toolButtonStyle = Qt::ToolButtonTextBesideIcon;
else if (toolBarStyle == QStringLiteral("TextOnly"))
m_toolButtonStyle = Qt::ToolButtonTextOnly;
else if (toolBarStyle == QStringLiteral("TextUnderIcon"))
m_toolButtonStyle = Qt::ToolButtonTextUnderIcon;
}
// Read system font, ignore 'fixed' 'smallestReadableFont'
if (QFont *systemFont = readKdeFontSetting(kdeSettings, QStringLiteral("font"))) {
m_resources.fonts[SystemFont] = systemFont;
} else {
m_resources.fonts[SystemFont] = new QFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize);
}
}
QString QKdeTheme::globalSettingsFile() const
{
return m_kdeHome + QStringLiteral("/share/config/kdeglobals");
}
static QStringList kdeIconThemeSearchPaths(const QString &kdeHome)
QStringList QKdeThemePrivate::kdeIconThemeSearchPaths(const QString &kdeHome)
{
QStringList candidates = QStringList(kdeHome);
const QString kdeDirs = QFile::decodeName(qgetenv("KDEDIRS"));
@ -298,6 +338,7 @@ static QStringList kdeIconThemeSearchPaths(const QString &kdeHome)
QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
{
Q_D(const QKdeTheme);
switch (hint) {
case QPlatformTheme::UseFullScreenForPopupMenu:
return QVariant(true);
@ -306,17 +347,17 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
case QPlatformTheme::DialogButtonBoxLayout:
return QVariant(2); // QDialogButtonBox::KdeLayout
case QPlatformTheme::ToolButtonStyle:
return QVariant(m_toolButtonStyle);
return QVariant(d->toolButtonStyle);
case QPlatformTheme::ToolBarIconSize:
return QVariant(m_toolBarIconSize);
return QVariant(d->toolBarIconSize);
case QPlatformTheme::SystemIconThemeName:
return QVariant(m_iconThemeName);
return QVariant(d->iconThemeName);
case QPlatformTheme::SystemIconFallbackThemeName:
return QVariant(m_iconFallbackThemeName);
return QVariant(d->iconFallbackThemeName);
case QPlatformTheme::IconThemeSearchPaths:
return QVariant(kdeIconThemeSearchPaths(m_kdeHome));
return QVariant(d->kdeIconThemeSearchPaths(d->kdeHome));
case QPlatformTheme::StyleNames:
return QVariant(m_styleNames);
return QVariant(d->styleNames);
case QPlatformTheme::KeyboardScheme:
return QVariant(int(KdeKeyboardScheme));
default:
@ -325,6 +366,18 @@ QVariant QKdeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
return QPlatformTheme::themeHint(hint);
}
const QPalette *QKdeTheme::palette(Palette type) const
{
Q_D(const QKdeTheme);
return d->resources.palettes[type];
}
const QFont *QKdeTheme::font(Font type) const
{
Q_D(const QKdeTheme);
return d->resources.fonts[type];
}
QPlatformTheme *QKdeTheme::createKdeTheme()
{
// Check for version >= 4 and determine home folder from environment,
@ -361,8 +414,18 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
const char *QGnomeTheme::name = "gnome";
class QGnomeThemePrivate : public QPlatformThemePrivate
{
public:
QGnomeThemePrivate()
: systemFont(QLatin1Literal(defaultSystemFontNameC), defaultSystemFontSize)
{}
const QFont systemFont;
};
QGnomeTheme::QGnomeTheme()
: m_systemFont(QLatin1String(defaultSystemFontNameC), defaultSystemFontSize)
: QPlatformTheme(new QGnomeThemePrivate())
{
}
@ -385,6 +448,8 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
}
case QPlatformTheme::KeyboardScheme:
return QVariant(int(GnomeKeyboardScheme));
case QPlatformTheme::PasswordMaskCharacter:
return QVariant(QChar(0x2022));
default:
break;
}
@ -393,8 +458,10 @@ QVariant QGnomeTheme::themeHint(QPlatformTheme::ThemeHint hint) const
const QFont *QGnomeTheme::font(Font type) const
{
Q_D(const QGnomeTheme);
if (type == QPlatformTheme::SystemFont)
return &m_systemFont;
return &d->systemFont;
return 0;
}

View File

@ -61,8 +61,11 @@ public:
QFont *fonts[QPlatformTheme::NFonts];
};
class QGenericUnixThemePrivate;
class QGenericUnixTheme : public QPlatformTheme
{
Q_DECLARE_PRIVATE(QGenericUnixTheme)
public:
QGenericUnixTheme();
@ -75,55 +78,39 @@ public:
static QStringList xdgIconThemePaths();
static const char *name;
private:
const QFont m_systemFont;
};
#ifndef QT_NO_SETTINGS
class QKdeThemePrivate;
class QKdeTheme : public QPlatformTheme
{
Q_DECLARE_PRIVATE(QKdeTheme)
QKdeTheme(const QString &kdeHome, int kdeVersion);
public:
static QPlatformTheme *createKdeTheme();
virtual QVariant themeHint(ThemeHint hint) const;
virtual const QPalette *palette(Palette type = SystemPalette) const
{ return m_resources.palettes[type]; }
virtual const QPalette *palette(Palette type = SystemPalette) const;
virtual const QFont *font(Font type) const
{ return m_resources.fonts[type]; }
virtual const QFont *font(Font type) const;
static const char *name;
private:
QString globalSettingsFile() const;
void refresh();
const QString m_kdeHome;
const int m_kdeVersion;
ResourceHelper m_resources;
QString m_iconThemeName;
QString m_iconFallbackThemeName;
QStringList m_styleNames;
int m_toolButtonStyle;
int m_toolBarIconSize;
};
#endif // QT_NO_SETTINGS
class QGnomeThemePrivate;
class QGnomeTheme : public QPlatformTheme
{
Q_DECLARE_PRIVATE(QGnomeTheme)
public:
QGnomeTheme();
virtual QVariant themeHint(ThemeHint hint) const;
virtual const QFont *font(Font type) const;
static const char *name;
private:
const QFont m_systemFont;
};
QPlatformTheme *qt_createUnixTheme();

View File

@ -252,14 +252,14 @@ void TableGenerator::parseIncludeInstruction(QString line)
processFile(line);
}
ushort TableGenerator::keysymToUtf8(uint32_t sym)
ushort TableGenerator::keysymToUtf8(quint32 sym)
{
QByteArray chars;
int bytes;
chars.resize(8);
if (needWorkaround(sym)) {
uint32_t codepoint;
quint32 codepoint;
if (sym == XKB_KEY_KP_Space)
codepoint = XKB_KEY_space & 0x7f;
else
@ -284,14 +284,14 @@ ushort TableGenerator::keysymToUtf8(uint32_t sym)
return ch->unicode();
}
uint32_t TableGenerator::stringToKeysym(QString keysymName)
quint32 TableGenerator::stringToKeysym(QString keysymName)
{
uint32_t keysym;
quint32 keysym;
QByteArray keysymArray = keysymName.toLatin1();
const char *name = keysymArray.constData();
if ((keysym = xkb_keysym_from_name(name, (xkb_keysym_flags)0)) == XKB_KEY_NoSymbol)
qWarning() << QString("Qt Warrning - invalid keysym: %1").arg(keysymName);
qWarning() << QString("Qt Warning - invalid keysym: %1").arg(keysymName);
return keysym;
}

View File

@ -109,8 +109,8 @@ protected:
bool findSystemComposeDir();
QString systemComposeDir();
ushort keysymToUtf8(uint32_t sym);
uint32_t stringToKeysym(QString keysymName);
ushort keysymToUtf8(quint32 sym);
quint32 stringToKeysym(QString keysymName);
void readLocaleMappings();
void initPossibleLocations();

View File

@ -74,9 +74,7 @@
# include "qandroidopenglplatformwindow.h"
#endif
#if __ANDROID_API__ > 8
#include <android/native_window_jni.h>
#endif
static jmethodID m_redrawSurfaceMethodID = 0;
@ -543,32 +541,6 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
env->DeleteGlobalRef(m_bitmapDrawableClass);
}
#ifdef ANDROID_PLUGIN_OPENGL
#if __ANDROID_API__ < 9
struct FakeNativeWindow
{
long long dummyNativeWindow;// force 64 bits alignment
};
class FakeSurface: public FakeNativeWindow
{
public:
virtual void FakeSurfaceMethod()
{
fakeSurface = 0;
}
int fakeSurface;
};
EGLNativeWindowType ANativeWindow_fromSurface(JNIEnv *env, jobject jSurface)
{
FakeSurface *surface = static_cast<FakeSurface *>(env->GetIntField(jSurface, m_surfaceFieldID));
return static_cast<EGLNativeWindowType>(static_cast<FakeNativeWindow*>(surface));
}
#endif // __ANDROID_API__ < 9
#endif // ANDROID_PLUGIN_OPENGL
static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
{
#ifndef ANDROID_PLUGIN_OPENGL
@ -587,7 +559,6 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
m_surfaceMutex.unlock();
m_androidPlatformIntegration->surfaceChanged();
} else if (m_androidPlatformIntegration && sameNativeWindow) {
QAndroidOpenGLPlatformWindow *window = m_androidPlatformIntegration->primaryWindow();
QPlatformScreen *screen = m_androidPlatformIntegration->screen();
QSize size = QtAndroid::nativeWindowSize();
@ -595,6 +566,11 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry);
QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry);
// Resize all top level windows, since they share the same surface
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
QAndroidOpenGLPlatformWindow *window =
static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
if (window != 0) {
window->lock();
window->scheduleResize(size);
@ -603,6 +579,7 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
QRegion(window->window()->geometry()));
window->unlock();
}
}
m_surfaceMutex.unlock();
} else {
@ -753,12 +730,7 @@ static int registerNatives(JNIEnv *env)
#ifdef ANDROID_PLUGIN_OPENGL
FIND_AND_CHECK_CLASS("android/view/Surface");
#if __ANDROID_API__ < 9
# define ANDROID_VIEW_SURFACE_JNI_ID "mSurface"
#else
# define ANDROID_VIEW_SURFACE_JNI_ID "mNativeSurface"
#endif
GET_AND_CHECK_FIELD(m_surfaceFieldID, clazz, ANDROID_VIEW_SURFACE_JNI_ID, "I");
GET_AND_CHECK_FIELD(m_surfaceFieldID, clazz, "mNativeSurface", "I");
#endif
jmethodID methodID;

View File

@ -62,16 +62,16 @@ void QAndroidOpenGLContext::swapBuffers(QPlatformSurface *surface)
{
QEglFSContext::swapBuffers(surface);
QAndroidOpenGLPlatformWindow *primaryWindow = m_platformIntegration->primaryWindow();
if (primaryWindow == surface) {
primaryWindow->lock();
QSize size = primaryWindow->scheduledResize();
if (surface->surface()->surfaceClass() == QSurface::Window) {
QAndroidOpenGLPlatformWindow *window = static_cast<QAndroidOpenGLPlatformWindow *>(surface);
window->lock();
QSize size = window->scheduledResize();
if (size.isValid()) {
QRect geometry(QPoint(0, 0), size);
primaryWindow->setGeometry(geometry);
primaryWindow->scheduleResize(QSize());
window->setGeometry(geometry);
window->scheduleResize(QSize());
}
primaryWindow->unlock();
window->unlock();
}
}

View File

@ -45,11 +45,21 @@
QT_BEGIN_NAMESPACE
EGLSurface QAndroidOpenGLPlatformWindow::m_staticSurface = 0;
EGLNativeWindowType QAndroidOpenGLPlatformWindow::m_staticNativeWindow = 0;
QReadWriteLock QAndroidOpenGLPlatformWindow::m_staticSurfaceLock;
QBasicAtomicInt QAndroidOpenGLPlatformWindow::m_referenceCount = Q_BASIC_ATOMIC_INITIALIZER(0);
QAndroidOpenGLPlatformWindow::QAndroidOpenGLPlatformWindow(QWindow *window)
: QEglFSWindow(window)
{
}
QAndroidOpenGLPlatformWindow::~QAndroidOpenGLPlatformWindow()
{
destroy();
}
bool QAndroidOpenGLPlatformWindow::isExposed() const
{
return QtAndroid::nativeWindow(false) != 0 && QEglFSWindow::isExposed();
@ -60,11 +70,57 @@ void QAndroidOpenGLPlatformWindow::invalidateSurface()
QWindowSystemInterface::handleExposeEvent(window(), QRegion()); // Obscure event
QWindowSystemInterface::flushWindowSystemEvents();
QEglFSWindow::invalidateSurface();
m_window = 0;
m_surface = 0;
if (!m_referenceCount.deref()){
QWriteLocker locker(&m_staticSurfaceLock);
EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
eglDestroySurface(display, m_staticSurface);
m_staticSurface = 0;
m_staticNativeWindow = 0;
}
}
void QAndroidOpenGLPlatformWindow::resetSurface()
{
m_referenceCount.ref();
if (m_staticSurface == 0) {
QWriteLocker locker(&m_staticSurfaceLock);
QEglFSWindow::resetSurface();
m_staticSurface = m_surface;
m_staticNativeWindow = m_window;
} else {
QReadLocker locker(&m_staticSurfaceLock);
Q_ASSERT(m_staticSurface != m_surface);
m_window = m_staticNativeWindow;
m_surface = m_staticSurface;
}
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event
QWindowSystemInterface::flushWindowSystemEvents();
}
void QAndroidOpenGLPlatformWindow::destroy()
{
if (!m_referenceCount.deref()) {
QEglFSWindow::destroy();
} else {
m_window = 0;
m_surface = 0;
}
}
void QAndroidOpenGLPlatformWindow::raise()
{
}
void QAndroidOpenGLPlatformWindow::setVisible(bool visible)
{
QEglFSWindow::setVisible(visible);
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event
QWindowSystemInterface::flushWindowSystemEvents();
}

View File

@ -44,6 +44,7 @@
#include "qeglfswindow.h"
#include <QtCore/qmutex.h>
#include <QtCore/qreadwritelock.h>
QT_BEGIN_NAMESPACE
@ -51,6 +52,7 @@ class QAndroidOpenGLPlatformWindow : public QEglFSWindow
{
public:
QAndroidOpenGLPlatformWindow(QWindow *window);
~QAndroidOpenGLPlatformWindow();
QSize scheduledResize() const { return m_scheduledResize; }
void scheduleResize(const QSize &size) { m_scheduledResize = size; }
@ -60,12 +62,23 @@ public:
bool isExposed() const;
void raise();
void invalidateSurface();
void resetSurface();
void setVisible(bool visible);
void destroy();
private:
QSize m_scheduledResize;
QMutex m_lock;
static QReadWriteLock m_staticSurfaceLock;
static EGLSurface m_staticSurface;
static EGLNativeWindowType m_staticNativeWindow;
static QBasicAtomicInt m_referenceCount;
};
QT_END_NAMESPACE

View File

@ -96,6 +96,7 @@ QDpi QEglFSAndroidHooks::logicalDpi() const
EGLNativeWindowType QEglFSAndroidHooks::createNativeWindow(const QSize &size, const QSurfaceFormat &format)
{
Q_UNUSED(size);
ANativeWindow *window = QtAndroid::nativeWindow();
if (window != 0)
ANativeWindow_acquire(window);

View File

@ -43,6 +43,7 @@
#include "qabstracteventdispatcher.h"
#include "androidjnimain.h"
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/qguiapplication.h>
#include <qpa/qwindowsysteminterface.h>
#include <QThread>
#include <qpa/qplatformwindow.h>
@ -85,9 +86,6 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA
QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList &paramList)
: m_touchDevice(0)
#ifdef ANDROID_PLUGIN_OPENGL
, m_primaryWindow(0)
#endif
{
Q_UNUSED(paramList);
@ -116,6 +114,7 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
{
switch (cap) {
case ThreadedPixmaps: return true;
case NonFullScreenWindows: return false;
default:
#ifndef ANDROID_PLUGIN_OPENGL
return QPlatformIntegration::hasCapability(cap);
@ -143,28 +142,32 @@ QAbstractEventDispatcher *QAndroidPlatformIntegration::guiThreadEventDispatcher(
#else // !ANDROID_PLUGIN_OPENGL
QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *window) const
{
if (m_primaryWindow != 0) {
qWarning("QAndroidPlatformIntegration::createPlatformWindow: Unsupported case: More than "
"one top-level window created.");
}
m_primaryWindow = new QAndroidOpenGLPlatformWindow(window);
m_primaryWindow->requestActivateWindow();
QAndroidOpenGLPlatformWindow *platformWindow = new QAndroidOpenGLPlatformWindow(window);
platformWindow->create();
platformWindow->requestActivateWindow();
QtAndroidMenu::setActiveTopLevelWindow(window);
return m_primaryWindow;
return platformWindow;
}
void QAndroidPlatformIntegration::invalidateNativeSurface()
{
if (m_primaryWindow != 0)
m_primaryWindow->invalidateSurface();
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
QAndroidOpenGLPlatformWindow *window =
static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
if (window != 0)
window->invalidateSurface();
}
}
void QAndroidPlatformIntegration::surfaceChanged()
{
if (m_primaryWindow != 0)
m_primaryWindow->resetSurface();
foreach (QWindow *w, QGuiApplication::topLevelWindows()) {
QAndroidOpenGLPlatformWindow *window =
static_cast<QAndroidOpenGLPlatformWindow *>(w->handle());
if (window != 0)
window->resetSurface();
}
}
QPlatformOpenGLContext *QAndroidPlatformIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const

View File

@ -95,7 +95,6 @@ public:
QPlatformWindow *createPlatformWindow(QWindow *window) const;
void invalidateNativeSurface();
void surfaceChanged();
QAndroidOpenGLPlatformWindow *primaryWindow() const { return m_primaryWindow; }
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
#endif
@ -138,8 +137,6 @@ private:
#ifndef ANDROID_PLUGIN_OPENGL
QAbstractEventDispatcher *m_eventDispatcher;
QAndroidPlatformScreen *m_primaryScreen;
#else
mutable QAndroidOpenGLPlatformWindow *m_primaryWindow;
#endif
QThread *m_mainThread;

View File

@ -59,6 +59,9 @@ public:
QPlatformIntegration * QCocoaIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
QCocoaAutoReleasePool pool;
if (system.toLower() == "cocoa")
return new QCocoaIntegration;

View File

@ -180,7 +180,8 @@ bool shouldBeIgnored(QAccessibleInterface *interface)
// state. Ignore interfaces with those flags set.
const QAccessible::State state = interface->state();
if (state.invisible ||
state.offscreen)
state.offscreen ||
state.invalid)
return true;
// Some roles are not interesting. In particular, container roles should be
@ -189,12 +190,13 @@ bool shouldBeIgnored(QAccessibleInterface *interface)
if (role == QAccessible::Border || // QFrame
role == QAccessible::Application || // We use the system-provided application element.
role == QAccessible::MenuItem || // The system also provides the menu items.
role == QAccessible::ToolBar) // Access the tool buttons directly.
role == QAccessible::ToolBar || // Access the tool buttons directly.
role == QAccessible::Pane || // Scroll areas.
role == QAccessible::Client) // The default for QWidget.
return true;
NSString *mac_role = macRole(interface);
if (mac_role == NSAccessibilityWindowRole || // We use the system-provided window elements.
mac_role == NSAccessibilityGroupRole ||
mac_role == NSAccessibilityUnknownRole)
return true;

Some files were not shown because too many files have changed in this diff Show More