summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-04-22 16:35:41 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-04-22 16:35:43 +0200
commit4c231d5df3040dbf4545a9a77145ee0e1f9c380c (patch)
tree2cc5b71a5d2b464214cf5372776913fbe4622e1e
parent7df16fb4ccbe0476bc34274a77e98eec4e8d2d93 (diff)
parentd672ef07681a959d9559dd1e11e70db1f448a7f1 (diff)
Merge remote-tracking branch 'origin/stable' into dev
-rwxr-xr-xbin/syncqt4
-rwxr-xr-xconfig.tests/unix/makeabs2
-rwxr-xr-xconfigure310
-rw-r--r--examples/widgets/doc/orientation.qdoc1
-rw-r--r--examples/widgets/doc/src/applicationicon.qdoc1
-rw-r--r--examples/widgets/doc/src/echoplugin.qdoc2
-rw-r--r--examples/widgets/doc/src/elidedlabel.qdoc1
-rw-r--r--examples/widgets/doc/src/syntaxhighlighter.qdoc2
-rw-r--r--examples/widgets/tools/tools.pro7
-rw-r--r--mkspecs/android-g++/qmake.conf5
-rw-r--r--mkspecs/common/wince/qmake.conf1
-rw-r--r--mkspecs/features/cmake_functions.prf16
-rw-r--r--mkspecs/features/create_cmake.prf19
-rw-r--r--mkspecs/features/ctest_testcase.prf2
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in16
-rw-r--r--mkspecs/features/mac/sdk.prf4
-rw-r--r--mkspecs/features/module.prf1
-rw-r--r--mkspecs/features/qt_module_config.prf2
-rw-r--r--mkspecs/features/wayland-scanner.prf50
-rw-r--r--src/3rdparty/atspi2/atspi2.pri2
-rw-r--r--src/3rdparty/atspi2/xml/Bus.xml17
-rw-r--r--src/3rdparty/sqlite/sqlite3.c12
-rw-r--r--src/3rdparty/sqlite/sqlite3.h4
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java1
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtSurface.java14
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in16
-rw-r--r--src/corelib/animation/qabstractanimation.cpp4
-rw-r--r--src/corelib/global/qcompilerdetection.h4
-rw-r--r--src/corelib/global/qfeatures.h7
-rw-r--r--src/corelib/global/qprocessordetection.h2
-rw-r--r--src/corelib/io/qbuffer.cpp21
-rw-r--r--src/corelib/io/qfsfileengine_win.cpp26
-rw-r--r--src/corelib/kernel/qmetaobject.cpp6
-rw-r--r--src/corelib/plugin/qpluginloader.cpp3
-rw-r--r--src/corelib/thread/qbasicatomic.h4
-rw-r--r--src/corelib/tools/qlocale_mac.mm3
-rw-r--r--src/dbus/qdbuserror.cpp4
-rw-r--r--src/gui/Qt5GuiConfigExtras.cmake.in20
-rw-r--r--src/gui/accessible/qaccessible.cpp21
-rw-r--r--src/gui/accessible/qplatformaccessibility.cpp1
-rw-r--r--src/gui/accessible/qplatformaccessibility.h5
-rw-r--r--src/gui/gui.pro16
-rw-r--r--src/gui/image/qimage.cpp9
-rw-r--r--src/gui/image/qimagereader.cpp4
-rw-r--r--src/gui/image/qimagewriter.cpp4
-rw-r--r--src/gui/image/qpicture.cpp3
-rw-r--r--src/gui/image/qpixmap_blitter.cpp2
-rw-r--r--src/gui/image/qpixmap_raster.cpp7
-rw-r--r--src/gui/kernel/kernel.pri1
-rw-r--r--src/gui/kernel/qguiapplication.cpp8
-rw-r--r--src/gui/kernel/qopenglcontext.h2
-rw-r--r--src/gui/kernel/qpalette.cpp34
-rw-r--r--src/gui/kernel/qplatformintegration.cpp10
-rw-r--r--src/gui/kernel/qplatformintegration.h6
-rw-r--r--src/gui/kernel/qplatformtheme.cpp38
-rw-r--r--src/gui/kernel/qplatformtheme.h13
-rw-r--r--src/gui/kernel/qplatformtheme_p.h74
-rw-r--r--src/gui/kernel/qplatformwindow.cpp26
-rw-r--r--src/gui/kernel/qplatformwindow.h3
-rw-r--r--src/gui/kernel/qstylehints.cpp9
-rw-r--r--src/gui/kernel/qstylehints.h1
-rw-r--r--src/gui/kernel/qwindow.cpp30
-rw-r--r--src/gui/kernel/qwindow.h3
-rw-r--r--src/gui/kernel/qwindow_p.h1
-rw-r--r--src/gui/opengl/qopenglbuffer.cpp2
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp6
-rw-r--r--src/gui/opengl/qopenglversionfunctions.h2
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp2
-rw-r--r--src/gui/painting/qpaintdevice.cpp2
-rw-r--r--src/gui/painting/qpaintdevice.h4
-rw-r--r--src/gui/painting/qpaintdevice.qdoc13
-rw-r--r--src/gui/painting/qpainter.cpp32
-rw-r--r--src/gui/painting/qpainter_p.h1
-rw-r--r--src/gui/painting/qpdf.cpp3
-rw-r--r--src/gui/text/qfont.cpp50
-rw-r--r--src/gui/text/qfontengine.cpp11
-rw-r--r--src/gui/text/qfontengine_qpa.cpp1
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp8
-rw-r--r--src/opengl/qglframebufferobject.cpp3
-rw-r--r--src/opengl/qglpaintdevice.cpp8
-rw-r--r--src/opengl/qglpixelbuffer.cpp3
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp18
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm2
-rw-r--r--src/platformsupport/linuxaccessibility/bridge.cpp8
-rw-r--r--src/platformsupport/linuxaccessibility/bridge_p.h1
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection.cpp51
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection_p.h2
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp221
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h35
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp10
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h4
-rw-r--r--src/plugins/platforms/android/src/androidjnimain.cpp56
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp14
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp58
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h13
-rw-r--r--src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp1
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.cpp33
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.h3
-rw-r--r--src/plugins/platforms/cocoa/main.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm42
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm50
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm7
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm9
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm17
-rw-r--r--src/plugins/platforms/cocoa/qmacmime.mm6
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm5
-rw-r--r--src/plugins/platforms/cocoa/qnsviewaccessibility.mm19
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm3
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp3
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp6
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.h6
-rw-r--r--src/plugins/platforms/ios/qiosapplicationdelegate.h3
-rw-r--r--src/plugins/platforms/ios/qiosapplicationdelegate.mm2
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.mm6
-rw-r--r--src/plugins/platforms/ios/qiosglobal.h2
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm8
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm2
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm4
-rw-r--r--src/plugins/platforms/ios/qtmain.mm3
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.h2
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp4
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp5
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.cpp20
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp13
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h5
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp14
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h5
-rw-r--r--src/printsupport/kernel/qprinter.cpp4
-rw-r--r--src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp4
-rw-r--r--src/tools/bootstrap/bootstrap.pro2
-rw-r--r--src/tools/qdoc/codemarker.cpp33
-rw-r--r--src/tools/qdoc/codemarker.h4
-rw-r--r--src/tools/qdoc/codeparser.cpp2
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp37
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.h13
-rw-r--r--src/tools/qdoc/generator.cpp14
-rw-r--r--src/tools/qdoc/generator.h7
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp71
-rw-r--r--src/tools/qdoc/htmlgenerator.h5
-rw-r--r--src/tools/qdoc/node.h15
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp96
-rw-r--r--src/tools/qdoc/qdocdatabase.h7
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp7
-rw-r--r--src/tools/qdoc/qdocindexfiles.h1
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp45
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp13
-rw-r--r--src/widgets/kernel/qwidget.cpp3
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp15
-rw-r--r--src/widgets/styles/qcommonstyle.cpp16
-rw-r--r--src/widgets/styles/qfusionstyle.cpp44
-rw-r--r--src/widgets/styles/qgtkstyle.cpp42
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm14
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp15
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp47
-rw-r--r--src/widgets/styles/qwindowsxpstyle_p_p.h4
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp1
-rw-r--r--src/widgets/widgets/qlineedit.cpp13
-rw-r--r--src/widgets/widgets/qmenu.cpp5
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp4
-rw-r--r--src/xml/sax/qxml.cpp20
-rw-r--r--src/xml/sax/qxml.h8
-rw-r--r--tests/auto/cmake/CMakeLists.txt4
-rw-r--r--tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp23
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp4
-rw-r--r--tests/auto/corelib/kernel/qmetatype/qmetatype.pro4
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp15
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp19
-rw-r--r--tests/auto/other/qaccessibility/qaccessibility.pro2
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp5
-rw-r--r--tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp8
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp38
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp2
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp4
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp17
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp11
-rw-r--r--tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp8
-rw-r--r--tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro2
-rw-r--r--tools/configure/environment.cpp2
-rw-r--r--util/accessibilityinspector/accessibilityinspector.cpp6
-rw-r--r--util/accessibilityinspector/accessibilityscenemanager.cpp54
-rw-r--r--util/accessibilityinspector/accessibilityscenemanager.h2
-rw-r--r--util/accessibilityinspector/optionswidget.h16
-rw-r--r--util/accessibilityinspector/screenreader.cpp6
202 files changed, 1951 insertions, 911 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 306c4df57a..ce07af4895 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -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;
diff --git a/config.tests/unix/makeabs b/config.tests/unix/makeabs
index c415cc7bda..4df26f769f 100755
--- a/config.tests/unix/makeabs
+++ b/config.tests/unix/makeabs
@@ -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/"
diff --git a/configure b/configure
index ed39ae387b..34ea35c6dc 100755
--- a/configure
+++ b/configure
@@ -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
@@ -6583,16 +6588,16 @@ 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"
- else
- echo "Default Link ........... release"
- fi
+ echo " Mode ................... debug and $release; default link: $build_mode"
else
- echo "Debug .................. $CFG_DEBUG"
+ echo " Mode ................... $build_mode"
fi
-if [ "$CFG_RELEASE" = "yes" ] || [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
- echo "Force debug info ....... $CFG_FORCEDEBUGINFO"
+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
-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"
+ 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}"
+ echo " JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
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"
+echo " QML debugging .......... $CFG_QML_DEBUG"
+echo " Use system proxies ..... $CFG_SYSTEM_PROXIES"
+
+# 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 support ........... $CFG_JPEG"
+ echo " JPEG ................. $CFG_JPEG"
else
- echo "JPEG support ........... $CFG_JPEG ($CFG_LIBJPEG)"
+ echo " JPEG ................. $CFG_JPEG ($CFG_LIBJPEG)"
fi
if [ "$CFG_PNG" = "no" ]; then
- echo "PNG support ............ $CFG_PNG"
+ echo " PNG .................. $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"
+ echo " PNG .................. $CFG_PNG ($CFG_LIBPNG)"
+fi
+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="(loading libraries at run-time)"
+elif [ "$CFG_OPENSSL" = "linked" ]; then
+ OPENSSL_LINKAGE="(linked to the libraries)"
fi
-echo "Use system proxies ..... $CFG_SYSTEM_PROXIES"
-
+echo " OpenSSL .............. $CFG_OPENSSL $OPENSSL_LINKAGE"
+unset OPENSSL_LINKAGE
+echo " NIS .................... $CFG_NIS"
if [ "$CFG_OPENGL" = "desktop" ]; then
- echo "OpenGL support ......... yes (Desktop OpenGL)"
+ echo " OpenGL ................. yes (Desktop OpenGL)"
elif [ "$CFG_OPENGL" = "es2" ]; then
- echo "OpenGL support ......... yes (OpenGL ES 2.x)"
+ echo " OpenGL ................. yes (OpenGL ES 2.x)"
else
- echo "OpenGL support ......... no"
+ echo " OpenGL ................. no"
fi
-
if [ "$CFG_OPENVG" ]; then
if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
- echo "OpenVG support ......... ShivaVG"
+ echo " OpenVG ................. ShivaVG"
else
- echo "OpenVG support ......... $CFG_OPENVG"
- 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)"
-
-OPENSSL_LINKAGE=""
-if [ "$CFG_OPENSSL" = "yes" ]; then
- OPENSSL_LINKAGE="(run-time)"
-elif [ "$CFG_OPENSSL" = "linked" ]; then
- OPENSSL_LINKAGE="(linked)"
+ echo " OpenVG ................. $CFG_OPENVG"
+ fi
fi
-echo "OpenSSL support ........ $CFG_OPENSSL $OPENSSL_LINKAGE"
-echo "Alsa support ........... $CFG_ALSA"
-if [ "$BUILD_ON_MAC" = "yes" ]; then
- echo "CoreWlan support ....... $CFG_COREWLAN"
-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"
-fi
-echo "EGLFS support .......... $CFG_EGLFS"
-echo "DirectFB support ....... $CFG_DIRECTFB"
-echo "LinuxFB support ........ $CFG_LINUXFB"
-echo "KMS support ............ $CFG_KMS"
+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
diff --git a/examples/widgets/doc/orientation.qdoc b/examples/widgets/doc/orientation.qdoc
index c224f42e4b..df84595885 100644
--- a/examples/widgets/doc/orientation.qdoc
+++ b/examples/widgets/doc/orientation.qdoc
@@ -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
diff --git a/examples/widgets/doc/src/applicationicon.qdoc b/examples/widgets/doc/src/applicationicon.qdoc
index 3c01c34a66..8f9e133e9c 100644
--- a/examples/widgets/doc/src/applicationicon.qdoc
+++ b/examples/widgets/doc/src/applicationicon.qdoc
@@ -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.
diff --git a/examples/widgets/doc/src/echoplugin.qdoc b/examples/widgets/doc/src/echoplugin.qdoc
index 7b7aa9b868..2c56a2f53b 100644
--- a/examples/widgets/doc/src/echoplugin.qdoc
+++ b/examples/widgets/doc/src/echoplugin.qdoc
@@ -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.
diff --git a/examples/widgets/doc/src/elidedlabel.qdoc b/examples/widgets/doc/src/elidedlabel.qdoc
index 8020c0aa56..5a4d384de8 100644
--- a/examples/widgets/doc/src/elidedlabel.qdoc
+++ b/examples/widgets/doc/src/elidedlabel.qdoc
@@ -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
diff --git a/examples/widgets/doc/src/syntaxhighlighter.qdoc b/examples/widgets/doc/src/syntaxhighlighter.qdoc
index 3ebfcad380..6c343a47fb 100644
--- a/examples/widgets/doc/src/syntaxhighlighter.qdoc
+++ b/examples/widgets/doc/src/syntaxhighlighter.qdoc
@@ -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.
diff --git a/examples/widgets/tools/tools.pro b/examples/widgets/tools/tools.pro
index f08f7fd6d2..7178411110 100644
--- a/examples/widgets/tools/tools.pro
+++ b/examples/widgets/tools/tools.pro
@@ -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
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
index c780e2f0d5..7e78725858 100644
--- a/mkspecs/android-g++/qmake.conf
+++ b/mkspecs/android-g++/qmake.conf
@@ -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 = /
}
}
diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf
index b006992702..5e6e6f0421 100644
--- a/mkspecs/common/wince/qmake.conf
+++ b/mkspecs/common/wince/qmake.conf
@@ -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
diff --git a/mkspecs/features/cmake_functions.prf b/mkspecs/features/cmake_functions.prf
index 62634d9b88..1285990206 100644
--- a/mkspecs/features/cmake_functions.prf
+++ b/mkspecs/features/cmake_functions.prf
@@ -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, " "))
+}
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index cf0acaf4b7..a9757acd17 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -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
}
diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf
index c88fc961cf..3045a21672 100644
--- a/mkspecs/features/ctest_testcase.prf
+++ b/mkspecs/features/ctest_testcase.prf
@@ -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\"
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index d88f6e1224..a77a6bd22d 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -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]\")
diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf
index ece0e27536..f5b1639a5d 100644
--- a/mkspecs/features/mac/sdk.prf
+++ b/mkspecs/features/mac/sdk.prf
@@ -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'")
diff --git a/mkspecs/features/module.prf b/mkspecs/features/module.prf
deleted file mode 100644
index 916430d493..0000000000
--- a/mkspecs/features/module.prf
+++ /dev/null
@@ -1 +0,0 @@
-warning("CONFIG+=module is obsolete. load(qt_module) is sufficient.")
diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf
deleted file mode 100644
index 79b939a217..0000000000
--- a/mkspecs/features/qt_module_config.prf
+++ /dev/null
@@ -1,2 +0,0 @@
-warning("load(qt_module_config) is obsolete. Use load(qt_module) instead.")
-load(qt_module)
diff --git a/mkspecs/features/wayland-scanner.prf b/mkspecs/features/wayland-scanner.prf
index 90e1e0f953..2ec064f29d 100644
--- a/mkspecs/features/wayland-scanner.prf
+++ b/mkspecs/features/wayland-scanner.prf
@@ -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
diff --git a/src/3rdparty/atspi2/atspi2.pri b/src/3rdparty/atspi2/atspi2.pri
index 1b2ac51b85..5a6dc6d839 100644
--- a/src/3rdparty/atspi2/atspi2.pri
+++ b/src/3rdparty/atspi2/atspi2.pri
@@ -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
diff --git a/src/3rdparty/atspi2/xml/Bus.xml b/src/3rdparty/atspi2/xml/Bus.xml
new file mode 100644
index 0000000000..5a33e335a1
--- /dev/null
+++ b/src/3rdparty/atspi2/xml/Bus.xml
@@ -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>
+
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 37ee4ad380..53f68627bb 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -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);
}
diff --git a/src/3rdparty/sqlite/sqlite3.h b/src/3rdparty/sqlite/sqlite3.h
index 1332eb1628..69b4586a3f 100644
--- a/src/3rdparty/sqlite/sqlite3.h
+++ b/src/3rdparty/sqlite/sqlite3.h
@@ -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
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index dedfc9d417..be618934df 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -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);
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java
index b994a43ac4..6cc2f1e333 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtSurface.java
@@ -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
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 379fb5d10e..3932c9e2c7 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -85,24 +85,24 @@ 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)
+!!IF !isEmpty(CMAKE_RELEASE_TYPE)
+ set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
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}\"
+ IMPORTED_LOCATION_RELEASE \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
!!ELSE
- IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
+ IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!ENDIF
-!!IF !isEmpty(CMAKE_RELEASE_TYPE)
- set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+!!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_RELEASE \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
+ IMPORTED_LOCATION_DEBUG \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
!!ELSE
- IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
+ IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\"
!!ENDIF
)
!!ENDIF
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index f650e58c5a..c58dfdbda1 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -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();
}
}
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index e547d58c2e..ab84adacce 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -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
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index daf853b916..f2e5dc7633 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -238,7 +238,7 @@
// QWheelEvent
//#define QT_NO_WHEELEVENT
-//
+//
//#define QT_NO_XMLSTREAM
// Animation
@@ -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
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 178afb1db6..21f9c8f44f 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -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
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index 5975e01e76..5748c5437a 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -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;
diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp
index 41526d1eac..fca1a446ce 100644
--- a/src/corelib/io/qfsfileengine_win.cpp
+++ b/src/corelib/io/qfsfileengine_win.cpp
@@ -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;
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 00d20d9300..7211a730ec 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -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]);
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index fa0162be82..5a59942aad 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -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)
{
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index b5a402857c..cf0a6a55e4 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -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__ .)
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index 8594cfd40d..9292dccf19 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -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>());
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp
index f486c19fdc..ddc2be7c38 100644
--- a/src/dbus/qdbuserror.cpp
+++ b/src/dbus/qdbuserror.cpp
@@ -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
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
new file mode 100644
index 0000000000..d9313d4364
--- /dev/null
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -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
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index 4fd595ed5a..18157f8e2f 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -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
diff --git a/src/gui/accessible/qplatformaccessibility.cpp b/src/gui/accessible/qplatformaccessibility.cpp
index 2e36e5ac71..490fb7a407 100644
--- a/src/gui/accessible/qplatformaccessibility.cpp
+++ b/src/gui/accessible/qplatformaccessibility.cpp
@@ -73,6 +73,7 @@ Q_GLOBAL_STATIC(QVector<QAccessibleBridge *>, bridges)
\sa QAccessible
*/
QPlatformAccessibility::QPlatformAccessibility()
+ : m_active(false)
{
}
diff --git a/src/gui/accessible/qplatformaccessibility.h b/src/gui/accessible/qplatformaccessibility.h
index 26a22e492d..f86a9b6157 100644
--- a/src/gui/accessible/qplatformaccessibility.h
+++ b/src/gui/accessible/qplatformaccessibility.h
@@ -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
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 14c267df70..9238fd91a4 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -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
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 7287f54e74..0efb9c2646 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -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;
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index e612a2c374..5dd51843fb 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -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)
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 8823f9293d..a27dc9d16f 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -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)
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index f6de22851d..1071ed754b 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -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");
diff --git a/src/gui/image/qpixmap_blitter.cpp b/src/gui/image/qpixmap_blitter.cpp
index 75b7a4ba06..4c1b30a6d8 100644
--- a/src/gui/image/qpixmap_blitter.cpp
+++ b/src/gui/image/qpixmap_blitter.cpp
@@ -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;
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 302945dbf8..f9a017c281 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -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;
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index eb87a8c31b..91374fe2dd 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -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 \
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 432929fec5..fba516c135 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -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) {
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h
index 419fd541eb..bfdb8921af 100644
--- a/src/gui/kernel/qopenglcontext.h
+++ b/src/gui/kernel/qopenglcontext.h
@@ -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);
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index f15559981b..df3d4dfef0 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -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 &)
{
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 70de75072c..e82e30df80 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -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:
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index ddee6f05c8..b7a44b13de 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -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;
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index 9f5c789a6e..02b69bcb4d 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -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:
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h
index 0e95321102..80ba29a028 100644
--- a/src/gui/kernel/qplatformtheme.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -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
diff --git a/src/gui/kernel/qplatformtheme_p.h b/src/gui/kernel/qplatformtheme_p.h
new file mode 100644
index 0000000000..2b965819c6
--- /dev/null
+++ b/src/gui/kernel/qplatformtheme_p.h
@@ -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
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index bfb6ab5a68..1e8ac60cca 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -463,6 +463,32 @@ QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &
}
/*!
+ 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
transient window w.r.t. its parent. For example this is useful on Windows
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 7ade461890..7dfbae036f 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -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);
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 23bc165edd..30b12835f7 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -193,6 +193,15 @@ int QStyleHints::passwordMaskDelay() const
}
/*!
+ 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.
*/
qreal QStyleHints::fontSmoothingGamma() const
diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h
index 7a447aae67..64ef182aab 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -62,6 +62,7 @@ public:
int cursorFlashTime() const;
bool showIsFullScreen() const;
int passwordMaskDelay() const;
+ QChar passwordMaskCharacter() const;
qreal fontSmoothingGamma() const;
bool useRtlExtensions() const;
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 2307df37ac..8c9bc575bd 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -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"
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 1b63e185f8..9b1ed2c702 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -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)
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index e32d45acca..ea2cb722ab 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -125,6 +125,7 @@ public:
virtual QWindow *eventReceiver() { Q_Q(QWindow); return q; }
void updateVisibility();
+ void _q_clearAlert();
QWindow::SurfaceType surfaceType;
Qt::WindowFlags windowFlags;
diff --git a/src/gui/opengl/qopenglbuffer.cpp b/src/gui/opengl/qopenglbuffer.cpp
index 87cb4cd93d..d70f326415 100644
--- a/src/gui/opengl/qopenglbuffer.cpp
+++ b/src/gui/opengl/qopenglbuffer.cpp
@@ -316,6 +316,8 @@ void QOpenGLBuffer::destroy()
d->guard->free();
d->guard = 0;
}
+ delete d->funcs;
+ d->funcs = 0;
}
/*!
diff --git a/src/gui/opengl/qopenglpaintdevice.cpp b/src/gui/opengl/qopenglpaintdevice.cpp
index d55d6a91bf..f0e7e4953f 100644
--- a/src/gui/opengl/qopenglpaintdevice.cpp
+++ b/src/gui/opengl/qopenglpaintdevice.cpp
@@ -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;
diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h
index 833c5adf9f..304b944de8 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/gui/opengl/qopenglversionfunctions.h
@@ -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);
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index f67037cc39..0387f0020f 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -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);
}
/*!
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index 6ac288607d..81d2063039 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -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;
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h
index 1529b701cf..bb66f32b7f 100644
--- a/src/gui/painting/qpaintdevice.h
+++ b/src/gui/painting/qpaintdevice.h
@@ -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); }
diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc
index 7397dc7fc2..993b23850e 100644
--- a/src/gui/painting/qpaintdevice.qdoc
+++ b/src/gui/painting/qpaintdevice.qdoc
@@ -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.
+*/
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index be77fffc7c..e42b70427c 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -225,17 +225,24 @@ QTransform QPainterPrivate::viewTransform() const
return QTransform();
}
-QTransform QPainterPrivate::hidpiScaleTransform() const
+int QPainterPrivate::effectiveDevicePixelRatio() 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);
+#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
- return QTransform();
+}
+
+QTransform QPainterPrivate::hidpiScaleTransform() const
+{
+ 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());
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 36a73866e7..04772b3ec9 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -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);
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index eed64180e5..5d9a743dac 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -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;
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 1d6cf3ceca..9d603bb08d 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -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;
+ it != end; ++it) {
+ 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;
}
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 47c59fb826..1ce70c6d83 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -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_;
}
diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp
index 837850e4be..0a730abcac 100644
--- a/src/gui/text/qfontengine_qpa.cpp
+++ b/src/gui/text/qfontengine_qpa.cpp
@@ -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)
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 590b3dfc67..0ce5c8915d 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -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());
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 15880108f3..1c802cabcb 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -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;
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index a3779218d2..6a8d5c042e 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -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
diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp
index e514e34552..e5e7de0fff 100644
--- a/src/opengl/qglpixelbuffer.cpp
+++ b/src/opengl/qglpixelbuffer.cpp
@@ -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;
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index 8d6f415fba..9c28c9fa63 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -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
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 3e553acd0a..8d1c4ed064 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -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,
diff --git a/src/platformsupport/linuxaccessibility/bridge.cpp b/src/platformsupport/linuxaccessibility/bridge.cpp
index 181feeba6a..350c67f1ed 100644
--- a/src/platformsupport/linuxaccessibility/bridge.cpp
+++ b/src/platformsupport/linuxaccessibility/bridge.cpp
@@ -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);
}
diff --git a/src/platformsupport/linuxaccessibility/bridge_p.h b/src/platformsupport/linuxaccessibility/bridge_p.h
index 8a02847d3d..0e1624c522 100644
--- a/src/platformsupport/linuxaccessibility/bridge_p.h
+++ b/src/platformsupport/linuxaccessibility/bridge_p.h
@@ -76,7 +76,6 @@ private:
DeviceEventControllerAdaptor *dec;
AtSpiAdaptor *dbusAdaptor;
DBusConnection* dbusConnection;
- bool m_enabled;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection.cpp b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
index a37b99c105..18915f8e08 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection.cpp
+++ b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
@@ -48,6 +48,7 @@
#include <qdebug.h>
#include <QDBusConnectionInterface>
+#include "bus_interface.h"
QT_BEGIN_NAMESPACE
@@ -81,21 +82,24 @@ 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.";
-
- // 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)));
-}
+ OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(A11Y_SERVICE, A11Y_PATH, c, this);
+
+ // 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 {
+ QDBusConnection c = QDBusConnection::sessionBus();
+ QDBusMessage m = QDBusMessage::createMethodCall(QLatin1String("org.a11y.Bus"),
+ QLatin1String("/org/a11y/bus"),
+ QLatin1String("org.a11y.Bus"), QLatin1String("GetAddress"));
+ c.callWithCallback(m, this, SLOT(connectA11yBus(QString)), SLOT(dbusError(QDBusError)));
+ }
+ }
-void DBusConnection::dbusError(const QDBusError &error)
-{
- qWarning() << "Accessibility encountered a DBus error:" << error;
+ // connect(a11yStatus, ); QtDbus doesn't support notifications for property changes yet
}
void DBusConnection::serviceUnregistered()
@@ -103,20 +107,6 @@ void DBusConnection::serviceUnregistered()
emit enabledChanged(false);
}
-void DBusConnection::enabledStateCallback(const QDBusVariant &enabled)
-{
- m_enabled = enabled.variant().toBool();
- if (m_a11yConnection.isConnected()) {
- emit enabledChanged(m_enabled);
- } else {
- QDBusConnection c = QDBusConnection::sessionBus();
- QDBusMessage m = QDBusMessage::createMethodCall(QLatin1String("org.a11y.Bus"),
- QLatin1String("/org/a11y/bus"),
- QLatin1String("org.a11y.Bus"), QLatin1String("GetAddress"));
- c.callWithCallback(m, this, SLOT(connectA11yBus(QString)), SLOT(dbusError(QDBusError)));
- }
-}
-
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.
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection_p.h b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
index 2d55ccb547..70f6fb80ac 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection_p.h
+++ b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
@@ -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);
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 6ea68397b6..cabddcc815 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -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;
}
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index b0ac13efe4..03445776f4 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -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();
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
index 3c61a69480..1113194136 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
@@ -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;
}
diff --git a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
index 11e7b2b422..cc1db20432 100644
--- a/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
+++ b/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.h
@@ -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();
diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp
index 36d95b0816..162a8aa977 100644
--- a/src/plugins/platforms/android/src/androidjnimain.cpp
+++ b/src/plugins/platforms/android/src/androidjnimain.cpp
@@ -74,9 +74,7 @@
# include "qandroidopenglplatformwindow.h"
#endif
-#if __ANDROID_API__ > 8
-# include <android/native_window_jni.h>
-#endif
+#include <android/native_window_jni.h>
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,13 +566,19 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry);
QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry);
- if (window != 0) {
- window->lock();
- window->scheduleResize(size);
+ // 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);
- QWindowSystemInterface::handleExposeEvent(window->window(),
- QRegion(window->window()->geometry()));
- window->unlock();
+ QWindowSystemInterface::handleExposeEvent(window->window(),
+ QRegion(window->window()->geometry()));
+ window->unlock();
+ }
}
m_surfaceMutex.unlock();
@@ -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;
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp
index aa8ee57341..4d741807d0 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp
@@ -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();
}
}
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
index 15c6559157..5362906e0e 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
@@ -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()
{
- QEglFSWindow::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();
}
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h
index b835cb3246..36a110e1a8 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h
@@ -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
diff --git a/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp b/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp
index 4734d47eb3..005758d83d 100644
--- a/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp
+++ b/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp
@@ -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);
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
index cbd0f26835..3de6c47ad0 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
@@ -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
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h
index 3f8cc5a809..8da9fb2ff4 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.h
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h
@@ -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;
diff --git a/src/plugins/platforms/cocoa/main.mm b/src/plugins/platforms/cocoa/main.mm
index 0eb4edef72..6adcb27817 100644
--- a/src/plugins/platforms/cocoa/main.mm
+++ b/src/plugins/platforms/cocoa/main.mm
@@ -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;
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 34192e85b0..25780e79f4 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -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;
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 1d6797e51a..f7c945c50d 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -151,6 +151,7 @@
[kids addObject: element];
[element release];
}
+ // ### maybe we should use NSAccessibilityUnignoredChildren(kids); this needs more profiling
return kids;
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
@@ -256,7 +257,7 @@
// misc
- (BOOL)accessibilityIsIgnored {
- return false; //QCocoaAccessible::shouldBeIgnored(QAccessible::accessibleInterface(id));
+ return QCocoaAccessible::shouldBeIgnored(QAccessible::accessibleInterface(axid));
}
- (id)accessibilityHitTest:(NSPoint)point {
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index 5c487b0bdd..2ac9a5dac9 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -741,11 +741,14 @@ void QCocoaEventDispatcherPrivate::endModalSession(QWindow *window)
// when we stop the _current_ modal session (which is the session on top of
// the stack, and might not belong to 'window').
int stackSize = cocoaModalSessionStack.size();
+ int endedSessions = 0;
for (int i=stackSize-1; i>=0; --i) {
QCocoaModalSessionInfo &info = cocoaModalSessionStack[i];
+ if (!info.window)
+ endedSessions++;
if (info.window == window) {
info.window = 0;
- if (i == stackSize-1) {
+ if (i + endedSessions == stackSize-1) {
// The top sessions ended. Interrupt the event dispatcher to
// start spinning the correct session immediately. Like in
// beginModalSession(), we call interrupt() before clearing
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 7093d27efe..071edb5b60 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -61,6 +61,8 @@
#include <stdlib.h>
#include <qabstracteventdispatcher.h>
#include "qcocoaautoreleasepool.h"
+#include <QFileSystemWatcher>
+#include <QDir>
#include <qpa/qplatformnativeinterface.h>
@@ -72,6 +74,30 @@ QT_FORWARD_DECLARE_CLASS(QFileInfo)
QT_FORWARD_DECLARE_CLASS(QWindow)
QT_USE_NAMESPACE
+class CachedEntries: public QObject {
+public:
+ CachedEntries(QDir::Filters filters) : mFilters(filters) {
+ QObject::connect(&mFSWatcher, &QFileSystemWatcher::directoryChanged, this, &CachedEntries::updateDirCache);
+ }
+ QString directory() const {
+ const QStringList &dirs = mFSWatcher.directories();
+ return (dirs.count() ? dirs[0] : QString());
+ }
+ QStringList entries() const {
+ return mQDirFilterEntryList;
+ }
+ void updateDirCache(const QString &path) {
+ mFSWatcher.removePaths(mFSWatcher.directories());
+ mFSWatcher.addPath(path);
+ mQDirFilterEntryList = QDir(path).entryList(mFilters);
+ }
+
+private:
+ QFileSystemWatcher mFSWatcher;
+ QStringList mQDirFilterEntryList;
+ QDir::Filters mFilters;
+};
+
typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
@class QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate);
@@ -91,9 +117,8 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
int mReturnCode;
SharedPointerFileDialogOptions mOptions;
- QString *mLastFilterCheckPath;
+ CachedEntries *mCachedEntries;
QString *mCurrentSelection;
- QStringList *mQDirFilterEntryList;
QStringList *mNameFilterDropDownList;
QStringList *mSelectedNameFilter;
}
@@ -137,8 +162,7 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
[mSavePanel setDelegate:self];
mReturnCode = -1;
mHelper = helper;
- mLastFilterCheckPath = new QString;
- mQDirFilterEntryList = new QStringList;
+ mCachedEntries = new CachedEntries(mOptions->filter());
mNameFilterDropDownList = new QStringList(mOptions->nameFilters());
QString selectedVisualNameFilter = mOptions->initiallySelectedNameFilter();
mSelectedNameFilter = new QStringList([self findStrippedFilterWithVisualFilterName:selectedVisualNameFilter]);
@@ -171,8 +195,7 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
- (void)dealloc
{
- delete mLastFilterCheckPath;
- delete mQDirFilterEntryList;
+ delete mCachedEntries;
delete mNameFilterDropDownList;
delete mSelectedNameFilter;
delete mCurrentSelection;
@@ -303,12 +326,11 @@ static QString strippedText(QString s)
QString qtFileName = QT_PREPEND_NAMESPACE(QCFString::toQString)(filename);
QFileInfo info(qtFileName.normalized(QT_PREPEND_NAMESPACE(QString::NormalizationForm_C)));
QString path = info.absolutePath();
- if (path != *mLastFilterCheckPath){
- *mLastFilterCheckPath = path;
- *mQDirFilterEntryList = info.dir().entryList(mOptions->filter());
+ if (mCachedEntries->directory() != path) {
+ mCachedEntries->updateDirCache(path);
}
// Check if the QDir filter accepts the file:
- if (!mQDirFilterEntryList->contains(info.fileName()))
+ if (!mCachedEntries->entries().contains(info.fileName()))
return NO;
// No filter means accept everything
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index e2d867e623..821e10de52 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -122,7 +122,9 @@ void QCocoaScreen::updateGeometry()
m_physicalSize = QSizeF(size.width, size.height);
m_logicalDpi.first = 72;
m_logicalDpi.second = 72;
- float refresh = CGDisplayModeGetRefreshRate(CGDisplayCopyDisplayMode(dpy));
+ CGDisplayModeRef displayMode = CGDisplayCopyDisplayMode(dpy);
+ float refresh = CGDisplayModeGetRefreshRate(displayMode);
+ CGDisplayModeRelease(displayMode);
if (refresh > 0)
m_refreshRate = refresh;
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 0fe4c48510..bde9ded14f 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -97,7 +97,6 @@ static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader()
if (![menuItem tag])
return YES;
-
QCocoaMenuItem* cocoaItem = reinterpret_cast<QCocoaMenuItem *>([menuItem tag]);
return cocoaItem->isEnabled();
}
@@ -308,13 +307,54 @@ void QCocoaMenu::setVisible(bool visible)
void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatformMenuItem *item)
{
+ QCocoaAutoReleasePool pool;
+
QCocoaWindow *cocoaWindow = parentWindow ? static_cast<QCocoaWindow *>(parentWindow->handle()) : 0;
NSView *view = cocoaWindow ? cocoaWindow->contentView() : nil;
NSMenuItem *nsItem = item ? ((QCocoaMenuItem *)item)->nsItem() : nil;
- NSPoint nsPos = NSMakePoint(pos.x(), pos.y());
- [m_nativeMenu popUpMenuPositioningItem:nsItem atLocation:nsPos inView:view];
- // The call above blocks, and also swallows any mouse release event,
+ // Ideally, we would call -popUpMenuPositioningItem:atLocation:inView:.
+ // However, this showed not to work with modal windows where the menu items
+ // would appear disabled. So, we resort to a more artisanal solution. Note
+ // that this implies several things.
+ if (nsItem) {
+ // If we want to position the menu popup so that a specific item lies under
+ // the mouse cursor, we resort to NSPopUpButtonCell to do that. This is the
+ // typical use-case for a choice list, or non-editable combobox. We can't
+ // re-use the popUpContextMenu:withEvent:forView: logic below since it won't
+ // respect the menu's minimum width.
+ NSPopUpButtonCell *popupCell = [[[NSPopUpButtonCell alloc] initTextCell:@"" pullsDown:NO]
+ autorelease];
+ [popupCell setAltersStateOfSelectedItem:NO];
+ [popupCell setTransparent:YES];
+ [popupCell setMenu:m_nativeMenu];
+ [popupCell selectItem:nsItem];
+ NSRect cellFrame = NSMakeRect(pos.x(), pos.y(), m_nativeMenu.minimumWidth, 10);
+ [popupCell performClickWithFrame:cellFrame inView:view];
+ } else {
+ // Else, we need to transform 'pos' to window or screen coordinates.
+ NSPoint nsPos = NSMakePoint(pos.x() - 1, pos.y());
+ if (view) {
+ nsPos.y = view.frame.size.height - nsPos.y;
+ } else if (!QGuiApplication::screens().isEmpty()) {
+ QScreen *screen = QGuiApplication::screens().at(0);
+ nsPos.y = screen->availableVirtualSize().height() - nsPos.y;
+ }
+
+ // Finally, we need to synthesize an event.
+ NSEvent *menuEvent = [NSEvent mouseEventWithType:NSRightMouseDown
+ location:nsPos
+ modifierFlags:0
+ timestamp:0
+ windowNumber:view ? view.window.windowNumber : 0
+ context:nil
+ eventNumber:0
+ clickCount:1
+ pressure:1.0];
+ [NSMenu popUpContextMenu:m_nativeMenu withEvent:menuEvent forView:view];
+ }
+
+ // The calls above block, and also swallow any mouse release event,
// so we need to clear any mouse button that triggered the menu popup.
if ([view isKindOfClass:[QNSView class]])
[(QNSView *)view resetMouseButtons];
@@ -356,6 +396,8 @@ QList<QCocoaMenuItem *> QCocoaMenu::merged() const
void QCocoaMenu::syncModalState(bool modal)
{
+ QCocoaAutoReleasePool pool;
+
if (!m_enabled)
modal = true;
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index c0c8caed05..b880db16a2 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -114,6 +114,8 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor
void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu)
{
+ QCocoaAutoReleasePool pool;
+
QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu);
if (!m_menus.contains(menu)) {
qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar";
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index dd99a6f3bc..350ef8a16a 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -218,8 +218,6 @@ NSMenuItem *QCocoaMenuItem::sync()
mergeItem = [loader aboutMenuItem];
else
mergeItem = [loader aboutQtMenuItem];
-
- m_merged = true;
} else if (m_text.startsWith(tr("Config"), Qt::CaseInsensitive)
|| m_text.startsWith(tr("Preference"), Qt::CaseInsensitive)
|| m_text.startsWith(tr("Options"), Qt::CaseInsensitive)
@@ -240,9 +238,9 @@ NSMenuItem *QCocoaMenuItem::sync()
if (mergeItem) {
m_merged = true;
+ [mergeItem retain];
[m_native release];
m_native = mergeItem;
- [m_native retain]; // balance out release!
[m_native setTag:reinterpret_cast<NSInteger>(this)];
} else if (m_merged) {
// was previously merged, but no longer
@@ -256,13 +254,12 @@ NSMenuItem *QCocoaMenuItem::sync()
m_native = [[NSMenuItem alloc] initWithTitle:QCFString::toNSString(m_text)
action:nil
keyEquivalent:@""];
- [m_native retain];
[m_native setTag:reinterpret_cast<NSInteger>(this)];
}
// [m_native setHidden:YES];
// [m_native setHidden:NO];
- [m_native setHidden: !m_isVisible];
+ [m_native setHidden: !m_isVisible];
[m_native setEnabled: m_enabled];
QString text = m_text;
QKeySequence accel = m_shortcut;
diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
index f0f1f56d90..84261ad273 100644
--- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
+++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm
@@ -85,10 +85,8 @@ void *QCocoaNativeInterface::nativeResourceForContext(const QByteArray &resource
void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
{
- if (!window->handle()) {
- qWarning("QCocoaNativeInterface::nativeResourceForWindow: Native window has not been created.");
+ if (!window->handle())
return 0;
- }
if (resourceString == "nsopenglcontext") {
return static_cast<QCocoaWindow *>(window->handle())->currentContext()->nsOpenGLContext();
@@ -228,6 +226,11 @@ void QCocoaNativeInterface::setWindowContentView(QPlatformWindow *window, void *
void QCocoaNativeInterface::registerTouchWindow(QWindow *window, bool enable)
{
+ // Make sure the QCocoaWindow is created when enabling. Disabling might
+ // happen on window destruction, don't (re)create the QCocoaWindow then.
+ if (enable)
+ window->create();
+
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
if (cocoaWindow)
cocoaWindow->registerTouch(enable);
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index e613dbbd1b..af817bd4c5 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -176,7 +176,7 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
QHash<QPlatformTheme::Palette, QPalette*> palettes;
QColor qc;
for (int i = 0; mac_widget_colors[i].paletteRole != QPlatformTheme::NPalettes; i++) {
- QPalette pal = *qt_mac_createSystemPalette();
+ QPalette &pal = *qt_mac_createSystemPalette();
if (mac_widget_colors[i].active != 0) {
qc = qt_mac_colorForThemeTextColor(mac_widget_colors[i].active);
pal.setColor(QPalette::Active, QPalette::Text, qc);
@@ -223,7 +223,7 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
pal.setBrush(QPalette::Disabled, QPalette::Base,
pal.brush(QPalette::Active, QPalette::Base));
}
- palettes.insert(mac_widget_colors[i].paletteRole, new QPalette(pal));
+ palettes.insert(mac_widget_colors[i].paletteRole, &pal);
}
return palettes;
}
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index f8eed0ebf1..8337e00eb6 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -290,6 +290,8 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const
sizes << 16 << 32 << 64 << 128;
return QVariant::fromValue(sizes);
}
+ case QPlatformTheme::PasswordMaskDelay:
+ return QVariant(QChar(kBulletUnicode));
default:
break;
}
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4e567c6c63..5ff1bf83ae 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -283,6 +283,10 @@ void QCocoaWindow::setVisible(bool visible)
parentCocoaWindow->m_activePopupWindow = window();
// QTBUG-30266: a window should not be resizable while a transient popup is open
// Since this isn't a native popup, the window manager doesn't close the popup when you click outside
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7
+ && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask))
+#endif
[parentCocoaWindow->m_nsWindow setStyleMask:
(parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags) & ~NSResizableWindowMask)];
}
@@ -346,7 +350,12 @@ void QCocoaWindow::setVisible(bool visible)
} else {
[m_contentView setHidden:YES];
}
- if (parentCocoaWindow && window()->type() == Qt::Popup)
+ if (parentCocoaWindow && window()->type() == Qt::Popup
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ && QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7
+ && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask)
+#endif
+ )
// QTBUG-30266: a window should not be resizable while a transient popup is open
[parentCocoaWindow->m_nsWindow setStyleMask:parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags)];
}
@@ -471,6 +480,8 @@ void QCocoaWindow::setWindowIcon(const QIcon &icon)
NSButton *iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];
if (iconButton == nil) {
+ if (icon.isNull())
+ return;
NSString *title = QCFString::toNSString(window()->title());
[m_nsWindow setRepresentedURL:[NSURL fileURLWithPath:title]];
iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton];
@@ -852,7 +863,7 @@ void QCocoaWindow::syncWindowState(Qt::WindowState newState)
// if content view width or height is 0 then the window animations will crash so
// do nothing except set the new state
NSRect contentRect = [contentView() frame];
- if (contentRect.size.width <= 0 || contentRect.size.height <= 0) {
+ if (contentRect.size.width < 0 || contentRect.size.height < 0) {
qWarning() << Q_FUNC_INFO << "invalid window content view size, check your window geometry";
m_synchedWindowState = newState;
return;
@@ -905,7 +916,7 @@ QCocoaMenuBar *QCocoaWindow::menubar() const
void QCocoaWindow::registerTouch(bool enable)
{
m_registerTouchCount += enable ? 1 : -1;
- if (m_registerTouchCount == 1)
+ if (enable && m_registerTouchCount == 1)
[m_contentView setAcceptsTouchEvents:YES];
else if (m_registerTouchCount == 0)
[m_contentView setAcceptsTouchEvents:NO];
diff --git a/src/plugins/platforms/cocoa/qmacmime.mm b/src/plugins/platforms/cocoa/qmacmime.mm
index 89539de331..51c39357ea 100644
--- a/src/plugins/platforms/cocoa/qmacmime.mm
+++ b/src/plugins/platforms/cocoa/qmacmime.mm
@@ -553,10 +553,8 @@ QVariant QMacPasteboardMimeTiff::convertToMime(const QString &mime, QList<QByteA
a.size(), kCFAllocatorNull);
QCFType<CGImageSourceRef> imageSource = CGImageSourceCreateWithData(tiffData, 0);
image = CGImageSourceCreateImageAtIndex(imageSource, 0, 0);
-
- // ### TODO (msorvig) QPixmap conversion
- //if (image != 0)
- // ret = QVariant(QPixmap::fromMacCGImageRef(image).toImage());
+ if (image != 0)
+ ret = QVariant(qt_mac_toQImage(image));
return ret;
}
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index e7ea3d8f8d..68145ec914 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -63,7 +63,6 @@ QT_END_NAMESPACE
QWindow *m_window;
QCocoaWindow *m_platformWindow;
Qt::MouseButtons m_buttons;
- QAccessibleInterface *m_accessibleRoot;
QString m_composingText;
bool m_sendKeyEvent;
QStringList *currentCustomDragTypes;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 568cc4bebf..52e2d781ee 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -121,7 +121,6 @@ static QTouchDevice *touchDevice = 0;
m_window = window;
m_platformWindow = platformWindow;
- m_accessibleRoot = 0;
m_sendKeyEvent = false;
#ifdef QT_COCOA_ENABLE_ACCESSIBILITY_INSPECTOR
@@ -130,15 +129,13 @@ static QTouchDevice *touchDevice = 0;
static bool skipAccessibilityForInspectorWindows = false;
if (!skipAccessibilityForInspectorWindows) {
- m_accessibleRoot = window->accessibleRoot();
+ // m_accessibleRoot = window->accessibleRoot();
AccessibilityInspector *inspector = new AccessibilityInspector(window);
skipAccessibilityForInspectorWindows = true;
inspector->inspectWindow(window);
skipAccessibilityForInspectorWindows = false;
}
-#else
- m_accessibleRoot = window->accessibleRoot();
#endif
[self registerDragTypes];
diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
index e3b8cf6532..c43c0b5068 100644
--- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
@@ -45,6 +45,7 @@
#include "qcocoahelpers.h"
#include "qcocoaaccessibility.h"
#include "qcocoaaccessibilityelement.h"
+#include <qpa/qplatformintegration.h>
#include <QtGui/private/qaccessible2_p.h>
#include <QtCore/QDebug>
@@ -60,22 +61,26 @@
}
- (id)accessibilityAttributeValue:(NSString *)attribute {
+
+ // activate accessibility updates
+ QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true);
+
if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) {
- if (m_accessibleRoot)
- return QCocoaAccessible::macRole(m_accessibleRoot);
+ if (m_window->accessibleRoot())
+ return QCocoaAccessible::macRole(m_window->accessibleRoot());
return NSAccessibilityUnknownRole;
} else if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
return NSAccessibilityRoleDescriptionForUIElement(self);
} else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
- if (!m_accessibleRoot)
+ if (!m_window->accessibleRoot())
return [super accessibilityAttributeValue:attribute];
// Create QCocoaAccessibleElements for each child if the
// root accessible interface.
- int numKids = m_accessibleRoot->childCount();
+ int numKids = m_window->accessibleRoot()->childCount();
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
- QAccessibleInterface *child = m_accessibleRoot->child(i);
+ QAccessibleInterface *child = m_window->accessibleRoot()->child(i);
Q_ASSERT(child);
QAccessible::Id childAxid = QAccessible::uniqueId(child);
QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithId:childAxid parent:self];
@@ -90,10 +95,10 @@
}
- (id)accessibilityHitTest:(NSPoint)point {
- if (!m_accessibleRoot)
+ if (!m_window->accessibleRoot())
return [super accessibilityHitTest:point];
- QAccessibleInterface *childInterface = m_accessibleRoot->childAt(point.x, qt_mac_flipYCoordinate(point.y));
+ QAccessibleInterface *childInterface = m_window->accessibleRoot()->childAt(point.x, qt_mac_flipYCoordinate(point.y));
// No child found, meaning we hit the NSView
if (!childInterface) {
return [super accessibilityHitTest:point];
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index 4748005f1a..2dedf99582 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -364,6 +364,9 @@ int QMacPrintEngine::metric(QPaintDevice::PaintDeviceMetric m) const
case QPaintDevice::PdmDepth:
val = 24;
break;
+ case QPaintDevice::PdmDevicePixelRatio:
+ val = 1;
+ break;
default:
val = 0;
qWarning("QPrinter::metric: Invalid metric command");
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 64e11b4e07..615b69f7d9 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -145,7 +145,8 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons
QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const
{
- QPlatformWindow *w = new QEglFSWindow(window);
+ QEglFSWindow *w = new QEglFSWindow(window);
+ w->create();
w->requestActivateWindow();
return w;
}
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 68cef6253e..ebf8e4af85 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -59,10 +59,6 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_winid));
#endif
-
- setWindowState(Qt::WindowFullScreen);
-
- create();
}
QEglFSWindow::~QEglFSWindow()
@@ -72,6 +68,8 @@ QEglFSWindow::~QEglFSWindow()
void QEglFSWindow::create()
{
+ setWindowState(Qt::WindowFullScreen);
+
if (m_window)
return;
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h
index a351b4a6f4..67a64973ce 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.h
+++ b/src/plugins/platforms/eglfs/qeglfswindow.h
@@ -68,10 +68,12 @@ public:
virtual void invalidateSurface();
virtual void resetSurface();
-private:
- WId m_winid;
+protected:
EGLSurface m_surface;
EGLNativeWindowType m_window;
+
+private:
+ WId m_winid;
EGLConfig m_config;
QSurfaceFormat m_format;
};
diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.h b/src/plugins/platforms/ios/qiosapplicationdelegate.h
index 442b37f1b3..3d3ba58049 100644
--- a/src/plugins/platforms/ios/qiosapplicationdelegate.h
+++ b/src/plugins/platforms/ios/qiosapplicationdelegate.h
@@ -42,9 +42,12 @@
#import <UIKit/UIKit.h>
#import <QtGui/QtGui>
+#import "qiosviewcontroller.h"
+
@interface QIOSApplicationDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
+@property (strong, nonatomic) QIOSViewController *qiosViewController;
@end
diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.mm b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
index 41a3fff84f..10cbe529c4 100644
--- a/src/plugins/platforms/ios/qiosapplicationdelegate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
@@ -46,6 +46,7 @@
@implementation QIOSApplicationDelegate
@synthesize window;
+@synthesize qiosViewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
@@ -85,6 +86,7 @@
- (void)dealloc
{
+ [qiosViewController release];
[window release];
[super dealloc];
}
diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm
index 566ff3a672..f3c1af2b2d 100644
--- a/src/plugins/platforms/ios/qiosbackingstore.mm
+++ b/src/plugins/platforms/ios/qiosbackingstore.mm
@@ -52,7 +52,11 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window)
, m_context(new QOpenGLContext)
, m_device(0)
{
- m_context->setFormat(window->requestedFormat());
+ QSurfaceFormat fmt = window->requestedFormat();
+ fmt.setDepthBufferSize(16);
+ fmt.setStencilBufferSize(8);
+
+ m_context->setFormat(fmt);
m_context->setScreen(window->screen());
m_context->create();
}
diff --git a/src/plugins/platforms/ios/qiosglobal.h b/src/plugins/platforms/ios/qiosglobal.h
index 3be9f8bb21..fd328c9171 100644
--- a/src/plugins/platforms/ios/qiosglobal.h
+++ b/src/plugins/platforms/ios/qiosglobal.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
class QPlatformScreen;
bool isQtApplication();
-QIOSViewController *rootViewController();
+QIOSViewController *qiosViewController();
CGRect toCGRect(const QRect &rect);
QRect fromCGRect(const CGRect &rect);
diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm
index 5860078372..d26eca54e5 100644
--- a/src/plugins/platforms/ios/qiosglobal.mm
+++ b/src/plugins/platforms/ios/qiosglobal.mm
@@ -58,10 +58,14 @@ bool isQtApplication()
return isQt;
}
-QIOSViewController *rootViewController()
+QIOSViewController *qiosViewController()
{
+ // If Qt controls the application, we have created a root view controller were we place top-level
+ // QWindows. Note that in a mixed native application, our view controller might later be removed or
+ // added as a child of another controller. To protect against that, we keep an explicit pointer to the
+ // view controller in cases where this is the controller we need to access.
static QIOSViewController *c = isQtApplication() ?
- static_cast<QIOSViewController *>([UIApplication sharedApplication].delegate.window.rootViewController) : nil;
+ static_cast<QIOSApplicationDelegate *>([UIApplication sharedApplication].delegate).qiosViewController : nil;
return c;
}
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index d86ed5f090..b73f9c3cbc 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -142,7 +142,7 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex)
if (isQtApplication()) {
// When in a non-mixed environment, let QScreen follow the current interface orientation:
- setPrimaryOrientation(toQtScreenOrientation(UIDeviceOrientation(rootViewController().interfaceOrientation)));
+ setPrimaryOrientation(toQtScreenOrientation(UIDeviceOrientation(qiosViewController().interfaceOrientation)));
}
[pool release];
diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm
index d7a2fa1a75..5edf81af93 100644
--- a/src/plugins/platforms/ios/qioswindow.mm
+++ b/src/plugins/platforms/ios/qioswindow.mm
@@ -375,7 +375,7 @@ void QIOSWindow::setVisible(bool visible)
requestActivateWindow();
} else {
// Activate top-most visible QWindow:
- NSArray *subviews = rootViewController().view.subviews;
+ NSArray *subviews = qiosViewController().view.subviews;
for (int i = int(subviews.count) - 1; i >= 0; --i) {
UIView *view = [subviews objectAtIndex:i];
if (!view.hidden) {
@@ -431,7 +431,7 @@ void QIOSWindow::setParent(const QPlatformWindow *parentWindow)
UIView *parentView = reinterpret_cast<UIView *>(parentWindow->winId());
[parentView addSubview:m_view];
} else if (isQtApplication()) {
- [rootViewController().view addSubview:m_view];
+ [qiosViewController().view addSubview:m_view];
}
}
diff --git a/src/plugins/platforms/ios/qtmain.mm b/src/plugins/platforms/ios/qtmain.mm
index 916224f936..19c98f2c59 100644
--- a/src/plugins/platforms/ios/qtmain.mm
+++ b/src/plugins/platforms/ios/qtmain.mm
@@ -56,7 +56,8 @@ extern int qt_main(int argc, char *argv[]);
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- self.window.rootViewController = [[[QIOSViewController alloc] init] autorelease];
+ self.qiosViewController = [[[QIOSViewController alloc] init] autorelease];
+ self.window.rootViewController = self.qiosViewController;
#ifdef QT_DEBUG
self.window.backgroundColor = [UIColor cyanColor];
diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.h b/src/plugins/platforms/offscreen/qoffscreencommon.h
index a5df7d05d3..28546aed88 100644
--- a/src/plugins/platforms/offscreen/qoffscreencommon.h
+++ b/src/plugins/platforms/offscreen/qoffscreencommon.h
@@ -73,12 +73,14 @@ public:
QScopedPointer<QPlatformCursor> m_cursor;
};
+#ifndef QT_NO_DRAGANDDROP
class QOffscreenDrag : public QPlatformDrag
{
public:
QMimeData *platformDropData() { return 0; }
Qt::DropAction drag(QDrag *) { return Qt::IgnoreAction; }
};
+#endif
class QOffscreenBackingStore : public QPlatformBackingStore
{
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
index e3fcc7ebb0..5b74ad3b8d 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
@@ -106,7 +106,9 @@ QOffscreenIntegration::QOffscreenIntegration()
m_fontDatabase.reset(new QBasicFontDatabase());
#endif
+#ifndef QT_NO_DRAGANDDROP
m_drag.reset(new QOffscreenDrag);
+#endif
m_services.reset(new QPlatformServices);
QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
@@ -149,10 +151,12 @@ QPlatformFontDatabase *QOffscreenIntegration::fontDatabase() const
return m_fontDatabase.data();
}
+#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *QOffscreenIntegration::drag() const
{
return m_drag.data();
}
+#endif
QPlatformServices *QOffscreenIntegration::services() const
{
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.h b/src/plugins/platforms/offscreen/qoffscreenintegration.h
index eb03100ec9..b403ce83b3 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.h
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.h
@@ -60,7 +60,9 @@ public:
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
+#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *drag() const;
+#endif
QPlatformServices *services() const;
QPlatformFontDatabase *fontDatabase() const;
@@ -71,7 +73,9 @@ public:
private:
QAbstractEventDispatcher *m_eventDispatcher;
QScopedPointer<QPlatformFontDatabase> m_fontDatabase;
+#ifndef QT_NO_DRAGANDDROP
QScopedPointer<QPlatformDrag> m_drag;
+#endif
QScopedPointer<QPlatformServices> m_services;
};
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index f1bebee9b2..a351ec865a 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -172,6 +172,7 @@ void QQnxWindow::setGeometry(const QRect &rect)
{
const QRect oldGeometry = setGeometryHelper(rect);
+#if !defined(QT_NO_OPENGL)
// If this is an OpenGL window we need to request that the GL context updates
// the EGLsurface on which it is rendering. The surface will be recreated the
// next time QQnxGLContext::makeCurrent() is called.
@@ -184,6 +185,7 @@ void QQnxWindow::setGeometry(const QRect &rect)
if (m_platformOpenGLContext != 0 && bufferSize() != rect.size())
m_platformOpenGLContext->requestSurfaceChange();
}
+#endif
// Send a geometry change event to Qt (triggers resizeEvent() in QWindow/QWidget).
@@ -353,13 +355,12 @@ void QQnxWindow::setBufferSize(const QSize &size)
// Create window buffers if they do not exist
if (m_bufferSize.isEmpty()) {
+ val[0] = m_screen->nativeFormat();
#if !defined(QT_NO_OPENGL)
// Get pixel format from EGL config if using OpenGL;
// otherwise inherit pixel format of window's screen
if (m_platformOpenGLContext != 0) {
val[0] = platformWindowFormatToNativeFormat(m_platformOpenGLContext->format());
- } else {
- val[0] = m_screen->nativeFormat();
}
#endif
diff --git a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
index f222deeeac..63b4370dc2 100644
--- a/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
+++ b/src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
@@ -52,7 +52,9 @@
#include <QtCore/qsettings.h>
#include <QtGui/qaccessible.h>
#include <QtGui/private/qaccessible2_p.h>
+#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformintegration.h>
#include <QtGui/qwindow.h>
#include <QtGui/qguiapplication.h>
@@ -245,6 +247,8 @@ bool QWindowsAccessibility::handleAccessibleObjectFromWindowRequest(HWND hwnd, W
if (static_cast<long>(lParam) == static_cast<long>(UiaRootObjectId)) {
/* For UI Automation */
} else if ((DWORD)lParam == DWORD(OBJID_CLIENT)) {
+ // Start handling accessibility internally
+ QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true);
#if 1
// Ignoring all requests while starting up
// ### Maybe QPA takes care of this???
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index b40aefa225..dfbbe3069c 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -146,7 +146,7 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
#endif
QImage::Format format = QWindowsNativeImage::systemFormat();
if (format == QImage::Format_RGB32 && rasterWindow()->window()->format().hasAlpha())
- format = QImage::Format_ARGB32;
+ format = QImage::Format_ARGB32_Premultiplied;
m_image.reset(new QWindowsNativeImage(size.width(), size.height(), format));
}
}
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp
index b66a16ae58..cf6cb199c7 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.cpp
+++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp
@@ -178,6 +178,20 @@ void QWindowsClipboard::unregisterViewer()
}
}
+static bool isProcessBeingDebugged(HWND hwnd)
+{
+ DWORD pid = 0;
+ if (!GetWindowThreadProcessId(hwnd, &pid) || !pid)
+ return false;
+ const HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
+ if (!processHandle)
+ return false;
+ BOOL debugged = FALSE;
+ CheckRemoteDebuggerPresent(processHandle, &debugged);
+ CloseHandle(processHandle);
+ return debugged != FALSE;
+}
+
void QWindowsClipboard::propagateClipboardMessage(UINT message, WPARAM wParam, LPARAM lParam) const
{
if (!m_nextClipboardViewer)
@@ -189,6 +203,12 @@ void QWindowsClipboard::propagateClipboardMessage(UINT message, WPARAM wParam, L
qWarning("%s: Cowardly refusing to send clipboard message to hung application...", Q_FUNC_INFO);
return;
}
+ // Also refuse if the process is being debugged, specifically, if it is
+ // displaying a runtime assert, which is not caught by isHungAppWindow().
+ if (isProcessBeingDebugged(m_nextClipboardViewer)) {
+ qWarning("%s: Cowardly refusing to send clipboard message to application under debugger...", Q_FUNC_INFO);
+ return;
+ }
SendMessage(m_nextClipboardViewer, message, wParam, lParam);
}
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 5fa954cb12..7fedc27951 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -1173,7 +1173,7 @@ QFontEngine *QWindowsFontDatabase::fontEngine(const QByteArray &fontData, qreal
fontFile->Release();
fontEngine = new QWindowsFontEngineDirectWrite(directWriteFontFace, pixelSize,
- m_fontEngineData);
+ sharedFontData());
// Get font family from font data
fontEngine->fontDef.family = font.familyName();
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index 5b6ce695d8..c0f1b3a000 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -220,6 +220,7 @@ QWindowsFontEngineDirectWrite::QWindowsFontEngineDirectWrite(IDWriteFontFace *di
fontDef.pixelSize = pixelSize;
collectMetrics();
+ cache_cost = (m_ascent.toInt() + m_descent.toInt()) * m_xHeight.toInt() * 2000;
}
QWindowsFontEngineDirectWrite::~QWindowsFontEngineDirectWrite()
@@ -740,6 +741,8 @@ void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
if (familyNames != NULL)
familyNames->Release();
+ if (fontFamily)
+ fontFamily->Release();
if (FAILED(hr))
qErrnoWarning(hr, "initFontInfo: Failed to get family name");
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index da3e2a6a6a..ae66ef8a3d 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -1052,8 +1052,16 @@ bool QWindowsGLContext::makeCurrent(QPlatformSurface *surface)
// Do we already have a DC entry for that window?
QWindowsWindow *window = static_cast<QWindowsWindow *>(surface);
const HWND hwnd = window->handle();
- if (const QOpenGLContextData *contextData = findByHWND(m_windowContexts, hwnd))
+ if (const QOpenGLContextData *contextData = findByHWND(m_windowContexts, hwnd)) {
+ // Repeated calls to wglMakeCurrent when vsync is enabled in the driver will
+ // often result in 100% cpuload. This check is cheap and avoids the problem.
+ // This is reproducable on NVidia cards and Intel onboard chips.
+ if (wglGetCurrentContext() == contextData->renderingContext
+ && wglGetCurrentDC() == contextData->hdc) {
+ return true;
+ }
return wglMakeCurrent(contextData->hdc, contextData->renderingContext);
+ }
// Create a new entry.
const QOpenGLContextData newContext(m_renderingContext, hwnd, GetDC(hwnd));
if (!newContext.hdc)
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 03e4925c3b..73df3ec032 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -113,6 +113,8 @@ public:
Q_INVOKABLE QString registerWindowClass(const QString &classNameIn, void *eventProc) const;
+ Q_INVOKABLE void beep() { MessageBeep(MB_OK); } // For QApplication
+
bool asyncExpose() const;
void setAsyncExpose(bool value);
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 9b2b67619d..2a5e08cf41 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1802,6 +1802,19 @@ QWindowsWindow *QWindowsWindow::childAt(const QPoint &clientPoint, unsigned cwex
}
#ifndef Q_OS_WINCE
+void QWindowsWindow::setAlertState(bool enabled)
+{
+ if (isAlertState() == enabled)
+ return;
+ if (enabled) {
+ alertWindow(0);
+ setFlag(AlertState);
+ } else {
+ stopAlertWindow();
+ clearFlag(AlertState);
+ }
+}
+
void QWindowsWindow::alertWindow(int durationMs)
{
DWORD timeOutMs = GetCaretBlinkTime();
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 1148440f05..2117ca50b8 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -132,7 +132,8 @@ public:
SynchronousGeometryChangeEvent = 0x400,
WithinSetStyle = 0x800,
WithinDestroy = 0x1000,
- TouchRegistered = 0x2000
+ TouchRegistered = 0x2000,
+ AlertState = 0x4000
};
struct WindowData
@@ -255,6 +256,8 @@ public:
void setWindowIcon(const QIcon &icon);
#ifndef Q_OS_WINCE
+ void setAlertState(bool enabled);
+ bool isAlertState() const { return testFlag(AlertState); }
void alertWindow(int durationMs = 0);
void stopAlertWindow();
#endif
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 08e72ed5ce..6241898462 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -57,6 +57,10 @@
#include "qglxintegration.h"
#endif
+#ifndef XCB_USE_XLIB
+# include <stdio.h>
+#endif
+
QT_BEGIN_NAMESPACE
class QXcbResourceMap : public QMap<QByteArray, QXcbNativeInterface::ResourceType>
@@ -84,6 +88,16 @@ QXcbNativeInterface::QXcbNativeInterface() :
{
}
+void QXcbNativeInterface::beep() // For QApplication::beep()
+{
+#ifdef XCB_USE_XLIB
+ ::Display *display = (::Display *)nativeResourceForScreen(QByteArrayLiteral("display"), QGuiApplication::primaryScreen());
+ XBell(display, 0);
+#else
+ fputc(7, stdout);
+#endif
+}
+
void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceString, QOpenGLContext *context)
{
QByteArray lowerCaseResource = resourceString.toLower();
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index 75d42ac6b0..db0fa3e2ca 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -53,6 +53,7 @@ class QXcbConnection;
class QXcbNativeInterface : public QPlatformNativeInterface
{
+ Q_OBJECT
public:
enum ResourceType {
Display,
@@ -89,6 +90,8 @@ public:
static void *eglContextForContext(QOpenGLContext *context);
static void *glxContextForContext(QOpenGLContext *context);
+ Q_INVOKABLE void beep();
+
private:
const QByteArray m_genericEventFilterType;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 5af6a9ec9d..68ccbfb8c0 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -189,6 +189,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
, m_usingSyncProtocol(false)
, m_deferredActivation(false)
, m_embedded(false)
+ , m_alertState(false)
, m_netWmUserTimeWindow(XCB_NONE)
, m_dirtyFrameMargins(false)
#if defined(XCB_USE_EGL)
@@ -2047,4 +2048,17 @@ void QXcbWindow::setMask(const QRegion &region)
#endif // !QT_NO_SHAPE
+void QXcbWindow::setAlertState(bool enabled)
+{
+ if (m_alertState == enabled)
+ return;
+ const NetWmStates oldState = netWmStates();
+ m_alertState = enabled;
+ if (enabled) {
+ setNetWmStates(oldState | NetWmStateDemandsAttention);
+ } else {
+ setNetWmStates(oldState & ~NetWmStateDemandsAttention);
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index f4bd2d96ff..300596845e 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE
class QXcbScreen;
class QXcbEGLSurface;
class QIcon;
-
class QXcbWindow : public QXcbObject, public QPlatformWindow
{
public:
@@ -120,6 +119,9 @@ public:
void setMask(const QRegion &region);
#endif // !QT_NO_SHAPE
+ void setAlertState(bool enabled);
+ bool isAlertState() const { return m_alertState; }
+
xcb_window_t xcb_window() const { return m_window; }
uint depth() const { return m_depth; }
QImage::Format imageFormat() const { return m_imageFormat; }
@@ -194,6 +196,7 @@ private:
bool m_deferredExpose;
bool m_configureNotifyPending;
bool m_embedded;
+ bool m_alertState;
xcb_window_t m_netWmUserTimeWindow;
QSurfaceFormat m_format;
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 387101dc9b..a8a99564ac 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -295,9 +295,9 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
lower quality output than HighResolution and should only be used
for drafts.
- \value PrinterResolution This value is deprecated. Is is
+ \value PrinterResolution This value is deprecated. It is
equivalent to ScreenResolution on Unix and HighResolution on
- Windows and Mac. Due do the difference between ScreenResolution
+ Windows and Mac. Due to the difference between ScreenResolution
and HighResolution, use of this value may lead to non-portable
printer code.
diff --git a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
index ab6ca63f40..a17628155a 100644
--- a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
@@ -229,8 +229,8 @@ QTest::touchEvent(&widget)
.move(0, QPoint(12, 12))
.move(1, QPoint(45, 5));
QTest::touchEvent(&widget)
- .release(0)
- .release(1);
+ .release(0, QPoint(12, 12))
+ .release(1, QPoint(45, 5));
//! [25]
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 4819dbdd07..972f57260e 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -28,6 +28,8 @@ DEFINES += \
QT_CRYPTOGRAPHICHASH_ONLY_SHA1 \
QT_NO_CAST_FROM_ASCII
+DEFINES -= QT_EVAL
+
MODULE_PRIVATE_INCLUDES = \
\$\$QT_MODULE_INCLUDE_BASE \
\$\$QT_MODULE_INCLUDE_BASE/QtCore \
diff --git a/src/tools/qdoc/codemarker.cpp b/src/tools/qdoc/codemarker.cpp
index 4e144d2f7d..e39ff203a5 100644
--- a/src/tools/qdoc/codemarker.cpp
+++ b/src/tools/qdoc/codemarker.cpp
@@ -455,39 +455,6 @@ void CodeMarker::insert(FastSection &fastSection,
}
}
-void CodeMarker::insert(FastSection& fastSection,
- Node* node,
- SynopsisStyle style,
- bool /* includeClassName */)
-{
- if (node->status() == Node::Compat || node->status() == Node::Obsolete)
- return;
-
- bool inheritedMember = false;
- InnerNode* parent = node->parent();
- if (parent && (parent->type() == Node::Document) &&
- (parent->subType() == Node::QmlPropertyGroup)) {
- parent = parent->parent();
- }
- inheritedMember = (parent != fastSection.parent_);
-
- if (!inheritedMember || style == Subpage) {
- QString key = sortName(node);
- if (!fastSection.memberMap.contains(key))
- fastSection.memberMap.insert(key, node);
- }
- else {
- if ((parent->type() == Node::Document) && (parent->subType() == Node::QmlClass)) {
- if (fastSection.inherited.isEmpty()
- || fastSection.inherited.last().first != parent) {
- QPair<InnerNode*, int> p(parent, 0);
- fastSection.inherited.append(p);
- }
- fastSection.inherited.last().second++;
- }
- }
-}
-
/*!
Returns true if \a node represents a reimplemented member
function in the class of the FastSection \a fs. If it is
diff --git a/src/tools/qdoc/codemarker.h b/src/tools/qdoc/codemarker.h
index c31b43e875..02caedf9b8 100644
--- a/src/tools/qdoc/codemarker.h
+++ b/src/tools/qdoc/codemarker.h
@@ -178,10 +178,6 @@ protected:
Node *node,
SynopsisStyle style,
Status status);
- void insert(FastSection& fastSection,
- Node* node,
- SynopsisStyle style,
- bool includeClassName = false);
bool insertReimpFunc(FastSection& fs, Node* node, Status status);
void append(QList<Section>& sectionList, const FastSection& fastSection, bool includeKeys = false);
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index 65eeda604f..557a6f08fa 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -237,7 +237,7 @@ void CodeParser::processCommonMetaCommand(const Location& location,
node->setStatus(Node::Compat);
}
else if (command == COMMAND_DEPRECATED) {
- node->setStatus(Node::Deprecated);
+ node->setStatus(Node::Obsolete);
}
else if ((command == COMMAND_INGROUP) || (command == COMMAND_INPUBLICGROUP)) {
// Note: \ingroup and \inpublicgroup are now the same.
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index 21bbdafaf5..a828101551 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -473,8 +473,6 @@ DitaXmlGenerator::DitaXmlGenerator()
inTableBody(false),
noLinks(false),
obsoleteLinks(false),
- offlineDocs(true),
- codeIndent(0),
divNestingLevel(0),
sectionNestingLevel(0),
tableColumnCount(0),
@@ -573,8 +571,6 @@ void DitaXmlGenerator::initializeGenerator(const Config &config)
customHeadElements = config.getStringList(DitaXmlGenerator::format() +
Config::dot +
DITAXMLGENERATOR_CUSTOMHEADELEMENTS);
- // The following line was changed to fix QTBUG-27798
- //codeIndent = config.getInt(CONFIG_CODEINDENT);
version = config.getString(CONFIG_VERSION);
vrm = version.split(QLatin1Char('.'));
}
@@ -1024,10 +1020,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
generateAnnotatedList(relative, marker, qdb_->getCppClasses());
}
else if (atom->string() == "classes") {
- generateCompactList(relative, qdb_->getCppClasses(), true);
+ generateCompactList(Generic, relative, qdb_->getCppClasses(), true);
}
else if (atom->string() == "qmlclasses") {
- generateCompactList(relative, qdb_->getQmlTypes(), true);
+ generateCompactList(Generic, relative, qdb_->getQmlTypes(), true);
}
else if (atom->string().contains("classesbymodule")) {
QString arg = atom->string().trimmed();
@@ -1046,10 +1042,19 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
generateClassHierarchy(relative, qdb_->getCppClasses());
}
else if (atom->string() == "compatclasses") {
- generateCompactList(relative, qdb_->getCompatibilityClasses(), false);
+ generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false);
}
else if (atom->string() == "obsoleteclasses") {
- generateCompactList(relative, qdb_->getObsoleteClasses(), false);
+ generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false);
+ }
+ else if (atom->string() == "obsoleteqmltypes") {
+ generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false);
+ }
+ else if (atom->string() == "obsoletecppmembers") {
+ generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false);
+ }
+ else if (atom->string() == "obsoleteqmlmembers") {
+ generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false);
}
else if (atom->string() == "functionindex") {
generateFunctionIndex(relative);
@@ -1058,10 +1063,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
generateLegaleseList(relative, marker);
}
else if (atom->string() == "mainclasses") {
- generateCompactList(relative, qdb_->getMainClasses(), true);
+ generateCompactList(Generic, relative, qdb_->getMainClasses(), true);
}
else if (atom->string() == "services") {
- generateCompactList(relative, qdb_->getServiceClasses(), false);
+ generateCompactList(Generic, relative, qdb_->getServiceClasses(), false);
}
else if (atom->string() == "overviews") {
generateOverviewList(relative);
@@ -1176,9 +1181,9 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
writeCharacters(protectEnc((*s).name));
writeEndTag(); // </p>
if (idx == Class)
- generateCompactList(0, ncmap, false, QString("Q"));
+ generateCompactList(Generic, 0, ncmap, false, QString("Q"));
else if (idx == QmlClass)
- generateCompactList(0, nqcmap, false, QString("Q"));
+ generateCompactList(Generic, 0, nqcmap, false, QString("Q"));
else if (idx == MemberFunction) {
ParentMaps parentmaps;
ParentMaps::iterator pmap;
@@ -2599,7 +2604,7 @@ void DitaXmlGenerator::generateTableOfContents(const Node* node,
inLink_ = false;
}
-void DitaXmlGenerator::generateLowStatusMembers(const InnerNode* inner,
+void DitaXmlGenerator::generateLowStatusMembers(InnerNode* inner,
CodeMarker* marker,
CodeMarker::Status status)
{
@@ -2620,6 +2625,9 @@ void DitaXmlGenerator::generateLowStatusMembers(const InnerNode* inner,
if (sections.isEmpty())
return;
+ if (status == CodeMarker::Obsolete)
+ inner->setObsoleteLink(fileBase(inner) + "-obsolete." + fileExtension());
+
QList<Section>::ConstIterator s = sections.constBegin();
while (s != sections.constEnd()) {
if ((*s).name == "Member Function Documentation") {
@@ -2779,7 +2787,8 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
normally you let it figure it out itself by looking at
the name of the first and last classes in \a classMap.
*/
-void DitaXmlGenerator::generateCompactList(const Node* relative,
+void DitaXmlGenerator::generateCompactList(ListType , // currently not needed for DITA
+ const Node* relative,
const NodeMap& classMap,
bool includeAlphabet,
QString commonPrefix)
diff --git a/src/tools/qdoc/ditaxmlgenerator.h b/src/tools/qdoc/ditaxmlgenerator.h
index c096829cae..15ef4260b2 100644
--- a/src/tools/qdoc/ditaxmlgenerator.h
+++ b/src/tools/qdoc/ditaxmlgenerator.h
@@ -46,7 +46,6 @@
#include <qregexp.h>
#include <qxmlstream.h>
#include "codemarker.h"
-#include "config.h"
#include "generator.h"
QT_BEGIN_NAMESPACE
@@ -374,16 +373,12 @@ private:
Doc::Sections sectioningUnit,
int numColumns,
const Node* relative = 0);
- void generateLowStatusMembers(const InnerNode* inner,
- CodeMarker* marker,
- CodeMarker::Status status);
- QString generateLowStatusMemberFile(const InnerNode* inner,
- CodeMarker* marker,
- CodeMarker::Status status);
+ void generateLowStatusMembers(InnerNode* inner, CodeMarker* marker, CodeMarker::Status status);
void generateClassHierarchy(const Node* relative, NodeMap& classMap);
void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap);
void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeList& nodes);
- void generateCompactList(const Node* relative,
+ void generateCompactList(ListType listType,
+ const Node* relative,
const NodeMap& classMap,
bool includeAlphabet,
QString commonPrefix = QString());
@@ -484,9 +479,7 @@ private:
bool noLinks;
bool obsoleteLinks;
- bool offlineDocs;
- int codeIndent;
int divNestingLevel;
int sectionNestingLevel;
int tableColumnCount;
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index e2ee660dd1..d9ee0e42ee 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -68,6 +68,7 @@ QStringList Generator::imageDirs;
QStringList Generator::imageFiles;
QMap<QString, QStringList> Generator::imgFileExts;
QString Generator::outDir_;
+QString Generator::outSubdir_;
QSet<QString> Generator::outputFormats;
QHash<QString, QString> Generator::outputPrefixes;
QString Generator::project;
@@ -1477,10 +1478,13 @@ void Generator::initialize(const Config &config)
redirectDocumentationToDevNull_ = config.getBool(CONFIG_REDIRECTDOCUMENTATIONTODEVNULL);
if (!outputFormats.isEmpty()) {
outDir_ = config.getOutputDir();
-
- if (outDir_.isEmpty())
+ if (outDir_.isEmpty()) {
config.lastLocation().fatal(tr("No output directory specified in "
"configuration file or on the command line"));
+ }
+ else {
+ outSubdir_ = outDir_.mid(outDir_.lastIndexOf('/') + 1);
+ }
QDir dirInfo;
if (dirInfo.exists(outDir_)) {
@@ -1625,8 +1629,12 @@ void Generator::augmentImageDirs(QSet<QString>& moreImageDirs)
}
}
-void Generator::initializeGenerator(const Config & /* config */)
+/*!
+ Sets the generator's pointer to the Config instance.
+ */
+void Generator::initializeGenerator(const Config& config)
{
+ config_ = &config;
}
bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType)
diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h
index ec1e49d2fb..08ee9b4e9b 100644
--- a/src/tools/qdoc/generator.h
+++ b/src/tools/qdoc/generator.h
@@ -50,7 +50,7 @@
#include <qstring.h>
#include <qstringlist.h>
#include <qtextstream.h>
-
+#include "config.h"
#include "node.h"
#include "text.h"
@@ -70,6 +70,7 @@ class Generator
public:
enum Passes { Both, Prepare, Generate };
+ enum ListType { Generic, Obsolete };
Generator();
virtual ~Generator();
@@ -81,11 +82,13 @@ public:
virtual void terminateGenerator();
QString fullDocumentLocation(const Node *node, bool subdir = false);
+ const Config* config() { return config_; }
static Generator *currentGenerator() { return currentGenerator_; }
static Generator *generatorForFormat(const QString& format);
static void initialize(const Config& config);
static const QString& outputDir() { return outDir_; }
+ static const QString& outputSubdir() { return outSubdir_; }
static void terminate();
static void writeOutFileNames();
static void augmentImageDirs(QSet<QString>& moreImageDirs);
@@ -192,6 +195,7 @@ private:
static QMap<QString, QStringList> imgFileExts;
static QString project;
static QString outDir_;
+ static QString outSubdir_;
static QSet<QString> outputFormats;
static QHash<QString, QString> outputPrefixes;
static QStringList scriptDirs;
@@ -222,6 +226,7 @@ private:
QRegExp tag;
protected:
+ const Config* config_;
QDocDatabase* qdb_;
bool inLink_;
bool inContents_;
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 7d7f9e811a..c5dc7d17c9 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -470,10 +470,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
generateAnnotatedList(relative, marker, qdb_->getCppClasses());
}
else if (atom->string() == "classes") {
- generateCompactList(relative, qdb_->getCppClasses(), true);
+ generateCompactList(Generic, relative, qdb_->getCppClasses(), true);
}
else if (atom->string() == "qmlclasses") {
- generateCompactList(relative, qdb_->getQmlTypes(), true);
+ generateCompactList(Generic, relative, qdb_->getQmlTypes(), true);
}
else if (atom->string().contains("classesbymodule")) {
QString arg = atom->string().trimmed();
@@ -492,10 +492,19 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
generateClassHierarchy(relative, qdb_->getCppClasses());
}
else if (atom->string() == "compatclasses") {
- generateCompactList(relative, qdb_->getCompatibilityClasses(), false);
+ generateCompactList(Generic, relative, qdb_->getCompatibilityClasses(), false);
}
else if (atom->string() == "obsoleteclasses") {
- generateCompactList(relative, qdb_->getObsoleteClasses(), false);
+ generateCompactList(Generic, relative, qdb_->getObsoleteClasses(), false);
+ }
+ else if (atom->string() == "obsoleteqmltypes") {
+ generateCompactList(Generic, relative, qdb_->getObsoleteQmlTypes(), false);
+ }
+ else if (atom->string() == "obsoletecppmembers") {
+ generateCompactList(Obsolete, relative, qdb_->getClassesWithObsoleteMembers(), false);
+ }
+ else if (atom->string() == "obsoleteqmlmembers") {
+ generateCompactList(Obsolete, relative, qdb_->getQmlTypesWithObsoleteMembers(), false);
}
else if (atom->string() == "functionindex") {
generateFunctionIndex(relative);
@@ -504,10 +513,10 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
generateLegaleseList(relative, marker);
}
else if (atom->string() == "mainclasses") {
- generateCompactList(relative, qdb_->getMainClasses(), true);
+ generateCompactList(Generic, relative, qdb_->getMainClasses(), true);
}
else if (atom->string() == "services") {
- generateCompactList(relative, qdb_->getServiceClasses(), false);
+ generateCompactList(Generic, relative, qdb_->getServiceClasses(), false);
}
else if (atom->string() == "overviews") {
generateOverviewList(relative);
@@ -640,9 +649,9 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
<< "\"></a>\n";
out() << "<h3>" << protectEnc((*s).name) << "</h3>\n";
if (idx == Class)
- generateCompactList(0, ncmap, false, QString("Q"));
+ generateCompactList(Generic, 0, ncmap, false, QString("Q"));
else if (idx == QmlClass)
- generateCompactList(0, nqcmap, false, QString("Q"));
+ generateCompactList(Generic, 0, nqcmap, false, QString("Q"));
else if (idx == MemberFunction) {
ParentMaps parentmaps;
ParentMaps::iterator pmap;
@@ -1131,9 +1140,10 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
QString obsoleteLink = generateLowStatusMemberFile(inner,
marker,
CodeMarker::Obsolete);
- if (!obsoleteLink.isEmpty())
+ if (!obsoleteLink.isEmpty()) {
out() << "<li><a href=\"" << obsoleteLink << "\">"
<< "Obsolete members</a></li>\n";
+ }
QString compatLink = generateLowStatusMemberFile(inner,
marker,
@@ -1481,9 +1491,10 @@ void HtmlGenerator::generateDocNode(DocNode* dn, CodeMarker* marker)
QString obsoleteLink = generateLowStatusMemberFile(dn,
marker,
CodeMarker::Obsolete);
- if (!obsoleteLink.isEmpty())
+ if (!obsoleteLink.isEmpty()) {
out() << "<li><a href=\"" << obsoleteLink << "\">"
<< "Obsolete members</a></li>\n";
+ }
QString compatLink = generateLowStatusMemberFile(dn,
marker,
@@ -2105,7 +2116,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(const QmlClassNode* qml_cn,
return fileName;
}
-QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner,
+QString HtmlGenerator::generateLowStatusMemberFile(InnerNode *inner,
CodeMarker *marker,
CodeMarker::Status status)
{
@@ -2133,6 +2144,10 @@ QString HtmlGenerator::generateLowStatusMemberFile(const InnerNode *inner,
title = "Obsolete Members for " + inner->name();
fileName = fileBase(inner) + "-obsolete." + fileExtension();
}
+ if (status == CodeMarker::Obsolete) {
+ QString link = QString("../" + Generator::outputSubdir() + QLatin1Char('/')) + fileName;
+ inner->setObsoleteLink(link);
+ }
beginSubPage(inner, fileName);
generateHeader(title, inner, marker);
@@ -2292,7 +2307,8 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
normally you let it figure it out itself by looking at
the name of the first and last classes in \a classMap.
*/
-void HtmlGenerator::generateCompactList(const Node *relative,
+void HtmlGenerator::generateCompactList(ListType listType,
+ const Node *relative,
const NodeMap &classMap,
bool includeAlphabet,
QString commonPrefix)
@@ -2452,11 +2468,19 @@ void HtmlGenerator::generateCompactList(const Node *relative,
for (int i=0; i<curParOffset; i++)
++it;
- /*
- Previously, we used generateFullName() for this, but we
- require some special formatting.
- */
- out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">";
+ if (listType == Generic) {
+ /*
+ Previously, we used generateFullName() for this, but we
+ require some special formatting.
+ */
+ out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">";
+ }
+ else if (listType == Obsolete) {
+ QString fileName = fileBase(it.value()) + "-obsolete." + fileExtension();
+ QString link = QString("../" + it.value()->outputSubdirectory() +
+ QLatin1Char('/')) + fileName;
+ out() << "<a href=\"" << link << "\">";
+ }
QStringList pieces;
if (it.value()->subType() == Node::QmlClass)
@@ -4158,15 +4182,28 @@ void HtmlGenerator::generateManifestFile(QString manifest, QString element)
else
writer.writeCDATA(QString("No description available"));
writer.writeEndElement(); // description
+
+ // Add words from module name as tags (QtQuickControls -> qt,quick,controls)
+ QRegExp re("([A-Z][a-z0-9]+)");
+ int pos = 0;
+ while ((pos = re.indexIn(project, pos)) != -1) {
+ tags << re.cap(1).toLower();
+ pos += re.matchedLength();
+ }
tags += QSet<QString>::fromList(en->title().toLower().split(QLatin1Char(' ')));
if (!tags.isEmpty()) {
writer.writeStartElement("tags");
bool wrote_one = false;
+ // Exclude invalid and common words
foreach (QString tag, tags) {
+ if (tag.length() < 2)
+ continue;
if (tag.at(0).isDigit())
continue;
if (tag.at(0) == '-')
continue;
+ if (tag == QStringLiteral("qt"))
+ continue;
if (tag.startsWith("example"))
continue;
if (tag.startsWith("chapter"))
diff --git a/src/tools/qdoc/htmlgenerator.h b/src/tools/qdoc/htmlgenerator.h
index f2efab78a1..cdf296e783 100644
--- a/src/tools/qdoc/htmlgenerator.h
+++ b/src/tools/qdoc/htmlgenerator.h
@@ -150,13 +150,14 @@ private:
CodeMarker *marker);
QString generateAllQmlMembersFile(const QmlClassNode* qml_cn,
CodeMarker* marker);
- QString generateLowStatusMemberFile(const InnerNode *inner,
+ QString generateLowStatusMemberFile(InnerNode *inner,
CodeMarker *marker,
CodeMarker::Status status);
void generateClassHierarchy(const Node *relative, NodeMap &classMap);
void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeMap& nodeMap);
void generateAnnotatedList(const Node* relative, CodeMarker* marker, const NodeList& nodes);
- void generateCompactList(const Node *relative,
+ void generateCompactList(ListType listType,
+ const Node *relative,
const NodeMap &classMap,
bool includeAlphabet,
QString commonPrefix = QString());
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 642bcec06a..d1a95358f0 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -167,7 +167,11 @@ public:
void setAccess(Access access) { access_ = access; }
void setLocation(const Location& location) { loc = location; }
void setDoc(const Doc& doc, bool replace = false);
- void setStatus(Status status) { status_ = status; }
+ void setStatus(Status status) {
+ if (status_ == Obsolete && status == Deprecated)
+ return;
+ status_ = status;
+ }
void setThreadSafeness(ThreadSafeness safeness) { safeness_ = safeness; }
void setSince(const QString &since);
void setRelates(InnerNode* pseudoParent);
@@ -218,6 +222,8 @@ public:
QString url() const;
virtual QString nameForLists() const { return name_; }
virtual QString outputFileName() const { return QString(); }
+ virtual QString obsoleteLink() const { return QString(); }
+ virtual void setObsoleteLink(const QString& ) { };
Access access() const { return access_; }
QString accessString() const;
@@ -253,6 +259,7 @@ public:
QmlClassNode* qmlClassNode();
ClassNode* declarativeCppNode();
const QString& outputSubdirectory() const { return outSubDir_; }
+ void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
QString fullDocumentName() const;
static QString cleanId(QString str);
QString idForNode() const;
@@ -430,6 +437,8 @@ public:
ClassNode(InnerNode* parent, const QString& name);
virtual ~ClassNode() { }
virtual bool isClass() const { return true; }
+ virtual QString obsoleteLink() const { return obsoleteLink_; }
+ virtual void setObsoleteLink(const QString& t) { obsoleteLink_ = t; };
void addBaseClass(Access access,
ClassNode* node,
@@ -455,6 +464,7 @@ private:
QList<RelatedClass> ignoredBases;
bool abstract_;
QString sname;
+ QString obsoleteLink_;
QmlClassNode* qmlelement;
};
@@ -561,6 +571,8 @@ public:
virtual void setAbstract(bool b) { abstract_ = b; }
virtual bool isInternal() const { return (status() == Internal); }
virtual QString qmlFullBaseName() const;
+ virtual QString obsoleteLink() const { return obsoleteLink_; }
+ virtual void setObsoleteLink(const QString& t) { obsoleteLink_ = t; };
const ImportList& importList() const { return importList_; }
void setImportList(const ImportList& il) { importList_ = il; }
const QString& qmlBaseName() const { return baseName_; }
@@ -582,6 +594,7 @@ private:
bool cnodeRequired_;
ClassNode* cnode_;
QString baseName_;
+ QString obsoleteLink_;
QmlClassNode* baseNode_;
ImportList importList_;
};
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index 30a9efaada..674917f6dc 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -430,6 +430,7 @@ void QDocDatabase::buildCollections()
findAllLegaleseTexts(treeRoot());
findAllNamespaces(treeRoot());
findAllSince(treeRoot());
+ findAllObsoleteThings(treeRoot());
}
/*!
@@ -451,9 +452,6 @@ void QDocDatabase::findAllClasses(const InnerNode* node)
if ((*c)->status() == Node::Compat) {
compatClasses_.insert(className, *c);
}
- else if ((*c)->status() == Node::Obsolete) {
- obsoleteClasses_.insert(className, *c);
- }
else {
nonCompatClasses_.insert(className, *c);
if ((*c)->status() == Node::Main)
@@ -548,6 +546,98 @@ void QDocDatabase::findAllNamespaces(const InnerNode* node)
}
/*!
+ Finds all nodes with status = Obsolete and sorts them into
+ maps. They can be C++ classes, QML types, or they can be
+ functions, enum types, typedefs, methods, etc.
+ */
+void QDocDatabase::findAllObsoleteThings(const InnerNode* node)
+{
+ NodeList::const_iterator c = node->childNodes().constBegin();
+ while (c != node->childNodes().constEnd()) {
+ if ((*c)->access() != Node::Private) {
+ QString name = (*c)->name();
+ if ((*c)->status() == Node::Obsolete) {
+ if ((*c)->type() == Node::Class) {
+ if ((*c)->parent() && (*c)->parent()->type() == Node::Namespace &&
+ !(*c)->parent()->name().isEmpty())
+ name = (*c)->parent()->name() + "::" + name;
+ obsoleteClasses_.insert(name, *c);
+ }
+ else if ((*c)->type() == Node::Document && (*c)->subType() == Node::QmlClass) {
+ if (name.startsWith(QLatin1String("QML:")))
+ name = name.mid(4);
+ name = (*c)->qmlModuleIdentifier() + "::" + name;
+ obsoleteQmlTypes_.insert(name,*c);
+ }
+ }
+ else if ((*c)->type() == Node::Class) {
+ InnerNode* n = static_cast<InnerNode*>(*c);
+ bool inserted = false;
+ NodeList::const_iterator p = n->childNodes().constBegin();
+ while (p != n->childNodes().constEnd()) {
+ if ((*p)->access() != Node::Private) {
+ switch ((*p)->type()) {
+ case Node::Enum:
+ case Node::Typedef:
+ case Node::Function:
+ case Node::Property:
+ case Node::Variable:
+ if ((*p)->status() == Node::Obsolete) {
+ if ((*c)->parent() && (*c)->parent()->type() == Node::Namespace &&
+ !(*c)->parent()->name().isEmpty())
+ name = (*c)->parent()->name() + "::" + name;
+ classesWithObsoleteMembers_.insert(name, *c);
+ inserted = true;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (inserted)
+ break;
+ ++p;
+ }
+ }
+ else if ((*c)->type() == Node::Document && (*c)->subType() == Node::QmlClass) {
+ InnerNode* n = static_cast<InnerNode*>(*c);
+ bool inserted = false;
+ NodeList::const_iterator p = n->childNodes().constBegin();
+ while (p != n->childNodes().constEnd()) {
+ if ((*p)->access() != Node::Private) {
+ switch ((*c)->type()) {
+ case Node::QmlProperty:
+ case Node::QmlSignal:
+ case Node::QmlSignalHandler:
+ case Node::QmlMethod:
+ if ((*c)->parent()) {
+ Node* parent = (*c)->parent();
+ if (parent->subType() == Node::QmlPropertyGroup && parent->parent())
+ parent = parent->parent();
+ if (parent && parent->subType() == Node::QmlClass && !parent->name().isEmpty())
+ name = parent->name() + "::" + name;
+ }
+ qmlTypesWithObsoleteMembers_.insert(name,*c);
+ inserted = true;
+ break;
+ default:
+ break;
+ }
+ }
+ if (inserted)
+ break;
+ ++p;
+ }
+ }
+ else if ((*c)->isInnerNode()) {
+ findAllObsoleteThings(static_cast<InnerNode*>(*c));
+ }
+ }
+ ++c;
+ }
+}
+
+/*!
Finds all the nodes where a \e{since} command appeared in the
qdoc comment and sorts them into maps according to the kind of
node.
diff --git a/src/tools/qdoc/qdocdatabase.h b/src/tools/qdoc/qdocdatabase.h
index 19dde361f8..d97fb3809a 100644
--- a/src/tools/qdoc/qdocdatabase.h
+++ b/src/tools/qdoc/qdocdatabase.h
@@ -113,6 +113,7 @@ class QDocDatabase
void findAllFunctions(const InnerNode *node);
void findAllLegaleseTexts(const InnerNode *node);
void findAllNamespaces(const InnerNode *node);
+ void findAllObsoleteThings(const InnerNode* node);
void findAllSince(const InnerNode *node);
void buildCollections();
@@ -121,6 +122,9 @@ class QDocDatabase
NodeMap& getMainClasses() { return mainClasses_; }
NodeMap& getCompatibilityClasses() { return compatClasses_; }
NodeMap& getObsoleteClasses() { return obsoleteClasses_; }
+ NodeMap& getClassesWithObsoleteMembers() { return classesWithObsoleteMembers_; }
+ NodeMap& getObsoleteQmlTypes() { return obsoleteQmlTypes_; }
+ NodeMap& getQmlTypesWithObsoleteMembers() { return qmlTypesWithObsoleteMembers_; }
NodeMap& getNamespaces() { return namespaceIndex_; }
NodeMap& getServiceClasses() { return serviceClasses_; }
NodeMap& getQmlTypes() { return qmlClasses_; }
@@ -223,6 +227,9 @@ class QDocDatabase
NodeMap mainClasses_;
NodeMap compatClasses_;
NodeMap obsoleteClasses_;
+ NodeMap classesWithObsoleteMembers_;
+ NodeMap obsoleteQmlTypes_;
+ NodeMap qmlTypesWithObsoleteMembers_;
NodeMap namespaceIndex_;
NodeMap serviceClasses_;
NodeMap qmlClasses_;
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index d7a51da952..59adc63c9e 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -136,6 +136,7 @@ void QDocIndexFiles::readIndexFile(const QString& path)
QDir installDir(path.section('/', 0, -3) + "/outputdir");
indexUrl = installDir.relativeFilePath(path).section('/', 0, -2);
}
+ project_ = indexElement.attribute("project", QString());
basesList_.clear();
relatedList_.clear();
@@ -459,7 +460,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
else if (status == "obsolete")
node->setStatus(Node::Obsolete);
else if (status == "deprecated")
- node->setStatus(Node::Deprecated);
+ node->setStatus(Node::Obsolete);
else if (status == "preliminary")
node->setStatus(Node::Preliminary);
else if (status == "commendable")
@@ -503,6 +504,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
Doc doc(location, location, " ", emptySet); // placeholder
node->setDoc(doc);
node->setIndexNodeFlag();
+ node->setOutputSubdirectory(project_.toLower());
if (node->isInnerNode()) {
InnerNode* inner = static_cast<InnerNode*>(node);
@@ -712,7 +714,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
status = "obsolete";
break;
case Node::Deprecated:
- status = "deprecated";
+ status = "obsolete";
break;
case Node::Preliminary:
status = "preliminary";
@@ -1203,6 +1205,7 @@ void QDocIndexFiles::generateIndex(const QString& fileName,
writer.writeAttribute("url", url);
writer.writeAttribute("title", title);
writer.writeAttribute("version", qdb_->version());
+ writer.writeAttribute("project", g->config()->getString(CONFIG_PROJECT));
generateIndexSections(writer, qdb_->treeRoot(), generateInternalNodes);
diff --git a/src/tools/qdoc/qdocindexfiles.h b/src/tools/qdoc/qdocindexfiles.h
index 2b1eb1951e..e4a83176a2 100644
--- a/src/tools/qdoc/qdocindexfiles.h
+++ b/src/tools/qdoc/qdocindexfiles.h
@@ -86,6 +86,7 @@ class QDocIndexFiles
static QDocIndexFiles* qdocIndexFiles_;
QDocDatabase* qdb_;
Generator* gen_;
+ QString project_;
QList<QPair<ClassNode*,QString> > basesList_;
QList<QPair<FunctionNode*,QString> > relatedList_;
diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp
index ffe1afe28b..ac659720b2 100644
--- a/src/tools/qdoc/qmlvisitor.cpp
+++ b/src/tools/qdoc/qmlvisitor.cpp
@@ -316,7 +316,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
}
}
else if (command == COMMAND_DEPRECATED) {
- node->setStatus(Node::Deprecated);
+ node->setStatus(Node::Obsolete);
}
else if (command == COMMAND_INQMLMODULE) {
qdb->addToQmlModule(args[0].first,node);
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index ee1c8ad0fd..519c158f81 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -850,7 +850,7 @@ bool QFileSystemModel::setData(const QModelIndex &idx, const QVariant &value, in
return true;
if (newName.isEmpty()
- || newName.contains(QDir::separator())
+ || QDir::toNativeSeparators(newName).contains(QDir::separator())
|| !QDir(filePath(parent(idx))).rename(oldName, newName)) {
#ifndef QT_NO_MESSAGEBOX
QMessageBox::information(0, QFileSystemModel::tr("Invalid filename"),
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index a485a55609..833320da16 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -90,6 +90,7 @@ enum DetailButtonLabel { ShowLabel = 0, HideLabel = 1 };
#ifndef QT_NO_TEXTEDIT
class QMessageBoxDetailsText : public QWidget
{
+ Q_OBJECT
public:
class TextEdit : public QTextEdit
{
@@ -109,6 +110,7 @@ public:
QMessageBoxDetailsText(QWidget *parent=0)
: QWidget(parent)
+ , copyAvailable(false)
{
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(0);
@@ -122,10 +124,29 @@ public:
textEdit->setReadOnly(true);
layout->addWidget(textEdit);
setLayout(layout);
+
+ connect(textEdit, SIGNAL(copyAvailable(bool)),
+ this, SLOT(textCopyAvailable(bool)));
}
void setText(const QString &text) { textEdit->setPlainText(text); }
QString text() const { return textEdit->toPlainText(); }
+
+ bool copy()
+ {
+ if (!copyAvailable)
+ return false;
+ textEdit->copy();
+ return true;
+ }
+
+private slots:
+ void textCopyAvailable(bool available)
+ {
+ copyAvailable = available;
+ }
+
private:
+ bool copyAvailable;
TextEdit *textEdit;
};
#endif // QT_NO_TEXTEDIT
@@ -1362,7 +1383,19 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
return;
}
-#if defined (Q_OS_WIN) && !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT)
+
+#if !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT)
+
+#if !defined(QT_NO_TEXTEDIT)
+ if (e == QKeySequence::Copy) {
+ if (d->detailsText->isVisible() && d->detailsText->copy()) {
+ e->setAccepted(true);
+ return;
+ }
+ }
+#endif // !QT_NO_TEXTEDIT
+
+#if defined(Q_OS_WIN)
if (e == QKeySequence::Copy) {
QString separator = QString::fromLatin1("---------------------------\n");
QString textToCopy = separator;
@@ -1379,11 +1412,16 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
buttonTexts += buttons[i]->text() + QLatin1String(" ");
}
textToCopy += buttonTexts + separator;
-
+#ifndef QT_NO_TEXTEDIT
+ if (d->detailsText)
+ textToCopy += d->detailsText->text() + separator;
+#endif
QApplication::clipboard()->setText(textToCopy);
return;
}
-#endif //QT_NO_SHORTCUT QT_NO_CLIPBOARD Q_OS_WIN
+#endif // Q_OS_WIN
+
+#endif // !QT_NO_CLIPBOARD && !QT_NO_SHORTCUT
#ifndef QT_NO_SHORTCUT
if (!(e->modifiers() & Qt::AltModifier)) {
@@ -2634,5 +2672,6 @@ QPixmap QMessageBox::standardIcon(Icon icon)
QT_END_NAMESPACE
#include "moc_qmessagebox.cpp"
+#include "qmessagebox.moc"
#endif // QT_NO_MESSAGEBOX
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index 54eb443c43..6567ef5c2f 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -55,6 +55,7 @@
#include <qdesktopwidget.h>
#include <qpa/qplatformcursor.h>
#include <qpa/qplatformtheme.h>
+#include <qpa/qplatformwindow.h>
#include <qdebug.h>
#include <qpa/qwindowsysteminterface.h>
@@ -408,10 +409,20 @@ QWidget *QApplication::topLevelAt(const QPoint &pos)
void QApplication::beep()
{
+ QMetaObject::invokeMethod(QGuiApplication::platformNativeInterface(), "beep");
}
-void QApplication::alert(QWidget *, int)
+void QApplication::alert(QWidget *widget, int duration)
{
+ if (widget) {
+ if (widget->window()->isActiveWindow()&& !widget->window()->windowState() & Qt::WindowMinimized)
+ return;
+ if (QWindow *window= QApplicationPrivate::windowForWidget(widget))
+ window->alert(duration);
+ } else {
+ foreach (QWidget *topLevel, topLevelWidgets())
+ QApplication::alert(topLevel, duration);
+ }
}
void qt_init(QApplicationPrivate *priv, int type)
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index edd2329df8..90cfb3446f 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1811,9 +1811,8 @@ void QWidgetPrivate::setSystemClip(QPaintDevice *paintDevice, const QRegion &reg
// it has been tested.
QPaintEngine *paintEngine = paintDevice->paintEngine();
#ifdef Q_OS_MAC
- const qreal devicePixelRatio = (paintDevice->physicalDpiX() == 0 || paintDevice->logicalDpiX() == 0) ?
- 1.0 : (paintDevice->physicalDpiX() / paintDevice->logicalDpiX());
QTransform scaleTransform;
+ const qreal devicePixelRatio = paintDevice->devicePixelRatio();
scaleTransform.scale(devicePixelRatio, devicePixelRatio);
paintEngine->d_func()->systemClip = scaleTransform.map(region);
#else
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 1374d25cef..fdc72ee23c 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -52,6 +52,7 @@
#include <qpa/qplatformopenglcontext.h>
#include <qpa/qplatformintegration.h>
#include "QtGui/private/qwindow_p.h"
+#include "QtGui/private/qguiapplication_p.h"
#include <qpa/qplatformcursor.h>
#include <QtGui/QGuiApplication>
@@ -675,6 +676,16 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
h = qMax(h,extra->minh);
}
+ if (q->isWindow() && q->windowHandle()) {
+ QPlatformIntegration *integration = QGuiApplicationPrivate::platformIntegration();
+ if (!integration->hasCapability(QPlatformIntegration::NonFullScreenWindows)) {
+ x = 0;
+ y = 0;
+ w = q->windowHandle()->width();
+ h = q->windowHandle()->height();
+ }
+ }
+
QPoint oldp = q->geometry().topLeft();
QSize olds = q->size();
QRect r(x, y, w, h);
@@ -720,7 +731,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
q->windowHandle()->setGeometry(QRect(posInNativeParent,r.size()));
}
const QWidgetBackingStore *bs = maybeBackingStore();
- if (bs->store) {
+ if (bs && bs->store) {
if (isResize)
bs->store->resize(r.size());
}
@@ -836,6 +847,8 @@ int QWidget::metric(PaintDeviceMetric m) const
return qRound(screen->physicalDotsPerInchX());
} else if (m == PdmPhysicalDpiY) {
return qRound(screen->physicalDotsPerInchY());
+ } else if (m == PdmDevicePixelRatio) {
+ return screen->devicePixelRatio();
} else {
val = QPaintDevice::metric(m);// XXX
}
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index f7ae667a82..c6edbee67d 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -4905,20 +4905,12 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = -1;
break;
case SH_LineEdit_PasswordCharacter: {
- const QFontMetrics &fm = opt ? opt->fontMetrics
- : (widget ? widget->fontMetrics() : QFontMetrics(QFont()));
- ret = 0;
- if (fm.inFont(QChar(0x25CF))) {
- ret = 0x25CF;
- } else if (fm.inFont(QChar(0x2022))) {
- ret = 0x2022;
- } else {
- ret = '*';
- }
+ const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme();
+ const QPlatformTheme::ThemeHint hintType = QPlatformTheme::PasswordMaskCharacter;
+ const QVariant hint = theme ? theme->themeHint(hintType) : QPlatformTheme::defaultThemeHint(hintType);
+ ret = hint.toChar().unicode();
break;
}
-
-
case SH_ToolBox_SelectedPageTitleBold:
ret = 1;
break;
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index bfc22807a0..41046a1254 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -1681,7 +1681,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow
int dim = (menuItem->rect.height() - 4) / 2;
PrimitiveElement arrow;
- arrow = QApplication::isRightToLeft() ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
+ arrow = option->direction == Qt::RightToLeft ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight;
int xpos = menuItem->rect.left() + menuItem->rect.width() - 3 - dim;
QRect vSubMenuRect = visualRect(option->direction, menuItem->rect,
QRect(xpos, menuItem->rect.top() + menuItem->rect.height() / 2 - dim / 2, dim, dim));
@@ -1896,50 +1896,14 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
}
}
+extern QPalette qt_fusionPalette();
+
/*!
\reimp
*/
QPalette QFusionStyle::standardPalette () const
{
- QPalette palette = QCommonStyle::standardPalette();
- palette.setBrush(QPalette::Active, QPalette::Highlight, QColor(48, 140, 198));
- palette.setBrush(QPalette::Inactive, QPalette::Highlight, QColor(145, 141, 126));
- palette.setBrush(QPalette::Disabled, QPalette::Highlight, QColor(145, 141, 126));
-
- QColor backGround(239, 235, 231);
-
- QColor light = backGround.lighter(150);
- QColor base = Qt::white;
- QColor dark = QColor(170, 156, 143).darker(110);
- dark = backGround.darker(150);
- QColor darkDisabled = QColor(209, 200, 191).darker(110);
-
- //### Find the correct disabled text color
- palette.setBrush(QPalette::Disabled, QPalette::Text, QColor(190, 190, 190));
-
- palette.setBrush(QPalette::Window, backGround);
- palette.setBrush(QPalette::Mid, backGround.darker(130));
- palette.setBrush(QPalette::Light, light);
-
- palette.setBrush(QPalette::Active, QPalette::Base, base);
- palette.setBrush(QPalette::Inactive, QPalette::Base, base);
- palette.setBrush(QPalette::Disabled, QPalette::Base, backGround);
-
- palette.setBrush(QPalette::Midlight, palette.mid().color().lighter(110));
-
- palette.setBrush(QPalette::All, QPalette::Dark, dark);
- palette.setBrush(QPalette::Disabled, QPalette::Dark, darkDisabled);
-
- QColor button = backGround;
-
- palette.setBrush(QPalette::Button, button);
-
- QColor shadow = dark.darker(135);
- palette.setBrush(QPalette::Shadow, shadow);
- palette.setBrush(QPalette::Disabled, QPalette::Shadow, shadow.lighter(150));
- palette.setBrush(QPalette::HighlightedText, QColor(QRgb(0xffffffff)));
-
- return palette;
+ return qt_fusionPalette();
}
/*!
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 15fa00d8a6..b981aef98b 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -2985,7 +2985,7 @@ void QGtkStyle::drawControl(ControlElement element,
GtkStyle *gtkStatusbarStyle = d->gtk_widget_get_style(gtkStatusbar);
QRect gripRect = option->rect.adjusted(0, 0, -gtkStatusbarStyle->xthickness, -gtkStatusbarStyle->ythickness);
gtkPainter->paintResizeGrip(gtkStatusbar, "statusbar", gripRect, GTK_STATE_NORMAL,
- GTK_SHADOW_OUT, QApplication::isRightToLeft() ?
+ GTK_SHADOW_OUT, option->direction == Qt::RightToLeft ?
GDK_WINDOW_EDGE_SOUTH_WEST : GDK_WINDOW_EDGE_SOUTH_EAST,
gtkStatusbarStyle);
}
@@ -3366,7 +3366,7 @@ void QGtkStyle::drawControl(ControlElement element,
menuItem->rect.height() / 2 - dim / 2, dim, dim));
GtkStateType state = enabled ? (act ? GTK_STATE_PRELIGHT: GTK_STATE_NORMAL) : GTK_STATE_INSENSITIVE;
GtkShadowType shadowType = (state == GTK_STATE_PRELIGHT) ? GTK_SHADOW_OUT : GTK_SHADOW_IN;
- gtkPainter->paintArrow(gtkMenuItem, "menuitem", vSubMenuRect, QApplication::isRightToLeft() ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, state,
+ gtkPainter->paintArrow(gtkMenuItem, "menuitem", vSubMenuRect, option->direction == Qt::RightToLeft ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, state,
shadowType, false, style);
}
}
@@ -3629,7 +3629,7 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
#ifndef QT_NO_GROUPBOX
case CC_GroupBox:
- if (qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
+ if (const QStyleOptionGroupBox * groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(option)) {
rect = option->rect.adjusted(0, groupBoxTopMargin, 0, -groupBoxBottomMargin);
int topMargin = 0;
int topHeight = 0;
@@ -3645,27 +3645,29 @@ QRect QGtkStyle::subControlRect(ComplexControl control, const QStyleOptionComple
return frameRect.adjusted(leftMarginExtension + margin, margin + topHeight + groupBoxTitleMargin, -margin, -margin);
}
- if (const QGroupBox *groupBoxWidget = qobject_cast<const QGroupBox *>(widget)) {
+ QFontMetrics fontMetrics = option->fontMetrics;
+ if (qobject_cast<const QGroupBox *>(widget)) {
//Prepare metrics for a bold font
QFont font = widget->font();
font.setBold(true);
- QFontMetrics fontMetrics(font);
- QSize textRect = fontMetrics.boundingRect(groupBoxWidget->title()).size() + QSize(4, 4);
- int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget);
- int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget);
-
- if (subControl == SC_GroupBoxCheckBox) {
- rect.setWidth(indicatorWidth);
- rect.setHeight(indicatorHeight);
- rect.moveTop((textRect.height() - indicatorHeight) / 2);
-
- } else if (subControl == SC_GroupBoxLabel) {
- if (groupBoxWidget->isCheckable())
- rect.adjust(indicatorWidth + 4, 0, 0, 0);
- rect.setSize(textRect);
- }
- rect = visualRect(option->direction, option->rect, rect);
+ fontMetrics = QFontMetrics(font);
+ }
+
+ QSize textRect = fontMetrics.boundingRect(groupBox->text).size() + QSize(4, 4);
+ int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget);
+ int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget);
+
+ if (subControl == SC_GroupBoxCheckBox) {
+ rect.setWidth(indicatorWidth);
+ rect.setHeight(indicatorHeight);
+ rect.moveTop((textRect.height() - indicatorHeight) / 2);
+
+ } else if (subControl == SC_GroupBoxLabel) {
+ if (groupBox->subControls & SC_GroupBoxCheckBox)
+ rect.adjust(indicatorWidth + 4, 0, 0, 0);
+ rect.setSize(textRect);
}
+ rect = visualRect(option->direction, option->rect, rect);
}
return rect;
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 04fea3ec47..b2bf2c5565 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -661,11 +661,11 @@ static CGColorSpaceRef qt_mac_displayColorSpace(const QWidget *widget)
bool qt_macWindowIsTextured(const QWidget *window)
{
- NSWindow *nswindow = static_cast<NSWindow*>(
- QApplication::platformNativeInterface()->nativeResourceForWindow("NSWindow", window->windowHandle()));
- if (!nswindow)
- return false;
- return ([nswindow styleMask] & NSTexturedBackgroundWindowMask) ? true : false;
+ if (QWindow *w = window->windowHandle())
+ if (w->handle())
+ if (NSWindow *nswindow = static_cast<NSWindow*>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("NSWindow"), w)))
+ return ([nswindow styleMask] & NSTexturedBackgroundWindowMask) ? true : false;
+ return false;
}
/*****************************************************************************
@@ -1785,6 +1785,7 @@ QMacStyle::~QMacStyle()
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
[[NSNotificationCenter defaultCenter] removeObserver:receiver];
+ [receiver release];
}
#endif
@@ -2465,9 +2466,6 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_TabBar_PreferNoArrows:
ret = true;
break;
- case SH_LineEdit_PasswordCharacter:
- ret = kBulletUnicode;
- break;
/*
case SH_DialogButtons_DefaultButton:
ret = QDialogButtons::Reject;
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 86fccabcbc..0acd6052c8 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -602,21 +602,6 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid
}
break;
#endif // QT_NO_RUBBERBAND
- case SH_LineEdit_PasswordCharacter:
- {
-#ifdef Q_OS_WIN
- if (widget && (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) {
- const QFontMetrics &fm = widget->fontMetrics();
- if (fm.inFont(QChar(0x25CF)))
- ret = 0x25CF;
- else if (fm.inFont(QChar(0x2022)))
- ret = 0x2022;
- }
-#endif
- if (!ret)
- ret = '*';
- }
- break;
#ifndef QT_NO_WIZARD
case SH_WizardStyle:
ret = QWizard::ModernStyle;
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 64569cfd9b..31cf329262 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -570,30 +570,6 @@ void QWindowsXPStylePrivate::setTransparency(QWidget *widget, XPThemeData &theme
}
/*! \internal
- Returns true if the native doublebuffer contains a pixel which
- has a non-0xFF alpha value. Should only be use when its
- guaranteed that data painted into the buffer wasn't a proper
- alpha pixmap.
-*/
-bool QWindowsXPStylePrivate::hasAnyData(const QRect &rect)
-{
- const int startX = rect.left();
- const int startY = rect.top();
- const int w = rect.width();
- const int h = rect.height();
-
- for (int y = startY; y < h; ++y) {
- register DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
- for (int x = startX; x < w; ++x, ++buffer) {
- int alpha = (*buffer) >> 24;
- if (alpha != 0xFF) // buffer has been touched
- return true;
- }
- }
- return false;
-}
-
-/*! \internal
Returns true if the native doublebuffer contains pixels with
varying alpha value.
*/
@@ -857,7 +833,6 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
bool stateHasData = true; // We assume so;
bool hasAlpha = false;
bool partIsTransparent;
- bool inspectData;
bool potentialInvalidAlpha;
QString pixmapCacheKey = QStringLiteral("$qt_xp_");
@@ -882,9 +857,6 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
bool haveCachedPixmap = false;
bool isCached = data.dataValid;
if (isCached) {
- if (!(stateHasData = data.hasAnyData))
- return; // Cached NOOP
- inspectData = data.wasAlphaSwapped;
partIsTransparent = data.partIsTransparent;
hasAlpha = data.hasAlphaChannel;
alphaType = data.alphaType;
@@ -907,13 +879,6 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
pGetThemeBool(themeData.handle(), themeData.partId, themeData.stateId, TMT_BORDERONLY, &tmt_borderonly);
pGetThemeColor(themeData.handle(), themeData.partId, themeData.stateId, TMT_TRANSPARENTCOLOR, &tmt_transparentcolor);
pGetThemePropertyOrigin(themeData.handle(), themeData.partId, themeData.stateId, TMT_CAPTIONMARGINS, &proporigin);
- inspectData = (tmt_transparentcolor != 0 || tmt_borderonly || proporigin == PO_PART || proporigin == PO_STATE);
-
- // ### This is a vista-specific workaround for broken alpha in titlebar pixmaps
- if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) {
- if (themeData.partId == WP_CAPTION || themeData.partId == WP_SMALLCAPTION)
- inspectData = false;
- }
partIsTransparent = isTransparent(themeData);
@@ -922,14 +887,13 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
if (proporigin == PO_PART || proporigin == PO_STATE) {
int tmt_glyphtype = GT_NONE;
pGetThemeEnumValue(themeData.handle(), themeData.partId, themeData.stateId, TMT_GLYPHTYPE, &tmt_glyphtype);
- potentialInvalidAlpha = partIsTransparent && !inspectData && tmt_glyphtype == GT_IMAGEGLYPH;
+ potentialInvalidAlpha = partIsTransparent && tmt_glyphtype == GT_IMAGEGLYPH;
}
#ifdef DEBUG_XP_STYLE
printf("---[ NOT CACHED ]-----------------------> Name(%-10s) Part(%d) State(%d)\n",
qPrintable(themeData.name), themeData.partId, themeData.stateId);
printf("-->partIsTransparen = %d\n", partIsTransparent);
- printf("-->inspectData = %d\n", inspectData);
printf("-->potentialInvalidAlpha = %d\n", potentialInvalidAlpha);
showProperties(themeData);
#endif
@@ -979,7 +943,7 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
// Clear the buffer
if (alphaType != NoAlpha) {
// Consider have separate "memset" function for small chunks for more speedup
- memset(bufferPixels, inspectData ? 0xFF : 0x00, bufferW * h * 4);
+ memset(bufferPixels, 0x00, bufferW * h * 4);
}
// Difference between area and rect
@@ -1021,8 +985,6 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
// If not cached, analyze the buffer data to figure
// out alpha type, and if it contains data
if (!isCached) {
- if (inspectData)
- stateHasData = hasAnyData(rect);
// SHORTCUT: If the part's state has no data, cache it for NOOP later
if (!stateHasData) {
memset(&data, 0, sizeof(data));
@@ -1038,10 +1000,6 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
#endif
}
- // Swap alpha values, if needed
- if (inspectData)
- wasAlphaSwapped = swapAlphaChannel(rect);
-
// Fix alpha values, if needed
if (potentialInvalidAlpha)
wasAlphaFixed = fixAlphaChannel(rect);
@@ -1143,7 +1101,6 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa
data.partIsTransparent = partIsTransparent;
data.alphaType = alphaType;
data.hasAlphaChannel = hasAlpha;
- data.hasAnyData = stateHasData;
data.wasAlphaSwapped = wasAlphaSwapped;
data.hadInvalidAlpha = wasAlphaFixed;
alphaCache.insert(key, data);
diff --git a/src/widgets/styles/qwindowsxpstyle_p_p.h b/src/widgets/styles/qwindowsxpstyle_p_p.h
index 783adc3085..27d9c9acc9 100644
--- a/src/widgets/styles/qwindowsxpstyle_p_p.h
+++ b/src/widgets/styles/qwindowsxpstyle_p_p.h
@@ -274,12 +274,11 @@ struct ThemeMapData {
bool dataValid : 1; // Only used to detect if hash value is ok
bool partIsTransparent : 1;
- bool hasAnyData : 1; // False = part & state has not data, NOP
bool hasAlphaChannel : 1; // True = part & state has real Alpha
bool wasAlphaSwapped : 1; // True = alpha channel needs to be swapped
bool hadInvalidAlpha : 1; // True = alpha channel contained invalid alpha values
- ThemeMapData() : dataValid(false), partIsTransparent(false), hasAnyData(false),
+ ThemeMapData() : dataValid(false), partIsTransparent(false),
hasAlphaChannel(false), wasAlphaSwapped(false), hadInvalidAlpha(false) {}
};
@@ -339,7 +338,6 @@ public:
void drawBackgroundThruNativeBuffer(XPThemeData &themeData);
void drawBackgroundDirectly(XPThemeData &themeData);
- bool hasAnyData(const QRect &rect);
bool hasAlphaChannel(const QRect &rect);
bool fixAlphaChannel(const QRect &rect);
bool swapAlphaChannel(const QRect &rect, bool allPixels = false);
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 765dcb8981..288375fe28 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -990,6 +990,7 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
selectAll();
event->ignore();
emit editingFinished();
+ emit d->edit->returnPressed();
return;
#ifdef QT_KEYPAD_NAVIGATION
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index ea58ec1429..abef6e8832 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -360,9 +360,9 @@ void QLineEdit::setPlaceholderText(const QString& placeholderText)
\brief the displayed text
If \l echoMode is \l Normal this returns the same as text(); if
- \l EchoMode is \l Password or \l PasswordEchoOnEdit it returns a string of asterisks
- text().length() characters long, e.g. "******"; if \l EchoMode is
- \l NoEcho returns an empty string, "".
+ \l EchoMode is \l Password or \l PasswordEchoOnEdit it returns a string of
+ platform-dependent password mask characters text().length() in size,
+ e.g. "******"; if \l EchoMode is \l NoEcho returns an empty string, "".
By default, this property contains an empty string.
@@ -440,10 +440,11 @@ void QLineEdit::setFrame(bool enable)
\value NoEcho Do not display anything. This may be appropriate
for passwords where even the length of the
password should be kept secret.
- \value Password Display asterisks instead of the characters
- actually entered.
+ \value Password Display platform-dependent password mask characters instead
+ of the characters actually entered.
\value PasswordEchoOnEdit Display characters as they are entered
- while editing otherwise display asterisks.
+ while editing otherwise display characters as with
+ \c Password.
\sa setEchoMode(), echoMode()
*/
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index dfa906d2ea..aaedd7ffee 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -1967,8 +1967,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
pos.setX(mouse.x() - size.width());
#ifndef QT_NO_MENUBAR
- // if in a menubar, it should be right-aligned
- if (qobject_cast<QMenuBar*>(d->causedPopup.widget))
+ // if the menu is in a menubar or is a submenu, it should be right-aligned
+ if (qobject_cast<QMenuBar*>(d->causedPopup.widget) || qobject_cast<QMenu*>(d->causedPopup.widget))
pos.rx() -= size.width();
#endif //QT_NO_MENUBAR
@@ -3004,6 +3004,7 @@ void QMenu::actionEvent(QActionEvent *e)
} else if (e->type() == QEvent::ActionRemoved) {
QPlatformMenuItem *menuItem = d->platformMenu->menuItemForTag(reinterpret_cast<quintptr>(e->action()));
d->platformMenu->removeMenuItem(menuItem);
+ delete menuItem;
} else if (e->type() == QEvent::ActionChanged) {
QPlatformMenuItem *menuItem = d->platformMenu->menuItemForTag(reinterpret_cast<quintptr>(e->action()));
copyActionToPlatformItem(e->action(), menuItem);
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 88690f8bff..f08689cb9b 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -680,6 +680,10 @@ void QToolButton::showMenu()
d->menuButtonDown = false;
return; // no menu to show
}
+ // prevent recursions spinning another event loop
+ if (d->menuButtonDown)
+ return;
+
d->menuButtonDown = true;
repaint();
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index 47e137976b..0e20041a62 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -985,12 +985,22 @@ void QXmlNamespaceSupport::reset()
Constructs an empty attribute list.
*/
+QXmlAttributes::QXmlAttributes()
+{
+ // ### In Qt 5.0, this function was inlined and d was not initialized
+ // The member cannot be used until Qt 6.0
+ Q_UNUSED(d);
+}
/*!
\fn QXmlAttributes::~QXmlAttributes()
Destroys the attributes object.
*/
+QXmlAttributes::~QXmlAttributes()
+{
+}
+
/*!
Looks up the index of an attribute by the qualified name \a qName.
@@ -2400,11 +2410,21 @@ events are reported.
Constructs a handler for use with subclasses of QXmlReader.
*/
+QXmlDefaultHandler::QXmlDefaultHandler()
+{
+ // ### In Qt 5.0, this function was inlined and d was not initialized
+ // The member cannot be used until Qt 6.0
+ Q_UNUSED(d);
+}
+
/*!
\fn QXmlDefaultHandler::~QXmlDefaultHandler()
Destroys the handler.
*/
+QXmlDefaultHandler::~QXmlDefaultHandler()
+{
+}
/*!
\reimp
diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h
index 4ce2c26b05..743f8702af 100644
--- a/src/xml/sax/qxml.h
+++ b/src/xml/sax/qxml.h
@@ -117,8 +117,8 @@ private:
class Q_XML_EXPORT QXmlAttributes
{
public:
- QXmlAttributes() {}
- virtual ~QXmlAttributes() {}
+ QXmlAttributes();
+ virtual ~QXmlAttributes();
int index(const QString& qName) const;
int index(QLatin1String qName) const;
@@ -365,8 +365,8 @@ public:
class Q_XML_EXPORT QXmlDefaultHandler : public QXmlContentHandler, public QXmlErrorHandler, public QXmlDTDHandler, public QXmlEntityResolver, public QXmlLexicalHandler, public QXmlDeclHandler
{
public:
- QXmlDefaultHandler() { }
- virtual ~QXmlDefaultHandler() { }
+ QXmlDefaultHandler();
+ virtual ~QXmlDefaultHandler();
void setDocumentLocator(QXmlLocator* locator);
bool startDocument();
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index ad31956f62..77cf81989a 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -70,8 +70,8 @@ if (NOT NO_DBUS)
expect_pass(test_dbus_module)
endif()
expect_pass(test_multiple_find_package)
-if (NOT WIN32)
- # Currently broken on windows. Reported upstream:
+if (NOT WIN32 OR (WIN32 AND NOT CMAKE_VERSION VERSION_LESS 2.8.11))
+ # Broken on windows on earlier CMake versions.
# http://public.kitware.com/Bug/view.php?id=13392
expect_pass(test_add_resources_delayed_file)
endif()
diff --git a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
index 4a43ea8201..3653fdb9e0 100644
--- a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
+++ b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
@@ -149,20 +149,25 @@ void tst_QBuffer::readBlock()
const int arraySize = 10;
char a[arraySize];
QBuffer b;
+ QCOMPARE(b.bytesAvailable(), (qint64) 0); // no data
QCOMPARE(b.read(a, arraySize), (qint64) -1); // not opened
QVERIFY(b.atEnd());
QByteArray ba;
ba.resize(arraySize);
b.setBuffer(&ba);
+ QCOMPARE(b.bytesAvailable(), (qint64) arraySize);
b.open(QIODevice::WriteOnly);
+ QCOMPARE(b.bytesAvailable(), (qint64) arraySize);
QTest::ignoreMessage(QtWarningMsg, "QIODevice::read: WriteOnly device");
QCOMPARE(b.read(a, arraySize), (qint64) -1); // no read access
b.close();
b.open(QIODevice::ReadOnly);
+ QCOMPARE(b.bytesAvailable(), (qint64) arraySize);
QCOMPARE(b.read(a, arraySize), (qint64) arraySize);
QVERIFY(b.atEnd());
+ QCOMPARE(b.bytesAvailable(), (qint64) 0);
// up to 3.0.x reading beyond the end was an error while ok
// this has been made consistent with other QIODevice sub classes in 3.1
@@ -172,10 +177,13 @@ void tst_QBuffer::readBlock()
// read in two chunks
b.close();
b.open(QIODevice::ReadOnly);
+ QCOMPARE(b.bytesAvailable(), (qint64) arraySize);
QCOMPARE(b.read(a, arraySize/2), (qint64) arraySize/2);
+ QCOMPARE(b.bytesAvailable(), (qint64) arraySize/2);
QCOMPARE(b.read(a + arraySize/2, arraySize - arraySize/2),
(qint64)(arraySize - arraySize/2));
QVERIFY(b.atEnd());
+ QCOMPARE(b.bytesAvailable(), (qint64) 0);
}
void tst_QBuffer::readBlockPastEnd()
@@ -319,9 +327,12 @@ void tst_QBuffer::seekTest()
buf.open(QIODevice::ReadWrite);
QCOMPARE(buf.pos(), qint64(0));
+ QCOMPARE(buf.bytesAvailable(), qint64(0));
QByteArray data = str.toLatin1();
QCOMPARE(buf.write( data.constData(), data.size() ), qint64(data.size()));
+ QCOMPARE(buf.bytesAvailable(), qint64(0)); // we're at the end
+ QCOMPARE(buf.size(), qint64(data.size()));
QTest::ignoreMessage(QtWarningMsg, "QBuffer::seek: Invalid pos: -1");
DO_INVALID_SEEK(-1);
@@ -336,6 +347,7 @@ void tst_QBuffer::seekTest()
{
char c = 'a';
QVERIFY(buf.seek(qint64(str.size())));
+ QCOMPARE(buf.bytesAvailable(), qint64(0));
QCOMPARE(buf.read(&c, qint64(1)), qint64(0));
QCOMPARE(c, 'a');
QCOMPARE(buf.write(&c, qint64(1)), qint64(1));
@@ -347,6 +359,7 @@ void tst_QBuffer::seekTest()
const int offset = 1; // any positive integer will do
const qint64 pos = buf.size() + offset;
QVERIFY(buf.seek(pos));
+ QCOMPARE(buf.bytesAvailable(), qint64(0));
QCOMPARE(buf.pos(), pos);
QVERIFY(!buf.getChar(&c));
QVERIFY(buf.seek(pos - 1));
@@ -533,7 +546,11 @@ void tst_QBuffer::readLineBoundaries()
lineByLine.append(buffer.readLine());
buffer.seek(0);
- QCOMPARE(lineByLine, buffer.readAll());
+ QCOMPARE(buffer.bytesAvailable(), lineByLine.size());
+
+ QByteArray all = buffer.readAll();
+ QCOMPARE(all.size(), lineByLine.size());
+ QCOMPARE(all, lineByLine);
}
// Test that any character in a buffer can be read and pushed back.
@@ -548,7 +565,9 @@ void tst_QBuffer::getAndUngetChar()
// Take a copy of the data held in the buffer
buffer.seek(0);
+ QCOMPARE(buffer.bytesAvailable(), buffer.size());
QByteArray data = buffer.readAll();
+ QCOMPARE(buffer.bytesAvailable(), qint64(0));
// Get and unget each character in order
for (qint64 i = 0; i < buffer.size(); ++i) {
@@ -570,7 +589,9 @@ void tst_QBuffer::getAndUngetChar()
// Verify that the state of the buffer still matches the original data.
buffer.seek(0);
+ QCOMPARE(buffer.bytesAvailable(), data.size());
QCOMPARE(buffer.readAll(), data);
+ QCOMPARE(buffer.bytesAvailable(), qint64(0));
}
void tst_QBuffer::writeAfterQByteArrayResize()
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 929865d4d6..cca4655f58 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -1057,7 +1057,7 @@ void tst_QFile::ungetChar()
QCOMPARE(buf[2], '4');
}
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QString driveLetters()
{
wchar_t volumeName[MAX_PATH];
@@ -1094,7 +1094,9 @@ void tst_QFile::invalidFile_data()
#if !defined(Q_OS_WIN)
QTest::newRow( "x11" ) << QString( "qwe//" );
#else
+#if !defined(Q_OS_WINCE)
QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid");
+#endif
QTest::newRow( "colon3" ) << QString( ":failinvalid" );
QTest::newRow( "forwardslash" ) << QString( "fail/invalid" );
QTest::newRow( "asterisk" ) << QString( "fail*invalid" );
diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
index 561b7ed9cc..5009fedc4f 100644
--- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
+++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
@@ -5,11 +5,11 @@ SOURCES = tst_qmetatype.cpp
TESTDATA=./typeFlags.bin
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-win32-msvc* {
+win32-msvc*|wince {
# Prevents "fatal error C1128: number of sections exceeded object file format limit".
QMAKE_CXXFLAGS += /bigobj
# Reduce compile time
- win32-msvc2012 {
+ win32-msvc2012|wince {
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE -= -O2
}
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index b84039f557..6cfcf74069 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -478,7 +478,12 @@ void tst_QDateTime::setMSecsSinceEpoch_data()
// positive value 1 too big for qint64max, causing an overflow.
<< std::numeric_limits<qint64>::min() + 1
<< QDateTime(QDate(-292275056, 5, 16), QTime(16, 47, 4, 193), Qt::UTC)
+#ifdef Q_OS_WIN
+ // Windows applies Daylight Time to dates before 1980, Olsen does not
+ << QDateTime(QDate(-292275056, 5, 16), QTime(18, 47, 4, 193), Qt::LocalTime);
+#else
<< QDateTime(QDate(-292275056, 5, 16), QTime(17, 47, 4, 193), Qt::LocalTime);
+#endif
QTest::newRow("max")
<< std::numeric_limits<qint64>::max()
<< QDateTime(QDate(292278994, 8, 17), QTime(7, 12, 55, 807), Qt::UTC)
@@ -844,10 +849,20 @@ void tst_QDateTime::toTimeSpec_data()
QTest::newRow("-271821/4/20 00:00 UTC (JavaScript min date, start of day)")
<< QDateTime(QDate(-271821, 4, 20), QTime(0, 0, 0), Qt::UTC)
+#ifdef Q_OS_WIN
+ // Windows applies Daylight Time to dates before 1980, Olsen does not
+ << QDateTime(QDate(-271821, 4, 20), QTime(2, 0, 0), Qt::LocalTime);
+#else
<< QDateTime(QDate(-271821, 4, 20), QTime(1, 0, 0), Qt::LocalTime);
+#endif
QTest::newRow("-271821/4/20 23:00 UTC (JavaScript min date, end of day)")
<< QDateTime(QDate(-271821, 4, 20), QTime(23, 0, 0), Qt::UTC)
+#ifdef Q_OS_WIN
+ // Windows applies Daylight Time to dates before 1980, Olsen does not
+ << QDateTime(QDate(-271821, 4, 21), QTime(1, 0, 0), Qt::LocalTime);
+#else
<< QDateTime(QDate(-271821, 4, 21), QTime(0, 0, 0), Qt::LocalTime);
+#endif
QTest::newRow("QDate min")
<< QDateTime(QDate::fromJulianDay(minJd()), QTime(0, 0, 0), Qt::UTC)
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index 2932387bdb..108ec466c9 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -41,8 +41,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
-
-#include <time.h>
+#include <QtCore/QDateTime>
#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfigmanager.h>
@@ -531,13 +530,9 @@ void tst_NetworkSelfTest::imapServer()
void tst_NetworkSelfTest::httpServer()
{
- QString uniqueExtension;
- qsrand(time(0));
-#ifndef Q_OS_WINCE
- uniqueExtension = QString("%1%2%3").arg((qulonglong)this).arg(qrand()).arg((qulonglong)time(0));
-#else
- uniqueExtension = QString("%1%2").arg((qulonglong)this).arg(qrand());
-#endif
+ QByteArray uniqueExtension = QByteArray::number((qulonglong)this) +
+ QByteArray::number((qulonglong)qrand()) +
+ QByteArray::number((qulonglong)QDateTime::currentDateTime().toTime_t());
netChat(80, QList<Chat>()
// HTTP/0.9 chat:
@@ -603,7 +598,7 @@ void tst_NetworkSelfTest::httpServer()
// HTTP/1.0 PUT
<< Chat::Reconnect
- << Chat::send("PUT /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n"
+ << Chat::send("PUT /dav/networkselftest-" + uniqueExtension + ".txt HTTP/1.0\r\n"
"Content-Length: 5\r\n"
"Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
"Connection: close\r\n"
@@ -616,7 +611,7 @@ void tst_NetworkSelfTest::httpServer()
// check that the file did get uploaded
<< Chat::Reconnect
- << Chat::send("HEAD /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n"
+ << Chat::send("HEAD /dav/networkselftest-" + uniqueExtension + ".txt HTTP/1.0\r\n"
"Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
"Connection: close\r\n"
"\r\n")
@@ -628,7 +623,7 @@ void tst_NetworkSelfTest::httpServer()
// HTTP/1.0 DELETE
<< Chat::Reconnect
- << Chat::send("DELETE /dav/networkselftest-" + uniqueExtension.toLatin1() + ".txt HTTP/1.0\r\n"
+ << Chat::send("DELETE /dav/networkselftest-" + uniqueExtension + ".txt HTTP/1.0\r\n"
"Host: " + QtNetworkSettings::serverName().toLatin1() + "\r\n"
"Connection: close\r\n"
"\r\n")
diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro
index 071b0bb66c..70f6633195 100644
--- a/tests/auto/other/qaccessibility/qaccessibility.pro
+++ b/tests/auto/other/qaccessibility/qaccessibility.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
TARGET = tst_qaccessibility
requires(contains(QT_CONFIG,accessibility))
-QT += testlib gui-private widgets-private
+QT += testlib core-private gui-private widgets-private
SOURCES += tst_qaccessibility.cpp
unix:!mac:LIBS+=-lm
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 4e0b3298fc..af8e4472ed 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -63,6 +63,9 @@
#include <QtWidgets/private/qaccessiblewidget_p.h>
#include <math.h>
#include <qpa/qplatformnativeinterface.h>
+#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformaccessibility.h>
+#include <QtGui/private/qguiapplication_p.h>
#if defined(Q_OS_WIN) && defined(interface)
# undef interface
@@ -311,6 +314,8 @@ void tst_QAccessibility::onClicked()
void tst_QAccessibility::initTestCase()
{
QTestAccessibility::initialize();
+ QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration();
+ pfIntegration->accessibility()->setActive(true);
}
void tst_QAccessibility::cleanupTestCase()
diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
index 15b8089525..79fd29f2a1 100644
--- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
+++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
@@ -55,6 +55,7 @@
#include <QDBusReply>
#include "atspi/atspi-constants.h"
+#include "bus_interface.h"
#include "dbusconnection_p.h"
#include "struct_marshallers_p.h"
@@ -154,16 +155,21 @@ QDBusInterface *tst_QAccessibilityLinux::getInterface(const QString &path, const
return new QDBusInterface(address, path, interfaceName, dbus.connection(), this);
}
-
void tst_QAccessibilityLinux::initTestCase()
{
// Oxygen style creates many extra items, it's simply unusable here
qApp->setStyle("fusion");
qApp->setApplicationName("tst_QAccessibilityLinux app");
+ // Pretend we are a screen reader
+ QDBusConnection c = QDBusConnection::sessionBus();
+ OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(QStringLiteral("org.a11y.Bus"), QStringLiteral("/org/a11y/bus"), c, this);
+ a11yStatus->setScreenReaderEnabled(true);
+
QTRY_VERIFY(dbus.isEnabled());
QTRY_VERIFY(dbus.connection().isConnected());
address = dbus.connection().baseService().toLatin1().data();
+ QVERIFY(!address.isEmpty());
m_window = new AccessibleTestWindow();
m_window->show();
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index c8ea74e6b2..b117edddd4 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -119,6 +119,8 @@ private slots:
void taskQTBUG4497_reusePrinterOnDifferentFiles();
void testPdfTitle();
+ void testPageMetrics_data();
+ void testPageMetrics();
#endif
};
@@ -1108,6 +1110,42 @@ void tst_QPrinter::testPdfTitle()
const char *expected = reinterpret_cast<const char*>(expectedBuf);
QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
}
+
+void tst_QPrinter::testPageMetrics_data()
+{
+ QTest::addColumn<int>("pageSize");
+ QTest::addColumn<int>("widthMM");
+ QTest::addColumn<int>("heightMM");
+ QTest::addColumn<float>("widthMMf");
+ QTest::addColumn<float>("heightMMf");
+
+ QTest::newRow("A4") << int(QPrinter::A4) << 210 << 297 << 210.0f << 297.0f;
+ QTest::newRow("A5") << int(QPrinter::A5) << 148 << 210 << 148.0f << 210.0f;
+ QTest::newRow("Letter") << int(QPrinter::Letter) << 216 << 279 << 215.9f << 279.4f;
+}
+
+void tst_QPrinter::testPageMetrics()
+{
+ QFETCH(int, pageSize);
+ QFETCH(int, widthMM);
+ QFETCH(int, heightMM);
+ QFETCH(float, widthMMf);
+ QFETCH(float, heightMMf);
+
+ QPrinter printer(QPrinter::HighResolution);
+ printer.setFullPage(true);
+ printer.setPageSize(QPrinter::PageSize(pageSize));
+
+ if (printer.pageSize() != pageSize) {
+ QSKIP("Current page size is not supported on this printer");
+ return;
+ }
+
+ QCOMPARE(printer.widthMM(), int(widthMM));
+ QCOMPARE(printer.heightMM(), int(heightMM));
+ QCOMPARE(printer.pageSizeMM(), QSizeF(widthMMf, heightMMf));
+}
+
#endif // QT_NO_PRINTER
QTEST_MAIN(tst_QPrinter)
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
index eebfdfac65..e215fd1086 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
@@ -661,7 +661,7 @@ void _scrollBarRanges_data()
}
const QScreen *screen = QGuiApplication::primaryScreen();
- if (screen && qFuzzyCompare(screen->logicalDotsPerInchX(), 96.0)) {
+ if (screen && qFuzzyCompare((double)screen->logicalDotsPerInchX(), 96.0)) {
_scrollBarRanges_addTestData(QString("motif"), false);
_scrollBarRanges_addTestData(QString("motif"), true);
}
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index ef91d6d3d2..fc94f95f8e 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -548,7 +548,7 @@ void tst_QStyle::testMacStyle()
void tst_QStyle::testWindowsCEStyle()
{
QStyle *cstyle = QStyleFactory::create("WindowsCE");
- QVERIFY(testAllFunctions(&cstyle));
+ QVERIFY(testAllFunctions(cstyle));
delete cstyle;
}
#endif
@@ -558,7 +558,7 @@ void tst_QStyle::testWindowsCEStyle()
void tst_QStyle::testWindowsMobileStyle()
{
QStyle *cstyle = QStyleFactory::create("WindowsMobile");
- QVERIFY(testAllFunctions(&cstyle));
+ QVERIFY(testAllFunctions(cstyle));
delete cstyle;
}
#endif
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index e48316fd19..3c32b8a476 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -101,6 +101,7 @@ private slots:
void pushButtonPopulateOnAboutToShow();
void QTBUG7907_submenus_autoselect();
void QTBUG7411_submenus_activate();
+ void QTBUG30595_rtl_submenu();
void QTBUG20403_nested_popup_on_shortcut_trigger();
void QTBUG_10735_crashWithDialog();
protected slots:
@@ -896,6 +897,22 @@ void tst_QMenu::QTBUG7411_submenus_activate()
QTRY_VERIFY(sub1.isVisible());
}
+void tst_QMenu::QTBUG30595_rtl_submenu()
+{
+ QMenu menu("Test Menu");
+ menu.setLayoutDirection(Qt::RightToLeft);
+ QMenu sub("&sub");
+ sub.addAction("bar");
+ sub.setTitle("&sub");
+ menu.addMenu(&sub);
+ menu.move(200, 20);
+ menu.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&menu));
+ QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) );
+ QTRY_VERIFY(sub.isVisible());
+ QVERIFY(sub.pos().x() < menu.pos().x());
+}
+
void tst_QMenu::QTBUG20403_nested_popup_on_shortcut_trigger()
{
QMenu menu("Test Menu");
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 89b7bc6790..a64b34c56a 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -138,7 +138,7 @@ private slots:
void integerOverflow();
void taskQTBUG_5008_textFromValueAndValidate();
-
+ void lineEditReturnPressed();
public slots:
void valueChangedHelper(const QString &);
void valueChangedHelper(int);
@@ -1044,5 +1044,14 @@ void tst_QSpinBox::integerOverflow()
QCOMPARE(sb.value(), INT_MIN);
}
+void tst_QSpinBox::lineEditReturnPressed()
+{
+ SpinBox spinBox;
+ QSignalSpy spyCurrentChanged(spinBox.lineEdit(), SIGNAL(returnPressed()));
+ spinBox.show();
+ QTest::keyClick(&spinBox, Qt::Key_Return);
+ QCOMPARE(spyCurrentChanged.count(), 1);
+}
+
QTEST_MAIN(tst_QSpinBox)
#include "tst_qspinbox.moc"
diff --git a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
index 0b569cc49d..8d388751d5 100644
--- a/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
+++ b/tests/benchmarks/corelib/io/qprocess/tst_bench_qprocess.cpp
@@ -46,7 +46,7 @@ class tst_QProcess : public QObject
{
Q_OBJECT
-#ifndef QT_NO_PROCESS
+#if !defined(QT_NO_PROCESS) && !defined(Q_OS_WINCE)
private slots:
void echoTest_performance();
@@ -54,8 +54,7 @@ private slots:
#endif // QT_NO_PROCESS
};
-#ifndef QT_NO_PROCESS
-#ifndef Q_OS_WINCE
+#if !defined(QT_NO_PROCESS) && !defined(Q_OS_WINCE)
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::echoTest_performance()
{
@@ -101,9 +100,8 @@ void tst_QProcess::echoTest_performance()
process.closeWriteChannel();
QVERIFY(process.waitForFinished());
}
-#endif // Q_OS_WINCE
-#endif // QT_NO_PROCESS
+#endif // QT_NO_PROCESS && Q_OS_WINCE
QTEST_MAIN(tst_QProcess)
#include "tst_bench_qprocess.moc"
diff --git a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro
index bfea404980..abfebad2aa 100644
--- a/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro
+++ b/tests/benchmarks/sql/kernel/qsqlquery/qsqlquery.pro
@@ -3,5 +3,5 @@ TARGET = tst_bench_qsqlquery
SOURCES += main.cpp
QT = core sql testlib core-private sql-private
-win32: LIBS += -lws2_32
+LIBS += $$QMAKE_LIBS_NETWORK
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp
index b7cbcc5cb9..1b4053ccdf 100644
--- a/tools/configure/environment.cpp
+++ b/tools/configure/environment.cpp
@@ -146,7 +146,7 @@ Compiler Environment::compilerFromQMakeSpec(const QString &qmakeSpec)
{
if (qmakeSpec == QLatin1String("win32-msvc2012"))
return CC_NET2012;
- if (qmakeSpec == QLatin1String("win32-msvc2012"))
+ if (qmakeSpec == QLatin1String("win32-msvc2010"))
return CC_NET2010;
if (qmakeSpec == QLatin1String("win32-msvc2008"))
return CC_NET2008;
diff --git a/util/accessibilityinspector/accessibilityinspector.cpp b/util/accessibilityinspector/accessibilityinspector.cpp
index b7cc9919a4..bf55c36df9 100644
--- a/util/accessibilityinspector/accessibilityinspector.cpp
+++ b/util/accessibilityinspector/accessibilityinspector.cpp
@@ -62,7 +62,7 @@ void MouseInterceptingGraphicsScene::mouseDoubleClickEvent(QGraphicsSceneMouseEv
AccessibilitySceneManager *sceneManager = 0;
QAccessible::UpdateHandler previousUpdateHandler = 0;
bool updateHandlerRecursion = false;
-void accessibilityUpdateHandler(QObject *object, int who, QAccessible::Event reason)
+void accessibilityUpdateHandler(QAccessibleEvent *event)
{
if (updateHandlerRecursion)
return;
@@ -70,13 +70,13 @@ void accessibilityUpdateHandler(QObject *object, int who, QAccessible::Event rea
updateHandlerRecursion = true;
if (sceneManager) {
- sceneManager->handleUpdate(object, reason);
+ sceneManager->handleUpdate(event);
//qDebug() << "update";
}
if (previousUpdateHandler) // call prev just to be sure.
- previousUpdateHandler(object, who, reason);
+ previousUpdateHandler(event);
updateHandlerRecursion = false;
}
diff --git a/util/accessibilityinspector/accessibilityscenemanager.cpp b/util/accessibilityinspector/accessibilityscenemanager.cpp
index 80bc3f4ba8..1a9cf12e00 100644
--- a/util/accessibilityinspector/accessibilityscenemanager.cpp
+++ b/util/accessibilityinspector/accessibilityscenemanager.cpp
@@ -73,7 +73,6 @@ void AccessibilitySceneManager::updateAccessibilitySceneItemFlags()
if (!interface)
continue;
updateItemFlags(m_graphicsItems.value(object), interface);
- delete interface;
}
}
@@ -89,15 +88,18 @@ void AccessibilitySceneManager::populateAccessibilityTreeScene()
populateAccessibilityTreeScene(rootInterface);
}
-void AccessibilitySceneManager::handleUpdate(QObject *object, QAccessible::Event reason)
+void AccessibilitySceneManager::handleUpdate(QAccessibleEvent *event)
{
+ QObject *object = event->object();
+ QAccessible::Event type = event->type();
+
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(object);
if (!interface)
return;
QString name = interface->text(QAccessible::Name);
- if (reason == QAccessible::ObjectCreated) {
+ if (type == QAccessible::ObjectCreated) {
// qDebug() << "ObjectCreated" << object << name;
populateAccessibilityScene(interface, m_scene);
}
@@ -109,7 +111,7 @@ void AccessibilitySceneManager::handleUpdate(QObject *object, QAccessible::Event
return;
}
- if (reason == QAccessible::LocationChanged) {
+ if (type == QAccessible::LocationChanged) {
//if (name.startsWith("List"))
qDebug() << "locationChange" << object << name << interface->rect();
@@ -119,12 +121,10 @@ void AccessibilitySceneManager::handleUpdate(QObject *object, QAccessible::Event
QAccessibleInterface *child = interface->child(i);
if (child) {
updateItem(m_graphicsItems.value(child->object()), child);
- delete child;
}
}
- delete interface;
- } else if (reason == QAccessible::ObjectDestroyed) {
+ } else if (type == QAccessible::ObjectDestroyed) {
// qDebug() << "ObjectDestroyed" << object << name;
delete m_graphicsItems.value(object);
m_graphicsItems.remove(object);
@@ -132,28 +132,25 @@ void AccessibilitySceneManager::handleUpdate(QObject *object, QAccessible::Event
if (object == m_selectedObject) {
m_selectedObject = 0;
}
- } else if (reason == QAccessible::ObjectHide) {
+ } else if (type == QAccessible::ObjectHide) {
// qDebug() << "ObjectCreated Hide" << object;
updateItemFlags(item, interface);
- } else if (reason == QAccessible::ObjectShow) {
+ } else if (type == QAccessible::ObjectShow) {
// qDebug() << "ObjectCreated Show" << object;
updateItemFlags(item, interface);
- } else if (reason == QAccessible::ScrollingStart) {
+ } else if (type == QAccessible::ScrollingStart) {
qDebug() << "ObjectCreated ScrollingStart" << object;
- QAccessibleInterface *child = 0;
for (int i = 0; i < interface->childCount(); ++i) {
QAccessibleInterface *child = interface->child(i);
if (child) {
m_animatedObjects.insert(child->object());
- delete child;
}
}
- } else if (reason == QAccessible::ScrollingEnd) {
+ } else if (type == QAccessible::ScrollingEnd) {
// qDebug() << "ObjectCreated ScrollingEnd" << object;
foreach (QObject *object, m_animatedObjects) {
updateItem(m_graphicsItems.value(object), interface);
}
- delete interface;
m_animatedObjects.clear();
} else {
@@ -197,10 +194,7 @@ void AccessibilitySceneManager::updateItems(QObject *root)
for (int i = 0; i < interface->childCount(); ++i) {
QAccessibleInterface *child = interface->child(i);
updateItems(child->object());
- delete child;
}
-
- delete interface;
}
void AccessibilitySceneManager::updateItem(QObject *object)
@@ -213,8 +207,6 @@ void AccessibilitySceneManager::updateItem(QObject *object)
return;
updateItem(m_graphicsItems.value(object), interface);
-
- delete interface;
}
void AccessibilitySceneManager::updateItem(QGraphicsRectItem *item, QAccessibleInterface *interface)
@@ -253,9 +245,21 @@ void AccessibilitySceneManager::updateItemFlags(QGraphicsRectItem *item, QAccess
}
}
+ if (m_optionsWidget->hideNullObjectItems()) {
+ if (interface->object() == 0) {
+ shouldShow = false;
+ }
+ }
+
+ if (m_optionsWidget->hideNullRectItems()) {
+ if (interface->rect().isNull()) {
+ shouldShow = false;
+ }
+ }
+
item->setVisible(shouldShow);
- if (interface->object() == m_selectedObject)
+ if (interface->object() && interface->object() == m_selectedObject)
item->setBrush(QColor(Qt::yellow));
else
item->setBrush(QColor(Qt::white));
@@ -320,7 +324,6 @@ void AccessibilitySceneManager::populateAccessibilityScene(QAccessibleInterface
QAccessibleInterface *child = interface->child(i);
updateItems(child->object());
populateAccessibilityScene(child, scene);
- delete child;
}
}
@@ -339,7 +342,6 @@ AccessibilitySceneManager::TreeItem AccessibilitySceneManager::computeLevels(QAc
TreeItem childLevel = computeLevels(child, level + 1);
currentLevel.children.append(childLevel);
currentLevel.width += childLevel.width + m_treeItemHorizontalPadding;
- delete child;
}
}
@@ -392,7 +394,7 @@ void AccessibilitySceneManager::addGraphicsItems(AccessibilitySceneManager::Tree
graphicsItem->setRect(0, 0, m_treeItemWidth, m_treeItemHeight);
graphicsItem->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
- if (item.object == m_selectedObject)
+ if (item.object && item.object == m_selectedObject)
graphicsItem->setBrush(QColor(Qt::yellow));
else
graphicsItem->setBrush(QColor(Qt::white));
@@ -473,11 +475,7 @@ bool AccessibilitySceneManager::isHidden(QAccessibleInterface *interface)
return true;
}
- QAccessibleInterface *parent = current->parent();
-
- if (current != interface)
- delete current;
- current = parent;
+ current = current->parent();
}
return false;
diff --git a/util/accessibilityinspector/accessibilityscenemanager.h b/util/accessibilityinspector/accessibilityscenemanager.h
index 3abc5d1b37..7467cbd0d4 100644
--- a/util/accessibilityinspector/accessibilityscenemanager.h
+++ b/util/accessibilityinspector/accessibilityscenemanager.h
@@ -63,7 +63,7 @@ public slots:
void populateAccessibilityScene();
void updateAccessibilitySceneItemFlags();
void populateAccessibilityTreeScene();
- void handleUpdate(QObject *object, QAccessible::Event reason);
+ void handleUpdate(QAccessibleEvent *event);
void setSelected(QObject *object);
void changeScale(int scale);
diff --git a/util/accessibilityinspector/optionswidget.h b/util/accessibilityinspector/optionswidget.h
index 95c7fdf44a..9283122af7 100644
--- a/util/accessibilityinspector/optionswidget.h
+++ b/util/accessibilityinspector/optionswidget.h
@@ -77,6 +77,18 @@ public:
m_hidePaneItems->setChecked(true);
connect(m_hidePaneItems, SIGNAL(toggled(bool)), SIGNAL(optionsChanged()));
+ m_hideNullObjectItems = new QCheckBox(this);
+ m_layout->addWidget(m_hideNullObjectItems);
+ m_hideNullObjectItems->setText("Hide Items with a null QObject pointer");
+ m_hideNullObjectItems->setChecked(true);
+ connect(m_hideNullObjectItems, SIGNAL(toggled(bool)), SIGNAL(optionsChanged()));
+
+ m_hideNullRectItems = new QCheckBox(this);
+ m_layout->addWidget(m_hideNullRectItems);
+ m_hideNullRectItems->setText("Hide Items with a null rect");
+ m_hideNullRectItems->setChecked(true);
+ connect(m_hideNullRectItems, SIGNAL(toggled(bool)), SIGNAL(optionsChanged()));
+
m_enableTextToSpeach = new QCheckBox(this);
m_layout->addWidget(m_enableTextToSpeach);
m_enableTextToSpeach->setText("Enable Text To Speech");
@@ -96,6 +108,8 @@ public:
bool hideInvisibleItems() { return m_hideInvisibleItems->isChecked(); }
bool hideOffscreenItems() { return m_hideOffscreenItems->isChecked(); }
bool hidePaneItems() { return m_hidePaneItems->isChecked(); }
+ bool hideNullObjectItems() { return m_hideNullObjectItems->isChecked(); }
+ bool hideNullRectItems() { return m_hideNullRectItems->isChecked(); }
bool enableTextToSpeach() { return m_enableTextToSpeach->isChecked(); }
signals:
void optionsChanged();
@@ -109,6 +123,8 @@ private:
QCheckBox *m_hideInvisibleItems;
QCheckBox *m_hideOffscreenItems;
QCheckBox *m_hidePaneItems;
+ QCheckBox *m_hideNullObjectItems;
+ QCheckBox *m_hideNullRectItems;
QCheckBox *m_enableTextToSpeach;
QSlider *m_scale;
};
diff --git a/util/accessibilityinspector/screenreader.cpp b/util/accessibilityinspector/screenreader.cpp
index 8b627b1454..5dcf52ef09 100644
--- a/util/accessibilityinspector/screenreader.cpp
+++ b/util/accessibilityinspector/screenreader.cpp
@@ -42,6 +42,7 @@
#include "screenreader.h"
#include "optionswidget.h"
#include "accessibilityscenemanager.h"
+#include <private/qaccessible2_p.h>
#include <QtGui>
ScreenReader::ScreenReader(QObject *parent) :
@@ -54,8 +55,6 @@ ScreenReader::ScreenReader(QObject *parent) :
ScreenReader::~ScreenReader()
{
- delete m_selectedInterface;
- delete m_rootInterface;
}
void ScreenReader::setRootObject(QObject *rootObject)
@@ -107,7 +106,8 @@ void ScreenReader::processTouchPoint()
}
m_selectedInterface = currentInterface;
- emit selected(m_selectedInterface->object());
+ if (m_selectedInterface->object())
+ emit selected(m_selectedInterface->object());
if (m_optionsWidget->enableTextToSpeach())
speak(m_selectedInterface->text(QAccessible::Name)
/*+ "," + translateRole(m_selectedInterface->role(0)) */);