summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-06-09 13:59:07 +0200
committerPaul Olav Tvete <paul.tvete@theqtcompany.com>2015-06-09 13:59:07 +0200
commit0963be63ce741ef6c7585358c3f3b1cb806b66e8 (patch)
tree6f4964c196b8a52cb15e9efc0388b6a549574460
parent9e6a1351823b3ee3d7e380248f6ef42ff383b014 (diff)
parenteacfbbf64ef90dad8c5cb6b2c812ad64c1100779 (diff)
Merge remote-tracking branch 'qt/dev' into dev-highdpi
Conflicts: src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Icd887552ade61d6a2b2527383970f7145aa00faf
-rw-r--r--config.tests/qpa/eglfs-brcm/eglfs-brcm.pro6
-rwxr-xr-xconfigure51
-rw-r--r--dist/changes-5.4.2124
-rw-r--r--doc/global/externalsites/qt-webpages.qdoc4
-rw-r--r--doc/global/qt-cpp-defines.qdocconf1
-rw-r--r--examples/opengl/legacy/framebufferobject2/framebufferobject2.pro8
-rw-r--r--examples/opengl/legacy/grabber/grabber.pro8
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.h3
-rw-r--r--examples/opengl/legacy/hellogl/hellogl.pro8
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.h3
-rw-r--r--examples/opengl/legacy/overpainting/overpainting.pro8
-rw-r--r--examples/opengl/legacy/pbuffers/pbuffers.pro8
-rw-r--r--examples/opengl/legacy/pbuffers2/pbuffers2.pro8
-rw-r--r--examples/opengl/legacy/samplebuffers/samplebuffers.pro8
-rw-r--r--examples/opengl/legacy/shared/qtlogo.cpp37
-rw-r--r--examples/opengl/legacy/shared/qtlogo.h3
-rw-r--r--examples/opengl/qopenglwidget/glwidget.cpp6
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.cpp20
-rw-r--r--examples/opengl/qopenglwidget/mainwindow.h2
-rw-r--r--examples/sql/books/books.pro2
-rw-r--r--examples/touch/fingerpaint/scribblearea.cpp5
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_accord.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_gallery.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_panel.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/anim_skew.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_backgrounds.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_border-img.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_grad-radial.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_mask-grad.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_mask-img.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/css3_text-overflow.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/form_tapper.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/mob_condjs.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/mobile.js0
-rw-r--r--[-rwxr-xr-x]examples/webkit/webkit-guide/js/storage.js0
-rw-r--r--examples/widgets/doc/images/imagegestures-example.jpgbin0 -> 38962 bytes
-rw-r--r--examples/widgets/doc/src/plugandpaint.qdoc9
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzle.pro2
-rw-r--r--examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc3
-rw-r--r--examples/widgets/graphicsview/boxes/boxes.pro6
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.cpp8
-rw-r--r--examples/widgets/mainwindows/mainwindow/colorswatch.h4
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp7
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro2
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.cpp1
-rw-r--r--examples/widgets/widgets/icons/icons.pro2
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp2
-rw-r--r--examples/widgets/widgets/movie/movie.pro2
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.cpp18
-rw-r--r--examples/xml/dombookmarks/dombookmarks.pro2
-rw-r--r--examples/xml/htmlinfo/htmlinfo.pro2
-rw-r--r--examples/xml/saxbookmarks/saxbookmarks.pro2
-rw-r--r--mkspecs/common/gcc-base-unix.conf1
-rw-r--r--mkspecs/common/gcc-base.conf2
-rw-r--r--mkspecs/common/qcc-base.conf2
-rw-r--r--mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in49
-rw-r--r--mkspecs/common/winrt_winphone/qmake.conf2
-rw-r--r--mkspecs/devices/linux-beagleboard-g++/qmake.conf4
-rw-r--r--mkspecs/devices/linux-imx53qsb-g++/qmake.conf5
-rw-r--r--mkspecs/devices/linux-imx6-g++/qmake.conf5
-rw-r--r--mkspecs/features/default_post.prf1
-rw-r--r--mkspecs/features/default_pre.prf15
-rw-r--r--mkspecs/features/plugin_bundle.prf2
-rw-r--r--mkspecs/features/qt.prf6
-rw-r--r--mkspecs/features/qt_build_config.prf6
-rw-r--r--mkspecs/features/qt_common.prf3
-rw-r--r--mkspecs/features/qt_functions.prf4
-rw-r--r--mkspecs/features/qt_module.prf7
-rw-r--r--mkspecs/features/qt_module_pris.prf11
-rw-r--r--mkspecs/features/resources.prf60
-rw-r--r--mkspecs/features/spec_post.prf5
-rw-r--r--mkspecs/features/testlib_defines.prf3
-rw-r--r--mkspecs/linux-icc/qmake.conf2
-rw-r--r--[-rwxr-xr-x]mkspecs/macx-ios-clang/Info.plist.app0
-rw-r--r--mkspecs/winrt-arm-msvc2015/qmake.conf32
-rw-r--r--mkspecs/winrt-arm-msvc2015/qplatformdefs.h (renamed from tests/auto/tools/qmake/testdata/functions/2.cpp)4
-rw-r--r--mkspecs/winrt-x64-msvc2015/qmake.conf32
-rw-r--r--mkspecs/winrt-x64-msvc2015/qplatformdefs.h (renamed from tests/auto/tools/qmake/testdata/functions/one/1.cpp)4
-rw-r--r--mkspecs/winrt-x86-msvc2015/qmake.conf32
-rw-r--r--mkspecs/winrt-x86-msvc2015/qplatformdefs.h (renamed from tests/auto/tools/qmake/testdata/functions/one/2.cpp)4
-rw-r--r--qmake/Makefile.unix6
-rw-r--r--qmake/Makefile.win321
-rw-r--r--qmake/doc/snippets/code/doc_src_qmake-manual.pro20
-rw-r--r--qmake/doc/src/qmake-manual.qdoc47
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp18
-rw-r--r--qmake/generators/makefile.cpp4
-rw-r--r--qmake/generators/unix/unixmake.cpp26
-rw-r--r--qmake/generators/unix/unixmake2.cpp35
-rw-r--r--qmake/generators/win32/mingw_make.cpp7
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp7
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp28
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h3
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp21
-rw-r--r--qmake/generators/win32/winmakefile.cpp28
-rw-r--r--qmake/library/proitems.cpp31
-rw-r--r--qmake/library/proitems.h3
-rw-r--r--qmake/library/qmakebuiltins.cpp10
-rw-r--r--qmake/library/qmakeevaluator.cpp46
-rw-r--r--qmake/library/qmakeevaluator.h2
-rw-r--r--qmake/library/qmakeglobals.h1
-rw-r--r--qmake/main.cpp71
-rw-r--r--qtbase.pro5
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h4
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp28
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp5
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp2
-rw-r--r--src/3rdparty/forkfd/forkfd.c56
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-thai.c4
-rw-r--r--src/3rdparty/md4/md4.cpp2
-rw-r--r--src/3rdparty/pcre/AUTHORS6
-rw-r--r--src/3rdparty/pcre/LICENCE9
-rw-r--r--src/3rdparty/pcre/pcre.h4
-rw-r--r--src/3rdparty/pcre/pcre_compile.c10
-rw-r--r--src/3rdparty/pcre/pcre_internal.h9
-rw-r--r--src/3rdparty/pcre/pcre_jit_compile.c7
-rw-r--r--src/3rdparty/pcre/pcre_study.c60
-rw-r--r--src/3rdparty/pcre/sljit/sljitNativeARM_64.c37
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-32-rvk.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-32.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-64.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-int-set.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-interface.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-opt32-settings.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-opt32.c0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-opt64-settings.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakF-1600-unrolling.macros0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakNISTInterface.c0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakNISTInterface.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakSponge.c0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/KeccakSponge.h0
-rw-r--r--[-rwxr-xr-x]src/3rdparty/sha3/brg_endian.h0
-rw-r--r--src/3rdparty/sqlite/sqlite3.c2
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java4
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java25
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java64
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java2
-rw-r--r--src/android/templates/AndroidManifest.xml4
-rw-r--r--src/angle/patches/0006-ANGLE-Allow-Windows-Phone-to-communicate-swap-region.patch145
-rw-r--r--src/angle/patches/0007-ANGLE-Fix-compilation-without-d3d11.patch57
-rw-r--r--src/angle/src/common/common.pri2
-rw-r--r--src/angle/src/libGLESv2/libGLESv2.pro2
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in10
-rw-r--r--src/corelib/Qt5CoreMacros.cmake6
-rw-r--r--src/corelib/codecs/qicucodec.cpp2
-rw-r--r--src/corelib/codecs/qtextcodec.cpp23
-rw-r--r--src/corelib/codecs/qwindowscodec.cpp4
-rw-r--r--src/corelib/doc/qtcore.qdocconf3
-rw-r--r--src/corelib/doc/snippets/code/doc_src_resources.cpp4
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp5
-rw-r--r--src/corelib/doc/src/statemachine.qdoc32
-rw-r--r--src/corelib/global/qglobal.cpp88
-rw-r--r--src/corelib/global/qglobal.h69
-rw-r--r--src/corelib/global/qlogging.cpp6
-rw-r--r--src/corelib/global/qnamespace.h31
-rw-r--r--src/corelib/global/qnamespace.qdoc65
-rw-r--r--src/corelib/global/qtypetraits.h21
-rw-r--r--src/corelib/io/io.pri2
-rw-r--r--src/corelib/io/qdir.cpp12
-rw-r--r--src/corelib/io/qdir.h11
-rw-r--r--src/corelib/io/qfileselector.cpp12
-rw-r--r--src/corelib/io/qfilesystementry.cpp16
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.mm31
-rw-r--r--src/corelib/io/qiodevice.cpp57
-rw-r--r--src/corelib/io/qlockfile.cpp12
-rw-r--r--src/corelib/io/qlockfile_p.h1
-rw-r--r--src/corelib/io/qlockfile_unix.cpp58
-rw-r--r--src/corelib/io/qlockfile_win.cpp73
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp18
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice_p.h4
-rw-r--r--src/corelib/io/qprocess.cpp1
-rw-r--r--src/corelib/io/qprocess.h11
-rw-r--r--src/corelib/io/qsettings.cpp6
-rw-r--r--src/corelib/io/qstandardpaths.cpp37
-rw-r--r--src/corelib/io/qstandardpaths_ios.mm29
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp24
-rw-r--r--src/corelib/io/qtemporaryfile.cpp4
-rw-r--r--src/corelib/io/qtemporaryfile_p.h2
-rw-r--r--src/corelib/io/qtextstream.cpp12
-rw-r--r--src/corelib/io/qurl.h4
-rw-r--r--src/corelib/io/qwindowspipereader.cpp102
-rw-r--r--src/corelib/io/qwindowspipereader_p.h4
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp5
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel_p.h2
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm17
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp10
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp12
-rw-r--r--src/corelib/kernel/qfunctions_winrt.h8
-rw-r--r--src/corelib/kernel/qjni.cpp472
-rw-r--r--src/corelib/kernel/qjni_p.h1
-rw-r--r--src/corelib/kernel/qmetatype.h15
-rw-r--r--src/corelib/kernel/qobject.cpp10
-rw-r--r--src/corelib/kernel/qobject_p.h4
-rw-r--r--src/corelib/kernel/qobjectdefs.h1
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp1
-rw-r--r--src/corelib/kernel/qsystemerror.cpp2
-rw-r--r--src/corelib/kernel/qsystemerror_p.h10
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp6
-rw-r--r--src/corelib/mimetypes/qmimetype_p.h2
-rw-r--r--src/corelib/plugin/plugin.pri1
-rw-r--r--src/corelib/plugin/qfactoryinterface.cpp (renamed from tests/auto/tools/qmake/testdata/functions/1.cpp)13
-rw-r--r--src/corelib/plugin/qfactoryinterface.h2
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp46
-rw-r--r--src/corelib/statemachine/qabstracttransition.h10
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h1
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp4
-rw-r--r--src/corelib/statemachine/qeventtransition_p.h3
-rw-r--r--src/corelib/statemachine/qstate_p.h2
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp341
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h21
-rw-r--r--src/corelib/thread/qexception.cpp16
-rw-r--r--src/corelib/thread/qexception.h10
-rw-r--r--src/corelib/thread/qrunnable.cpp11
-rw-r--r--src/corelib/thread/qrunnable.h9
-rw-r--r--src/corelib/thread/qthread_p.h14
-rw-r--r--src/corelib/tools/qbytearray.cpp7
-rw-r--r--src/corelib/tools/qcollator.cpp22
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp8
-rw-r--r--src/corelib/tools/qcontiguouscache.h2
-rw-r--r--src/corelib/tools/qdatetimeparser.cpp14
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h3
-rw-r--r--src/corelib/tools/qhash.h25
-rw-r--r--src/corelib/tools/qlist.h10
-rw-r--r--src/corelib/tools/qlocale_mac.mm14
-rw-r--r--src/corelib/tools/qpair.qdoc54
-rw-r--r--src/corelib/tools/qregularexpression.cpp20
-rw-r--r--src/corelib/tools/qringbuffer.cpp309
-rw-r--r--src/corelib/tools/qringbuffer_p.h266
-rw-r--r--src/corelib/tools/qscopedpointer.cpp7
-rw-r--r--src/corelib/tools/qset.h30
-rw-r--r--src/corelib/tools/qset.qdoc25
-rw-r--r--src/corelib/tools/qsimd.cpp4
-rw-r--r--src/corelib/tools/qsize.h20
-rw-r--r--src/corelib/tools/qstring.cpp112
-rw-r--r--src/corelib/tools/qstring.h2
-rw-r--r--src/corelib/tools/qvector.cpp22
-rw-r--r--src/corelib/tools/qvector.h2
-rw-r--r--src/corelib/tools/tools.pri1
-rw-r--r--src/dbus/qdbus_symbols_p.h3
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp6
-rw-r--r--src/dbus/qdbusvirtualobject.cpp6
-rw-r--r--src/gui/accessible/qaccessible.cpp128
-rw-r--r--src/gui/accessible/qaccessible.h38
-rw-r--r--src/gui/image/qicon.cpp2
-rw-r--r--src/gui/image/qicon.h12
-rw-r--r--src/gui/image/qimage.cpp16
-rw-r--r--src/gui/image/qimage.h9
-rw-r--r--src/gui/image/qimageiohandler.cpp37
-rw-r--r--src/gui/image/qimageiohandler.h19
-rw-r--r--src/gui/image/qimagereader.cpp63
-rw-r--r--src/gui/image/qimagereader.h5
-rw-r--r--src/gui/image/qimagewriter.cpp39
-rw-r--r--src/gui/image/qimagewriter.h3
-rw-r--r--src/gui/image/qjpeghandler.cpp122
-rw-r--r--src/gui/image/qpicture.h5
-rw-r--r--src/gui/image/qpixmap.h5
-rw-r--r--src/gui/image/qpixmap_win.cpp5
-rw-r--r--src/gui/image/qpnghandler.cpp7
-rw-r--r--src/gui/kernel/qevent.cpp35
-rw-r--r--src/gui/kernel/qevent.h14
-rw-r--r--src/gui/kernel/qgenericpluginfactory.cpp8
-rw-r--r--src/gui/kernel/qguiapplication.cpp19
-rw-r--r--src/gui/kernel/qinputdevicemanager.cpp1
-rw-r--r--src/gui/kernel/qinputdevicemanager_p.h2
-rw-r--r--src/gui/kernel/qkeysequence.cpp11
-rw-r--r--src/gui/kernel/qkeysequence.h6
-rw-r--r--src/gui/kernel/qopenglwindow.cpp244
-rw-r--r--src/gui/kernel/qpalette.h8
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp6
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h1
-rw-r--r--src/gui/kernel/qplatforminputcontextplugin_p.h2
-rw-r--r--src/gui/kernel/qplatformintegrationplugin.h2
-rw-r--r--src/gui/kernel/qplatformmenu.cpp5
-rw-r--r--src/gui/kernel/qplatformmenu.h1
-rw-r--r--src/gui/kernel/qplatformopenglcontext.cpp4
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow.cpp10
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow_p.h2
-rw-r--r--src/gui/kernel/qsimpledrag.cpp15
-rw-r--r--src/gui/kernel/qtouchdevice.cpp23
-rw-r--r--src/gui/kernel/qtouchdevice.h9
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp85
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h13
-rw-r--r--src/gui/math3d/qgenericmatrix.h2
-rw-r--r--src/gui/math3d/qquaternion.cpp14
-rw-r--r--src/gui/math3d/qquaternion.h22
-rw-r--r--src/gui/math3d/qvector2d.h2
-rw-r--r--src/gui/math3d/qvector4d.h2
-rw-r--r--src/gui/opengl/qopengl.cpp13
-rw-r--r--src/gui/opengl/qopenglengineshadermanager.cpp2
-rw-r--r--src/gui/opengl/qopenglextensions_p.h3
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp66
-rw-r--r--src/gui/opengl/qopenglpaintdevice.cpp4
-rw-r--r--src/gui/opengl/qopenglpaintdevice_p.h2
-rw-r--r--src/gui/painting/qbrush.cpp2
-rw-r--r--src/gui/painting/qbrush.h5
-rw-r--r--src/gui/painting/qcolor.cpp8
-rw-r--r--src/gui/painting/qdrawhelper.cpp6
-rw-r--r--src/gui/painting/qdrawhelper_p.h4
-rw-r--r--src/gui/painting/qimagescale.cpp213
-rw-r--r--src/gui/painting/qimagescale_sse4.cpp42
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp4
-rw-r--r--src/gui/painting/qpagedpaintdevice_p.h4
-rw-r--r--src/gui/painting/qpaintdevice.cpp2
-rw-r--r--src/gui/painting/qpaintdevice.h2
-rw-r--r--src/gui/painting/qpaintengine.cpp4
-rw-r--r--src/gui/painting/qpaintengine_p.h3
-rw-r--r--src/gui/painting/qpaintengineex.cpp8
-rw-r--r--src/gui/painting/qpainter.cpp4
-rw-r--r--src/gui/painting/qpainterpath.cpp19
-rw-r--r--src/gui/painting/qpainterpath.h22
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp129
-rw-r--r--src/gui/painting/qplatformbackingstore.h17
-rw-r--r--src/gui/painting/qpolygon.h8
-rw-r--r--src/gui/painting/qregion.h4
-rw-r--r--src/gui/painting/qstroker_p.h2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp10
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h4
-rw-r--r--src/gui/painting/qtransform.cpp2
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.cpp9
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h2
-rw-r--r--src/gui/text/qabstracttextdocumentlayout_p.h3
-rw-r--r--src/gui/text/qfont.h2
-rw-r--r--src/gui/text/qfontdatabase.cpp74
-rw-r--r--src/gui/text/qfontdatabase.h2
-rw-r--r--src/gui/text/qfontengine.cpp2
-rw-r--r--src/gui/text/qfontengine_ft.cpp2
-rw-r--r--src/gui/text/qfontengine_qpf2.cpp2
-rw-r--r--src/gui/text/qfontengineglyphcache.cpp (renamed from src/plugins/platforms/cocoa/qcocoaautoreleasepool.mm)13
-rw-r--r--src/gui/text/qfontengineglyphcache_p.h4
-rw-r--r--src/gui/text/qfontmetrics.h5
-rw-r--r--src/gui/text/qglyphrun.cpp1
-rw-r--r--src/gui/text/qrawfont.cpp1
-rw-r--r--src/gui/text/qstatictext.cpp5
-rw-r--r--src/gui/text/qstatictext_p.h5
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp8
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp2
-rw-r--r--src/gui/text/qtextengine.cpp10
-rw-r--r--src/gui/text/qtextengine_p.h8
-rw-r--r--src/gui/text/qtextlayout.cpp44
-rw-r--r--src/gui/text/qtextlayout.h8
-rw-r--r--src/gui/text/qtexttable.cpp6
-rw-r--r--src/gui/text/qzip.cpp2
-rw-r--r--src/gui/text/text.pri2
-rw-r--r--src/network/access/qftp.cpp5
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp35
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel_p.h2
-rw-r--r--src/network/access/qhttpprotocolhandler.cpp7
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h36
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager_p.h2
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp41
-rw-r--r--src/network/access/qnetworkcookie.cpp2
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp25
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h7
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp1
-rw-r--r--src/network/doc/src/ssl.qdoc2
-rw-r--r--src/network/kernel/qhostinfo_winrt.cpp1
-rw-r--r--src/network/socket/qabstractsocket.cpp1
-rw-r--r--src/network/socket/qabstractsocket_p.h1
-rw-r--r--src/network/socket/qnativesocketengine_winrt_p.h1
-rw-r--r--src/network/ssl/qasn1element.cpp52
-rw-r--r--src/network/ssl/qsslcertificate.cpp2
-rw-r--r--src/network/ssl/qsslellipticcurve_dummy.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp31
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp2
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp18
-rw-r--r--src/platformheaders/helper/helper.pri2
-rw-r--r--src/platformheaders/helper/qplatformheaderhelper.h (renamed from src/platformheaders/xcbfunctions/qxcbfunctionshelper.h)13
-rw-r--r--src/platformheaders/platformheaders.pro1
-rw-r--r--src/platformheaders/xcbfunctions/qxcbintegrationfunctions.h4
-rw-r--r--src/platformheaders/xcbfunctions/qxcbwindowfunctions.h12
-rw-r--r--src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc2
-rw-r--r--src/platformsupport/dbusmenu/qdbusplatformmenu.cpp9
-rw-r--r--src/platformsupport/dbusmenu/qdbusplatformmenu_p.h4
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm14
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositor.cpp31
-rw-r--r--src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp3
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm37
-rw-r--r--src/plugins/generic/evdevkeyboard/main.cpp2
-rw-r--r--src/plugins/generic/evdevmouse/main.cpp2
-rw-r--r--src/plugins/generic/evdevtablet/main.cpp2
-rw-r--r--src/plugins/generic/evdevtouch/main.cpp2
-rw-r--r--src/plugins/generic/libinput/main.cpp2
-rw-r--r--src/plugins/generic/tslib/main.cpp2
-rw-r--r--src/plugins/generic/tuiotouch/main.cpp2
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/main.cpp2
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp47
-rw-r--r--src/plugins/platforms/android/androidplatformplugin.cpp2
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp2
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro2
-rw-r--r--src/plugins/platforms/cocoa/main.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm11
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm35
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoainputcontext.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm7
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm53
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm9
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoanativeinterface.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.h5
-rw-r--r--src/plugins/platforms/cocoa/qcocoaprintdevice.mm28
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm3
-rw-r--r--[-rwxr-xr-x]src/plugins/platforms/cocoa/qcocoasystemtrayicon.h0
-rw-r--r--[-rwxr-xr-x]src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm0
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm78
-rw-r--r--src/plugins/platforms/cocoa/qmacclipboard.mm3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm76
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm7
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac_p.h2
-rw-r--r--src/plugins/platforms/cocoa/qt_mac_p.h11
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp22
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dplatformplugin.cpp2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp2
-rw-r--r--src/plugins/platforms/directfb/main.cpp2
-rw-r--r--src/plugins/platforms/directfb/qdirectfbconvenience.cpp2
-rw-r--r--[-rwxr-xr-x]src/plugins/platforms/eglfs/cursor-atlas.pngbin2236 -> 2236 bytes
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmscursor.cpp45
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp25
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.h6
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.cpp9
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsintegration.h3
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.cpp5
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsscreen.h7
-rw-r--r--src/plugins/platforms/eglfs/qeglfsmain.cpp2
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp2
-rw-r--r--src/plugins/platforms/haiku/main.h2
-rw-r--r--src/plugins/platforms/haiku/qhaikuwindow.cpp13
-rw-r--r--src/plugins/platforms/ios/plugin.mm2
-rw-r--r--src/plugins/platforms/ios/qiosapplicationstate.mm12
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.h8
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.mm109
-rw-r--r--src/plugins/platforms/ios/qiosclipboard.mm4
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm6
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.mm6
-rw-r--r--src/plugins/platforms/ios/qiosfileengineassetslibrary.h7
-rw-r--r--src/plugins/platforms/ios/qiosfileengineassetslibrary.mm320
-rw-r--r--src/plugins/platforms/ios/qiosglobal.h2
-rw-r--r--src/plugins/platforms/ios/qiosglobal.mm4
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm2
-rw-r--r--src/plugins/platforms/ios/qiosintegration.mm15
-rw-r--r--src/plugins/platforms/ios/qiosmenu.mm4
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm8
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm34
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm6
-rw-r--r--src/plugins/platforms/ios/qioswindow.mm6
-rw-r--r--src/plugins/platforms/ios/quiaccessibilityelement.h4
-rw-r--r--src/plugins/platforms/ios/quiaccessibilityelement.mm26
-rw-r--r--src/plugins/platforms/ios/quiview.mm14
-rw-r--r--src/plugins/platforms/kms/main.cpp2
-rw-r--r--src/plugins/platforms/linuxfb/main.cpp2
-rw-r--r--src/plugins/platforms/minimal/main.cpp2
-rw-r--r--src/plugins/platforms/minimalegl/main.cpp2
-rw-r--r--src/plugins/platforms/offscreen/main.cpp2
-rw-r--r--src/plugins/platforms/openwfd/main.cpp2
-rw-r--r--src/plugins/platforms/qnx/main.h2
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp2
-rw-r--r--src/plugins/platforms/windows/main.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.cpp16
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.h3
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
-rw-r--r--src/plugins/platforms/winrt/main.cpp25
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.cpp28
-rw-r--r--src/plugins/platforms/winrt/qwinrtcursor.h27
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp37
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.h24
-rw-r--r--src/plugins/platforms/winrt/qwinrteventdispatcher.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrteventdispatcher.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtfiledialoghelper.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.h27
-rw-r--r--src/plugins/platforms/winrt/qwinrtfontdatabase.cpp112
-rw-r--r--src/plugins/platforms/winrt/qwinrtfontdatabase.h29
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtintegration.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtmessagedialoghelper.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtmessagedialoghelper.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtservices.h27
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrttheme.h23
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp23
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.h23
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp79
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h34
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp450
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp31
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbmain.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp124
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h10
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro5
-rw-r--r--src/plugins/platformthemes/gtk2/main.cpp2
-rw-r--r--src/plugins/printsupport/cocoa/main.cpp2
-rw-r--r--src/plugins/printsupport/cups/main.cpp2
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.cpp24
-rw-r--r--src/plugins/printsupport/cups/qppdprintdevice.h7
-rw-r--r--src/plugins/printsupport/windows/main.cpp2
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.cpp17
-rw-r--r--src/plugins/printsupport/windows/qwindowsprintdevice.h7
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/button/core_button_inactive.pngbin2428 -> 2428 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/button/core_button_pressed.pngbin3221 -> 3221 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/checkbox/core_checkbox_pressed.pngbin2776 -> 2776 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg.pngbin1315 -> 1315 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/lineedit/core_textinput_bg_highlight.pngbin394 -> 394 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/listitem/core_listitem_active.pngbin164 -> 164 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/listitem/core_listitem_divider.pngbin135 -> 135 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/progressbar/core_progressindicator_bg.pngbin1802 -> 1802 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_inactive.pngbin4245 -> 4245 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/radiobutton/core_radiobutton_pressed.pngbin5460 -> 5460 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/scrollbar/core_scrollbar.pngbin1242 -> 1242 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/bright/slider/core_slider_handle_pressed.pngbin6577 -> 6577 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/button/core_button_inactive.pngbin2262 -> 2262 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/button/core_button_pressed.pngbin2853 -> 2853 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/checkbox/core_checkbox_pressed.pngbin2478 -> 2478 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg.pngbin1315 -> 1315 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/lineedit/core_textinput_bg_highlight.pngbin394 -> 394 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/listitem/core_listitem_active.pngbin164 -> 164 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/listitem/core_listitem_divider.pngbin136 -> 136 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/progressbar/core_progressindicator_bg.pngbin1724 -> 1724 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_inactive.pngbin3968 -> 3968 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/radiobutton/core_radiobutton_pressed.pngbin4777 -> 4777 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/scrollbar/core_scrollbar.pngbin1245 -> 1245 bytes
-rw-r--r--[-rwxr-xr-x]src/plugins/styles/bb10style/dark/slider/core_slider_handle_pressed.pngbin6593 -> 6593 bytes
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_mac.mm3
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm3
-rw-r--r--src/printsupport/kernel/qplatformprintdevice.cpp5
-rw-r--r--src/printsupport/kernel/qplatformprintdevice.h7
-rw-r--r--src/printsupport/kernel/qplatformprintplugin.h2
-rw-r--r--src/printsupport/kernel/qprintdevice.cpp2
-rw-r--r--src/printsupport/kernel/qprintdevice_p.h2
-rw-r--r--src/printsupport/kernel/qprinter.cpp4
-rw-r--r--src/printsupport/widgets/qprintpreviewwidget.cpp4
-rw-r--r--src/sql/kernel/qsqlresult.cpp3
-rw-r--r--src/sql/models/qsqltablemodel.cpp8
-rw-r--r--src/testlib/doc/qttestlib.qdocconf3
-rw-r--r--src/testlib/qtest.h31
-rw-r--r--src/testlib/qtestblacklist.cpp27
-rw-r--r--src/testlib/qtestblacklist_p.h6
-rw-r--r--src/testlib/qtestcase.cpp24
-rw-r--r--src/testlib/qtestcase.h2
-rw-r--r--src/testlib/qtestmouse.cpp (renamed from src/plugins/platforms/cocoa/qcocoaautoreleasepool.h)28
-rw-r--r--src/testlib/qtestmouse.h80
-rw-r--r--src/testlib/testlib.pro1
-rw-r--r--src/tools/bootstrap/bootstrap.pro1
-rw-r--r--src/tools/moc/generator.cpp6
-rw-r--r--src/tools/moc/preprocessor.cpp8
-rw-r--r--src/tools/qdoc/atom.cpp4
-rw-r--r--src/tools/qdoc/atom.h2
-rw-r--r--src/tools/qdoc/codeparser.cpp27
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp34
-rw-r--r--src/tools/qdoc/cppcodeparser.h1
-rw-r--r--src/tools/qdoc/doc.cpp23
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-cmdindex.qdoc1
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-contextcmds.qdoc40
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-markupcmds.qdoc14
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp65
-rw-r--r--src/tools/qdoc/location.cpp4
-rw-r--r--src/tools/qdoc/node.cpp12
-rw-r--r--src/tools/qdoc/puredocparser.cpp4
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp4
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp2
-rw-r--r--src/tools/qdoc/qmlvisitor.cpp3
-rw-r--r--src/tools/qdoc/tree.cpp8
-rw-r--r--src/widgets/accessible/itemviews.cpp3
-rw-r--r--src/widgets/dialogs/qdialog.cpp5
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp6
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp6
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp50
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h1
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/images/listview.pngbin9695 -> 9695 bytes
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/images/modelview-combobox.pngbin5022 -> 5022 bytes
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/images/tableview.pngbin10102 -> 10102 bytes
-rw-r--r--[-rwxr-xr-x]src/widgets/doc/snippets/macmainwindow.mm0
-rw-r--r--src/widgets/effects/qgraphicseffect.cpp4
-rw-r--r--src/widgets/effects/qgraphicseffect_p.h1
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp3
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.h4
-rw-r--r--src/widgets/graphicsview/qgraphicstransform.cpp5
-rw-r--r--src/widgets/graphicsview/qgraphicstransform_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp4
-rw-r--r--src/widgets/graphicsview/qgraphicsview_p.h1
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.cpp4
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp3
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h14
-rw-r--r--src/widgets/itemviews/qcolumnview.cpp4
-rw-r--r--src/widgets/itemviews/qcolumnview_p.h10
-rw-r--r--src/widgets/itemviews/qfileiconprovider.cpp1
-rw-r--r--src/widgets/itemviews/qheaderview.cpp14
-rw-r--r--src/widgets/itemviews/qlistview.cpp57
-rw-r--r--src/widgets/itemviews/qlistview.h3
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp18
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp17
-rw-r--r--src/widgets/itemviews/qtreeview.cpp1
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp8
-rw-r--r--src/widgets/kernel/kernel.pri1
-rw-r--r--src/widgets/kernel/qapplication.cpp23
-rw-r--r--src/widgets/kernel/qapplication_p.h2
-rw-r--r--src/widgets/kernel/qgesture.cpp50
-rw-r--r--src/widgets/kernel/qlayout.cpp81
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp19
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp8
-rw-r--r--src/widgets/kernel/qsizepolicy.cpp (renamed from src/widgets/kernel/qsizepolicy.qdoc)140
-rw-r--r--src/widgets/kernel/qsizepolicy.h3
-rw-r--r--src/widgets/kernel/qwidget.cpp10
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp5
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp13
-rw-r--r--src/widgets/styles/qcommonstylepixmaps_p.h2
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm22
-rw-r--r--src/widgets/styles/qstyle.cpp2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp2
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp9
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
-rw-r--r--src/widgets/util/qflickgesture.cpp14
-rw-r--r--src/widgets/util/qscroller_mac.mm3
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp4
-rw-r--r--src/widgets/widgets/qabstractscrollarea_p.h3
-rw-r--r--src/widgets/widgets/qcombobox.cpp2
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp4
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp12
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp82
-rw-r--r--src/widgets/widgets/qdockarealayout_p.h4
-rw-r--r--src/widgets/widgets/qdockwidget.cpp153
-rw-r--r--src/widgets/widgets/qdockwidget_p.h3
-rw-r--r--src/widgets/widgets/qframe.cpp6
-rw-r--r--src/widgets/widgets/qframe_p.h4
-rw-r--r--src/widgets/widgets/qlabel.cpp4
-rw-r--r--src/widgets/widgets/qlabel_p.h1
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp8
-rw-r--r--src/widgets/widgets/qlineedit_p.h2
-rw-r--r--src/widgets/widgets/qmacnativewidget_mac.h1
-rw-r--r--src/widgets/widgets/qmainwindow.cpp9
-rw-r--r--src/widgets/widgets/qmainwindow.h3
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp519
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h24
-rw-r--r--src/widgets/widgets/qmenu.cpp15
-rw-r--r--src/widgets/widgets/qmenubar.cpp2
-rw-r--r--src/widgets/widgets/qsplitter.cpp4
-rw-r--r--src/widgets/widgets/qsplitter_p.h1
-rw-r--r--src/widgets/widgets/qstackedwidget.cpp4
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp7
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp12
-rw-r--r--src/winmain/qtmain_win.cpp2
-rw-r--r--src/winmain/qtmain_winrt.cpp38
-rw-r--r--src/xml/doc/qtxml.qdocconf3
-rw-r--r--sync.profile2
-rw-r--r--tests/auto/corelib/global/qglobalstatic/qglobalstatic.pro1
-rw-r--r--tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp21
-rw-r--r--tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp2
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp4
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp2
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp65
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp16
-rw-r--r--tests/auto/corelib/kernel/qmetaenum/tst_qmetaenum.cpp8
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp9
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp24
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp4
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp174
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm12
-rw-r--r--tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp12
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm6
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp23
-rw-r--r--tests/auto/corelib/tools/qset/tst_qset.cpp27
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring_mac.mm8
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp141
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp33
-rw-r--r--tests/auto/dbus/qdbustype/tst_qdbustype.cpp13
-rw-r--r--tests/auto/gui/image/qimage/images/jpeg_exif_QTBUG-45865.jpgbin0 -> 27540 bytes
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp53
-rw-r--r--tests/auto/gui/kernel/qtouchevent/BLACKLIST6
-rw-r--r--tests/auto/gui/kernel/qtouchevent/qtouchevent.pro2
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp316
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST6
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp31
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp174
-rw-r--r--tests/auto/network/kernel/qhostinfo/BLACKLIST3
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp21
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp10
-rw-r--r--tests/auto/other/baselineexample/baselineexample.pro19
-rw-r--r--tests/auto/other/baselineexample/tst_baselineexample.cpp138
-rw-r--r--tests/auto/other/other.pro3
-rw-r--r--[-rwxr-xr-x]tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdbbin65536 -> 65536 bytes
-rw-r--r--tests/auto/testlib/selftests/blacklisted/BLACKLIST12
-rw-r--r--tests/auto/testlib/selftests/blacklisted/blacklisted.pro7
-rw-r--r--tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp94
-rw-r--r--tests/auto/testlib/selftests/expected_blacklisted.txt26
-rw-r--r--tests/auto/testlib/selftests/selftests.pri1
-rw-r--r--tests/auto/testlib/selftests/selftests.qrc1
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp8
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp25
-rw-r--r--tests/auto/tools/qmake/qmake.pro6
-rw-r--r--tests/auto/tools/qmake/testdata/comments/comments.pro31
-rw-r--r--tests/auto/tools/qmake/testdata/func_export/func_export.pro19
-rw-r--r--tests/auto/tools/qmake/testdata/func_variables/func_variables.pro49
-rw-r--r--tests/auto/tools/qmake/testdata/functions/functions.pro184
-rw-r--r--tests/auto/tools/qmake/testdata/functions/textfile1
-rw-r--r--tests/auto/tools/qmake/testdata/functions/three/wildcard21.cpp32
-rw-r--r--tests/auto/tools/qmake/testdata/functions/three/wildcard22.cpp32
-rw-r--r--tests/auto/tools/qmake/testdata/functions/two/1.cpp32
-rw-r--r--tests/auto/tools/qmake/testdata/functions/two/2.cpp32
-rw-r--r--tests/auto/tools/qmake/testdata/functions/wildcard21.cpp32
-rw-r--r--tests/auto/tools/qmake/testdata/functions/wildcard22.cpp32
-rw-r--r--tests/auto/tools/qmake/testdata/include_function/existing_file.pri3
-rw-r--r--tests/auto/tools/qmake/testdata/include_function/include_existing_file.pro7
-rw-r--r--tests/auto/tools/qmake/testdata/include_function/include_missing_file.pro3
-rw-r--r--tests/auto/tools/qmake/testdata/include_function/include_missing_file2.pro3
-rw-r--r--tests/auto/tools/qmake/testdata/json/json.pro26
-rw-r--r--tests/auto/tools/qmake/testdata/json/test.json9
-rw-r--r--tests/auto/tools/qmake/testdata/operators/operators.pro23
-rw-r--r--tests/auto/tools/qmake/testdata/resources/main.cpp (renamed from tests/auto/tools/qmake/testdata/include_function/main.cpp)9
-rw-r--r--tests/auto/tools/qmake/testdata/resources/resources.pro10
-rw-r--r--tests/auto/tools/qmake/testdata/resources/subdir/file.txt0
-rw-r--r--tests/auto/tools/qmake/testdata/resources/test.qrc5
-rw-r--r--tests/auto/tools/qmake/testdata/variables/variables.pro12
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp129
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp2513
-rw-r--r--tests/auto/tools/qmakelib/parsertest.cpp1987
-rw-r--r--tests/auto/tools/qmakelib/qmakelib.pro12
-rw-r--r--tests/auto/tools/qmakelib/testdata/cat/file1.txt2
-rw-r--r--tests/auto/tools/qmakelib/testdata/cat/file2.txt5
-rw-r--r--tests/auto/tools/qmakelib/testdata/files/dir/file1.txt0
-rw-r--r--tests/auto/tools/qmakelib/testdata/files/dir/file2.txt0
-rw-r--r--tests/auto/tools/qmakelib/testdata/files/file1.txt0
-rw-r--r--tests/auto/tools/qmakelib/testdata/files/file2.txt0
-rw-r--r--tests/auto/tools/qmakelib/testdata/files/other.txt0
-rw-r--r--tests/auto/tools/qmakelib/testdata/fromfile/badfile.prx1
-rw-r--r--tests/auto/tools/qmakelib/testdata/fromfile/infile.prx (renamed from tests/auto/tools/qmake/testdata/functions/infiletest.pro)0
-rw-r--r--tests/auto/tools/qmakelib/testdata/include/inc.pri8
-rw-r--r--tests/auto/tools/qmakelib/testdata/mkspecs/fake-g++/qmake.conf1
-rw-r--r--tests/auto/tools/qmakelib/testdata/mkspecs/features/default_post.prf1
-rw-r--r--tests/auto/tools/qmakelib/testdata/mkspecs/features/default_pre.prf1
-rw-r--r--tests/auto/tools/qmakelib/testdata/mkspecs/features/spec_post.prf1
-rw-r--r--tests/auto/tools/qmakelib/testdata/mkspecs/features/spec_pre.prf1
-rw-r--r--tests/auto/tools/qmakelib/testdata/mkspecs/features/testfeat.prf1
-rw-r--r--tests/auto/tools/qmakelib/tst_qmakelib.cpp2059
-rw-r--r--tests/auto/tools/qmakelib/tst_qmakelib.h111
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp5
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp29
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp50
-rw-r--r--tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp1
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp113
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp8
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp12
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp8
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp78
-rw-r--r--tests/auto/widgets/kernel/qaction/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp34
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp62
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST121
-rw-r--r--tests/auto/widgets/kernel/qwidget/qwidget.pro2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp73
-rw-r--r--tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp66
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp45
-rw-r--r--tests/auto/widgets/widgets/qmenu/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST2
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.entbin4 -> 4 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.entbin54 -> 54 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.entbin12 -> 12 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent0
-rw-r--r--tests/benchmarks/gui/text/qtext/main.cpp14
-rw-r--r--tests/manual/qscreen/README12
-rw-r--r--tests/manual/qscreen/main.cpp23
-rw-r--r--tests/manual/qtabletevent/regular_widgets/main.cpp10
-rw-r--r--tests/manual/touch/main.cpp415
-rw-r--r--tools/configure/Makefile.mingw3
-rw-r--r--tools/configure/Makefile.win324
-rw-r--r--tools/configure/configure.pro4
-rw-r--r--tools/configure/configureapp.cpp54
-rw-r--r--tools/configure/environment.cpp8
-rw-r--r--tools/configure/tools.cpp2
841 files changed, 15167 insertions, 7038 deletions
diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
index b63c75c070..ce16a3a391 100644
--- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
+++ b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
@@ -4,4 +4,8 @@ CONFIG -= qt
INCLUDEPATH += $$QMAKE_INCDIR_EGL
-LIBS += -L$$QMAKE_LIBDIR_EGL -lEGL -lGLESv2 -lbcm_host
+for(p, QMAKE_LIBDIR_EGL) {
+ exists($$p):LIBS += -L$$p
+}
+
+LIBS += -lEGL -lGLESv2 -lbcm_host
diff --git a/configure b/configure
index 6b59a888d4..7251e8e673 100755
--- a/configure
+++ b/configure
@@ -728,6 +728,7 @@ CFG_EVENTFD=auto
CFG_RPATH=yes
CFG_FRAMEWORK=auto
CFG_USE_GOLD_LINKER=auto
+CFG_ENABLE_NEW_DTAGS=auto
DEFINES=
INCLUDES=
D_FLAGS=
@@ -2961,8 +2962,20 @@ if [ -f "$relpath"/LICENSE.PREVIEW.COMMERCIAL ] && [ $COMMERCIAL_USER = "yes" ];
Edition="Preview"
EditionString="Technology Preview"
elif [ $COMMERCIAL_USER = "yes" ]; then
- if test -x "$relpath/bin/licheck"; then
- LicheckOutput=`$relpath/bin/licheck $OPT_CONFIRM_LICENSE $relpath $outpath\
+ if [ $UNAME_SYSTEM = "Linux" ]; then
+ if file -L /bin/sh | grep -q "64-bit" ; then
+ Licheck=licheck64
+ else
+ Licheck=licheck32
+ fi
+ elif [ $UNAME_SYSTEM = "Darwin" ]; then
+ Licheck=licheck_mac
+ else
+ echo >&2 "Host operating system not supported by this edition of Qt."
+ exit 1
+ fi
+ if [ -x "$relpath/bin/$Licheck" ]; then
+ LicheckOutput=`$relpath/bin/$Licheck $OPT_CONFIRM_LICENSE $relpath $outpath\
$PLATFORM $XPLATFORM`
if [ $? -ne 0 ]; then
exit 1
@@ -2973,7 +2986,7 @@ elif [ $COMMERCIAL_USER = "yes" ]; then
echo
echo "Error: This is the Open Source version of Qt."
echo "If you want to use Enterprise features of Qt,"
- echo "information use the contact form at http://www.qt.io/contact-us"
+ echo "use the contact form at http://www.qt.io/contact-us"
echo "to purchase a license."
echo
exit 1
@@ -3305,7 +3318,7 @@ if [ "$XPLATFORM_IOS" = "yes" ]; then
CFG_RPATH="no"
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples"
CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store
- CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples"
+ CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples"
CFG_PRECOMPILE="no" # Precompiled headers not supported with multiple -arch arguments
# If the user passes -sdk on the command line we build a SDK-specific Qt build.
@@ -3442,6 +3455,13 @@ if [ "$CFG_USE_GOLD_LINKER" != "no" ]; then
fi
fi
+# auto-detect --enable-new-dtags support
+if linkerSupportsFlag $TEST_COMPILER --enable-new-dtags; then
+ CFG_ENABLE_NEW_DTAGS=yes
+else
+ CFG_ENABLE_NEW_DTAGS=no
+fi
+
# auto-detect -fstack-protector-strong support (for QNX only currently)
if [ "$XPLATFORM_QNX" = "yes" ]; then
if compilerSupportsFlag $TEST_COMPILER -fstack-protector-strong; then
@@ -5338,6 +5358,14 @@ fi
# auto-detect XInput2 support
if [ "$CFG_XINPUT2" != "no" ]; then
if compileTest x11/xinput2 "XInput2"; then
+ if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xi 2>/dev/null; then
+ QMAKE_LIBXI_VERSION_MAJOR=`$PKG_CONFIG --modversion xi 2>/dev/null | cut -d . -f 1`
+ QMAKE_LIBXI_VERSION_MINOR=`$PKG_CONFIG --modversion xi 2>/dev/null | cut -d . -f 2`
+ QMAKE_LIBXI_VERSION_PATCH=`$PKG_CONFIG --modversion xi 2>/dev/null | cut -d . -f 3`
+ QMakeVar set QMAKE_LIBXI_VERSION_MAJOR "$QMAKE_LIBXI_VERSION_MAJOR"
+ QMakeVar set QMAKE_LIBXI_VERSION_MINOR "$QMAKE_LIBXI_VERSION_MINOR"
+ QMakeVar set QMAKE_LIBXI_VERSION_PATCH "$QMAKE_LIBXI_VERSION_PATCH"
+ fi
CFG_XINPUT2=yes
CFG_XINPUT=no
else
@@ -6067,6 +6095,7 @@ fi
[ "$CFG_STRIP" = "no" ] && QMAKE_CONFIG="$QMAKE_CONFIG nostrip"
[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
[ "$CFG_USE_GOLD_LINKER" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG use_gold_linker"
+[ "$CFG_ENABLE_NEW_DTAGS" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG enable_new_dtags"
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
QT_CONFIG="$QT_CONFIG separate_debug_info"
fi
@@ -6196,11 +6225,7 @@ fi
[ '!' -z "$INCLUDES" ] && QMakeVar add INCLUDEPATH "$INCLUDES"
[ '!' -z "$L_FLAGS" ] && QMakeVar add LIBS "$L_FLAGS"
-if [ "$XPLATFORM_MAC" = "yes" ] && [ "$QT_CROSS_COMPILE" = "no" ]; then
- if [ "$CFG_RPATH" = "yes" ]; then
- QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname"
- fi
-elif [ -z "`getXQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
+if [ -z "`getXQMakeConf 'QMAKE_(LFLAGS_)?RPATH'`" ]; then
if [ -n "$RPATH_FLAGS" ]; then
echo
echo "ERROR: -R cannot be used on this platform as \$QMAKE_LFLAGS_RPATH is"
@@ -6758,8 +6783,15 @@ QT_PATCH_VERSION = $QT_PATCH_VERSION
QT_LIBINFIX = $QT_LIBINFIX
QT_NAMESPACE = $QT_NAMESPACE
+QT_EDITION = $Edition
EOF
+if [ "$Edition" != "OpenSource" ] && [ "$Edition" != "Preview" ]; then
+ echo "QT_LICHECK = $Licheck" >> "$QTCONFIG.tmp"
+ echo "QT_RELEASE_DATE = $ReleaseDate" >> "$QTCONFIG.tmp"
+fi
+echo >> "$QTCONFIG.tmp"
+
if [ "$CFG_SHARED" = "no" ]; then
echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM" >> "$QTCONFIG.tmp"
echo >> "$QTCONFIG.tmp"
@@ -6980,6 +7012,7 @@ unset build_mode release
echo " Using sanitizer(s)...... $CFG_SANITIZERS"
echo " Using C++11 ............ $CFG_CXX11"
echo " Using gold linker....... $CFG_USE_GOLD_LINKER"
+echo " Using new DTAGS ........ $CFG_ENABLE_NEW_DTAGS"
echo " Using PCH .............. $CFG_PRECOMPILE"
echo " Target compiler supports:"
if [ "$CFG_ARCH" = "i386" -o "$CFG_ARCH" = "x86_64" ]; then
diff --git a/dist/changes-5.4.2 b/dist/changes-5.4.2
new file mode 100644
index 0000000000..1a34898011
--- /dev/null
+++ b/dist/changes-5.4.2
@@ -0,0 +1,124 @@
+Qt 5.4.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.4.1. Compatibility with Qt
+5.4.0 is also retained, except on Windows when using MSVC 2012 or MSVC
+2013. See note below.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+ http://doc.qt.io/qt-5.4/
+
+The Qt version 5.4 series is binary compatible with the 5.3.x series.
+Applications compiled for 5.3 will continue to run with 5.4 with the
+exception of on Windows when using MSVC 2012 or MSVC 2013. See note
+below.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+- Restored binary compatibility with Qt 5.3.2 on Windows when using MSVC
+ 2012 or MSVC 2013. This means that Qt 5.4.1 and 5.4.2 are no longer
+ binary compatible with Qt 5.4.0 when using either of those compilers.
+- [QTBUG-42594] OS X binary package: fixed incorrect linking to libraries in
+ /opt/local/lib
+- EXIF orientation is no longer applied to JPEG images on read. EXIF
+ orientation on JPEG was introduced in 5.4.0, but due to a bug the most
+ common EXIF-format (big-endian) was not working until 5.4.1. 5.4.2 restores the
+ behavior of 5.4.0 and earlier for most EXIF-tagged JPEGs.
+ EXIF orientation will be an opt-in starting with Qt 5.5.
+- On x86 and x86-64 systems with ELF binaries (especially Linux), due to
+ a new optimization in GCC 5.x in combination with a recent version of
+ GNU binutils, compiling Qt applications with -fPIE is no longer
+ enough with GCC 5.x. Applications now need to be compiled with
+ the -fPIC option if Qt's option "reduce relocations" is active. For
+ backward compatibility only, Qt accepts the use of -fPIE for GCC 4.x
+ versions.
+ Note that Clang is known to generate incompatible code even with -fPIC if
+ the -flto option is active.
+ Applications using qmake or cmake >= 2.8.12 as their build system will
+ adapt automatically. Applications using an older release of cmake in
+ combination with GCC 5.x need to change their CMakeLists.txt to add
+ Qt5Core_EXECUTABLE_COMPILE_FLAGS to CMAKE_CXX_FLAGS. In particular,
+ applications using cmake >= 2.8.9 and < 2.8.11 will continue to build
+ with the -fPIE option and invoke the special compatibility mode if using
+ GCC 4.x.
+
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtCore
+------
+ - [QTBUG-43893] Fixed memory leak in qSetMessagePattern
+ - [QTBUG-43513] QXmlStreamReader: Correctly parse XML containing NUL bytes
+ in the input stream
+ - [QTBUG-43352] QTemporaryDirectory: Properly clean up in case of a failure
+ - [QTBUG-43827] Fixed regression in QSortFilterProxyModel which crashed when
+ sorting a tree model
+
+QtGui
+-----
+ - [QTBUG-44273] Fixed misplacement of outlined text with native text rendering
+ - [QTBUG-44147] Fixed VNC not working on some VNC servers
+ - [QTBUG-43850] Fixed crash with multi-threaded font usage
+ - [QTBUG-43850] Made the old harfbuzz fallback available at runtime
+ - Improvements to the experimental high-dpi support
+ - [QTBUG-43318] Better resolution of GLES 3 functions to avoid issues when
+ deploying on systems with GLES 2.0 only
+
+QtWidgets
+---------
+ - [QTBUG-43830] Fixed crash in stylesheets when styling QProgressBar
+ - [QTBUG-43663] QColorDialog: Don't lose focus while color picking
+
+QtNetwork
+---------
+ - [QTBUG-43793] Fixed disconnects of QSSLSocket after starting encryption
+
+QtPrintSupport
+--------------
+ - [QTBUG-43124] Fixed QPrinter::{width,height} return values
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Android
+-------
+
+ - [QTBUG-44648] Fixed rendering Chinese text on Android 5
+
+Linux/XCB
+---------
+
+ - [QTBUG-45071] Don't crash when resizing windows to bigger than 3840x2160
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+configure & build system
+------------------------
+
+ - CMake-based projects using Qt will now always be built with -fPIE,
+ which fixes function pointer based QObject::connect() on ARM. This
+ is consistent with qmake
+ - [Android] Fixed compilation on armv5 with 4.9 toolchain
+
+qmake
+-----
+
+ - [VS] Fixed handling of files that are excluded from build
+ - [QTBUG-44413][VS] Fixed vcxproj generation for CONFIG-=flat, again
+ - [QTBUG-44595] Restored Qt 4 behavior of qtLibraryTarget()
+ - [QTBUG-45118][Windows] Fixed parallel build when using TYPELIBS
+ - [OS X/iOS] Fixed QMAKE_INFO_PLIST path resolution for shadow builds
diff --git a/doc/global/externalsites/qt-webpages.qdoc b/doc/global/externalsites/qt-webpages.qdoc
index 057f0259e9..386573e526 100644
--- a/doc/global/externalsites/qt-webpages.qdoc
+++ b/doc/global/externalsites/qt-webpages.qdoc
@@ -110,3 +110,7 @@
\externalpage http://wiki.qt.io/BlackBerry
\title Qt for BlackBerry
*/
+/*!
+ \externalpage http://wiki.qt.io/Qt_Multimedia_Backends
+ \title Qt Multimedia Backends
+*/
diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf
index 3491e00402..5f309d2a61 100644
--- a/doc/global/qt-cpp-defines.qdocconf
+++ b/doc/global/qt-cpp-defines.qdocconf
@@ -66,6 +66,7 @@ Cpp.ignoretokens += \
Q_POSITIONING_EXPORT \
Q_MULTIMEDIA_EXPORT \
Q_NETWORK_EXPORT \
+ Q_NEVER_INLINE \
Q_NORETURN \
Q_OPENGL_EXPORT \
Q_OPENVG_EXPORT \
diff --git a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
index e0067cf27f..78fc6b1a63 100644
--- a/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
+++ b/examples/opengl/legacy/framebufferobject2/framebufferobject2.pro
@@ -5,11 +5,7 @@ RESOURCES += framebufferobject2.qrc
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/framebufferobject2
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/framebufferobject2
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/grabber/grabber.pro b/examples/opengl/legacy/grabber/grabber.pro
index b8567580f0..1db0e23156 100644
--- a/examples/opengl/legacy/grabber/grabber.pro
+++ b/examples/opengl/legacy/grabber/grabber.pro
@@ -6,11 +6,7 @@ SOURCES = glwidget.cpp \
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/grabber
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/grabber
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/hellogl/glwidget.cpp b/examples/opengl/legacy/hellogl/glwidget.cpp
index 02501cd99e..122f7ddfe1 100644
--- a/examples/opengl/legacy/hellogl/glwidget.cpp
+++ b/examples/opengl/legacy/hellogl/glwidget.cpp
@@ -128,6 +128,8 @@ void GLWidget::setZRotation(int angle)
//! [6]
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
qglClearColor(qtPurple.dark());
logo = new QtLogo(this, 64);
@@ -153,7 +155,7 @@ void GLWidget::paintGL()
glRotatef(xRot / 16.0, 1.0, 0.0, 0.0);
glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
- logo->draw();
+ logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
}
//! [7]
diff --git a/examples/opengl/legacy/hellogl/glwidget.h b/examples/opengl/legacy/hellogl/glwidget.h
index 994e38e13d..9aca4451df 100644
--- a/examples/opengl/legacy/hellogl/glwidget.h
+++ b/examples/opengl/legacy/hellogl/glwidget.h
@@ -42,11 +42,12 @@
#define GLWIDGET_H
#include <QGLWidget>
+#include <QOpenGLFunctions_1_1>
class QtLogo;
//! [0]
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
{
Q_OBJECT
diff --git a/examples/opengl/legacy/hellogl/hellogl.pro b/examples/opengl/legacy/hellogl/hellogl.pro
index 500bd85b3c..c211242fd2 100644
--- a/examples/opengl/legacy/hellogl/hellogl.pro
+++ b/examples/opengl/legacy/hellogl/hellogl.pro
@@ -11,11 +11,7 @@ SOURCES = glwidget.cpp \
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/hellogl
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp
index b41bc31126..52b6c35801 100644
--- a/examples/opengl/legacy/overpainting/glwidget.cpp
+++ b/examples/opengl/legacy/overpainting/glwidget.cpp
@@ -115,6 +115,8 @@ void GLWidget::setZRotation(int angle)
//! [2]
void GLWidget::initializeGL()
{
+ initializeOpenGLFunctions();
+
glEnable(GL_MULTISAMPLE);
logo = new QtLogo(this);
@@ -173,7 +175,7 @@ void GLWidget::paintEvent(QPaintEvent *event)
glRotatef(yRot / 16.0, 0.0, 1.0, 0.0);
glRotatef(zRot / 16.0, 0.0, 0.0, 1.0);
- logo->draw();
+ logo->draw(static_cast<QOpenGLFunctions_1_1 *>(this));
//! [7]
//! [8]
diff --git a/examples/opengl/legacy/overpainting/glwidget.h b/examples/opengl/legacy/overpainting/glwidget.h
index dd5c0ba9ff..7e62a00170 100644
--- a/examples/opengl/legacy/overpainting/glwidget.h
+++ b/examples/opengl/legacy/overpainting/glwidget.h
@@ -42,13 +42,14 @@
#define GLWIDGET_H
#include <QGLWidget>
+#include <QOpenGLFunctions_1_1>
#include <QTimer>
class Bubble;
class QtLogo;
//! [0]
-class GLWidget : public QGLWidget
+class GLWidget : public QGLWidget, public QOpenGLFunctions_1_1
{
Q_OBJECT
diff --git a/examples/opengl/legacy/overpainting/overpainting.pro b/examples/opengl/legacy/overpainting/overpainting.pro
index c1bda7853d..cc46f18889 100644
--- a/examples/opengl/legacy/overpainting/overpainting.pro
+++ b/examples/opengl/legacy/overpainting/overpainting.pro
@@ -13,11 +13,7 @@ SOURCES = bubble.cpp \
qtlogo.cpp
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/overpainting
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/overpainting
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers/pbuffers.pro b/examples/opengl/legacy/pbuffers/pbuffers.pro
index a349e39f68..d779a2a2dc 100644
--- a/examples/opengl/legacy/pbuffers/pbuffers.pro
+++ b/examples/opengl/legacy/pbuffers/pbuffers.pro
@@ -7,11 +7,7 @@ RESOURCES += pbuffers.qrc
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/pbuffers2/pbuffers2.pro b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
index f9dd269eea..2ba40a6f74 100644
--- a/examples/opengl/legacy/pbuffers2/pbuffers2.pro
+++ b/examples/opengl/legacy/pbuffers2/pbuffers2.pro
@@ -5,11 +5,7 @@ SOURCES += glwidget.cpp main.cpp
RESOURCES += pbuffers2.qrc
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/pbuffers2
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/pbuffers2
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/samplebuffers/samplebuffers.pro b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
index b57599aae4..3719f5039d 100644
--- a/examples/opengl/legacy/samplebuffers/samplebuffers.pro
+++ b/examples/opengl/legacy/samplebuffers/samplebuffers.pro
@@ -4,11 +4,7 @@ SOURCES += glwidget.cpp main.cpp
QT += opengl widgets
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/opengl/samplebuffers
+target.path = $$[QT_INSTALL_EXAMPLES]/opengl/legacy/samplebuffers
INSTALLS += target
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
diff --git a/examples/opengl/legacy/shared/qtlogo.cpp b/examples/opengl/legacy/shared/qtlogo.cpp
index efe3fb0201..0d960dd4b6 100644
--- a/examples/opengl/legacy/shared/qtlogo.cpp
+++ b/examples/opengl/legacy/shared/qtlogo.cpp
@@ -43,6 +43,7 @@
#include <QGLWidget>
#include <QMatrix4x4>
#include <QVector3D>
+#include <QOpenGLFunctions_1_1>
#include <qmath.h>
@@ -60,7 +61,7 @@ struct Geometry
void appendSmooth(const QVector3D &a, const QVector3D &n, int from);
void appendFaceted(const QVector3D &a, const QVector3D &n);
void finalize();
- void loadArrays() const;
+ void loadArrays(QOpenGLFunctions_1_1 *functions) const;
};
//! [0]
@@ -73,7 +74,7 @@ public:
void setSmoothing(Smoothing s) { sm = s; }
void translate(const QVector3D &t);
void rotate(qreal deg, QVector3D axis);
- void draw() const;
+ void draw(QOpenGLFunctions_1_1 *functions) const;
void addTri(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &n);
void addQuad(const QVector3D &a, const QVector3D &b, const QVector3D &c, const QVector3D &d);
@@ -96,10 +97,10 @@ static inline void qSetColor(float colorVec[], QColor c)
colorVec[3] = c.alphaF();
}
-void Geometry::loadArrays() const
+void Geometry::loadArrays(QOpenGLFunctions_1_1 *functions) const
{
- glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
- glNormalPointer(GL_FLOAT, 0, normals.constData());
+ functions->glVertexPointer(3, GL_FLOAT, 0, vertices.constData());
+ functions->glNormalPointer(GL_FLOAT, 0, normals.constData());
}
void Geometry::finalize()
@@ -170,15 +171,15 @@ void Patch::translate(const QVector3D &t)
}
//! [2]
-void Patch::draw() const
+void Patch::draw(QOpenGLFunctions_1_1 *functions) const
{
- glPushMatrix();
- glMultMatrixf(mat.constData());
- glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
+ functions->glPushMatrix();
+ functions->glMultMatrixf(mat.constData());
+ functions->glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, faceColor);
const GLushort *indices = geom->faces.constData();
- glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices + start);
- glPopMatrix();
+ functions->glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indices + start);
+ functions->glPopMatrix();
}
//! [2]
@@ -371,17 +372,17 @@ void QtLogo::buildGeometry(int divisions, qreal scale)
//! [3]
//! [4]
-void QtLogo::draw() const
+void QtLogo::draw(QOpenGLFunctions_1_1 *functions) const
{
- geom->loadArrays();
+ geom->loadArrays(functions);
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_NORMAL_ARRAY);
+ functions->glEnableClientState(GL_VERTEX_ARRAY);
+ functions->glEnableClientState(GL_NORMAL_ARRAY);
for (int i = 0; i < parts.count(); ++i)
- parts[i]->draw();
+ parts[i]->draw(functions);
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_NORMAL_ARRAY);
+ functions->glDisableClientState(GL_VERTEX_ARRAY);
+ functions->glDisableClientState(GL_NORMAL_ARRAY);
}
//! [4]
diff --git a/examples/opengl/legacy/shared/qtlogo.h b/examples/opengl/legacy/shared/qtlogo.h
index 562435daed..9bd15a1431 100644
--- a/examples/opengl/legacy/shared/qtlogo.h
+++ b/examples/opengl/legacy/shared/qtlogo.h
@@ -44,6 +44,7 @@
#include <QObject>
#include <QColor>
+class QOpenGLFunctions_1_1;
class Patch;
struct Geometry;
@@ -54,7 +55,7 @@ public:
explicit QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
~QtLogo();
void setColor(QColor c);
- void draw() const;
+ void draw(QOpenGLFunctions_1_1 *functions) const;
private:
void buildGeometry(int d, qreal s);
diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp
index f93e667615..df52e3efbf 100644
--- a/examples/opengl/qopenglwidget/glwidget.cpp
+++ b/examples/opengl/qopenglwidget/glwidget.cpp
@@ -537,14 +537,14 @@ void GLWidget::setTransparent(bool transparent)
window()->update();
}
-void GLWidget::resizeGL(int w, int h)
+void GLWidget::resizeGL(int, int)
{
if (m_hasButton) {
if (!m_btn) {
- m_btn = new QPushButton("A widget on top.\nPress me!", this);
+ m_btn = new QPushButton("A widget on top.\nPress for more widgets.", this);
connect(m_btn, &QPushButton::clicked, this, &GLWidget::handleButtonPress);
}
- m_btn->move(w / 2, h / 2);
+ m_btn->move(20, 80);
}
}
diff --git a/examples/opengl/qopenglwidget/mainwindow.cpp b/examples/opengl/qopenglwidget/mainwindow.cpp
index 6cf1d5d6e2..22111afdcb 100644
--- a/examples/opengl/qopenglwidget/mainwindow.cpp
+++ b/examples/opengl/qopenglwidget/mainwindow.cpp
@@ -47,6 +47,7 @@
#include <QLabel>
#include <QCheckBox>
#include <QSpinBox>
+#include <QScrollArea>
#include "glwidget.h"
@@ -69,7 +70,7 @@ MainWindow::MainWindow()
"and therefore an interval < 16 ms will likely lead to a 60 FPS update rate.");
QGroupBox *updateGroupBox = new QGroupBox(this);
QCheckBox *timerBased = new QCheckBox("Use timer", this);
- timerBased->setChecked(true);
+ timerBased->setChecked(false);
timerBased->setToolTip("Toggles using a timer to trigger update().\n"
"When not set, each paintGL() schedules the next update immediately,\n"
"expecting the blocking swap to throttle the thread.\n"
@@ -87,7 +88,7 @@ MainWindow::MainWindow()
slider->setRange(0, 50);
slider->setSliderPosition(30);
m_timer->setInterval(10);
- label->setText("A QOpenGLWidget");
+ label->setText("A scrollable QOpenGLWidget");
label->setAlignment(Qt::AlignHCenter);
QGroupBox * groupBox = new QGroupBox(this);
@@ -96,7 +97,10 @@ MainWindow::MainWindow()
m_layout = new QGridLayout(groupBox);
- m_layout->addWidget(glwidget,1,0,8,1);
+ QScrollArea *scrollArea = new QScrollArea;
+ scrollArea->setWidget(glwidget);
+
+ m_layout->addWidget(scrollArea,1,0,8,1);
m_layout->addWidget(label,9,0,1,1);
m_layout->addWidget(updateGroupBox, 10, 0, 1, 1);
m_layout->addWidget(slider, 11,0,1,1);
@@ -134,7 +138,10 @@ MainWindow::MainWindow()
connect(timerBased, &QCheckBox::toggled, this, &MainWindow::timerUsageChanged);
connect(timerBased, &QCheckBox::toggled, updateInterval, &QWidget::setEnabled);
- m_timer->start();
+ if (timerBased->isChecked())
+ m_timer->start();
+ else
+ updateInterval->setEnabled(false);
}
void MainWindow::updateIntervalChanged(int value)
@@ -170,3 +177,8 @@ void MainWindow::timerUsageChanged(bool enabled)
w->update();
}
}
+
+void MainWindow::resizeEvent(QResizeEvent *)
+{
+ m_glWidgets[0]->setMinimumSize(size() + QSize(128, 128));
+}
diff --git a/examples/opengl/qopenglwidget/mainwindow.h b/examples/opengl/qopenglwidget/mainwindow.h
index f1b2c51e53..9ad8a01339 100644
--- a/examples/opengl/qopenglwidget/mainwindow.h
+++ b/examples/opengl/qopenglwidget/mainwindow.h
@@ -56,6 +56,8 @@ public:
void addNew();
bool timerEnabled() const { return m_timer->isActive(); }
+ void resizeEvent(QResizeEvent *);
+
private slots:
void updateIntervalChanged(int value);
void timerUsageChanged(bool enabled);
diff --git a/examples/sql/books/books.pro b/examples/sql/books/books.pro
index 31c47ba04f..1cdcaff870 100644
--- a/examples/sql/books/books.pro
+++ b/examples/sql/books/books.pro
@@ -16,5 +16,5 @@ wince*: {
CONFIG(debug, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*d4.dll
CONFIG(release, debug|release):sqlPlugins.files = $$QT_BUILD_TREE/plugins/sqldrivers/*[^d]4.dll
sqlPlugins.path = sqldrivers
- DEPLOYMENT += sqlPlugins
+ INSTALLS += sqlPlugins
}
diff --git a/examples/touch/fingerpaint/scribblearea.cpp b/examples/touch/fingerpaint/scribblearea.cpp
index 469c6b1a70..05598c134c 100644
--- a/examples/touch/fingerpaint/scribblearea.cpp
+++ b/examples/touch/fingerpaint/scribblearea.cpp
@@ -187,13 +187,14 @@ bool ScribbleArea::event(QEvent *event)
foreach (const QTouchEvent::TouchPoint &touchPoint, touchPoints) {
switch (touchPoint.state()) {
case Qt::TouchPointStationary:
- // don't do anything if this touch point hasn't moved
+ case Qt::TouchPointReleased:
+ // don't do anything if this touch point hasn't moved or has been released
continue;
default:
{
QRectF rect = touchPoint.rect();
if (rect.isEmpty()) {
- qreal diameter = MinimumDiameter;
+ qreal diameter = MaximumDiameter;
if (touch->device()->capabilities() & QTouchDevice::Pressure)
diameter = MinimumDiameter + (MaximumDiameter - MinimumDiameter) * touchPoint.pressure();
rect.setSize(QSizeF(diameter, diameter));
diff --git a/examples/webkit/webkit-guide/js/anim_accord.js b/examples/webkit/webkit-guide/js/anim_accord.js
index cc95b7f7c9..cc95b7f7c9 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_accord.js
+++ b/examples/webkit/webkit-guide/js/anim_accord.js
diff --git a/examples/webkit/webkit-guide/js/anim_gallery.js b/examples/webkit/webkit-guide/js/anim_gallery.js
index 050f113bb4..050f113bb4 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_gallery.js
+++ b/examples/webkit/webkit-guide/js/anim_gallery.js
diff --git a/examples/webkit/webkit-guide/js/anim_panel.js b/examples/webkit/webkit-guide/js/anim_panel.js
index e6cc5e6d8f..e6cc5e6d8f 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_panel.js
+++ b/examples/webkit/webkit-guide/js/anim_panel.js
diff --git a/examples/webkit/webkit-guide/js/anim_skew.js b/examples/webkit/webkit-guide/js/anim_skew.js
index 8b1300fd1f..8b1300fd1f 100755..100644
--- a/examples/webkit/webkit-guide/js/anim_skew.js
+++ b/examples/webkit/webkit-guide/js/anim_skew.js
diff --git a/examples/webkit/webkit-guide/js/css3_backgrounds.js b/examples/webkit/webkit-guide/js/css3_backgrounds.js
index 29004c7b53..29004c7b53 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_backgrounds.js
+++ b/examples/webkit/webkit-guide/js/css3_backgrounds.js
diff --git a/examples/webkit/webkit-guide/js/css3_border-img.js b/examples/webkit/webkit-guide/js/css3_border-img.js
index a8bfd9132d..a8bfd9132d 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_border-img.js
+++ b/examples/webkit/webkit-guide/js/css3_border-img.js
diff --git a/examples/webkit/webkit-guide/js/css3_grad-radial.js b/examples/webkit/webkit-guide/js/css3_grad-radial.js
index f194ddaa6c..f194ddaa6c 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_grad-radial.js
+++ b/examples/webkit/webkit-guide/js/css3_grad-radial.js
diff --git a/examples/webkit/webkit-guide/js/css3_mask-grad.js b/examples/webkit/webkit-guide/js/css3_mask-grad.js
index 911212dcf4..911212dcf4 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_mask-grad.js
+++ b/examples/webkit/webkit-guide/js/css3_mask-grad.js
diff --git a/examples/webkit/webkit-guide/js/css3_mask-img.js b/examples/webkit/webkit-guide/js/css3_mask-img.js
index a8bfd9132d..a8bfd9132d 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_mask-img.js
+++ b/examples/webkit/webkit-guide/js/css3_mask-img.js
diff --git a/examples/webkit/webkit-guide/js/css3_text-overflow.js b/examples/webkit/webkit-guide/js/css3_text-overflow.js
index 58af80d6d1..58af80d6d1 100755..100644
--- a/examples/webkit/webkit-guide/js/css3_text-overflow.js
+++ b/examples/webkit/webkit-guide/js/css3_text-overflow.js
diff --git a/examples/webkit/webkit-guide/js/form_tapper.js b/examples/webkit/webkit-guide/js/form_tapper.js
index d4d87a2c1a..d4d87a2c1a 100755..100644
--- a/examples/webkit/webkit-guide/js/form_tapper.js
+++ b/examples/webkit/webkit-guide/js/form_tapper.js
diff --git a/examples/webkit/webkit-guide/js/mob_condjs.js b/examples/webkit/webkit-guide/js/mob_condjs.js
index 32bf550d20..32bf550d20 100755..100644
--- a/examples/webkit/webkit-guide/js/mob_condjs.js
+++ b/examples/webkit/webkit-guide/js/mob_condjs.js
diff --git a/examples/webkit/webkit-guide/js/mobile.js b/examples/webkit/webkit-guide/js/mobile.js
index 51c94d4080..51c94d4080 100755..100644
--- a/examples/webkit/webkit-guide/js/mobile.js
+++ b/examples/webkit/webkit-guide/js/mobile.js
diff --git a/examples/webkit/webkit-guide/js/storage.js b/examples/webkit/webkit-guide/js/storage.js
index b5a374f39d..b5a374f39d 100755..100644
--- a/examples/webkit/webkit-guide/js/storage.js
+++ b/examples/webkit/webkit-guide/js/storage.js
diff --git a/examples/widgets/doc/images/imagegestures-example.jpg b/examples/widgets/doc/images/imagegestures-example.jpg
new file mode 100644
index 0000000000..c8484b4a71
--- /dev/null
+++ b/examples/widgets/doc/images/imagegestures-example.jpg
Binary files differ
diff --git a/examples/widgets/doc/src/plugandpaint.qdoc b/examples/widgets/doc/src/plugandpaint.qdoc
index 7a8a2cf2fc..a1e26272bc 100644
--- a/examples/widgets/doc/src/plugandpaint.qdoc
+++ b/examples/widgets/doc/src/plugandpaint.qdoc
@@ -30,8 +30,7 @@
\title Plug & Paint Example
\ingroup examples-widgets-tools
- \brief The Plug & Paint example demonstrates how to write Qt
- applications that can be extended through plugins.
+ \brief Demonstrates how to extend Qt applications using plugins.
\image plugandpaint.png Screenshot of the Plug & Paint example
@@ -314,6 +313,9 @@
/*!
\example tools/plugandpaintplugins/basictools
\title Plug & Paint Basic Tools Example
+ \brief A plugin providing the basic tools for painting functionality.
+
+ \image plugandpaint.png Screenshot of the Plug & Paint example
The Basic Tools example is a static plugin for the
\l{tools/plugandpaint}{Plug & Paint} example. It provides a set
@@ -499,6 +501,9 @@
/*!
\example tools/plugandpaintplugins/extrafilters
\title Plug & Paint Extra Filters Example
+ \brief A plugin providing the extra filters.
+
+ \image plugandpaint.png Screenshot of the Plug & Paint example
The Extra Filters example is a plugin for the
\l{tools/plugandpaint}{Plug & Paint} example. It provides a set
diff --git a/examples/widgets/draganddrop/puzzle/puzzle.pro b/examples/widgets/draganddrop/puzzle/puzzle.pro
index 95008fc29b..b310f1f776 100644
--- a/examples/widgets/draganddrop/puzzle/puzzle.pro
+++ b/examples/widgets/draganddrop/puzzle/puzzle.pro
@@ -18,5 +18,5 @@ INSTALLS += target
wince*: {
addFile.files = example.jpg
addFile.path = .
- DEPLOYMENT += addFile
+ INSTALLS += addFile
}
diff --git a/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc b/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc
index 07acef6b4d..2751c64e76 100644
--- a/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc
+++ b/examples/widgets/gestures/imagegestures/doc/src/imagegestures.qdoc
@@ -28,10 +28,13 @@
/*!
\example gestures/imagegestures
\title Image Gestures Example
+ \brief Demonstrates the use of simple gestures in a widget
This example shows how to enable gestures for a widget and use gesture input
to perform actions.
+ \image imagegestures-example.jpg
+
We use two classes to create the user interface for the application: \c MainWidget
and \c ImageWidget. The \c MainWidget class is simply used as a container for the
\c ImageWidget class, which we will configure to accept gesture input. Since we
diff --git a/examples/widgets/graphicsview/boxes/boxes.pro b/examples/widgets/graphicsview/boxes/boxes.pro
index e608b1c845..15d26f02f0 100644
--- a/examples/widgets/graphicsview/boxes/boxes.pro
+++ b/examples/widgets/graphicsview/boxes/boxes.pro
@@ -1,10 +1,6 @@
QT += opengl widgets
-contains(QT_CONFIG, opengles.) {
- contains(QT_CONFIG, angle): \
- warning("Qt was built with ANGLE, which provides only OpenGL ES 2.0 on top of DirectX 9.0c")
- error("This example requires Qt to be configured with -opengl desktop")
-}
+contains(QT_CONFIG, opengles.|angle|dynamicgl):error("This example requires Qt to be configured with -opengl desktop")
HEADERS += 3rdparty/fbm.h \
glbuffers.h \
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
index 408f6c4b0f..7499389dc3 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.cpp
@@ -248,8 +248,8 @@ void ColorDock::setCustomSizeHint(const QSize &size)
updateGeometry();
}
-ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFlags flags)
- : QDockWidget(parent, flags)
+ColorSwatch::ColorSwatch(const QString &colorName, QMainWindow *parent, Qt::WindowFlags flags)
+ : QDockWidget(parent, flags), mainWindow(parent)
{
setObjectName(colorName + QLatin1String(" Dock Widget"));
setWindowTitle(objectName() + QLatin1String(" [*]"));
@@ -390,7 +390,6 @@ ColorSwatch::ColorSwatch(const QString &colorName, QWidget *parent, Qt::WindowFl
void ColorSwatch::updateContextMenu()
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
const Qt::DockWidgetArea area = mainWindow->dockWidgetArea(this);
const Qt::DockWidgetAreas areas = allowedAreas();
@@ -458,7 +457,6 @@ void ColorSwatch::updateContextMenu()
void ColorSwatch::splitInto(QAction *action)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
ColorSwatch *target = 0;
foreach (ColorSwatch *dock, dock_list) {
@@ -477,7 +475,6 @@ void ColorSwatch::splitInto(QAction *action)
void ColorSwatch::tabInto(QAction *action)
{
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
QList<ColorSwatch*> dock_list = mainWindow->findChildren<ColorSwatch*>();
ColorSwatch *target = 0;
foreach (ColorSwatch *dock, dock_list) {
@@ -525,7 +522,6 @@ void ColorSwatch::place(Qt::DockWidgetArea area, bool p)
{
if (!p) return;
- QMainWindow *mainWindow = qobject_cast<QMainWindow *>(parentWidget());
mainWindow->addDockWidget(area, this);
if (allowedAreasActions->isEnabled()) {
diff --git a/examples/widgets/mainwindows/mainwindow/colorswatch.h b/examples/widgets/mainwindows/mainwindow/colorswatch.h
index 6d02592b22..78f267c320 100644
--- a/examples/widgets/mainwindows/mainwindow/colorswatch.h
+++ b/examples/widgets/mainwindows/mainwindow/colorswatch.h
@@ -70,8 +70,10 @@ class ColorSwatch : public QDockWidget
QAction *windowModifiedAction;
+ QMainWindow *mainWindow;
+
public:
- explicit ColorSwatch(const QString &colorName, QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit ColorSwatch(const QString &colorName, QMainWindow *parent = 0, Qt::WindowFlags flags = 0);
QMenu *menu;
void setCustomSizeHint(const QSize &size);
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index 70a8644b47..ea557c7aa9 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -156,6 +156,11 @@ void MainWindow::setupMenuBar()
action->setChecked(dockOptions() & VerticalTabs);
connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+ action = mainWindowMenu->addAction(tr("Grouped dragging"));
+ action->setCheckable(true);
+ action->setChecked(dockOptions() & GroupedDragging);
+ connect(action, SIGNAL(toggled(bool)), this, SLOT(setDockOptions()));
+
QMenu *toolBarMenu = menuBar()->addMenu(tr("Tool bars"));
for (int i = 0; i < toolBars.count(); ++i)
toolBarMenu->addMenu(toolBars.at(i)->menu);
@@ -187,6 +192,8 @@ void MainWindow::setDockOptions()
opts |= ForceTabbedDocks;
if (actions.at(4)->isChecked())
opts |= VerticalTabs;
+ if (actions.at(5)->isChecked())
+ opts |= GroupedDragging;
QMainWindow::setDockOptions(opts);
}
diff --git a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
index 640f36f9b8..809667b2ad 100644
--- a/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
+++ b/examples/widgets/richtext/syntaxhighlighter/syntaxhighlighter.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince*: {
addFiles.files = main.cpp mainwindow.cpp
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
index 45ded876a7..6764423d71 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.cpp
@@ -370,7 +370,6 @@ void AddressBook::loadFromFile()
QDataStream in(&file);
in.setVersion(QDataStream::Qt_4_3);
- contacts.empty(); // empty existing contacts
in >> contacts;
QMap<QString, QString>::iterator i = contacts.begin();
diff --git a/examples/widgets/widgets/icons/icons.pro b/examples/widgets/widgets/icons/icons.pro
index 51d8b79ba9..58e6c2137c 100644
--- a/examples/widgets/widgets/icons/icons.pro
+++ b/examples/widgets/widgets/icons/icons.pro
@@ -24,5 +24,5 @@ wince*: {
} else {
imageFiles.path = images
}
- DEPLOYMENT += imageFiles
+ INSTALLS += imageFiles
}
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp
index c32f21e7f3..0b8513f090 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.cpp
+++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp
@@ -107,7 +107,7 @@ void ImageViewer::open()
mimeTypeFilters.sort();
const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
QFileDialog dialog(this, tr("Open File"),
- picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.first());
+ picturesLocations.isEmpty() ? QDir::currentPath() : picturesLocations.last());
dialog.setAcceptMode(QFileDialog::AcceptOpen);
dialog.setMimeTypeFilters(mimeTypeFilters);
dialog.selectMimeTypeFilter("image/jpeg");
diff --git a/examples/widgets/widgets/movie/movie.pro b/examples/widgets/widgets/movie/movie.pro
index 6d333edfa8..58925c98a0 100644
--- a/examples/widgets/widgets/movie/movie.pro
+++ b/examples/widgets/widgets/movie/movie.pro
@@ -14,5 +14,5 @@ INSTALLS += target
wince*: {
addFiles.files += *.gif
addFiles.path = .
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/widgets/windowcontainer/windowcontainer.cpp b/examples/widgets/windowcontainer/windowcontainer.cpp
index 022b6dafc4..a38a10e6f6 100644
--- a/examples/widgets/windowcontainer/windowcontainer.cpp
+++ b/examples/widgets/windowcontainer/windowcontainer.cpp
@@ -92,10 +92,12 @@ public:
}
void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
- m_mouseDown = true;
- m_polygon.clear();
- m_polygon.append(e->pos());
- renderLater();
+ if (!m_mouseDown) {
+ m_mouseDown = true;
+ m_polygon.clear();
+ m_polygon.append(e->pos());
+ renderLater();
+ }
}
void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
@@ -106,9 +108,11 @@ public:
}
void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE {
- m_mouseDown = false;
- m_polygon.append(e->pos());
- renderLater();
+ if (m_mouseDown) {
+ m_mouseDown = false;
+ m_polygon.append(e->pos());
+ renderLater();
+ }
}
void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE {
diff --git a/examples/xml/dombookmarks/dombookmarks.pro b/examples/xml/dombookmarks/dombookmarks.pro
index 93a5fb9ac9..a16cdadcfa 100644
--- a/examples/xml/dombookmarks/dombookmarks.pro
+++ b/examples/xml/dombookmarks/dombookmarks.pro
@@ -14,6 +14,6 @@ INSTALLS += target
wince*: {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/examples/xml/htmlinfo/htmlinfo.pro b/examples/xml/htmlinfo/htmlinfo.pro
index 9e58973db6..4ad40213fe 100644
--- a/examples/xml/htmlinfo/htmlinfo.pro
+++ b/examples/xml/htmlinfo/htmlinfo.pro
@@ -9,7 +9,7 @@ win32: CONFIG += console
wince*:{
htmlfiles.files = *.html
htmlfiles.path = .
- DEPLOYMENT += htmlfiles
+ INSTALLS += htmlfiles
}
# install
diff --git a/examples/xml/saxbookmarks/saxbookmarks.pro b/examples/xml/saxbookmarks/saxbookmarks.pro
index 6723b0c6fc..aa84ee4f3e 100644
--- a/examples/xml/saxbookmarks/saxbookmarks.pro
+++ b/examples/xml/saxbookmarks/saxbookmarks.pro
@@ -16,5 +16,5 @@ INSTALLS += target
wince*: {
addFiles.files = frank.xbel jennifer.xbel
addFiles.path = "\\My Documents"
- DEPLOYMENT += addFiles
+ INSTALLS += addFiles
}
diff --git a/mkspecs/common/gcc-base-unix.conf b/mkspecs/common/gcc-base-unix.conf
index 29e0521927..f82c8a8430 100644
--- a/mkspecs/common/gcc-base-unix.conf
+++ b/mkspecs/common/gcc-base-unix.conf
@@ -16,6 +16,7 @@ QMAKE_LFLAGS_SONAME += -Wl,-soname,
QMAKE_LFLAGS_THREAD +=
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link,
+QMAKE_LFLAGS_NEW_DTAGS = -Wl,--enable-new-dtags
QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold
# -Bsymbolic-functions (ld) support
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
index dc0aa4b4a9..27e812b3a1 100644
--- a/mkspecs/common/gcc-base.conf
+++ b/mkspecs/common/gcc-base.conf
@@ -43,7 +43,7 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC
QMAKE_CFLAGS_STATIC_LIB += -fPIC
-QMAKE_CFLAGS_APP += -fPIE
+QMAKE_CFLAGS_APP += -fPIC
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf
index 09fdabce43..4ef03d8587 100644
--- a/mkspecs/common/qcc-base.conf
+++ b/mkspecs/common/qcc-base.conf
@@ -23,7 +23,7 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC -shared
QMAKE_CFLAGS_STATIC_LIB += -fPIC
-QMAKE_CFLAGS_APP += -fPIE
+QMAKE_CFLAGS_APP += -fPIC
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CFLAGS_SSE2 += -msse2
diff --git a/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in b/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
new file mode 100644
index 0000000000..c6419660c1
--- /dev/null
+++ b/mkspecs/common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
@@ -0,0 +1,49 @@
+<?xml version=\"1.0\" encoding=\"utf-8\"?>
+
+<Package
+ xmlns=\"http://schemas.microsoft.com/appx/manifest/foundation/windows10\"
+ xmlns:mp=\"http://schemas.microsoft.com/appx/2014/phone/manifest\"
+ xmlns:uap=\"http://schemas.microsoft.com/appx/manifest/uap/windows10\"
+ IgnorableNamespaces=\"uap mp\">
+
+ <Identity
+ Name=\"$${WINRT_MANIFEST.identity}\"
+ Publisher=\"$${WINRT_MANIFEST.publisherid}\"
+ Version=\"$${WINRT_MANIFEST.version}\" />
+
+ <mp:PhoneIdentity PhoneProductId=\"$${WINRT_MANIFEST.identity}\" PhonePublisherId=\"$${WINRT_MANIFEST.phone_publisher_id}\"/>
+
+ <Properties>
+ <DisplayName>$${WINRT_MANIFEST.name}</DisplayName>
+ <PublisherDisplayName>$${WINRT_MANIFEST.publisher}</PublisherDisplayName>
+ <Logo>$${WINRT_MANIFEST.logo_store}</Logo>
+ </Properties>
+
+ <Dependencies>
+ <TargetDeviceFamily Name=\"Windows.Universal\" MinVersion=\"10.0.10069.0\" MaxVersionTested=\"10.0.10069.0\" />
+ </Dependencies>
+
+ <Resources>
+ <Resource Language=\"en\"/>
+ </Resources>
+
+ <Applications>
+ <Application Id=\"App\"
+ Executable=\"$${WINRT_MANIFEST.target}.exe\"
+ EntryPoint=\"$${WINRT_MANIFEST.target}.App\">
+ <uap:VisualElements
+ DisplayName=\"$${WINRT_MANIFEST.name}\"
+ Description=\"$${WINRT_MANIFEST.description}\"
+ BackgroundColor=\"$${WINRT_MANIFEST.background}\"
+ Square150x150Logo=\"$${WINRT_MANIFEST.logo_150x150}\"
+ Square44x44Logo=\"$${WINRT_MANIFEST.logo_44x44}\">
+
+ <uap:SplashScreen Image=\"$${WINRT_MANIFEST.logo_620x300}\" />
+ </uap:VisualElements>
+ </Application>
+ </Applications>
+
+ <Capabilities>
+ <Capability Name=\"internetClient\" />
+ </Capabilities>
+</Package>
diff --git a/mkspecs/common/winrt_winphone/qmake.conf b/mkspecs/common/winrt_winphone/qmake.conf
index d71915408d..97ef661230 100644
--- a/mkspecs/common/winrt_winphone/qmake.conf
+++ b/mkspecs/common/winrt_winphone/qmake.conf
@@ -50,7 +50,7 @@ QMAKE_CXXFLAGS_STL_OFF =
QMAKE_CXXFLAGS_RTTI_ON = -GR
QMAKE_CXXFLAGS_RTTI_OFF =
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHsc
-QMAKE_CXXFLAGS_EXCEPTIONS_OFF =
+QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -D_HAS_EXCEPTIONS=0
QMAKE_INCDIR =
diff --git a/mkspecs/devices/linux-beagleboard-g++/qmake.conf b/mkspecs/devices/linux-beagleboard-g++/qmake.conf
index 3b9ca66306..1d32d374c6 100644
--- a/mkspecs/devices/linux-beagleboard-g++/qmake.conf
+++ b/mkspecs/devices/linux-beagleboard-g++/qmake.conf
@@ -36,8 +36,8 @@ QMAKE_CXXFLAGS_RELEASE += -O3
QMAKE_LIBS += -lrt -lpthread -ldl
# Extra stuff (OpenGL, DirectFB, ...)
-QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/usr/include
-QMAKE_LIBDIR_EGL = $$[QT_SYSROOT]/usr/lib
+QMAKE_INCDIR_EGL =
+QMAKE_LIBDIR_EGL =
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_LIBDIR_OPENGL_ES2 = $${QMAKE_LIBDIR_EGL}
QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
diff --git a/mkspecs/devices/linux-imx53qsb-g++/qmake.conf b/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
index 937bbf2416..39462d83d9 100644
--- a/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
+++ b/mkspecs/devices/linux-imx53qsb-g++/qmake.conf
@@ -16,15 +16,10 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += $$[QT_SYSROOT]/usr/include
-QMAKE_LIBDIR += $$[QT_SYSROOT]/usr/lib
-
QMAKE_LIBS_EGL += -lEGL
QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
QMAKE_LIBS_OPENVG += -lOpenVG -lEGL
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib
-
IMX5_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -Wno-psabi
QMAKE_CFLAGS += $$IMX5_CFLAGS
QMAKE_CXXFLAGS += $$IMX5_CFLAGS
diff --git a/mkspecs/devices/linux-imx6-g++/qmake.conf b/mkspecs/devices/linux-imx6-g++/qmake.conf
index 1646c5fe77..71e37845c3 100644
--- a/mkspecs/devices/linux-imx6-g++/qmake.conf
+++ b/mkspecs/devices/linux-imx6-g++/qmake.conf
@@ -4,15 +4,10 @@
include(../common/linux_device_pre.conf)
-QMAKE_INCDIR += $$[QT_SYSROOT]/usr/include
-QMAKE_LIBDIR += $$[QT_SYSROOT]/usr/lib
-
QMAKE_LIBS_EGL += -lEGL
QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
-QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib
-
IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
QMAKE_CFLAGS += $$IMX6_CFLAGS
QMAKE_CXXFLAGS += $$IMX6_CFLAGS
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index e967399258..8e68b95dd5 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -63,6 +63,7 @@ debug {
}
use_gold_linker: QMAKE_LFLAGS += $$QMAKE_LFLAGS_USE_GOLD
+enable_new_dtags: QMAKE_LFLAGS += $$QMAKE_LFLAGS_NEW_DTAGS
dll:win32: QMAKE_LFLAGS += $$QMAKE_LFLAGS_DLL
static:mac: QMAKE_LFLAGS += $$QMAKE_LFLAGS_STATIC_LIB
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
index b06b9d6cfc..eb3281ea1d 100644
--- a/mkspecs/features/default_pre.prf
+++ b/mkspecs/features/default_pre.prf
@@ -7,3 +7,18 @@ CONFIG = \
lex yacc debug exceptions depend_includepath \
testcase_targets import_plugins import_qpa_plugin \
$$CONFIG
+
+!build_pass:defined(QT_EDITION, var):!equals(QT_EDITION, "OpenSource"):!equals(QT_EDITION, "Preview") {
+ #
+ # call license checker (but cache result for one day)
+ #
+ today = $$section(_DATE_, " ", 0, 2)
+ !isEqual(QMAKE_LICHECK_TIMESTAMP, $$today) {
+ !system("$$system_quote($$system_path($$[QT_HOST_BINS/src]/$$QT_LICHECK)) check" \
+ "$$QT_RELEASE_DATE $$[QMAKE_SPEC] $$[QMAKE_XSPEC]"): \
+ error("License check failed! Giving up ...")
+
+ cache(QMAKE_LICHECK_TIMESTAMP, set stash, today)
+ }
+ unset(today)
+}
diff --git a/mkspecs/features/plugin_bundle.prf b/mkspecs/features/plugin_bundle.prf
new file mode 100644
index 0000000000..f3e7294c90
--- /dev/null
+++ b/mkspecs/features/plugin_bundle.prf
@@ -0,0 +1,2 @@
+# Override mkspec default which creates a shared library
+mac: QMAKE_LFLAGS_PLUGIN = -bundle
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index 264641b5b3..8e7b8bca0a 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -257,10 +257,10 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
debug: QT_ITEM = $${QTPLUG}d4.dll
else: QT_ITEM = $${QTPLUG}4.dll
- eval(qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM})
- eval(qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH})
+ qt_additional_plugin_$${QTPLUG}.files = $$[QT_INSTALL_PLUGINS/get]/$${QT_PLUGINPATH}/$${QT_ITEM}
+ qt_additional_plugin_$${QTPLUG}.path = $${QT_PLUGINPATH}
- DEPLOYMENT *= qt_additional_plugin_$${QTPLUG}
+ INSTALLS *= qt_additional_plugin_$${QTPLUG}
}
}
}
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 42046c238a..7197f84c9a 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -52,12 +52,6 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
unset(modpath)
}
-mac {
- !isEmpty(QMAKE_RPATHDIR){
- CONFIG += absolute_library_soname
- }
-}
-
cross_compile: \
CONFIG += force_bootstrap
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 6a66b76305..5861941848 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -79,6 +79,9 @@ warnings_are_errors:warning_clean {
# Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
}
+ } else:msvc {
+ # enable for MSVC 2012, MSVC 2013
+ equals(MSVC_VER, "11.0")|equals(MSVC_VER, "12.0"): QMAKE_CXXFLAGS_WARN_ON += -WX
}
unset(ver)
}
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 78be2e8473..a1c499610b 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -185,7 +185,7 @@ defineTest(qtAddRpathLink) {
# paths OTOH need to be put there.
pubqt = $$replace(1, -private$, _private)
pubdep = $$resolve_depends(pubqt, "QT.")
- privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".private_depends" ".run_depends")
+ privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".run_depends")
privdep -= $$pubdep
rpaths =
for(dep, privdep): \
@@ -259,7 +259,7 @@ defineTest(qtAddToolEnv) {
# target variable, dependency var name, [non-empty: prepare for system(), not make]
defineTest(qtAddTargetEnv) {
deps = $$replace($$2, -private$, _private)
- deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends")
+ deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends")
!isEmpty(deps) {
ptypes =
for(dep, deps) {
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 66a7598597..5412f3778a 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -60,7 +60,7 @@ MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES
load(qt_build_paths)
-qt_no_install_library {
+header_module {
TEMPLATE = aux
CONFIG += force_qt # Needed for the headers_clean tests.
} else {
@@ -104,7 +104,7 @@ mac:CONFIG(shared, static|shared):contains(QT_CONFIG, qt_framework) {
QMAKE_TARGET_BUNDLE_PREFIX = org.qt-project
#QMAKE_FRAMEWORK_VERSION = 4.0
CONFIG += sliced_bundle qt_framework
- qt_no_install_library {
+ header_module {
CONFIG += bundle
QMAKE_BUNDLE_EXTENSION = .framework
QMAKE_INFO_PLIST = $$QMAKESPEC/Info.plist.lib
@@ -132,6 +132,9 @@ mac {
QMAKE_CFLAGS += -fconstant-cfstrings
QMAKE_CXXFLAGS += -fconstant-cfstrings
}
+
+ contains(QT_CONFIG, rpath): \
+ QMAKE_SONAME_PREFIX = @rpath
}
DEFINES += QT_BUILDING_QT
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index 4ce03f4327..1d727847e2 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -91,15 +91,22 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
MODULE_PRIVATE_INCLUDES = \$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION \
\$\$QT_MODULE_INCLUDE_BASE/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME
}
- split_incpath: \
+ split_incpath {
MODULE_SHADOW_INCLUDES = $$replace(MODULE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \
$$MODULE_BASE_OUTDIR/include)
+ generated_privates: \
+ MODULE_SHADOW_PRIVATE_INCLUDES = $$replace(MODULE_PRIVATE_INCLUDES, ^\\\$\\\$QT_MODULE_INCLUDE_BASE, \
+ $$MODULE_BASE_OUTDIR/include)
+ }
MODULE_INCLUDES += $$MODULE_AUX_INCLUDES
MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES
internal_module: \
MODULE_INCLUDES += $$MODULE_PRIVATE_INCLUDES
- split_incpath: \
+ split_incpath {
MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$val_escape(MODULE_SHADOW_INCLUDES)"
+ generated_privates: \
+ MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}_private.includes += $$val_escape(MODULE_SHADOW_PRIVATE_INCLUDES)"
+ }
MODULE_PRI_CONT = \
"QT.$${MODULE_ID}.VERSION = $${VERSION}" \
"QT.$${MODULE_ID}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \
diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf
index 8564731a22..7a38ff8f38 100644
--- a/mkspecs/features/resources.prf
+++ b/mkspecs/features/resources.prf
@@ -6,6 +6,66 @@ isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
!contains(QMAKE_RESOURCE_FLAGS, -root):!isEmpty(QMAKE_RESOURCE_ROOT):QMAKE_RESOURCE_FLAGS += -root $$QMAKE_RESOURCE_ROOT
!contains(QMAKE_RESOURCE_FLAGS, -name): QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE}
+# http://www.w3.org/TR/xml/#syntax
+defineReplace(xml_escape) {
+ 1 ~= s,&,&amp;,
+ 1 ~= s,\',&apos;,
+ 1 ~= s,\",&quot;,
+ 1 ~= s,<,&lt;,
+ 1 ~= s,>,&gt;,
+ return($$1)
+}
+
+RESOURCES += qmake_immediate
+for(resource, RESOURCES) {
+ # Regular case of user qrc file
+ contains(resource, ".*\.qrc$"): \
+ next()
+
+ # Fallback for stand-alone files/directories
+ !defined($${resource}.files, var) {
+ !equals(resource, qmake_immediate) {
+ !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
+ warning("Failure to find: $$resource")
+ qmake_immediate.files += $$resource
+ }
+ RESOURCES -= $$resource
+ next()
+ }
+
+ resource_file = $$RCC_DIR/qmake_$${resource}.qrc
+
+ !debug_and_release|build_pass {
+ # Collection of files, generate qrc file
+ prefix = $$eval($${resource}.prefix)
+ isEmpty(prefix): \
+ prefix = "/"
+
+ resource_file_content = \
+ "<!DOCTYPE RCC><RCC version=\"1.0\">" \
+ "<qresource prefix=\"$$xml_escape($$prefix)\">"
+
+ abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_)
+
+ for(file, $${resource}.files) {
+ abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_)
+ alias = $$relative_path($$abs_path, $$abs_base)
+ resource_file_content += \
+ "<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$abs_path)</file>"
+ }
+
+ resource_file_content += \
+ "</qresource>" \
+ "</RCC>"
+
+ !write_file($$OUT_PWD/$$resource_file, resource_file_content): \
+ error("Aborting.")
+ }
+
+ RESOURCES -= $$resource
+ RESOURCES += $$resource_file
+}
+
rcc.input = RESOURCES
rcc.name = RCC ${QMAKE_FILE_IN}
rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN}
diff --git a/mkspecs/features/spec_post.prf b/mkspecs/features/spec_post.prf
index c9578773fe..4d398059b2 100644
--- a/mkspecs/features/spec_post.prf
+++ b/mkspecs/features/spec_post.prf
@@ -109,9 +109,8 @@ equals(MAKEFILE_GENERATOR, MSBUILD) \
}
QMAKE_INSTALL_DIR = $$QMAKE_COPY_DIR
equals(QMAKE_HOST.os, Windows) {
- # Ugly (and broken for relative paths) hack to support cross-building for Unix.
- QMAKE_SYMBOLIC_LINK = $$QMAKE_COPY
- QMAKE_LN_SHLIB = $$QMAKE_SYMBOLIC_LINK
+ QMAKE_SYMBOLIC_LINK = $(QMAKE) -install ln -f -s
+ QMAKE_LN_SHLIB = $(QMAKE) -install ln -s
} else {
QMAKE_SYMBOLIC_LINK = ln -f -s
QMAKE_LN_SHLIB = ln -s
diff --git a/mkspecs/features/testlib_defines.prf b/mkspecs/features/testlib_defines.prf
index 9176beb9dd..901e03a91d 100644
--- a/mkspecs/features/testlib_defines.prf
+++ b/mkspecs/features/testlib_defines.prf
@@ -1 +1,2 @@
-DEFINES += QT_TESTCASE_BUILDDIR=$$shell_quote(\"$$OUT_PWD\")
+contains(TEMPLATE, vc.*): DEFINES += QT_TESTCASE_BUILDDIR=\"$$OUT_PWD\"
+else: DEFINES += QT_TESTCASE_BUILDDIR=$$shell_quote(\"$$OUT_PWD\")
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index 8119c8aa09..9190aa9f28 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -12,7 +12,7 @@ QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS =
-QMAKE_CFLAGS_APP = -fPIE
+QMAKE_CFLAGS_APP = -fPIC
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -w1 -Wall -Wcheck -wd1572,873,2259,2261
QMAKE_CFLAGS_WARN_OFF = -w
diff --git a/mkspecs/macx-ios-clang/Info.plist.app b/mkspecs/macx-ios-clang/Info.plist.app
index 623ed496c5..623ed496c5 100755..100644
--- a/mkspecs/macx-ios-clang/Info.plist.app
+++ b/mkspecs/macx-ios-clang/Info.plist.app
diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf
new file mode 100644
index 0000000000..fcb6d99aa9
--- /dev/null
+++ b/mkspecs/winrt-arm-msvc2015/qmake.conf
@@ -0,0 +1,32 @@
+#
+# qmake configuration for winrt-arm-msvc2015
+#
+# Written for Microsoft Visual C++ 2015
+#
+
+include(../common/winrt_winphone/qmake.conf)
+QMAKE_COMPILER_DEFINES += _MSC_VER=1900
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP ARM __ARM__ __arm__
+
+QMAKE_CFLAGS += -FS
+QMAKE_CXXFLAGS += -FS
+QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib
+
+QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib
+
+# Note that the order is important, ucrt(d) has to be first
+# Otherwise the linker might use malloc from a different library
+# but free_dbg() from the runtime, causing assert when deleting
+# items from different heaps
+CONFIG(debug, debug|release) {
+ QMAKE_LIBS = ucrtd.lib $$QMAKE_LIBS
+} else {
+ QMAKE_LIBS = ucrt.lib $$QMAKE_LIBS
+}
+
+VCPROJ_ARCH = ARM
+MSVC_VER = 14.0
+WINSDK_VER = 10.0
+WINTARGET_VER = winv10.0
+WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
+WINRT_MANIFEST.architecture = arm
diff --git a/tests/auto/tools/qmake/testdata/functions/2.cpp b/mkspecs/winrt-arm-msvc2015/qplatformdefs.h
index 8bdc2e59e8..c8f88524d9 100644
--- a/tests/auto/tools/qmake/testdata/functions/2.cpp
+++ b/mkspecs/winrt-arm-msvc2015/qplatformdefs.h
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the test suite of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -30,3 +30,5 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf
new file mode 100644
index 0000000000..e8062f5364
--- /dev/null
+++ b/mkspecs/winrt-x64-msvc2015/qmake.conf
@@ -0,0 +1,32 @@
+#
+# qmake configuration for winrt-x64-msvc2015
+#
+# Written for Microsoft Visual C++ 2015
+#
+
+include(../common/winrt_winphone/qmake.conf)
+QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP X64 __X64__ __x64__
+
+QMAKE_CFLAGS += -FS
+QMAKE_CXXFLAGS += -FS
+QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib
+
+QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib
+
+# Note that the order is important, ucrt(d) has to be first
+# Otherwise the linker might use malloc from a different library
+# but free_dbg() from the runtime, causing assert when deleting
+# items from different heaps
+CONFIG(debug, debug|release) {
+ QMAKE_LIBS = ucrtd.lib $$QMAKE_LIBS
+} else {
+ QMAKE_LIBS = ucrt.lib $$QMAKE_LIBS
+}
+
+VCPROJ_ARCH = x64
+MSVC_VER = 14.0
+WINSDK_VER = 10.0
+WINTARGET_VER = winv10.0
+WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
+WINRT_MANIFEST.architecture = x64
diff --git a/tests/auto/tools/qmake/testdata/functions/one/1.cpp b/mkspecs/winrt-x64-msvc2015/qplatformdefs.h
index 8bdc2e59e8..c8f88524d9 100644
--- a/tests/auto/tools/qmake/testdata/functions/one/1.cpp
+++ b/mkspecs/winrt-x64-msvc2015/qplatformdefs.h
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the test suite of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -30,3 +30,5 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf
new file mode 100644
index 0000000000..5b44a97e8d
--- /dev/null
+++ b/mkspecs/winrt-x86-msvc2015/qmake.conf
@@ -0,0 +1,32 @@
+#
+# qmake configuration for winrt-x86-msvc2015
+#
+# Written for Microsoft Visual C++ 2015
+#
+
+include(../common/winrt_winphone/qmake.conf)
+QMAKE_COMPILER_DEFINES += _MSC_VER=1900 _WIN32
+DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_APP X86 __X86__ __x86__
+
+QMAKE_CFLAGS += -FS
+QMAKE_CXXFLAGS += -FS
+QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib
+
+QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib
+
+# Note that the order is important, ucrt(d) has to be first
+# Otherwise the linker might use malloc from a different library
+# but free_dbg() from the runtime, causing assert when deleting
+# items from different heaps
+CONFIG(debug, debug|release) {
+ QMAKE_LIBS = ucrtd.lib $$QMAKE_LIBS
+} else {
+ QMAKE_LIBS = ucrt.lib $$QMAKE_LIBS
+}
+
+VCPROJ_ARCH = Win32
+MSVC_VER = 14.0
+WINSDK_VER = 10.0
+WINTARGET_VER = winv10.0
+WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in
+WINRT_MANIFEST.architecture = x86
diff --git a/tests/auto/tools/qmake/testdata/functions/one/2.cpp b/mkspecs/winrt-x86-msvc2015/qplatformdefs.h
index 8bdc2e59e8..c8f88524d9 100644
--- a/tests/auto/tools/qmake/testdata/functions/one/2.cpp
+++ b/mkspecs/winrt-x86-msvc2015/qplatformdefs.h
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the test suite of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -30,3 +30,5 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include "../common/winrt_winphone/qplatformdefs.h"
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 86f884fe20..520ae667e9 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -13,7 +13,7 @@ OBJS=project.o option.o property.o main.o ioutils.o proitems.o \
#qt code
QOBJS=qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtextstream.o qiodevice.o \
- qdebug.o qmalloc.o qglobal.o \
+ qringbuffer.o qdebug.o qmalloc.o qglobal.o \
qarraydata.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfiledevice.o qfile.o \
qfilesystementry.o qfilesystemengine.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o \
qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o \
@@ -44,6 +44,7 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/tools/qstring_compat.cpp \
$(SOURCE_PATH)/src/corelib/io/qfiledevice.cpp \
$(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp \
+ $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp \
$(SOURCE_PATH)/src/corelib/io/qdebug.cpp \
$(SOURCE_PATH)/src/corelib/global/qmalloc.cpp \
$(SOURCE_PATH)/src/corelib/global/qglobal.cpp $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp \
@@ -242,6 +243,9 @@ qsettings_win.o: $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
qiodevice.o: $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
+qringbuffer.o: $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp
+
qdebug.o: $(SOURCE_PATH)/src/corelib/io/qdebug.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdebug.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 9dda6ca1e7..272a0c09b1 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -88,6 +88,7 @@ QTOBJS= \
qglobal.obj \
qhash.obj \
qiodevice.obj \
+ qringbuffer.obj \
qdebug.obj \
qlist.obj \
qlinkedlist.obj \
diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
index 335fa6f97e..7609a98111 100644
--- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro
+++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
@@ -186,21 +186,6 @@ DEFINES += USE_MY_STUFF
#! [27]
-#! [28]
-myFiles.files = path\*.png
-DEPLOYMENT += myFiles
-#! [28]
-
-
-#! [29]
-myFiles.files = path\file1.ext1 path2\file2.ext1 path3\*
-myFiles.path = \some\path\on\device
-someother.files = C:\additional\files\*
-someother.path = \myFiles\path2
-DEPLOYMENT += myFiles someother
-#! [29]
-
-
#! [30]
DESTDIR = ../../lib
#! [30]
@@ -987,3 +972,8 @@ QMAKE_SONAME_PREFIX = /Library/Frameworks
#! [185]
VERSION_PE_HEADER = 1.2
#! [185]
+
+#! [186]
+RC_DEFINES += USE_MY_STUFF
+#! [186]
+
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 56d9dd35ae..6f855ba9ca 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1120,38 +1120,6 @@
Specifies a list of all directories to look in to resolve dependencies. This
variable is used when crawling through \c included files.
- \target DEPLOYMENT
- \section1 DEPLOYMENT
-
- \note This variable is used only on the Windows CE platform.
-
- Specifies which additional files will be deployed. Deployment means the
- transfer of files from the development system to the target device or
- emulator.
-
- Files can be deployed by either creating a Visual Studio project or using
- the \l {Using Qt Test remotely on Windows CE}{cetest} executable.
-
- For example, the following definition uploads all PNG images in \c path to
- the directory where the build target is deployed:
-
- \snippet code/doc_src_qmake-manual.pro 28
-
- The default deployment target path for Windows CE is
- \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
- \c{\Program Files\target}.
-
- It is also possible to specify multiple \c sources to be deployed on
- target \c paths. In addition, different variables can be used for
- deployment to different directories.
-
- For example:
-
- \snippet code/doc_src_qmake-manual.pro 29
-
- \note In Windows CE all linked Qt libraries will be deployed to the path
- specified by \c{myFiles.path}.
-
\target DEPLOYMENT_PLUGIN
\section1 DEPLOYMENT_PLUGIN
@@ -1276,6 +1244,13 @@
For more information, see \l{Installing Files}.
+ This variable is also used to specify which additional files will be
+ deployed to embedded devices.
+
+ For Windows CE, the default deployment target path is
+ \c{%CSIDL_PROGRAM_FILES%\target}, which usually gets expanded to
+ \c{\Program Files\target}.
+
\target LEXIMPLS
\section1 LEXIMPLS
@@ -2314,6 +2289,14 @@
.rc file. This is only utilized if the \l{VERSION} or \l{RC_ICONS} variable
is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
+ \target RC_DEFINES
+ \section1 RC_DEFINES
+
+ Windows only. qmake adds the values of this variable as RC preprocessor macros
+ (/d option). If this variable is not set, the \l{DEFINES} variable is used instead.
+
+ \snippet code/doc_src_qmake-manual.pro 186
+
\target RC_ICONS
\section1 RC_ICONS
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index fcd6bf8308..deacac2c83 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -810,7 +810,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES
ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"),
&frameworkdirs = project->values("QMAKE_FRAMEWORKPATH");
- static const char * const libs[] = { "QMAKE_LFLAGS", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
+ static const char * const libs[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 };
for (int i = 0; libs[i]; i++) {
tmp = project->values(libs[i]);
for(int x = 0; x < tmp.count();) {
@@ -821,9 +821,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QString r = opt.mid(2).toQString();
fixForOutput(r);
libdirs.append(r);
- } else if(opt == "-prebind") {
- project->values("QMAKE_DO_PREBINDING").append("TRUE");
- remove = true;
} else if(opt.startsWith("-l")) {
name = opt.mid(2).toQString();
QString lib("lib" + name);
@@ -921,7 +918,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(!path.isEmpty() && !libdirs.contains(path))
libdirs += path;
}
- library = fileFixify(library, FileFixifyFromOutdir);
+ library = fileFixify(library, FileFixifyFromOutdir | FileFixifyAbsolute);
QString key = keyFor(library);
if (!project->values("QMAKE_PBX_LIBRARIES").contains(key)) {
bool is_frmwrk = (library.endsWith(".framework"));
@@ -1812,11 +1809,14 @@ ProjectBuilderMakefileGenerator::openOutput(QFile &file, const QString &build) c
}
output += QString("project.pbxproj");
file.setFileName(output);
+ bool ret = UnixMakefileGenerator::openOutput(file, build);
+ ((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir.section(Option::dir_sep, 0, -1);
+ Option::output_dir = pbx_dir.section(Option::dir_sep, 0, -2);
+ return ret;
}
- bool ret = UnixMakefileGenerator::openOutput(file, build);
- ((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir.section(Option::dir_sep, 0, -1);
- Option::output_dir = pbx_dir.section(Option::dir_sep, 0, -2);
- return ret;
+
+ ((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir;
+ return UnixMakefileGenerator::openOutput(file, build);
}
/* This function is such a hack it is almost pointless, but it
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index f5e8248af5..4a03fafd77 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -2019,7 +2019,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for(int i = 0; i < pre_deps.size(); ++i)
deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell);
}
- QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out, LocalShell);
+ QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out, TargetShell);
// NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use!
for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
@@ -2240,7 +2240,7 @@ QString MakefileGenerator::buildArgs()
QString ret;
foreach (const QString &arg, Option::globals->qmake_args)
- ret += " " + escapeFilePath(arg);
+ ret += " " + shellQuote(arg);
return ret;
}
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index efea807209..c4750cb8a4 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -612,7 +612,7 @@ UnixMakefileGenerator::processPrlFiles()
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
if(!prl_libs.isEmpty()) {
for(int prl = 0; prl < prl_libs.size(); ++prl)
- l.insert(lit+prl+1, prl_libs.at(prl).toQString());
+ l.insert(++lit, prl_libs.at(prl));
prl_libs.clear();
}
}
@@ -699,6 +699,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
return QString();
enum { NoBundle, SolidBundle, SlicedBundle } bundle = NoBundle;
+ bool isAux = (project->first("TEMPLATE") == "aux");
const QString root = "$(INSTALL_ROOT)";
ProStringList &uninst = project->values(ProKey(t + ".uninstall"));
QString ret, destdir = project->first("DESTDIR").toQString();
@@ -773,21 +774,21 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
}
src_targ = escapeFilePath(src_targ);
dst_targ = escapeFilePath(dst_targ);
- if(!ret.isEmpty())
- ret += "\n\t";
- QString copy_cmd("-");
+ QString copy_cmd;
if (bundle == SolidBundle) {
- copy_cmd += "$(INSTALL_DIR) " + src_targ + ' ' + plain_targ;
+ copy_cmd += "-$(INSTALL_DIR) " + src_targ + ' ' + plain_targ;
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
- copy_cmd += "$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
- } else {
+ copy_cmd += "-$(INSTALL_FILE) " + src_targ + ' ' + dst_targ;
+ } else if (!isAux) {
if (bundle == SlicedBundle)
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false) + "\n\t";
- copy_cmd += "$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
+ copy_cmd += "-$(INSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
}
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
+ if (!ret.isEmpty())
+ ret += "\n\t";
if(!project->isEmpty("QMAKE_FIX_RPATH")) {
ret += copy_cmd;
ret += "\n\t-" + var("QMAKE_FIX_RPATH") + ' ' + dst_targ + ' ' + dst_targ;
@@ -797,11 +798,14 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
} else {
ret += copy_cmd;
}
- } else {
+ } else if (!copy_cmd.isEmpty()) {
+ if (!ret.isEmpty())
+ ret += "\n\t";
ret += copy_cmd;
}
- if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
+ if (isAux) {
+ } else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
if(!project->isEmpty("QMAKE_RANLIB"))
ret += QString("\n\t$(RANLIB) ") + dst_targ;
} else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip")
@@ -820,7 +824,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
uninst.append("\n\t");
if (bundle == SolidBundle)
uninst.append("-$(DEL_FILE) -r " + plain_targ);
- else
+ else if (!isAux)
uninst.append("-$(DEL_FILE) " + dst_targ);
if (bundle == SlicedBundle) {
int dstlen = project->first("DESTDIR").length();
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 9b9e54c461..5cde7c4ac2 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -807,11 +807,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} else {
info_plist = escapeFilePath(fileFixify(info_plist));
}
- bool isApp = (project->first("TEMPLATE") == "app");
- QString info_plist_out =
- bundle_dir + (isApp ? "Contents/Info.plist"
- : "Versions/" + project->first("QMAKE_FRAMEWORK_VERSION")
- + "/Resources/Info.plist");
+ bool isFramework = project->first("TEMPLATE") == "lib" && project->isActiveConfig("lib_bundle");
+ QString info_plist_out = bundle_dir +
+ (isFramework ? ("Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/Resources/Info.plist")
+ : "Contents/Info.plist");
bundledFiles << info_plist_out;
alldeps << info_plist_out;
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
@@ -842,7 +841,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
bundleIdentifier.chop(10);
commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" ";
- if (isApp) {
+ if (!isFramework) {
QString icon = fileFixify(var("ICON"));
t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
<< "@sed ";
@@ -850,6 +849,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << arg;
t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" "
<< "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" "
+ << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ?
QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "
<< "" << info_plist << " >" << info_plist_out << endl;
@@ -922,17 +922,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
}
- QString bundle_dir_f = escapeFilePath(bundle_dir);
- QHash<QString, QString>::ConstIterator symIt = symlinks.constBegin(),
- symEnd = symlinks.constEnd();
- for (; symIt != symEnd; ++symIt) {
- bundledFiles << symIt.key();
- alldeps << symIt.key();
- t << escapeDependencyPath(symIt.key()) << ":\n\t"
- << mkdir_p_asstring(bundle_dir) << "\n\t"
- << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
- }
- if (!project->first("QMAKE_FRAMEWORK_VERSION").isEmpty()) {
+ if (!symlinks.isEmpty()) {
+ QString bundle_dir_f = escapeFilePath(bundle_dir);
+ QHash<QString, QString>::ConstIterator symIt = symlinks.constBegin(),
+ symEnd = symlinks.constEnd();
+ for (; symIt != symEnd; ++symIt) {
+ bundledFiles << symIt.key();
+ alldeps << symIt.key();
+ t << escapeDependencyPath(symIt.key()) << ":\n\t"
+ << mkdir_p_asstring(bundle_dir) << "\n\t"
+ << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
+ }
+
QString currentLink = bundle_dir + "Versions/Current";
QString currentLink_f = escapeDependencyPath(currentLink);
bundledFiles << currentLink;
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index c19e17bc0e..57955dc456 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -405,9 +405,14 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
}
if (!rc_file.isEmpty()) {
+
+ ProString defines = varGlue("RC_DEFINES", " -D", " -D", "");
+ if (defines.isEmpty())
+ defines = ProString(" $(DEFINES)");
+
t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t"
<< var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE")
- << incPathStr << " $(DEFINES)\n\n";
+ << incPathStr << defines << "\n\n";
}
}
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 6c2d2c6206..cbf7cf26dc 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -608,10 +608,13 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
xml.setIndentString(" ");
+ const QString toolsVersion = (tool.SdkVersion == QStringLiteral("10.0")) ? QStringLiteral("14.0")
+ : QStringLiteral("4.0");
+
xml << decl("1.0", "utf-8")
<< tag("Project")
<< attrTag("DefaultTargets","Build")
- << attrTag("ToolsVersion", "4.0")
+ << attrTag("ToolsVersion", toolsVersion)
<< attrTag("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003")
<< tag("ItemGroup")
<< attrTag("Label", "ProjectConfigurations");
@@ -640,7 +643,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("DefaultLanguage", "en")
<< tagValue("AppContainerApplication", "true")
<< tagValue("ApplicationType", isWinPhone ? "Windows Phone" : "Windows Store")
- << tagValue("ApplicationTypeRevision", tool.SdkVersion);
+ << tagValue("ApplicationTypeRevision", tool.SdkVersion == "10.0" ? "8.2" : tool.SdkVersion);
}
xml << closetag();
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index eb8ae23384..dfa8f8837b 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -176,11 +176,34 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
const QString vcInstallDir = "/fake/vc_install_dir";
const QString kitDir = "/fake/sdk_install_dir";
#endif // Q_OS_WIN
-
QStringList incDirs;
QStringList libDirs;
QStringList binDirs;
- if (isPhone) {
+ if (msvcVer == QStringLiteral("14.0")) {
+ binDirs << vcInstallDir + QStringLiteral("bin/") + compiler;
+ binDirs << vcInstallDir + QStringLiteral("bin/"); // Maybe remove for x86 again?
+ binDirs << kitDir + QStringLiteral("bin/") + (arch == QStringLiteral("arm") ? QStringLiteral("x86") : arch);
+ binDirs << vcInstallDir + QStringLiteral("../Common7/Tools/bin");
+ binDirs << vcInstallDir + QStringLiteral("../Common7/Tools");
+ binDirs << vcInstallDir + QStringLiteral("../Common7/ide");
+ binDirs << kitDir + QStringLiteral("Windows Performance Toolkit/");
+
+ incDirs << vcInstallDir + QStringLiteral("include");
+ incDirs << vcInstallDir + QStringLiteral("atlmfc/include");
+ // ### Investigate why VS uses 10056 first
+ incDirs << kitDir + QStringLiteral("Include/10.0.10056.0/ucrt");
+ incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/ucrt");
+ incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/um");
+ incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/shared");
+ incDirs << kitDir + QStringLiteral("Include/10.0.10069.0/winrt");
+
+ libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch;
+ libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch;
+ // ### Investigate why VS uses 10056 first
+ libDirs << kitDir + QStringLiteral("lib/10.0.10056.0/ucrt/") + arch;
+ libDirs << kitDir + QStringLiteral("lib/10.0.10069.0/ucrt/") + arch;
+ libDirs << kitDir + QStringLiteral("lib/10.0.10069.0/um/") + arch;
+ } else if (isPhone) {
QString sdkDir = vcInstallDir;
if (!QDir(sdkDir).exists()) {
fprintf(stderr, "Failed to find the Windows Phone SDK in %s.\n"
@@ -208,7 +231,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
<< kitDir + QStringLiteral("/include/shared")
<< kitDir + QStringLiteral("/include/winrt");
}
-
// Inherit PATH
binDirs << QString::fromLocal8Bit(qgetenv("PATH")).split(QLatin1Char(';'));
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 59136b16c8..7092da3e59 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -56,7 +56,8 @@ enum DotNET {
NET2008 = 0x90,
NET2010 = 0xa0,
NET2012 = 0xb0,
- NET2013 = 0xc0
+ NET2013 = 0xc0,
+ NET2015 = 0xd0
};
/*
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 1fa117afda..b8f9c8135d 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -71,6 +71,7 @@ struct DotNetCombo {
const char *regKey;
} dotNetCombo[] = {
#ifdef Q_OS_WIN64
+ {NET2015, "MSVC.NET 2015 (14.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
{NET2012, "MSVC.NET 2012 (11.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"},
@@ -84,6 +85,7 @@ struct DotNetCombo {
{NET2003, "MSVC.NET 2003 (7.1)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir"},
{NET2002, "MSVC.NET 2002 (7.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"},
#else
+ {NET2015, "MSVC.NET 2015 (14.0)", "Software\\Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
{NET2012, "MSVC.NET 2012 (11.0)", "Software\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"},
@@ -175,6 +177,8 @@ const char _slnHeader110[] = "Microsoft Visual Studio Solution File, Format
"\n# Visual Studio 2012";
const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2013";
+const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
+ "\n# Visual Studio 2015";
// The following UUID _may_ change for later servicepacks...
// If so we need to search through the registry at
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects
@@ -401,6 +405,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const
return QStringLiteral("v110") + suffix;
case NET2013:
return QStringLiteral("v120") + suffix;
+ case NET2015:
+ return QStringLiteral("v140") + suffix;
default:
return QString();
}
@@ -647,6 +653,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
+ case NET2015:
+ t << _slnHeader140;
case NET2013:
t << _slnHeader120;
break;
@@ -972,6 +980,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString();
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
+ case NET2015:
+ vcProject.Version = "14.00";
+ break;
case NET2013:
vcProject.Version = "12.00";
break;
@@ -1213,7 +1224,12 @@ void VcprojGenerator::initLinkerTool()
void VcprojGenerator::initResourceTool()
{
VCConfiguration &conf = vcProject.Configuration;
- conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions;
+
+ ProStringList rcDefines = project->values("RC_DEFINES");
+ if (rcDefines.size() > 0)
+ conf.resource.PreprocessorDefinitions = rcDefines.toQStringList();
+ else
+ conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions;
foreach (const ProString &path, project->values("RC_INCLUDEPATH")) {
QString fixedPath = fileFixify(path.toQString());
@@ -1369,8 +1385,7 @@ void VcprojGenerator::initDeploymentTool()
}
}
- // foreach item in DEPLOYMENT
- foreach (const ProString &item, project->values("DEPLOYMENT")) {
+ foreach (const ProString &item, project->values("INSTALLS")) {
// get item.path
QString devicePath = project->first(ProKey(item + ".path")).toQString();
if (!conf.WinRT) {
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 6ea129f82c..0d761b08a2 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -100,10 +100,13 @@ ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
{
if (lib.startsWith('/')) {
if (lib.startsWith("/LIBPATH:"))
- return QStringLiteral("/LIBPATH:") + escapeFilePath(lib.mid(9));
+ return QLatin1String("/LIBPATH:")
+ + escapeFilePath(Option::fixPathToTargetOS(lib.mid(9).toQString(), false));
+ // This appears to be a user-supplied flag. Assume sufficient quoting.
return lib;
}
- return escapeFilePath(lib);
+ // This must be a fully resolved library path.
+ return escapeFilePath(Option::fixPathToTargetOS(lib.toQString(), false));
}
bool
@@ -231,7 +234,7 @@ Win32MakefileGenerator::processPrlFiles()
}
ProStringList &prl_libs = project->values("QMAKE_CURRENT_PRL_LIBS");
for (int prl = 0; prl < prl_libs.size(); ++prl)
- l.insert(lit + prl + 1, prl_libs.at(prl));
+ l.insert(++lit, prl_libs.at(prl));
prl_libs.clear();
}
@@ -752,10 +755,6 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
if(!project->values("RC_FILE").isEmpty()) {
const ProString res_file = project->first("RES_FILE");
const QString rc_file = fileFixify(project->first("RC_FILE").toQString());
- // The resource tool needs to have the same defines passed in as the compiler, since you may
- // use these defines in the .rc file itself. Also, we need to add the _DEBUG define manually
- // since the compiler defines this symbol by itself, and we use it in the automatically
- // created rc file when VERSION is define the .pro file.
const ProStringList rcIncPaths = project->values("RC_INCLUDEPATH");
QString incPathStr;
@@ -767,9 +766,20 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
incPathStr += escapeFilePath(path);
}
+ // The resource tool may use defines. This might be the same defines passed in as the
+ // compiler, since you may use these defines in the .rc file itself.
+ // As the escape syntax for the command line defines for RC is different from that for CL,
+ // we might have to set specific defines for RC.
+ ProString defines = varGlue("RC_DEFINES", " -D", " -D", "");
+ if (defines.isEmpty())
+ defines = ProString(" $(DEFINES)");
+
+ // Also, we need to add the _DEBUG define manually since the compiler defines this symbol
+ // by itself, and we use it in the automatically created rc file when VERSION is defined
+ // in the .pro file.
t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t"
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
- << " $(DEFINES)" << incPathStr << " -fo " << escapeFilePath(res_file)
+ << defines << incPathStr << " -fo " << escapeFilePath(res_file)
<< ' ' << escapeFilePath(rc_file);
t << endl << endl;
}
@@ -784,7 +794,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
{
if((t != "target" && t != "dlltarget") ||
(t == "dlltarget" && (project->first("TEMPLATE") != "lib" || !project->isActiveConfig("shared"))) ||
- project->first("TEMPLATE") == "subdirs")
+ project->first("TEMPLATE") == "subdirs" || project->first("TEMPLATE") == "aux")
return QString();
const QString root = "$(INSTALL_ROOT)";
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index e780259417..a610da6b69 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -159,6 +159,18 @@ QString &ProString::toQString(QString &tmp) const
return tmp.setRawData(m_string.constData() + m_offset, m_length);
}
+/*!
+ * \brief ProString::prepareExtend
+ * \param extraLen number of new characters to be added
+ * \param thisTarget offset to which current contents should be moved
+ * \param extraTarget offset at which new characters will be added
+ * \return pointer to storage location for new characters
+ *
+ * Prepares the string for adding new characters.
+ * If the string is detached and has enough space, it will be changed in place.
+ * Otherwise, it will be replaced with a new string object, thus detaching.
+ * In either case, the hash will be reset.
+ */
QChar *ProString::prepareExtend(int extraLen, int thisTarget, int extraTarget)
{
if (m_string.isDetached() && m_length + extraLen <= m_string.capacity()) {
@@ -473,4 +485,23 @@ ProFile::~ProFile()
{
}
+ProString ProFile::getStr(const ushort *&tPtr)
+{
+ uint len = *tPtr++;
+ ProString ret(items(), tPtr - tokPtr(), len);
+ ret.setSource(this);
+ tPtr += len;
+ return ret;
+}
+
+ProKey ProFile::getHashStr(const ushort *&tPtr)
+{
+ uint hash = *tPtr++;
+ hash |= (uint)*tPtr++ << 16;
+ uint len = *tPtr++;
+ ProKey ret(items(), tPtr - tokPtr(), len, hash);
+ tPtr += len;
+ return ret;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index d31367361d..9430d28521 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -352,6 +352,9 @@ public:
bool isHostBuild() const { return m_hostBuild; }
void setHostBuild(bool host_build) { m_hostBuild = host_build; }
+ ProString getStr(const ushort *&tPtr);
+ ProKey getHashStr(const ushort *&tPtr);
+
private:
ProItemRefCount m_refCount;
QString m_proitems;
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index e384d26f4c..02d5d5dd31 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -214,7 +214,7 @@ static QString windowsErrorCode()
NULL);
QString ret = QString::fromWCharArray(string);
LocalFree((HLOCAL)string);
- return ret;
+ return ret.trimmed();
}
#endif
@@ -362,7 +362,7 @@ QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::Open
{
QString errStr;
if (!m_vfs->writeFile(fn, mode, contents, &errStr)) {
- evalError(fL1S("Cannot write %1file %2: %3.")
+ evalError(fL1S("Cannot write %1file %2: %3")
.arg(ctx, QDir::toNativeSeparators(fn), errStr));
return ReturnFalse;
}
@@ -1121,7 +1121,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
switch (func_t) {
case T_DEFINED: {
if (args.count() < 1 || args.count() > 2) {
- evalError(fL1S("defined(function, [\"test\"|\"replace\"])"
+ evalError(fL1S("defined(function, [\"test\"|\"replace\"|\"var\"])"
" requires one or two arguments."));
return ReturnFalse;
}
@@ -1582,7 +1582,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (rHand == INVALID_HANDLE_VALUE) {
- evalError(fL1S("Cannot open() reference file %1: %2.").arg(rfn, windowsErrorCode()));
+ evalError(fL1S("Cannot open reference file %1: %2").arg(rfn, windowsErrorCode()));
return ReturnFalse;
}
FILETIME ft;
@@ -1592,7 +1592,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
GENERIC_WRITE, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (wHand == INVALID_HANDLE_VALUE) {
- evalError(fL1S("Cannot open() %1: %2.").arg(tfn, windowsErrorCode()));
+ evalError(fL1S("Cannot open %1: %2").arg(tfn, windowsErrorCode()));
return ReturnFalse;
}
SetFileTime(wHand, 0, 0, &ft);
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index 5c9dc45f3a..8e247d9afa 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -188,7 +188,8 @@ void QMakeEvaluator::initStatics()
{ "QMAKE_RPATH", "QMAKE_LFLAGS_RPATH" },
{ "QMAKE_FRAMEWORKDIR", "QMAKE_FRAMEWORKPATH" },
{ "QMAKE_FRAMEWORKDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS" },
- { "IN_PWD", "PWD" }
+ { "IN_PWD", "PWD" },
+ { "DEPLOYMENT", "INSTALLS" }
};
for (unsigned i = 0; i < sizeof(mapInits)/sizeof(mapInits[0]); ++i)
statics.varMap.insert(ProKey(mapInits[i].oldname), ProKey(mapInits[i].newname));
@@ -258,24 +259,6 @@ uint QMakeEvaluator::getBlockLen(const ushort *&tokPtr)
return len;
}
-ProString QMakeEvaluator::getStr(const ushort *&tokPtr)
-{
- uint len = *tokPtr++;
- ProString ret(m_current.pro->items(), tokPtr - m_current.pro->tokPtr(), len);
- ret.setSource(m_current.pro);
- tokPtr += len;
- return ret;
-}
-
-ProKey QMakeEvaluator::getHashStr(const ushort *&tokPtr)
-{
- uint hash = getBlockLen(tokPtr);
- uint len = *tokPtr++;
- ProKey ret(m_current.pro->items(), tokPtr - m_current.pro->tokPtr(), len, hash);
- tokPtr += len;
- return ret;
-}
-
void QMakeEvaluator::skipStr(const ushort *&tokPtr)
{
uint len = *tokPtr++;
@@ -314,7 +297,8 @@ ProStringList QMakeEvaluator::split_value_list(const QString &vals, const ProFil
switch (unicode) {
case '"':
case '\'':
- quote = unicode;
+ if (!quote)
+ quote = unicode;
hadWord = true;
break;
case ' ':
@@ -429,6 +413,7 @@ void QMakeEvaluator::evaluateExpression(
const ushort *&tokPtr, ProStringList *ret, bool joined)
{
debugMsg(2, joined ? "evaluating joined expression" : "evaluating expression");
+ ProFile *pro = m_current.pro;
if (joined)
*ret << ProString();
bool pending = false;
@@ -444,35 +429,35 @@ void QMakeEvaluator::evaluateExpression(
m_current.line = *tokPtr++;
break;
case TokLiteral: {
- const ProString &val = getStr(tokPtr);
+ const ProString &val = pro->getStr(tokPtr);
debugMsg(2, "literal %s", dbgStr(val));
addStr(val, ret, pending, joined);
break; }
case TokHashLiteral: {
- const ProKey &val = getHashStr(tokPtr);
+ const ProKey &val = pro->getHashStr(tokPtr);
debugMsg(2, "hashed literal %s", dbgStr(val.toString()));
addStr(val, ret, pending, joined);
break; }
case TokVariable: {
- const ProKey &var = getHashStr(tokPtr);
+ const ProKey &var = pro->getHashStr(tokPtr);
const ProStringList &val = values(map(var));
debugMsg(2, "variable %s => %s", dbgKey(var), dbgStrList(val));
addStrList(val, tok, ret, pending, joined);
break; }
case TokProperty: {
- const ProKey &var = getHashStr(tokPtr);
+ const ProKey &var = pro->getHashStr(tokPtr);
const ProString &val = propertyValue(var);
debugMsg(2, "property %s => %s", dbgKey(var), dbgStr(val));
addStr(val, ret, pending, joined);
break; }
case TokEnvVar: {
- const ProString &var = getStr(tokPtr);
+ const ProString &var = pro->getStr(tokPtr);
const ProString &val = ProString(m_option->getEnv(var.toQString(m_tmp1)));
debugMsg(2, "env var %s => %s", dbgStr(var), dbgStr(val));
addStr(val, ret, pending, joined);
break; }
case TokFuncName: {
- const ProKey &func = getHashStr(tokPtr);
+ const ProKey &func = pro->getHashStr(tokPtr);
debugMsg(2, "function %s", dbgKey(func));
addStrList(evaluateExpandFunction(func, tokPtr), tok, ret, pending, joined);
break; }
@@ -537,6 +522,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
{
traceMsg("entering block");
ProStringList curr;
+ ProFile *pro = m_current.pro;
bool okey = true, or_op = false, invert = false;
uint blockLen;
while (ushort tok = *tokPtr++) {
@@ -596,7 +582,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
blockLen = getBlockLen(tokPtr);
ret = visitProBlock(tokPtr);
} else if (okey != or_op) {
- const ProKey &variable = getHashStr(tokPtr);
+ const ProKey &variable = pro->getHashStr(tokPtr);
uint exprLen = getBlockLen(tokPtr);
const ushort *exprPtr = tokPtr;
tokPtr += exprLen;
@@ -616,7 +602,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
case TokTestDef:
case TokReplaceDef:
if (m_cumulative || okey != or_op) {
- const ProKey &name = getHashStr(tokPtr);
+ const ProKey &name = pro->getHashStr(tokPtr);
blockLen = getBlockLen(tokPtr);
visitProFunctionDef(tok, name, tokPtr);
traceMsg("defined %s function %s",
@@ -796,8 +782,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop(
forever {
if (infinite) {
if (!variable.isEmpty())
- m_valuemapStack.top()[variable] = ProStringList(ProString(QString::number(index++)));
- if (index > 1000) {
+ m_valuemapStack.top()[variable] = ProStringList(ProString(QString::number(index)));
+ if (++index > 1000) {
evalError(fL1S("Ran into infinite loop (> 1000 iterations)."));
break;
}
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index 4f2acf25ee..a60adde84e 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -150,8 +150,6 @@ public:
{ return b ? ReturnTrue : ReturnFalse; }
static ALWAYS_INLINE uint getBlockLen(const ushort *&tokPtr);
- ProString getStr(const ushort *&tokPtr);
- ProKey getHashStr(const ushort *&tokPtr);
void evaluateExpression(const ushort *&tokPtr, ProStringList *ret, bool joined);
static ALWAYS_INLINE void skipStr(const ushort *&tokPtr);
static ALWAYS_INLINE void skipHashStr(const ushort *&tokPtr);
diff --git a/qmake/library/qmakeglobals.h b/qmake/library/qmakeglobals.h
index 7c77450523..de46ebbe74 100644
--- a/qmake/library/qmakeglobals.h
+++ b/qmake/library/qmakeglobals.h
@@ -135,6 +135,7 @@ public:
bool initProperties();
# else
void setProperties(const QHash<QString, QString> &props);
+ void setProperties(const QHash<ProKey, ProString> &props) { properties = props; }
# endif
ProString propertyValue(const ProKey &name) const { return properties.value(name); }
#endif
diff --git a/qmake/main.cpp b/qmake/main.cpp
index 27969932bc..bde537dcca 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -163,6 +163,75 @@ static int doSed(int argc, char **argv)
return 0;
}
+static int doLink(int argc, char **argv)
+{
+ bool isSymlink = false;
+ bool force = false;
+ QList<const char *> inFiles;
+ for (int i = 0; i < argc; i++) {
+ if (!strcmp(argv[i], "-s")) {
+ isSymlink = true;
+ } else if (!strcmp(argv[i], "-f")) {
+ force = true;
+ } else if (argv[i][0] == '-') {
+ fprintf(stderr, "Error: unrecognized ln option '%s'\n", argv[i]);
+ return 3;
+ } else {
+ inFiles << argv[i];
+ }
+ }
+ if (inFiles.size() != 2) {
+ fprintf(stderr, "Error: this ln requires exactly two file arguments\n");
+ return 3;
+ }
+ if (!isSymlink) {
+ fprintf(stderr, "Error: this ln supports faking symlinks only\n");
+ return 3;
+ }
+ QString target = QString::fromLocal8Bit(inFiles[0]);
+ QString linkname = QString::fromLocal8Bit(inFiles[1]);
+
+ QDir destdir;
+ QFileInfo tfi(target);
+ QFileInfo lfi(linkname);
+ if (lfi.isDir()) {
+ destdir.setPath(linkname);
+ lfi.setFile(destdir, tfi.fileName());
+ } else {
+ destdir.setPath(lfi.path());
+ }
+ if (!destdir.exists()) {
+ fprintf(stderr, "Error: destination directory %s does not exist\n", qPrintable(destdir.path()));
+ return 1;
+ }
+ tfi.setFile(destdir.absoluteFilePath(tfi.filePath()));
+ if (!tfi.exists()) {
+ fprintf(stderr, "Error: this ln does not support symlinking non-existing targets\n");
+ return 3;
+ }
+ if (tfi.isDir()) {
+ fprintf(stderr, "Error: this ln does not support symlinking directories\n");
+ return 3;
+ }
+ if (lfi.exists()) {
+ if (!force) {
+ fprintf(stderr, "Error: %s exists\n", qPrintable(lfi.filePath()));
+ return 1;
+ }
+ if (!QFile::remove(lfi.filePath())) {
+ fprintf(stderr, "Error: cannot overwrite %s\n", qPrintable(lfi.filePath()));
+ return 1;
+ }
+ }
+ if (!QFile::copy(tfi.filePath(), lfi.filePath())) {
+ fprintf(stderr, "Error: cannot copy %s to %s\n",
+ qPrintable(tfi.filePath()), qPrintable(lfi.filePath()));
+ return 1;
+ }
+
+ return 0;
+}
+
static int doInstall(int argc, char **argv)
{
if (!argc) {
@@ -171,6 +240,8 @@ static int doInstall(int argc, char **argv)
}
if (!strcmp(argv[0], "sed"))
return doSed(argc - 1, argv + 1);
+ if (!strcmp(argv[0], "ln"))
+ return doLink(argc - 1, argv + 1);
fprintf(stderr, "Error: unrecognized -install subcommand '%s'\n", argv[0]);
return 3;
}
diff --git a/qtbase.pro b/qtbase.pro
index bae2641404..51e8fb8760 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -46,6 +46,11 @@ equals(QMAKE_HOST.os, Windows) {
}
INSTALLS += qmake
+#licheck
+licheck.path = $$[QT_HOST_BINS]
+licheck.files = $$PWD/bin/$$QT_LICHECK
+exists($$licheck.files): INSTALLS += licheck
+
#syncqt
syncqt.path = $$[QT_HOST_BINS]
syncqt.files = $$PWD/bin/syncqt.pl
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
index 4fde295443..4a87488014 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
@@ -189,6 +189,7 @@ egl::Error SurfaceD3D::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
return egl::Error(EGL_SUCCESS);
}
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (defined(ANGLE_ENABLE_WINDOWS_STORE) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) // Qt WP: eglPostSubBufferNV comes here
if (x + width > mWidth)
{
width = mWidth - x;
@@ -198,6 +199,7 @@ egl::Error SurfaceD3D::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
{
height = mHeight - y;
}
+#endif
if (width == 0 || height == 0)
{
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h
index 81b9ea748d..0f70fe4615 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h
@@ -38,7 +38,7 @@ class InspectableNativeWindow;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
-#else
+#elif defined(ANGLE_ENABLE_D3D11)
typedef IDXGISwapChain DXGISwapChain;
typedef IDXGIFactory DXGIFactory;
#endif
@@ -60,9 +60,11 @@ class NativeWindow
#endif
static bool isValidNativeWindow(EGLNativeWindowType window);
+#if defined(ANGLE_ENABLE_D3D11)
HRESULT createSwapChain(ID3D11Device* device, DXGIFactory* factory,
DXGI_FORMAT format, UINT width, UINT height,
DXGISwapChain** swapChain);
+#endif
inline EGLNativeWindowType getNativeWindow() const { return mWindow; }
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
index 298f3ccbd2..dc539cf66e 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
@@ -552,18 +552,18 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
d3d11::PositionTexCoordVertex *vertices = static_cast<d3d11::PositionTexCoordVertex*>(mappedResource.pData);
+#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
// Create a quad in homogeneous coordinates
- float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
- float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
- float x2 = ((x + width) / float(mWidth)) * 2.0f - 1.0f;
- float y2 = ((y + height) / float(mHeight)) * 2.0f - 1.0f;
+ float x1 = -1.0f;
+ float y1 = -1.0f;
+ float x2 = 1.0f;
+ float y2 = 1.0f;
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
const float dim = std::max(mWidth, mHeight);
- float u1 = x / dim;
- float v1 = y / dim;
- float u2 = (x + width) / dim;
- float v2 = (y + height) / dim;
+ float u1 = 0;
+ float v1 = 0;
+ float u2 = float(width) / dim;
+ float v2 = float(height) / dim;
const NativeWindow::RotationFlags flags = mNativeWindow.rotationFlags();
const bool rotateL = flags == NativeWindow::RotateLeft;
@@ -573,6 +573,12 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, rotateR ? u1 : u2, rotateL ? v2 : v1);
d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, rotateL ? u1 : u2, rotateR ? v1 : v2);
#else
+ // Create a quad in homogeneous coordinates
+ float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
+ float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
+ float x2 = ((x + width) / float(mWidth)) * 2.0f - 1.0f;
+ float y2 = ((y + height) / float(mHeight)) * 2.0f - 1.0f;
+
float u1 = x / float(mWidth);
float v1 = y / float(mHeight);
float u2 = (x + width) / float(mWidth);
@@ -613,8 +619,8 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
viewport.TopLeftX = 0;
viewport.TopLeftY = 0;
#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
- viewport.Width = (rotateL || rotateR) ? mHeight : mWidth;
- viewport.Height = (rotateL || rotateR) ? mWidth : mHeight;
+ viewport.Width = (rotateL || rotateR) ? height : width;
+ viewport.Height = (rotateL || rotateR) ? width : height;
#else
viewport.Width = mWidth;
viewport.Height = mHeight;
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
index 9d8f0bb96c..0a4f45b5b7 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
@@ -37,6 +37,7 @@ bool NativeWindow::isValidNativeWindow(EGLNativeWindowType window)
return IsWindow(window) == TRUE;
}
+#if defined(ANGLE_ENABLE_D3D11)
HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory,
DXGI_FORMAT format, unsigned int width, unsigned int height,
DXGISwapChain** swapChain)
@@ -65,4 +66,5 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory
return factory->CreateSwapChain(device, &swapChainDesc, swapChain);
}
+#endif
}
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
index 350526c867..fa9a69c5a1 100644
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
@@ -100,6 +100,7 @@ bool CoreWindowNativeWindow::registerForSizeChangeEvents()
if (SUCCEEDED(result))
{
result = mDisplayInformation->add_OrientationChanged(orientationChangedHandler.Get(), &mOrientationChangedEventToken);
+ orientationChangedHandler->Invoke(mDisplayInformation.Get(), nullptr);
}
#endif
@@ -135,8 +136,8 @@ HRESULT CoreWindowNativeWindow::createSwapChain(ID3D11Device *device, DXGIFactor
}
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = { 0 };
- swapChainDesc.Width = width;
- swapChainDesc.Height = height;
+ swapChainDesc.Width = mRotationFlags ? height : width;
+ swapChainDesc.Height = mRotationFlags ? width : height;
swapChainDesc.Format = format;
swapChainDesc.Stereo = FALSE;
swapChainDesc.SampleDesc.Count = 1;
diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
index ded73dbb48..62f3ca1207 100644
--- a/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
@@ -101,12 +101,14 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin
return EGL_FALSE;
}
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (defined(ANGLE_ENABLE_WINDOWS_STORE) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) // Qt WP: Allow this entry point as a workaround
if (!display->getExtensions().postSubBuffer)
{
// Spec is not clear about how this should be handled.
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
+#endif
error = eglSurface->postSubBuffer(x, y, width, height);
if (error.isError())
diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c
index 017ae0741e..8d08f403ec 100644
--- a/src/3rdparty/forkfd/forkfd.c
+++ b/src/3rdparty/forkfd/forkfd.c
@@ -63,7 +63,7 @@
# include <Availability.h>
# include <AvailabilityMacros.h>
# if MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
-# define HAVE_BROKEN_WAITID_ALL 1
+# define HAVE_BROKEN_WAITID 1
# endif
#endif
@@ -109,10 +109,10 @@ static struct sigaction old_sigaction;
static pthread_once_t forkfd_initialization = PTHREAD_ONCE_INIT;
static ffd_atomic_int forkfd_status = FFD_ATOMIC_INIT(0);
-#ifdef HAVE_BROKEN_WAITID_ALL
-static int waitid_p_all_works = 0;
+#ifdef HAVE_BROKEN_WAITID
+static int waitid_works = 0;
#else
-static const int waitid_p_all_works = 1;
+static const int waitid_works = 1;
#endif
static ProcessInfo *tryAllocateInSection(Header *header, ProcessInfo entries[], int maxCount)
@@ -183,10 +183,13 @@ static int tryReaping(pid_t pid, siginfo_t *info)
{
/* reap the child */
#ifdef HAVE_WAITID
- // we have waitid(2), which fills in siginfo_t for us
- info->si_pid = 0;
- return waitid(P_PID, pid, info, WEXITED | WNOHANG) == 0 && info->si_pid == pid;
-#else
+ if (waitid_works) {
+ // we have waitid(2), which fills in siginfo_t for us
+ info->si_pid = 0;
+ return waitid(P_PID, pid, info, WEXITED | WNOHANG) == 0 && info->si_pid == pid;
+ }
+#endif
+
int status;
if (waitpid(pid, &status, WNOHANG) <= 0)
return 0; // child did not change state
@@ -206,7 +209,6 @@ static int tryReaping(pid_t pid, siginfo_t *info)
}
return 1;
-#endif
}
static void freeInfo(Header *header, ProcessInfo *entry)
@@ -246,7 +248,7 @@ static void sigchld_handler(int signum)
memset(&info, 0, sizeof info);
#ifdef HAVE_WAITID
- if (!waitid_p_all_works)
+ if (!waitid_works)
goto search_arrays;
/* be optimistic: try to see if we can get the child that exited */
@@ -310,12 +312,14 @@ search_arrays:
if (pid <= 0)
continue;
#ifdef HAVE_WAITID
- /* The child might have been reaped by the block above in another thread,
- * so first check if it's ready and, if it is, lock it */
- if (!isChildReady(pid, &info) ||
- !ffd_atomic_compare_exchange(&children.entries[i].pid, &pid, -1,
- FFD_ATOMIC_RELAXED, FFD_ATOMIC_RELAXED))
- continue;
+ if (waitid_works) {
+ /* The child might have been reaped by the block above in another thread,
+ * so first check if it's ready and, if it is, lock it */
+ if (!isChildReady(pid, &info) ||
+ !ffd_atomic_compare_exchange(&children.entries[i].pid, &pid, -1,
+ FFD_ATOMIC_RELAXED, FFD_ATOMIC_RELAXED))
+ continue;
+ }
#endif
if (tryReaping(pid, &info)) {
/* this is our child, send notification and free up this entry */
@@ -331,12 +335,14 @@ search_arrays:
if (pid <= 0)
continue;
#ifdef HAVE_WAITID
- /* The child might have been reaped by the block above in another thread,
- * so first check if it's ready and, if it is, lock it */
- if (!isChildReady(pid, &info) ||
- !ffd_atomic_compare_exchange(&array->entries[i].pid, &pid, -1,
- FFD_ATOMIC_RELAXED, FFD_ATOMIC_RELAXED))
- continue;
+ if (waitid_works) {
+ /* The child might have been reaped by the block above in another thread,
+ * so first check if it's ready and, if it is, lock it */
+ if (!isChildReady(pid, &info) ||
+ !ffd_atomic_compare_exchange(&array->entries[i].pid, &pid, -1,
+ FFD_ATOMIC_RELAXED, FFD_ATOMIC_RELAXED))
+ continue;
+ }
#endif
if (tryReaping(pid, &info)) {
/* this is our child, send notification and free up this entry */
@@ -357,17 +363,19 @@ chain_handler:
static void forkfd_initialize()
{
-#if defined(HAVE_BROKEN_WAITID_ALL)
+#if defined(HAVE_BROKEN_WAITID)
pid_t pid = fork();
if (pid == 0) {
_exit(0);
} else if (pid > 0) {
siginfo_t info;
waitid(P_ALL, 0, &info, WNOWAIT | WEXITED);
- waitid_p_all_works = (info.si_pid != 0);
+ waitid_works = (info.si_pid != 0);
+ info.si_pid = 0;
// now really reap the child
waitid(P_PID, pid, &info, WEXITED);
+ waitid_works = waitid_works && (info.si_pid != 0);
}
#endif
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
index 7438d5994c..2d4627e4f7 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-thai.c
@@ -241,7 +241,7 @@ static HB_Bool HB_ThaiConvertStringToGlyphIndices (HB_ShaperItem *item)
int lgn = 0;
HB_Bool haveSaraAm = false;
- cell_length = th_next_cell ((const unsigned char *)cstr + i, len - i, &tis_cell, true); /* !item->fixedPitch); */
+ cell_length = (int)(th_next_cell ((const unsigned char *)cstr + i, len - i, &tis_cell, true)); /* !item->fixedPitch); */
haveSaraAm = (cstr[i + cell_length - 1] == (char)0xd3);
/* set shaper item's log_clusters */
@@ -432,7 +432,7 @@ static void HB_ThaiAssignAttributes(const HB_UChar16 *string, hb_uint32 len, HB_
/* manage grapheme boundaries */
i = 0;
while (i < len) {
- cell_length = th_next_cell((const unsigned char *)cstr + i, len - i, &tis_cell, true);
+ cell_length = (hb_uint32)(th_next_cell((const unsigned char *)cstr + i, len - i, &tis_cell, true));
attributes[i].graphemeBoundary = true;
for (j = 1; j < cell_length; j++)
diff --git a/src/3rdparty/md4/md4.cpp b/src/3rdparty/md4/md4.cpp
index 94ac6adf58..ec74958d69 100644
--- a/src/3rdparty/md4/md4.cpp
+++ b/src/3rdparty/md4/md4.cpp
@@ -180,7 +180,7 @@ static void md4_update(struct md4_context *ctx, const unsigned char *data, size_
saved_lo = ctx->lo;
if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
ctx->hi++;
- ctx->hi += size >> 29;
+ ctx->hi += (quint32)(size >> 29);
used = saved_lo & 0x3f;
diff --git a/src/3rdparty/pcre/AUTHORS b/src/3rdparty/pcre/AUTHORS
index 5eee1af4c6..d33723f198 100644
--- a/src/3rdparty/pcre/AUTHORS
+++ b/src/3rdparty/pcre/AUTHORS
@@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2014 University of Cambridge
+Copyright (c) 1997-2015 University of Cambridge
All rights reserved
@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2010-2014 Zoltan Herczeg
+Copyright(c) 2010-2015 Zoltan Herczeg
All rights reserved.
@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2009-2014 Zoltan Herczeg
+Copyright(c) 2009-2015 Zoltan Herczeg
All rights reserved.
diff --git a/src/3rdparty/pcre/LICENCE b/src/3rdparty/pcre/LICENCE
index 602e4ae680..9f6f98e477 100644
--- a/src/3rdparty/pcre/LICENCE
+++ b/src/3rdparty/pcre/LICENCE
@@ -6,7 +6,8 @@ and semantics are as close as possible to those of the Perl 5 language.
Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
specified below. The documentation for PCRE, supplied in the "doc"
-directory, is distributed under the same terms as the software itself.
+directory, is distributed under the same terms as the software itself. The data
+in the testdata directory is not copyrighted and is in the public domain.
The basic library functions are written in C and are freestanding. Also
included in the distribution is a set of C++ wrapper functions, and a
@@ -24,7 +25,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
-Copyright (c) 1997-2014 University of Cambridge
+Copyright (c) 1997-2015 University of Cambridge
All rights reserved.
@@ -35,7 +36,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2010-2014 Zoltan Herczeg
+Copyright(c) 2010-2015 Zoltan Herczeg
All rights reserved.
@@ -46,7 +47,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
-Copyright(c) 2009-2014 Zoltan Herczeg
+Copyright(c) 2009-2015 Zoltan Herczeg
All rights reserved.
diff --git a/src/3rdparty/pcre/pcre.h b/src/3rdparty/pcre/pcre.h
index 20f04ebed4..58ed46a2a3 100644
--- a/src/3rdparty/pcre/pcre.h
+++ b/src/3rdparty/pcre/pcre.h
@@ -43,8 +43,8 @@ POSSIBILITY OF SUCH DAMAGE.
#define PCRE_MAJOR 8
#define PCRE_MINOR 37
-#define PCRE_PRERELEASE -RC1
-#define PCRE_DATE 2015-02-03
+#define PCRE_PRERELEASE
+#define PCRE_DATE 2015-04-28
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate
diff --git a/src/3rdparty/pcre/pcre_compile.c b/src/3rdparty/pcre/pcre_compile.c
index 6510835c17..0efad2645d 100644
--- a/src/3rdparty/pcre/pcre_compile.c
+++ b/src/3rdparty/pcre/pcre_compile.c
@@ -866,14 +866,6 @@ static const pcre_uint8 opcode_possessify[] = {
};
-/* Structure for mutual recursion detection. */
-
-typedef struct recurse_check {
- struct recurse_check *prev;
- const pcre_uchar *group;
-} recurse_check;
-
-
/*************************************************
* Find an error text *
@@ -5532,13 +5524,13 @@ for (;; ptr++)
PUT(previous, 1, (int)(code - previous));
break; /* End of class handling */
}
-#endif
/* Even though any XCLASS list is now discarded, we must allow for
its memory. */
if (lengthptr != NULL)
*lengthptr += (int)(class_uchardata - class_uchardata_base);
+#endif
/* If there are no characters > 255, or they are all to be included or
excluded, set the opcode to OP_CLASS or OP_NCLASS, depending on whether the
diff --git a/src/3rdparty/pcre/pcre_internal.h b/src/3rdparty/pcre/pcre_internal.h
index 1c5f4cefd6..dd0ac7fc91 100644
--- a/src/3rdparty/pcre/pcre_internal.h
+++ b/src/3rdparty/pcre/pcre_internal.h
@@ -2446,7 +2446,7 @@ typedef struct compile_data {
BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */
BOOL check_lookbehind; /* Lookbehinds need later checking */
BOOL dupnames; /* Duplicate names exist */
- BOOL iscondassert; /* Next assert is a condition */
+ BOOL iscondassert; /* Next assert is a condition */
int nltype; /* Newline type */
int nllen; /* Newline string length */
pcre_uchar nl[4]; /* Newline string when fixed length */
@@ -2460,6 +2460,13 @@ typedef struct branch_chain {
pcre_uchar *current_branch;
} branch_chain;
+/* Structure for mutual recursion detection. */
+
+typedef struct recurse_check {
+ struct recurse_check *prev;
+ const pcre_uchar *group;
+} recurse_check;
+
/* Structure for items in a linked list that represents an explicit recursive
call within the pattern; used by pcre_exec(). */
diff --git a/src/3rdparty/pcre/pcre_jit_compile.c b/src/3rdparty/pcre/pcre_jit_compile.c
index dd378e097b..debdf6ef45 100644
--- a/src/3rdparty/pcre/pcre_jit_compile.c
+++ b/src/3rdparty/pcre/pcre_jit_compile.c
@@ -1533,7 +1533,11 @@ while (cc < ccend)
{
case OP_KET:
if (PRIVATE_DATA(cc) != 0)
+ {
private_data_length++;
+ SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
+ cc += PRIVATE_DATA(cc + 1);
+ }
cc += 1 + LINK_SIZE;
break;
@@ -1548,6 +1552,7 @@ while (cc < ccend)
case OP_SBRAPOS:
case OP_SCOND:
private_data_length++;
+ SLJIT_ASSERT(PRIVATE_DATA(cc) != 0);
cc += 1 + LINK_SIZE;
break;
@@ -1710,6 +1715,8 @@ do
{
count = 1;
srcw[0] = PRIVATE_DATA(cc);
+ SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0);
+ cc += PRIVATE_DATA(cc + 1);
}
cc += 1 + LINK_SIZE;
break;
diff --git a/src/3rdparty/pcre/pcre_study.c b/src/3rdparty/pcre/pcre_study.c
index a2458c4c96..998fe2325e 100644
--- a/src/3rdparty/pcre/pcre_study.c
+++ b/src/3rdparty/pcre/pcre_study.c
@@ -70,7 +70,7 @@ Arguments:
code pointer to start of group (the bracket)
startcode pointer to start of the whole pattern's code
options the compiling options
- int RECURSE depth
+ recurses chain of recurse_check to catch mutual recursion
Returns: the minimum length
-1 if \C in UTF-8 mode or (*ACCEPT) was encountered
@@ -80,12 +80,13 @@ Returns: the minimum length
static int
find_minlength(const REAL_PCRE *re, const pcre_uchar *code,
- const pcre_uchar *startcode, int options, int recurse_depth)
+ const pcre_uchar *startcode, int options, recurse_check *recurses)
{
int length = -1;
/* PCRE_UTF16 has the same value as PCRE_UTF8. */
BOOL utf = (options & PCRE_UTF8) != 0;
BOOL had_recurse = FALSE;
+recurse_check this_recurse;
register int branchlength = 0;
register pcre_uchar *cc = (pcre_uchar *)code + 1 + LINK_SIZE;
@@ -130,7 +131,7 @@ for (;;)
case OP_SBRAPOS:
case OP_ONCE:
case OP_ONCE_NC:
- d = find_minlength(re, cc, startcode, options, recurse_depth);
+ d = find_minlength(re, cc, startcode, options, recurses);
if (d < 0) return d;
branchlength += d;
do cc += GET(cc, 1); while (*cc == OP_ALT);
@@ -393,7 +394,7 @@ for (;;)
ce = cs = (pcre_uchar *)PRIV(find_bracket)(startcode, utf, GET2(slot, 0));
if (cs == NULL) return -2;
do ce += GET(ce, 1); while (*ce == OP_ALT);
- if ((cc > cs && cc < ce) || recurse_depth > 10)
+ if (cc > cs && cc < ce) /* Simple recursion */
{
d = 0;
had_recurse = TRUE;
@@ -401,8 +402,22 @@ for (;;)
}
else
{
- int dd = find_minlength(re, cs, startcode, options, recurse_depth+1);
- if (dd < d) d = dd;
+ recurse_check *r = recurses;
+ for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
+ if (r != NULL) /* Mutual recursion */
+ {
+ d = 0;
+ had_recurse = TRUE;
+ break;
+ }
+ else
+ {
+ int dd;
+ this_recurse.prev = recurses;
+ this_recurse.group = cs;
+ dd = find_minlength(re, cs, startcode, options, &this_recurse);
+ if (dd < d) d = dd;
+ }
}
slot += re->name_entry_size;
}
@@ -418,14 +433,26 @@ for (;;)
ce = cs = (pcre_uchar *)PRIV(find_bracket)(startcode, utf, GET2(cc, 1));
if (cs == NULL) return -2;
do ce += GET(ce, 1); while (*ce == OP_ALT);
- if ((cc > cs && cc < ce) || recurse_depth > 10)
+ if (cc > cs && cc < ce) /* Simple recursion */
{
d = 0;
had_recurse = TRUE;
}
else
{
- d = find_minlength(re, cs, startcode, options, recurse_depth + 1);
+ recurse_check *r = recurses;
+ for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
+ if (r != NULL) /* Mutual recursion */
+ {
+ d = 0;
+ had_recurse = TRUE;
+ }
+ else
+ {
+ this_recurse.prev = recurses;
+ this_recurse.group = cs;
+ d = find_minlength(re, cs, startcode, options, &this_recurse);
+ }
}
}
else d = 0;
@@ -474,12 +501,21 @@ for (;;)
case OP_RECURSE:
cs = ce = (pcre_uchar *)startcode + GET(cc, 1);
do ce += GET(ce, 1); while (*ce == OP_ALT);
- if ((cc > cs && cc < ce) || recurse_depth > 10)
+ if (cc > cs && cc < ce) /* Simple recursion */
had_recurse = TRUE;
else
{
- branchlength += find_minlength(re, cs, startcode, options,
- recurse_depth + 1);
+ recurse_check *r = recurses;
+ for (r = recurses; r != NULL; r = r->prev) if (r->group == cs) break;
+ if (r != NULL) /* Mutual recursion */
+ had_recurse = TRUE;
+ else
+ {
+ this_recurse.prev = recurses;
+ this_recurse.group = cs;
+ branchlength += find_minlength(re, cs, startcode, options,
+ &this_recurse);
+ }
}
cc += 1 + LINK_SIZE;
break;
@@ -1503,7 +1539,7 @@ if ((re->options & PCRE_ANCHORED) == 0 &&
/* Find the minimum length of subject string. */
-switch(min = find_minlength(re, code, code, re->options, 0))
+switch(min = find_minlength(re, code, code, re->options, NULL))
{
case -2: *errorptr = "internal error: missing capturing bracket"; return NULL;
case -3: *errorptr = "internal error: opcode not recognized"; return NULL;
diff --git a/src/3rdparty/pcre/sljit/sljitNativeARM_64.c b/src/3rdparty/pcre/sljit/sljitNativeARM_64.c
index c5251be53d..b66455f756 100644
--- a/src/3rdparty/pcre/sljit/sljitNativeARM_64.c
+++ b/src/3rdparty/pcre/sljit/sljitNativeARM_64.c
@@ -1081,12 +1081,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil
FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10)));
offs = (local_size - saved_regs_size) << (15 - 3);
} else {
- compiler->local_size += 2 * sizeof(sljit_sw);
- local_size -= saved_regs_size;
- saved_regs_size += 2 * sizeof(sljit_sw);
- FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR)
- | RN(TMP_SP) | ((-(saved_regs_size >> 3) & 0x7f) << 15)));
- offs = 2 << 15;
+ offs = 0 << 15;
+ if (saved_regs_size & 0x8) {
+ offs = 1 << 15;
+ saved_regs_size += sizeof(sljit_sw);
+ }
+ local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET;
+ FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10)));
}
tmp = saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - saveds) : SLJIT_FIRST_SAVED_REG;
@@ -1122,6 +1123,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compil
}
if (local_size)
FAIL_IF(push_inst(compiler, SUBI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10)));
+ FAIL_IF(push_inst(compiler, STP_PRE | 29 | RT2(TMP_LR)
+ | RN(TMP_SP) | ((-(16 >> 3) & 0x7f) << 15)));
FAIL_IF(push_inst(compiler, ADDI | RD(SLJIT_SP) | RN(TMP_SP) | (0 << 10)));
}
@@ -1145,8 +1148,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_set_context(struct sljit_compiler *compi
local_size += GET_SAVED_REGISTERS_SIZE(scratches, saveds, 0) + SLJIT_LOCALS_OFFSET;
local_size = (local_size + 15) & ~0xf;
- if (local_size > (63 * sizeof(sljit_sw)))
- local_size += 2 * sizeof(sljit_sw);
compiler->local_size = local_size;
return SLJIT_SUCCESS;
}
@@ -1167,16 +1168,20 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compi
if (local_size <= (63 * sizeof(sljit_sw)))
offs = (local_size - saved_regs_size) << (15 - 3);
else {
- saved_regs_size += 2 * sizeof(sljit_sw);
- local_size -= saved_regs_size;
+ FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR)
+ | RN(TMP_SP) | (((16 >> 3) & 0x7f) << 15)));
+ offs = 0 << 15;
+ if (saved_regs_size & 0x8) {
+ offs = 1 << 15;
+ saved_regs_size += sizeof(sljit_sw);
+ }
+ local_size -= saved_regs_size + SLJIT_LOCALS_OFFSET;
if (local_size > 0xfff) {
FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | ((local_size >> 12) << 10) | (1 << 22)));
local_size &= 0xfff;
}
if (local_size)
FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (local_size << 10)));
- local_size = saved_regs_size;
- offs = 2 << 15;
}
tmp = compiler->saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - compiler->saveds) : SLJIT_FIRST_SAVED_REG;
@@ -1204,8 +1209,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compi
if (prev != -1)
FAIL_IF(push_inst(compiler, LDRI | RT(prev) | RN(TMP_SP) | (offs >> 5)));
- FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR)
- | RN(TMP_SP) | (((local_size >> 3) & 0x7f) << 15)));
+ if (compiler->local_size <= (63 * sizeof(sljit_sw))) {
+ FAIL_IF(push_inst(compiler, LDP_PST | 29 | RT2(TMP_LR)
+ | RN(TMP_SP) | (((local_size >> 3) & 0x7f) << 15)));
+ } else {
+ FAIL_IF(push_inst(compiler, ADDI | RD(TMP_SP) | RN(TMP_SP) | (saved_regs_size << 10)));
+ }
FAIL_IF(push_inst(compiler, RET | RN(TMP_LR)));
return SLJIT_SUCCESS;
diff --git a/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros b/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros
index c0c9029873..c0c9029873 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-32-rvk.macros
diff --git a/src/3rdparty/sha3/KeccakF-1600-32.macros b/src/3rdparty/sha3/KeccakF-1600-32.macros
index 9ade600067..9ade600067 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-32.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-32.macros
diff --git a/src/3rdparty/sha3/KeccakF-1600-64.macros b/src/3rdparty/sha3/KeccakF-1600-64.macros
index 0c20bca40f..0c20bca40f 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-64.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-64.macros
diff --git a/src/3rdparty/sha3/KeccakF-1600-int-set.h b/src/3rdparty/sha3/KeccakF-1600-int-set.h
index 0ed1d802e3..0ed1d802e3 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-int-set.h
+++ b/src/3rdparty/sha3/KeccakF-1600-int-set.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-interface.h b/src/3rdparty/sha3/KeccakF-1600-interface.h
index ce2710eeb2..ce2710eeb2 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-interface.h
+++ b/src/3rdparty/sha3/KeccakF-1600-interface.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h b/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h
index b135918ca9..b135918ca9 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h
+++ b/src/3rdparty/sha3/KeccakF-1600-opt32-settings.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt32.c b/src/3rdparty/sha3/KeccakF-1600-opt32.c
index 4e32dca9cb..4e32dca9cb 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt32.c
+++ b/src/3rdparty/sha3/KeccakF-1600-opt32.c
diff --git a/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h b/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h
index 8f16ada636..8f16ada636 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h
+++ b/src/3rdparty/sha3/KeccakF-1600-opt64-settings.h
diff --git a/src/3rdparty/sha3/KeccakF-1600-unrolling.macros b/src/3rdparty/sha3/KeccakF-1600-unrolling.macros
index 83c694ca48..83c694ca48 100755..100644
--- a/src/3rdparty/sha3/KeccakF-1600-unrolling.macros
+++ b/src/3rdparty/sha3/KeccakF-1600-unrolling.macros
diff --git a/src/3rdparty/sha3/KeccakNISTInterface.c b/src/3rdparty/sha3/KeccakNISTInterface.c
index e530a11db5..e530a11db5 100755..100644
--- a/src/3rdparty/sha3/KeccakNISTInterface.c
+++ b/src/3rdparty/sha3/KeccakNISTInterface.c
diff --git a/src/3rdparty/sha3/KeccakNISTInterface.h b/src/3rdparty/sha3/KeccakNISTInterface.h
index cd85f24aa7..cd85f24aa7 100755..100644
--- a/src/3rdparty/sha3/KeccakNISTInterface.h
+++ b/src/3rdparty/sha3/KeccakNISTInterface.h
diff --git a/src/3rdparty/sha3/KeccakSponge.c b/src/3rdparty/sha3/KeccakSponge.c
index 6f3da95dbb..6f3da95dbb 100755..100644
--- a/src/3rdparty/sha3/KeccakSponge.c
+++ b/src/3rdparty/sha3/KeccakSponge.c
diff --git a/src/3rdparty/sha3/KeccakSponge.h b/src/3rdparty/sha3/KeccakSponge.h
index 8bb11a8a1d..8bb11a8a1d 100755..100644
--- a/src/3rdparty/sha3/KeccakSponge.h
+++ b/src/3rdparty/sha3/KeccakSponge.h
diff --git a/src/3rdparty/sha3/brg_endian.h b/src/3rdparty/sha3/brg_endian.h
index 7226eb3bec..7226eb3bec 100755..100644
--- a/src/3rdparty/sha3/brg_endian.h
+++ b/src/3rdparty/sha3/brg_endian.h
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index 086fb3bcd6..71f6c1036d 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -34875,6 +34875,7 @@ static void winLogIoerr(int nRetry){
** create a substitute.
*/
/* #include <time.h> */
+# if _WIN32_WCE < 0x800
struct tm *__cdecl localtime(const time_t *t)
{
static struct tm y;
@@ -34896,6 +34897,7 @@ struct tm *__cdecl localtime(const time_t *t)
y.tm_sec = pTm.wSecond;
return &y;
}
+# endif
#endif
#define HANDLE_TO_WINFILE(a) (winFile*)&((char*)a)[-(int)offsetof(winFile,h)]
diff --git a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java
index 4df70796bd..ff0032d623 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/ExtractStyle.java
@@ -1111,7 +1111,9 @@ public class ExtractStyle {
{
try {
InsetDrawable d = (InsetDrawable)drawable;
- Object mInsetStateObject = getAccessibleField(InsetDrawable.class, "mInsetState").get(d);
+ // mInsetState changed to mState in Android 5.1 (22)
+ Object mInsetStateObject = getAccessibleField(InsetDrawable.class, (Build.VERSION.SDK_INT > 21) ? "mState"
+ : "mInsetState").get(d);
Rect _padding = new Rect();
boolean hasPadding = d.getPadding(_padding);
return getDrawable(getAccessibleField(mInsetStateObject.getClass(), "mDrawable").get(mInsetStateObject), filename, hasPadding ? _padding : null);
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 da52369de0..18fa2f8fde 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -65,7 +65,6 @@ import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
-import android.widget.LinearLayout;
import java.io.BufferedReader;
import java.io.DataOutputStream;
@@ -790,29 +789,7 @@ public class QtActivityDelegate
metrics.xdpi, metrics.ydpi,
metrics.scaledDensity, metrics.density);
}
-
- ViewGroup layout = null;
m_layout = new QtLayout(m_activity);
- if (Build.VERSION.SDK_INT >= 14) {
- try {
- ActivityInfo activityInfo = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(),
- PackageManager.GET_META_DATA);
- if (activityInfo.metaData == null
- || !activityInfo.metaData.containsKey("android.app.allow_overlapping_system_ui")
- || !activityInfo.metaData.getBoolean("android.app.allow_overlapping_system_ui")) {
- layout = new LinearLayout(m_activity);
- layout.setFitsSystemWindows(true);
- layout.addView(m_layout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- if (layout == null)
- layout = m_layout;
-
m_editText = new QtEditText(m_activity, this);
m_imm = (InputMethodManager)m_activity.getSystemService(Context.INPUT_METHOD_SERVICE);
m_surfaces = new HashMap<Integer, QtSurface>();
@@ -835,7 +812,7 @@ public class QtActivityDelegate
Log.w("Qt A11y", "Unknown exception: " + e.toString());
}
- m_activity.setContentView(layout,
+ m_activity.setContentView(m_layout,
new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 6855a47554..b7363e5d87 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -43,6 +43,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.ClipboardManager;
+import android.os.Build;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Menu;
@@ -306,32 +307,49 @@ public class QtNative
static public void sendTouchEvent(MotionEvent event, int id)
{
- //@ANDROID-5
- touchBegin(id);
- for (int i=0;i<event.getPointerCount();i++) {
- touchAdd(id,
- event.getPointerId(i),
- getAction(i, event),
- i == 0,
- (int)event.getX(i),
- (int)event.getY(i),
- event.getSize(i),
- event.getPressure(i));
- }
+ int pointerType = 0;
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- touchEnd(id,0);
+ if (Build.VERSION.SDK_INT >= 14) {
+ switch (event.getToolType(0)) {
+ case MotionEvent.TOOL_TYPE_STYLUS:
+ pointerType = 1; // QTabletEvent::Pen
break;
-
- case MotionEvent.ACTION_UP:
- touchEnd(id,2);
+ case MotionEvent.TOOL_TYPE_ERASER:
+ pointerType = 3; // QTabletEvent::Eraser
break;
+ // TODO TOOL_TYPE_MOUSE
+ }
+ }
- default:
- touchEnd(id,1);
+ if (pointerType != 0) {
+ tabletEvent(id, event.getDeviceId(), event.getEventTime(), event.getAction(), pointerType,
+ event.getButtonState(), event.getX(), event.getY(), event.getPressure());
+ } else {
+ touchBegin(id);
+ for (int i = 0; i < event.getPointerCount(); ++i) {
+ touchAdd(id,
+ event.getPointerId(i),
+ getAction(i, event),
+ i == 0,
+ (int)event.getX(i),
+ (int)event.getY(i),
+ event.getSize(i),
+ event.getPressure(i));
+ }
+
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ touchEnd(id, 0);
+ break;
+
+ case MotionEvent.ACTION_UP:
+ touchEnd(id, 2);
+ break;
+
+ default:
+ touchEnd(id, 1);
+ }
}
- //@ANDROID-5
}
static public void sendTrackballEvent(MotionEvent event, int id)
@@ -598,6 +616,10 @@ public class QtNative
public static native void longPress(int winId, int x, int y);
// pointer methods
+ // tablet methods
+ public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure);
+ // tablet methods
+
// keyboard methods
public static native void keyDown(int key, int unicode, int modifier, boolean autoRepeat);
public static native void keyUp(int key, int unicode, int modifier, boolean autoRepeat);
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
index 95af3c87ad..23e08f537a 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java
@@ -187,7 +187,7 @@ public class QtActivity extends Activity
QT_ANDROID_THEMES = new String[] {"Theme_Light"};
QT_ANDROID_DEFAULT_THEME = "Theme_Light";
}
- else if ((Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) || Build.VERSION.SDK_INT == 21){
+ else if ((Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) || Build.VERSION.SDK_INT >= 21){
QT_ANDROID_THEMES = new String[] {"Theme_Holo_Light"};
QT_ANDROID_DEFAULT_THEME = "Theme_Holo_Light";
} else {
diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index 779612cdaf..60c612976f 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -44,10 +44,6 @@
signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/>
<!-- Background running -->
-
- <!-- Show translucent UI on top of Qt's surface when system theme mandates it -->
- <meta-data android:name="android.app.allow_overlapping_system_ui" android:value="false"/>
- <!-- Show translucent UI on top of Qt's surface when system theme mandates it -->
</activity>
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
diff --git a/src/angle/patches/0006-ANGLE-Allow-Windows-Phone-to-communicate-swap-region.patch b/src/angle/patches/0006-ANGLE-Allow-Windows-Phone-to-communicate-swap-region.patch
new file mode 100644
index 0000000000..5c6ef7b036
--- /dev/null
+++ b/src/angle/patches/0006-ANGLE-Allow-Windows-Phone-to-communicate-swap-region.patch
@@ -0,0 +1,145 @@
+From f0fb8d75bd2c7a894df1cb7e7d3dcd1ad0fd88d0 Mon Sep 17 00:00:00 2001
+From: Andrew Knight <andrew.knight@intopalo.com>
+Date: Sun, 3 May 2015 20:55:04 +0300
+Subject: [PATCH] ANGLE: Allow Windows Phone to communicate swap region
+
+eglPostSubBufferNV is used to communicate the size of the window, as
+otherwise there is no way for the renderer to know if the last frame was
+rendered in landscape or portrait, causing rendering glitches when the
+orientation changes. The rotation flags are utilized in a few additional
+places now to fix some corner cases where the rotation was not applied.
+
+This patch should be squashed into "ANGLE-Improve-Windows-Phone-Support"
+during the next ANGLE rebase.
+
+Task-number: QTBUG-44333
+Task-number: QTBUG-43502
+Change-Id: Iec37f7531854184819c30c87eab82d96d56ff133
+---
+ .../angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp | 2 ++
+ .../libANGLE/renderer/d3d/d3d11/SwapChain11.cpp | 28 +++++++++++++---------
+ .../d3d/d3d11/winrt/CoreWindowNativeWindow.cpp | 5 ++--
+ .../angle/src/libGLESv2/entry_points_egl_ext.cpp | 2 ++
+ 4 files changed, 24 insertions(+), 13 deletions(-)
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+index 4fde295..4a87488 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+@@ -189,6 +189,7 @@ egl::Error SurfaceD3D::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ return egl::Error(EGL_SUCCESS);
+ }
+
++#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (defined(ANGLE_ENABLE_WINDOWS_STORE) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) // Qt WP: eglPostSubBufferNV comes here
+ if (x + width > mWidth)
+ {
+ width = mWidth - x;
+@@ -198,6 +199,7 @@ egl::Error SurfaceD3D::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ {
+ height = mHeight - y;
+ }
++#endif
+
+ if (width == 0 || height == 0)
+ {
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+index 298f3cc..dc539cf 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+@@ -552,18 +552,18 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+
+ d3d11::PositionTexCoordVertex *vertices = static_cast<d3d11::PositionTexCoordVertex*>(mappedResource.pData);
+
++#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+ // Create a quad in homogeneous coordinates
+- float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
+- float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
+- float x2 = ((x + width) / float(mWidth)) * 2.0f - 1.0f;
+- float y2 = ((y + height) / float(mHeight)) * 2.0f - 1.0f;
++ float x1 = -1.0f;
++ float y1 = -1.0f;
++ float x2 = 1.0f;
++ float y2 = 1.0f;
+
+-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+ const float dim = std::max(mWidth, mHeight);
+- float u1 = x / dim;
+- float v1 = y / dim;
+- float u2 = (x + width) / dim;
+- float v2 = (y + height) / dim;
++ float u1 = 0;
++ float v1 = 0;
++ float u2 = float(width) / dim;
++ float v2 = float(height) / dim;
+
+ const NativeWindow::RotationFlags flags = mNativeWindow.rotationFlags();
+ const bool rotateL = flags == NativeWindow::RotateLeft;
+@@ -573,6 +573,12 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, rotateR ? u1 : u2, rotateL ? v2 : v1);
+ d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, rotateL ? u1 : u2, rotateR ? v1 : v2);
+ #else
++ // Create a quad in homogeneous coordinates
++ float x1 = (x / float(mWidth)) * 2.0f - 1.0f;
++ float y1 = (y / float(mHeight)) * 2.0f - 1.0f;
++ float x2 = ((x + width) / float(mWidth)) * 2.0f - 1.0f;
++ float y2 = ((y + height) / float(mHeight)) * 2.0f - 1.0f;
++
+ float u1 = x / float(mWidth);
+ float v1 = y / float(mHeight);
+ float u2 = (x + width) / float(mWidth);
+@@ -613,8 +619,8 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
+ viewport.TopLeftX = 0;
+ viewport.TopLeftY = 0;
+ #if defined(ANGLE_ENABLE_WINDOWS_STORE) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+- viewport.Width = (rotateL || rotateR) ? mHeight : mWidth;
+- viewport.Height = (rotateL || rotateR) ? mWidth : mHeight;
++ viewport.Width = (rotateL || rotateR) ? height : width;
++ viewport.Height = (rotateL || rotateR) ? width : height;
+ #else
+ viewport.Width = mWidth;
+ viewport.Height = mHeight;
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+index 350526c..fa9a69c 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp
+@@ -100,6 +100,7 @@ bool CoreWindowNativeWindow::registerForSizeChangeEvents()
+ if (SUCCEEDED(result))
+ {
+ result = mDisplayInformation->add_OrientationChanged(orientationChangedHandler.Get(), &mOrientationChangedEventToken);
++ orientationChangedHandler->Invoke(mDisplayInformation.Get(), nullptr);
+ }
+ #endif
+
+@@ -135,8 +136,8 @@ HRESULT CoreWindowNativeWindow::createSwapChain(ID3D11Device *device, DXGIFactor
+ }
+
+ DXGI_SWAP_CHAIN_DESC1 swapChainDesc = { 0 };
+- swapChainDesc.Width = width;
+- swapChainDesc.Height = height;
++ swapChainDesc.Width = mRotationFlags ? height : width;
++ swapChainDesc.Height = mRotationFlags ? width : height;
+ swapChainDesc.Format = format;
+ swapChainDesc.Stereo = FALSE;
+ swapChainDesc.SampleDesc.Count = 1;
+diff --git a/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp b/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
+index ded73db..62f3ca1 100644
+--- a/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
++++ b/src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp
+@@ -101,12 +101,14 @@ EGLBoolean EGLAPIENTRY PostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLin
+ return EGL_FALSE;
+ }
+
++#if !defined(ANGLE_ENABLE_WINDOWS_STORE) || (defined(ANGLE_ENABLE_WINDOWS_STORE) && WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) // Qt WP: Allow this entry point as a workaround
+ if (!display->getExtensions().postSubBuffer)
+ {
+ // Spec is not clear about how this should be handled.
+ SetGlobalError(Error(EGL_SUCCESS));
+ return EGL_TRUE;
+ }
++#endif
+
+ error = eglSurface->postSubBuffer(x, y, width, height);
+ if (error.isError())
+--
+1.9.5.msysgit.0
+
diff --git a/src/angle/patches/0007-ANGLE-Fix-compilation-without-d3d11.patch b/src/angle/patches/0007-ANGLE-Fix-compilation-without-d3d11.patch
new file mode 100644
index 0000000000..eca7d0e162
--- /dev/null
+++ b/src/angle/patches/0007-ANGLE-Fix-compilation-without-d3d11.patch
@@ -0,0 +1,57 @@
+From 1f993a2492a618becd4bf89ef0d6cb5d2c9aa67a Mon Sep 17 00:00:00 2001
+From: Kai Koehne <kai.koehne@theqtcompany.com>
+Date: Mon, 11 May 2015 15:17:12 +0200
+Subject: [PATCH] ANGLE: Fix compilation without d3d11
+
+Change-Id: I0b772698cf521083e5ecf35a395af57100a50131
+---
+ src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h | 4 +++-
+ .../angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp | 2 ++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h
+index 81b9ea7..0f70fe4 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h
+@@ -38,7 +38,7 @@ class InspectableNativeWindow;
+ using namespace Microsoft::WRL;
+ using namespace Microsoft::WRL::Wrappers;
+
+-#else
++#elif defined(ANGLE_ENABLE_D3D11)
+ typedef IDXGISwapChain DXGISwapChain;
+ typedef IDXGIFactory DXGIFactory;
+ #endif
+@@ -60,9 +60,11 @@ class NativeWindow
+ #endif
+ static bool isValidNativeWindow(EGLNativeWindowType window);
+
++#if defined(ANGLE_ENABLE_D3D11)
+ HRESULT createSwapChain(ID3D11Device* device, DXGIFactory* factory,
+ DXGI_FORMAT format, UINT width, UINT height,
+ DXGISwapChain** swapChain);
++#endif
+
+ inline EGLNativeWindowType getNativeWindow() const { return mWindow; }
+
+diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
+index 9d8f0bb..0a4f45b 100644
+--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp
+@@ -37,6 +37,7 @@ bool NativeWindow::isValidNativeWindow(EGLNativeWindowType window)
+ return IsWindow(window) == TRUE;
+ }
+
++#if defined(ANGLE_ENABLE_D3D11)
+ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory,
+ DXGI_FORMAT format, unsigned int width, unsigned int height,
+ DXGISwapChain** swapChain)
+@@ -65,4 +66,5 @@ HRESULT NativeWindow::createSwapChain(ID3D11Device* device, DXGIFactory* factory
+
+ return factory->CreateSwapChain(device, &swapChainDesc, swapChain);
+ }
++#endif
+ }
+--
+1.9.5.msysgit.0
+
diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri
index 63b80347d1..735c841ad8 100644
--- a/src/angle/src/common/common.pri
+++ b/src/angle/src/common/common.pri
@@ -13,7 +13,7 @@ lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
# DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK.
-win32-msvc2012|win32-msvc2013|winrt {
+winrt|if(msvc:!win32-msvc2005:!win32-msvc2008:!win32-msvc2010) {
FXC = fxc.exe
} else {
DX_DIR = $$(DXSDK_DIR)
diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro
index 1bf9af0436..5979b68098 100644
--- a/src/angle/src/libGLESv2/libGLESv2.pro
+++ b/src/angle/src/libGLESv2/libGLESv2.pro
@@ -329,6 +329,8 @@ angle_d3d11 {
!static {
DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}.def
mingw:equals(QT_ARCH, i386): DEF_FILE = $$ANGLE_DIR/src/libGLESv2/$${TARGET}_mingw32.def
+} else {
+ DEFINES += DllMain=DllMain_ANGLE # prevent symbol from conflicting with the user's DllMain
}
float_converter.target = float_converter
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 7213a844f5..65fd1f9383 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -70,8 +70,14 @@ set(_qt5_corelib_extra_includes)
# Qt5_POSITION_INDEPENDENT_CODE variable is used in the # qt5_use_module
# macro to add it.
set(Qt5_POSITION_INDEPENDENT_CODE True)
-set_property(TARGET Qt5::Core PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\")
-set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIE\")
+set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\")
+if (CMAKE_VERSION VERSION_LESS 2.8.12
+ AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
+ OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
+ set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\")
+else()
+ set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP)
+endif()
!!IF !isEmpty(QT_NAMESPACE)
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index a94caf0d25..18563764ad 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -333,8 +333,10 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
-
- if (Qt5_POSITION_INDEPENDENT_CODE)
+ if (Qt5_POSITION_INDEPENDENT_CODE
+ AND (CMAKE_VERSION VERSION_LESS 2.8.12
+ AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
+ OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)))
set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
endif()
endforeach()
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp
index 65cc337708..b375999aeb 100644
--- a/src/corelib/codecs/qicucodec.cpp
+++ b/src/corelib/codecs/qicucodec.cpp
@@ -121,7 +121,7 @@ struct MibToName {
short index;
};
-static MibToName mibToName[] = {
+static const MibToName mibToName[] = {
{ 3, 0 },
{ 4, 9 },
{ 5, 20 },
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 050f8f207f..8fef333a77 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -1147,13 +1147,30 @@ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba)
return codecForUtfText(ba, QTextCodec::codecForMib(/*Latin 1*/ 4));
}
+/*!
+ \fn QTextCodec * QTextCodec::codecForTr ()
+ \obsolete
+
+ Returns the codec used by QObject::tr() on its argument. If this
+ function returns 0 (the default), tr() assumes Latin-1.
+
+ \sa setCodecForTr()
+*/
+
+/*!
+ \fn QTextCodec::setCodecForTr ( QTextCodec * c )
+ \obsolete
+
+ Sets the codec used by QObject::tr() on its argument to c. If c
+ is 0 (the default), tr() assumes Latin-1.
+*/
/*!
\internal
\since 4.3
- Determines whether the decoder encountered a failure while decoding the input. If
- an error was encountered, the produced result is undefined, and gets converted as according
- to the conversion flags.
+ Determines whether the decoder encountered a failure while decoding the
+ input. If an error was encountered, the produced result is undefined, and
+ gets converted as according to the conversion flags.
*/
bool QTextDecoder::hasFailure() const
{
diff --git a/src/corelib/codecs/qwindowscodec.cpp b/src/corelib/codecs/qwindowscodec.cpp
index cf427c64b6..dded93ccb5 100644
--- a/src/corelib/codecs/qwindowscodec.cpp
+++ b/src/corelib/codecs/qwindowscodec.cpp
@@ -172,7 +172,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le
}
#else
QString s;
- int size = mbstowcs(NULL, mb, length);
+ size_t size = mbstowcs(NULL, mb, length);
if (size < 0) {
Q_ASSERT("Error in CE TextCodec");
return QString();
@@ -181,7 +181,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le
ws[size +1] = 0;
ws[size] = 0;
size = mbstowcs(ws, mb, length);
- for (int i=0; i< size; i++)
+ for (size_t i = 0; i < size; i++)
s.append(QChar(ws[i]));
delete [] ws;
#endif
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index df1ee4afea..502689e4c2 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -43,5 +43,8 @@ imagedirs += images
excludedirs += snippets
+excludefiles += ../../../examples/widgets/tools/customcompleter/doc/src/customcompleter.qdoc \
+ ../../../examples/widgets/tools/codecs/doc/src/codecs.qdoc
+
navigation.landingpage = "Qt Core"
navigation.cppclassespage = "Qt Core C++ Classes"
diff --git a/src/corelib/doc/snippets/code/doc_src_resources.cpp b/src/corelib/doc/snippets/code/doc_src_resources.cpp
index 430c0c92c1..ab97f609ac 100644
--- a/src/corelib/doc/snippets/code/doc_src_resources.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_resources.cpp
@@ -48,7 +48,7 @@ MyClass::MyClass() : BaseClass()
{
Q_INIT_RESOURCE(resources);
- QFile file("qrc:/myfile.dat");
+ QFile file(":/myfile.dat");
...
}
//! [5]
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
Q_INIT_RESOURCE(graphlib);
- QFile file("qrc:/graph.png");
+ QFile file(":/graph.png");
...
return app.exec();
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp
index 77ec85cc36..e3d76453d0 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp
@@ -51,8 +51,9 @@ sem.release(2); // resources available == 3
//! [1]
QSystemSemaphore sem("market", 5, QSystemSemaphore::Create);
-sem.acquire(5); // acquire all 5 resources
-sem.release(5); // release the 5 resources
+for (int i = 0; i < 5; ++i) // acquire all 5 resources
+ sem.acquire();
+sem.release(5); // release the 5 resources
//! [1]
diff --git a/src/corelib/doc/src/statemachine.qdoc b/src/corelib/doc/src/statemachine.qdoc
index 037b09810f..e44a603959 100644
--- a/src/corelib/doc/src/statemachine.qdoc
+++ b/src/corelib/doc/src/statemachine.qdoc
@@ -63,7 +63,7 @@
used to effectively embed the elements and semantics of statecharts in Qt
applications. The framework integrates tightly with Qt's meta-object system;
for example, transitions between states can be triggered by signals, and
- states can be configured to set properties and invoke methods on QObjects.
+ states can be configured to set properties and invoke methods on {QObject}s.
Qt's event system is used to drive the state machines.
The state graph in the State Machine framework is hierarchical. States can be nested inside of
@@ -126,9 +126,9 @@
The QState::entered() signal is emitted when the state is entered, and the
QState::exited() signal is emitted when the state is exited. In the
- following snippet, the button's showMaximized() slot will be called when
- state \c s3 is entered, and the button's showMinimized() slot will be called
- when \c s3 is exited:
+ following snippet, the button's \l {QPushButton::}{showMaximized()} slot
+ will be called when state \c s3 is entered, and the button's \l {QPushButton::}{showMinimized()}
+ slot will be called when \c s3 is exited:
\snippet statemachine/main.cpp 5
@@ -151,7 +151,7 @@
Assume we wanted the user to be able to quit the application at any time by
clicking a Quit button. In order to achieve this, we need to create a final
state and make it the target of a transition associated with the Quit
- button's clicked() signal. We could add a transition from each of \c s1, \c
+ button's \l{QPushButton::}{clicked()} signal. We could add a transition from each of \c s1, \c
s2 and \c s3; however, this seems redundant, and one would also have to
remember to add such a transition from every new state that is added in the
future.
@@ -184,8 +184,8 @@
\snippet statemachine/main2.cpp 1
In this case we want the application to quit when the state machine is
- finished, so the machine's finished() signal is connected to the
- application's quit() slot.
+ finished, so the machine's \l {QStateMachine::}{finished()} signal is connected to the
+ application's \l {QCoreApplication::}{quit()} slot.
A child state can override an inherited transition. For example, the
following code adds a transition that effectively causes the Quit button to
@@ -290,7 +290,7 @@
\endomit
When \c s1 's final state is entered, \c s1 will automatically emit
- finished(). We use a signal transition to cause this event to trigger a
+ \l {QState::}{finished()}. We use a signal transition to cause this event to trigger a
state change:
\snippet statemachine/main3.cpp 1
@@ -302,7 +302,7 @@
encapsulation mechanism when building complex (deeply nested) state
machines. (In the above example, you could of course create a transition
directly from \c s1 's \c done state rather than relying on \c s1 's
- finished() signal, but with the consequence that implementation details of
+ \l {QState::}{finished()} signal, but with the consequence that implementation details of
\c s1 are exposed and depended on).
For parallel state groups, the QState::finished() signal is emitted when \e
@@ -365,8 +365,8 @@
\snippet statemachine/main4.cpp 1
- In the eventTest() reimplementation, we first check if the event type is the
- desired one; if so, we cast the event to a StringEvent and perform the
+ In the \l {QAbstractTransition::}{eventTest()} reimplementation, we first check if the event type is the
+ desired one; if so, we cast the event to a \c StringEvent and perform the
string comparison.
The following is a statechart that uses the custom event and transition:
@@ -486,7 +486,7 @@
message box will pop up before the geometry of the button has actually been set.
To ensure that the message box does not pop up until the geometry actually reaches its final
- value, we can use the state's propertiesAssigned() signal. The propertiesAssigned() signal will be
+ value, we can use the state's \l {QState::}{propertiesAssigned()} signal. The \l {QState::}{propertiesAssigned()} signal will be
emitted when the property is assigned its final value, whether this is done immediately or
after the animation has finished playing.
@@ -503,14 +503,14 @@
has been assigned the defined value.
If the global restore policy is set to QStateMachine::RestoreProperties, the state will not emit
- the propertiesAssigned() signal until these have been executed as well.
+ the \l {QState::}{propertiesAssigned()} signal until these have been executed as well.
\section1 What Happens If A State Is Exited Before The Animation Has Finished
If a state has property assignments, and the transition into the state has animations for the
properties, the state can potentially be exited before the properties have been assigned to the
values defines by the state. This is true in particular when there are transitions out from the
- state that do not depend on the propertiesAssigned signal, as described in the previous section.
+ state that do not depend on the \l {QState::}{propertiesAssigned()} signal, as described in the previous section.
The State Machine API guarantees that a property assigned by the state machine either:
\list
@@ -563,13 +563,13 @@
The parent state machine treats the child machine as an \e atomic state in the state machine
algorithm. The child state machine is self-contained; it maintains its own event queue and
- configuration. In particular, note that the \l{QStateMachine::configuration()}{configuration}
+ configuration. In particular, note that the \l{QStateMachine::}{configuration()}
of the child machine is not part of the parent machine's configuration (only the child machine
itself is).
States of the child state machine cannot be specified as targets of transitions in the parent
state machine; only the child state machine itself can. Conversely, states of the parent state
machine cannot be specified as targets of transitions in the child state machine. The child
- state machine's \l{QState::finished()}{finished}() signal can be used to trigger a transition
+ state machine's \l{QState::}{finished}() signal can be used to trigger a transition
in the parent machine.
*/
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 2176a148b0..91e8699472 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2124,9 +2124,9 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
# define USE_ETC_OS_RELEASE
struct QUnixOSVersion
{
- // from /etc/os-release older /etc/lsb-release
- QString productType; // $ID $DISTRIB_ID
- QString productVersion; // $VERSION_ID $DISTRIB_RELEASE
+ // from /etc/os-release older /etc/lsb-release // redhat /etc/redhat-release // debian /etc/debian_version
+ QString productType; // $ID $DISTRIB_ID // single line file containing: // Debian
+ QString productVersion; // $VERSION_ID $DISTRIB_RELEASE // <Vendor_ID release Version_ID> // single line file <Release_ID/sid>
QString prettyName; // $PRETTY_NAME $DISTRIB_DESCRIPTION
};
@@ -2138,24 +2138,32 @@ static QString unquote(const char *begin, const char *end)
}
return QString::fromLatin1(begin, end - begin);
}
-
-static bool readEtcFile(QUnixOSVersion &v, const char *filename,
- const QByteArray &idKey, const QByteArray &versionKey, const QByteArray &prettyNameKey)
+static QByteArray getEtcFileContent(const char *filename)
{
// we're avoiding QFile here
int fd = qt_safe_open(filename, O_RDONLY);
if (fd == -1)
- return false;
+ return QByteArray();
QT_STATBUF sbuf;
if (QT_FSTAT(fd, &sbuf) == -1) {
qt_safe_close(fd);
- return false;
+ return QByteArray();
}
QByteArray buffer(sbuf.st_size, Qt::Uninitialized);
buffer.resize(qt_safe_read(fd, buffer.data(), sbuf.st_size));
qt_safe_close(fd);
+ return buffer;
+}
+
+static bool readEtcFile(QUnixOSVersion &v, const char *filename,
+ const QByteArray &idKey, const QByteArray &versionKey, const QByteArray &prettyNameKey)
+{
+
+ QByteArray buffer = getEtcFileContent(filename);
+ if (buffer.isEmpty())
+ return false;
const char *ptr = buffer.constData();
const char *end = buffer.constEnd();
@@ -2219,14 +2227,72 @@ static bool readEtcLsbRelease(QUnixOSVersion &v)
}
}
- return ok;
+ // some distributions have a /etc/lsb-release file that does not provide the values
+ // we are looking for, i.e. DISTRIB_ID, DISTRIB_RELEASE and DISTRIB_DESCRIPTION.
+ // Assuming that neither DISTRIB_ID nor DISTRIB_RELEASE were found, or contained valid values,
+ // returning false for readEtcLsbRelease will allow further /etc/<lowercasename>-release parsing.
+ return ok && !(v.productType.isEmpty() && v.productVersion.isEmpty());
}
+#if defined(Q_OS_LINUX)
+static QByteArray getEtcFileFirstLine(const char *fileName)
+{
+ QByteArray buffer = getEtcFileContent(fileName);
+ if (buffer.isEmpty())
+ return QByteArray();
+
+ const char *ptr = buffer.constData();
+ int eol = buffer.indexOf("\n");
+ return QByteArray(ptr, eol).trimmed();
+}
+
+static bool readEtcRedHatRelease(QUnixOSVersion &v)
+{
+ // /etc/redhat-release analysed should be a one line file
+ // the format of its content is <Vendor_ID release Version>
+ // i.e. "Red Hat Enterprise Linux Workstation release 6.5 (Santiago)"
+ QByteArray line = getEtcFileFirstLine("/etc/redhat-release");
+ if (line.isEmpty())
+ return false;
+
+ v.prettyName = QString::fromLatin1(line);
+
+ const char keyword[] = "release ";
+ int releaseIndex = line.indexOf(keyword);
+ v.productType = QString::fromLatin1(line.mid(0, releaseIndex)).remove(QLatin1Char(' '));
+ int spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword));
+ v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword), spaceIndex > -1 ? spaceIndex - releaseIndex - strlen(keyword) : -1));
+ return true;
+}
+
+static bool readEtcDebianVersion(QUnixOSVersion &v)
+{
+ // /etc/debian_version analysed should be a one line file
+ // the format of its content is <Release_ID/sid>
+ // i.e. "jessie/sid"
+ QByteArray line = getEtcFileFirstLine("/etc/debian_version");
+ if (line.isEmpty())
+ return false;
+
+ v.productType = QStringLiteral("Debian");
+ v.productVersion = QString::fromLatin1(line);
+ return true;
+}
+#endif
+
static bool findUnixOsVersion(QUnixOSVersion &v)
{
if (readEtcOsRelease(v))
return true;
- return readEtcLsbRelease(v);
+ if (readEtcLsbRelease(v))
+ return true;
+#if defined(Q_OS_LINUX)
+ if (readEtcRedHatRelease(v))
+ return true;
+ if (readEtcDebianVersion(v))
+ return true;
+#endif
+ return false;
}
# endif // USE_ETC_OS_RELEASE
#endif // Q_OS_UNIX
@@ -2955,7 +3021,7 @@ namespace {
// depending on the return type
static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf)
{
- return QString::fromLocal8Bit(buf);
+ return QString::fromLocal8Bit(buf.constData());
}
static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &)
{
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index c4e2f7609c..4eeee0fef4 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -322,6 +322,15 @@ typedef double qreal;
#endif
/*
+ Some classes do not permit copies to be made of an object. These
+ classes contains a private copy constructor and assignment
+ operator to disable copying (the compiler gives an error message).
+*/
+#define Q_DISABLE_COPY(Class) \
+ Class(const Class &) Q_DECL_EQ_DELETE;\
+ Class &operator=(const Class &) Q_DECL_EQ_DELETE;
+
+/*
No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols
for Qt's internal unit tests. If you want slower loading times and more
symbols that can vanish from version to version, feel free to define QT_BUILD_INTERNAL.
@@ -543,7 +552,21 @@ template <typename T>
Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max)
{ return qMax(min, qMin(max, val)); }
-#ifdef Q_OS_DARWIN
+#ifndef Q_FORWARD_DECLARE_OBJC_CLASS
+# ifdef __OBJC__
+# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
+# else
+# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
+# endif
+#endif
+#ifndef Q_FORWARD_DECLARE_CF_TYPE
+# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref
+#endif
+#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE
+# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref
+#endif
+
+#ifdef Q_OS_MAC
# define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) \
((defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && osx != __MAC_NA && __MAC_OS_X_VERSION_MAX_ALLOWED >= osx) || \
(defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MAX_ALLOWED >= ios))
@@ -561,7 +584,21 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_NA, ios)
# define QT_OSX_DEPLOYMENT_TARGET_BELOW(osx) \
QT_MAC_DEPLOYMENT_TARGET_BELOW(osx, __IPHONE_NA)
-#endif
+
+Q_FORWARD_DECLARE_OBJC_CLASS(NSAutoreleasePool);
+
+// Implemented in qcore_mac_objc.mm
+class Q_CORE_EXPORT QMacAutoReleasePool
+{
+public:
+ QMacAutoReleasePool();
+ ~QMacAutoReleasePool();
+private:
+ Q_DISABLE_COPY(QMacAutoReleasePool);
+ NSAutoreleasePool *pool;
+};
+
+#endif // Q_OS_MAC
/*
Data stream functions are provided by many classes (defined in qdatastream.h)
@@ -1033,15 +1070,6 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1);
{ return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
#endif
-/*
- Some classes do not permit copies to be made of an object. These
- classes contains a private copy constructor and assignment
- operator to disable copying (the compiler gives an error message).
-*/
-#define Q_DISABLE_COPY(Class) \
- Class(const Class &) Q_DECL_EQ_DELETE;\
- Class &operator=(const Class &) Q_DECL_EQ_DELETE;
-
class QByteArray;
Q_CORE_EXPORT QByteArray qgetenv(const char *varName);
Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
@@ -1062,9 +1090,10 @@ Q_CORE_EXPORT int qrand();
#define QT_MODULE(x)
-#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__)
+#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \
+ (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500))
# error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
- "Compile your code with -fPIC or -fPIE."
+ "Compile your code with -fPIC (-fPIE is not enough)."
#endif
namespace QtPrivate {
@@ -1076,20 +1105,6 @@ template <bool B, typename T, typename F> struct QConditional { typedef T Type;
template <typename T, typename F> struct QConditional<false, T, F> { typedef F Type; };
}
-#ifndef Q_FORWARD_DECLARE_OBJC_CLASS
-# ifdef __OBJC__
-# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname
-# else
-# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname
-# endif
-#endif
-#ifndef Q_FORWARD_DECLARE_CF_TYPE
-# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref
-#endif
-#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE
-# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref
-#endif
-
QT_END_NAMESPACE
// We need to keep QTypeInfo, QSysInfo, QFlags, qDebug & family in qglobal.h for compatibility with Qt 4.
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index d9d21c535c..88882bbe8f 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -972,8 +972,8 @@ struct QMessagePattern {
QElapsedTimer timer;
#endif
#ifdef QLOGGING_HAVE_BACKTRACE
- int backtraceDepth;
QString backtraceSeparator;
+ int backtraceDepth;
#endif
bool fromEnvironment;
@@ -986,8 +986,8 @@ QMessagePattern::QMessagePattern()
: literals(0)
, tokens(0)
#ifdef QLOGGING_HAVE_BACKTRACE
- , backtraceDepth(5)
, backtraceSeparator(QLatin1Char('|'))
+ , backtraceDepth(5)
#endif
, fromEnvironment(false)
{
@@ -1737,7 +1737,7 @@ void qErrnoWarning(int code, const char *msg, ...)
Example:
\code
- QT_MESSAGE_PATTERN="[%{time yyyyMMdd h:mm:ss.zzz t} %{if-debug}D{%endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}"
+ QT_MESSAGE_PATTERN="[%{time yyyyMMdd h:mm:ss.zzz t} %{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}"
\endcode
The default \a pattern is "%{if-category}%{category}: %{endif}%{message}".
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 123e2edf0e..fc5207fa25 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -294,10 +294,13 @@ public:
WindowCloseButtonHint = 0x08000000,
MacWindowToolBarButtonHint = 0x10000000,
BypassGraphicsProxyWidget = 0x20000000,
- WindowOkButtonHint = 0x00080000,
- WindowCancelButtonHint = 0x00100000,
NoDropShadowWindowHint = 0x40000000,
- WindowFullscreenButtonHint = 0x80000000
+ WindowFullscreenButtonHint = 0x80000000,
+
+ // The following enums have overlapping values with other enums.
+ // This was not intentional, but it's too late to change now.
+ WindowOkButtonHint = 0x00080000, // WindowTransparentForInput
+ WindowCancelButtonHint = 0x00100000 // WindowOverridesSystemGestures
};
Q_DECLARE_FLAGS(WindowFlags, WindowType)
@@ -1323,7 +1326,7 @@ public:
ImAbsolutePosition = 0x400,
ImTextBeforeCursor = 0x800,
ImTextAfterCursor = 0x1000,
- ImReturnKeyType = 0x2000,
+ ImEnterKeyType = 0x2000,
ImPlatformData = 0x80000000,
ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText |
@@ -1363,15 +1366,15 @@ public:
};
Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint)
- enum ReturnKeyType {
- ReturnKeyDefault,
- ReturnKeyEnter,
- ReturnKeyDone,
- ReturnKeyGo,
- ReturnKeySend,
- ReturnKeySearch,
- ReturnKeyNext,
- ReturnKeyPrevious
+ enum EnterKeyType {
+ EnterKeyDefault,
+ EnterKeyReturn,
+ EnterKeyDone,
+ EnterKeyGo,
+ EnterKeySend,
+ EnterKeySearch,
+ EnterKeyNext,
+ EnterKeyPrevious
};
enum ToolButtonStyle {
@@ -1697,7 +1700,7 @@ public:
QT_Q_ENUM(InputMethodHint)
QT_Q_ENUM(InputMethodQuery)
QT_Q_FLAG(InputMethodHints)
- QT_Q_ENUM(ReturnKeyType)
+ QT_Q_ENUM(EnterKeyType)
QT_Q_FLAG(InputMethodQueries)
QT_Q_FLAG(TouchPointStates)
QT_Q_ENUM(ScreenOrientation)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index d4d7b631ad..970e1b1f42 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2527,7 +2527,7 @@
but \b{must} not return an empty string unless the cursor is at the start of the document.
\value ImTextAfterCursor The plain text after the cursor. The widget can decide how much text to return,
but \b{must} not return an empty string unless the cursor is at the end of the document.
- \value ImReturnKeyType The return key type.
+ \value ImEnterKeyType The Enter key type.
Masks:
@@ -2538,31 +2538,32 @@
*/
/*!
- \enum Qt::ReturnKeyType
+ \enum Qt::EnterKeyType
This can be used to alter the appearance of the Return key on an on screen keyboard.
- Note that not all of these values are supported on all platforms.
-
- \value ReturnKeyDefault The default return key.
- This can either be a button closing the keyboard, or a Return button
- causing a new line in case of a multi-line input field.
- \value ReturnKeyEnter Show a Return button that inserts a new line.
- The keyboard will not close when this button is pressed.
- \value ReturnKeyDone Show a "Done" button.
- The keyboard will close when this button is pressed.
- \value ReturnKeyGo Show a "Go" button.
- Typically used in an address bar when entering an URL; the keyboard
- will close when this button is pressed.
- \value ReturnKeySend Show a "Send" button.
- The keyboard will close when this button is pressed.
- \value ReturnKeySearch Show a "Search" button.
- The keyboard will close when this button is pressed.
- \value ReturnKeyNext Show a "Next" button.
- Typically used in a form to allow navigating to the next input field;
- the keyboard will not close when this button is pressed.
- \value ReturnKeyPrevious Show a "Previous" button.
- The keyboard will not close when this button is pressed.
+ \note Not all of these values are supported on all platforms.
+ For unsuppoted values the default key will be used instead.
+
+ \value EnterKeyDefault The default Enter key.
+ This can either be a button closing the keyboard, or a Return button
+ causing a new line in case of a multi-line input field.
+ \value EnterKeyReturn Show a Return button that inserts a new line.
+ The keyboard will not close when this button is pressed.
+ \value EnterKeyDone Show a "Done" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeyGo Show a "Go" button.
+ Typically used in an address bar when entering a URL; the keyboard
+ will close when this button is pressed.
+ \value EnterKeySend Show a "Send" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeySearch Show a "Search" button.
+ The keyboard will close when this button is pressed.
+ \value EnterKeyNext Show a "Next" button.
+ Typically used in a form to allow navigating to the next input field;
+ the keyboard will not close when this button is pressed.
+ \value EnterKeyPrevious Show a "Previous" button.
+ The keyboard will not close when this button is pressed.
\since 5.6
*/
@@ -2955,15 +2956,19 @@
\enum Qt::NativeGestureType
\since 5.2
- \value BeginNativeGesture
- \value EndNativeGesture
- \value PanNativeGesture
- \value ZoomNativeGesture
- \value SmartZoomNativeGesture
- \value RotateNativeGesture
- \value SwipeNativeGesture
+ This enum returns the gesture type.
+
+ \value BeginNativeGesture Sent before gesture event stream.
+ \value EndNativeGesture Sent after gesture event stream.
+ \value PanNativeGesture Sent after a panning gesture.
+ Similar to a click-and-drag mouse movement.
+ \value ZoomNativeGesture Specifies the magnification delta in percent.
+ \value SmartZoomNativeGesture Boolean magnification state.
+ \value RotateNativeGesture Rotation delta in degrees.
+ \value SwipeNativeGesture Sent after a swipe movements.
*/
+
/*!
\enum Qt::NavigationMode
\since 4.6
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
index 3a305713e6..488e257e0f 100644
--- a/src/corelib/global/qtypetraits.h
+++ b/src/corelib/global/qtypetraits.h
@@ -506,6 +506,27 @@ Q_STATIC_ASSERT((!is_unsigned<qint64>::value));
Q_STATIC_ASSERT((!is_signed<quint64>::value));
Q_STATIC_ASSERT(( is_signed<qint64>::value));
+template<class T = void> struct is_default_constructible;
+
+template<> struct is_default_constructible<void>
+{
+protected:
+ template<bool> struct test { typedef char type; };
+public:
+ static bool const value = false;
+};
+template<> struct is_default_constructible<>::test<true> { typedef double type; };
+
+template<class T> struct is_default_constructible : is_default_constructible<>
+{
+private:
+ template<class U> static typename test<!!sizeof(::new U())>::type sfinae(U*);
+ template<class U> static char sfinae(...);
+public:
+ static bool const value = sizeof(sfinae<T>(0)) > 1;
+};
+
+
} // namespace QtPrivate
QT_END_NAMESPACE
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 4c189bfe57..207de2a85b 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -187,7 +187,7 @@ win32 {
}
!nacl {
- freebsd-*|mac|darwin-*|openbsd-*:{
+ freebsd-*|mac|darwin-*|openbsd-*|netbsd-*:{
SOURCES += io/qfilesystemwatcher_kqueue.cpp
HEADERS += io/qfilesystemwatcher_kqueue_p.h
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 9b1ec3917a..8b3dd5d82f 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1826,6 +1826,8 @@ QFileInfoList QDir::drives()
underlying operating system. If you want to display paths to the
user using their operating system's separator use
toNativeSeparators().
+
+ \sa listSeparator()
*/
QChar QDir::separator()
{
@@ -1837,6 +1839,16 @@ QChar QDir::separator()
}
/*!
+ \fn QDir::listSeparator()
+ \since 5.6
+
+ Returns the native path list separator: ':' under Unix
+ and ';' under Windows.
+
+ \sa separator()
+*/
+
+/*!
Sets the application's current working directory to \a path.
Returns \c true if the directory was successfully changed; otherwise
returns \c false.
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index e622011f98..b6946eba65 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -177,7 +177,16 @@ public:
static QFileInfoList drives();
- static QChar separator();
+ Q_DECL_CONSTEXPR static inline QChar listSeparator() Q_DECL_NOTHROW
+ {
+#if defined(Q_OS_WIN)
+ return QLatin1Char(';');
+#else
+ return QLatin1Char(':');
+#endif
+ }
+
+ static QChar separator(); // ### Qt6: Make it inline
static bool setCurrent(const QString &path);
static inline QDir current() { return QDir(currentPath()); }
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 4ca07ba41d..cddd70f908 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -225,9 +225,13 @@ QString QFileSelector::select(const QString &filePath) const
return d->select(filePath);
}
-static QString qrcScheme()
+static bool isLocalScheme(const QString &file)
{
- return QStringLiteral("qrc");
+ bool local = file == QStringLiteral("qrc");
+#ifdef Q_OS_ANDROID
+ local |= file == QStringLiteral("assets");
+#endif
+ return local;
}
/*!
@@ -240,10 +244,10 @@ static QString qrcScheme()
QUrl QFileSelector::select(const QUrl &filePath) const
{
Q_D(const QFileSelector);
- if (filePath.scheme() != qrcScheme() && !filePath.isLocalFile())
+ if (!isLocalScheme(filePath.scheme()) && !filePath.isLocalFile())
return filePath;
QUrl ret(filePath);
- if (filePath.scheme() == qrcScheme()) {
+ if (isLocalScheme(filePath.scheme())) {
QString equivalentPath = QLatin1Char(':') + filePath.path();
QString selectedPath = d->select(equivalentPath);
ret.setPath(selectedPath.remove(0, 1));
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index faaf7a00af..79f16a0839 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -255,15 +255,15 @@ QString QFileSystemEntry::completeSuffix() const
bool QFileSystemEntry::isRelative() const
{
resolveFilePath();
- return (m_filePath.isEmpty() || (!m_filePath.isEmpty() && (m_filePath[0].unicode() != '/')
- && (!(m_filePath.length() >= 2 && m_filePath[1].unicode() == ':'))));
+ return (m_filePath.isEmpty() || (!m_filePath.isEmpty() && (m_filePath.at(0).unicode() != '/')
+ && (!(m_filePath.length() >= 2 && m_filePath.at(1).unicode() == ':'))));
}
bool QFileSystemEntry::isAbsolute() const
{
resolveFilePath();
return (!m_filePath.isEmpty() && ((m_filePath.length() >= 3
- && (m_filePath[0].isLetter() && m_filePath[1].unicode() == ':' && m_filePath[2].unicode() == '/'))
+ && (m_filePath.at(0).isLetter() && m_filePath.at(1).unicode() == ':' && m_filePath.at(2).unicode() == '/'))
|| (m_filePath.length() >= 2 && (m_filePath.at(0) == QLatin1Char('/') && m_filePath.at(1) == QLatin1Char('/')))
));
}
@@ -276,7 +276,7 @@ bool QFileSystemEntry::isRelative() const
bool QFileSystemEntry::isAbsolute() const
{
resolveFilePath();
- return (!m_filePath.isEmpty() && (m_filePath[0].unicode() == '/'));
+ return (!m_filePath.isEmpty() && (m_filePath.at(0).unicode() == '/'));
}
#endif
@@ -337,10 +337,10 @@ void QFileSystemEntry::findFileNameSeparators() const
int i = m_filePath.size() - 1;
for (; i >= stop; --i) {
- if (m_filePath[i].unicode() == '.') {
+ if (m_filePath.at(i).unicode() == '.') {
firstDotInFileName = lastDotInFileName = i;
break;
- } else if (m_filePath[i].unicode() == '/') {
+ } else if (m_filePath.at(i).unicode() == '/') {
lastSeparator = i;
break;
}
@@ -348,9 +348,9 @@ void QFileSystemEntry::findFileNameSeparators() const
if (lastSeparator != i) {
for (--i; i >= stop; --i) {
- if (m_filePath[i].unicode() == '.')
+ if (m_filePath.at(i).unicode() == '.')
firstDotInFileName = i;
- else if (m_filePath[i].unicode() == '/') {
+ else if (m_filePath.at(i).unicode() == '/') {
lastSeparator = i;
break;
}
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index 0bd46400d3..3a8f7bd0a9 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -52,7 +52,7 @@
# include "qfilesystemwatcher_win_p.h"
#elif defined(USE_INOTIFY)
# include "qfilesystemwatcher_inotify_p.h"
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_IOS)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_IOS)
# include "qfilesystemwatcher_kqueue_p.h"
#elif defined(Q_OS_OSX)
# include "qfilesystemwatcher_fsevents_p.h"
@@ -68,7 +68,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject
// there is a chance that inotify may fail on Linux pre-2.6.13 (August
// 2005), so we can't just new inotify directly.
return QInotifyFileSystemWatcherEngine::create(parent);
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_IOS)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_IOS)
return QKqueueFileSystemWatcherEngine::create(parent);
#elif defined(Q_OS_OSX)
return QFseventsFileSystemWatcherEngine::create(parent);
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm
index 8a028c91e1..7656530a46 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.mm
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm
@@ -56,25 +56,6 @@
QT_BEGIN_NAMESPACE
-namespace {
-class RaiiAutoreleasePool
-{
- Q_DISABLE_COPY(RaiiAutoreleasePool)
-
-public:
- RaiiAutoreleasePool()
- : pool([[NSAutoreleasePool alloc] init])
- {}
-
- ~RaiiAutoreleasePool()
- { [pool release]; }
-
-private:
- NSAutoreleasePool *pool;
-};
-#define Q_AUTORELEASE_POOL(pool) RaiiAutoreleasePool pool; Q_UNUSED(pool);
-}
-
static void callBackFunction(ConstFSEventStreamRef streamRef,
void *clientCallBackInfo,
size_t numEvents,
@@ -82,7 +63,7 @@ static void callBackFunction(ConstFSEventStreamRef streamRef,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[])
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
char **paths = static_cast<char **>(eventPaths);
QFseventsFileSystemWatcherEngine *engine = static_cast<QFseventsFileSystemWatcherEngine *>(clientCallBackInfo);
@@ -297,7 +278,7 @@ void QFseventsFileSystemWatcherEngine::doEmitDirectoryChanged(const QString &pat
void QFseventsFileSystemWatcherEngine::restartStream()
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
QMutexLocker locker(&lock);
stopStream();
startStream();
@@ -328,7 +309,7 @@ QFseventsFileSystemWatcherEngine::QFseventsFileSystemWatcherEngine(QObject *pare
QFseventsFileSystemWatcherEngine::~QFseventsFileSystemWatcherEngine()
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
if (stream)
FSEventStreamStop(stream);
@@ -344,7 +325,7 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
if (stream) {
DEBUG("Flushing, last id is %llu", FSEventStreamGetLatestEventId(stream));
@@ -432,7 +413,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
QStringList *files,
QStringList *directories)
{
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
QMutexLocker locker(&lock);
@@ -489,7 +470,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
bool QFseventsFileSystemWatcherEngine::startStream()
{
Q_ASSERT(stream == 0);
- Q_AUTORELEASE_POOL(pool)
+ QMacAutoReleasePool pool;
if (stream) // This shouldn't happen, but let's be nice and handle it.
stopStream();
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index e73a200fb4..07a2ff8f6b 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -38,9 +38,9 @@
#include "qiodevice_p.h"
#include "qfile.h"
#include "qstringlist.h"
+#include "qdir.h"
#include <algorithm>
-#include <limits.h>
#ifdef QIODEVICE_DEBUG
# include <ctype.h>
@@ -80,10 +80,29 @@ void debugBinaryString(const char *data, qint64 maxlen)
#define Q_VOID
+static void checkWarnMessage(const QIODevice *device, const char *function, const char *what)
+{
+ QDebug d = qWarning();
+ d.noquote();
+ d.nospace();
+ d << "QIODevice::" << function;
+#ifndef QT_NO_QOBJECT
+ d << " (" << device->metaObject()->className();
+ if (!device->objectName().isEmpty())
+ d << ", \"" << device->objectName() << '"';
+ if (const QFile *f = qobject_cast<const QFile *>(device))
+ d << ", \"" << QDir::toNativeSeparators(f->fileName()) << '"';
+ d << ')';
+#else
+ Q_UNUSED(device)
+#endif // !QT_NO_QOBJECT
+ d << ": " << what;
+}
+
#define CHECK_MAXLEN(function, returnType) \
do { \
if (maxSize < 0) { \
- qWarning("QIODevice::"#function": Called with maxSize < 0"); \
+ checkWarnMessage(this, #function, "Called with maxSize < 0"); \
return returnType; \
} \
} while (0)
@@ -92,10 +111,10 @@ void debugBinaryString(const char *data, qint64 maxlen)
do { \
if ((d->openMode & WriteOnly) == 0) { \
if (d->openMode == NotOpen) { \
- qWarning("QIODevice::"#function": device not open"); \
+ checkWarnMessage(this, #function, "device not open"); \
return returnType; \
} \
- qWarning("QIODevice::"#function": ReadOnly device"); \
+ checkWarnMessage(this, #function, "ReadOnly device"); \
return returnType; \
} \
} while (0)
@@ -104,10 +123,10 @@ void debugBinaryString(const char *data, qint64 maxlen)
do { \
if ((d->openMode & ReadOnly) == 0) { \
if (d->openMode == NotOpen) { \
- qWarning("QIODevice::"#function": device not open"); \
+ checkWarnMessage(this, #function, "device not open"); \
return returnType; \
} \
- qWarning("QIODevice::"#function": WriteOnly device"); \
+ checkWarnMessage(this, #function, "WriteOnly device"); \
return returnType; \
} \
} while (0)
@@ -462,7 +481,7 @@ void QIODevice::setTextModeEnabled(bool enabled)
{
Q_D(QIODevice);
if (!isOpen()) {
- qWarning("QIODevice::setTextModeEnabled: The device is not open");
+ checkWarnMessage(this, "setTextModeEnabled", "The device is not open");
return;
}
if (enabled)
@@ -621,11 +640,11 @@ bool QIODevice::seek(qint64 pos)
{
Q_D(QIODevice);
if (d->isSequential()) {
- qWarning("QIODevice::seek: Cannot call seek on a sequential device");
+ checkWarnMessage(this, "seek", "Cannot call seek on a sequential device");
return false;
}
if (d->openMode == NotOpen) {
- qWarning("QIODevice::seek: The device is not open");
+ checkWarnMessage(this, "seek", "The device is not open");
return false;
}
if (pos < 0) {
@@ -922,9 +941,9 @@ QByteArray QIODevice::read(qint64 maxSize)
Q_UNUSED(d);
#endif
- if (maxSize != qint64(int(maxSize))) {
- qWarning("QIODevice::read: maxSize argument exceeds QByteArray size limit");
- maxSize = INT_MAX;
+ if (quint64(maxSize) >= QByteArray::MaxSize) {
+ checkWarnMessage(this, "read", "maxSize argument exceeds QByteArray size limit");
+ maxSize = QByteArray::MaxSize - 1;
}
qint64 readBytes = 0;
@@ -976,7 +995,7 @@ QByteArray QIODevice::readAll()
// flush internal read buffer
if (!(d->openMode & Text) && !d->buffer.isEmpty()) {
- if (d->buffer.size() >= INT_MAX)
+ if (quint64(d->buffer.size()) >= QByteArray::MaxSize)
return QByteArray();
result = d->buffer.readAll();
readBytes = result.size();
@@ -989,7 +1008,7 @@ QByteArray QIODevice::readAll()
// Size is unknown, read incrementally.
qint64 readResult;
do {
- if (quint64(readBytes) + QIODEVICE_BUFFERSIZE > QByteArray::MaxSize) {
+ if (quint64(readBytes) + QIODEVICE_BUFFERSIZE >= QByteArray::MaxSize) {
// If resize would fail, don't read more, return what we have.
break;
}
@@ -1001,7 +1020,7 @@ QByteArray QIODevice::readAll()
} else {
// Read it all in one go.
// If resize fails, don't read anything.
- if (quint64(readBytes + theSize - d->pos) > QByteArray::MaxSize)
+ if (quint64(readBytes + theSize - d->pos) >= QByteArray::MaxSize)
return QByteArray();
result.resize(int(readBytes + theSize - d->pos));
readBytes += read(result.data() + readBytes, result.size() - readBytes);
@@ -1055,7 +1074,7 @@ qint64 QIODevice::readLine(char *data, qint64 maxSize)
{
Q_D(QIODevice);
if (maxSize < 2) {
- qWarning("QIODevice::readLine: Called with maxSize < 2");
+ checkWarnMessage(this, "readLine", "Called with maxSize < 2");
return qint64(-1);
}
@@ -1159,9 +1178,9 @@ QByteArray QIODevice::readLine(qint64 maxSize)
Q_UNUSED(d);
#endif
- if (maxSize > INT_MAX) {
+ if (quint64(maxSize) >= QByteArray::MaxSize) {
qWarning("QIODevice::read: maxSize argument exceeds QByteArray size limit");
- maxSize = INT_MAX;
+ maxSize = QByteArray::MaxSize - 1;
}
result.resize(int(maxSize));
@@ -1169,7 +1188,7 @@ QByteArray QIODevice::readLine(qint64 maxSize)
if (!result.size()) {
// If resize fails or maxSize == 0, read incrementally
if (maxSize == 0)
- maxSize = INT_MAX;
+ maxSize = QByteArray::MaxSize - 1;
// The first iteration needs to leave an extra byte for the terminating null
result.resize(1);
diff --git a/src/corelib/io/qlockfile.cpp b/src/corelib/io/qlockfile.cpp
index 4f5aeff395..2bd996d213 100644
--- a/src/corelib/io/qlockfile.cpp
+++ b/src/corelib/io/qlockfile.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
+** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -66,9 +67,12 @@ QT_BEGIN_NAMESPACE
If the process holding the lock crashes, the lock file stays on disk and can prevent
any other process from accessing the shared resource, ever. For this reason, QLockFile
- tries to detect such a "stale" lock file, based on the process ID written into the file,
- and (in case that process ID got reused meanwhile), on the last modification time of
- the lock file (30s by default, for the use case of a short-lived operation).
+ tries to detect such a "stale" lock file, based on the process ID written into the file.
+ To cover the situation that the process ID got reused meanwhile, the current process name is
+ compared to the name of the process that corresponds to the process ID from the lock file.
+ If the process names differ, the lock file is considered stale.
+ Additionally, the last modification time of the lock file (30s by default, for the use case of a
+ short-lived operation) is taken into account.
If the lock file is found to be stale, it will be deleted.
For the use case of protecting a resource over a long time, you should therefore call
@@ -122,7 +126,7 @@ QLockFile::~QLockFile()
The value of \a staleLockTime is used by lock() and tryLock() in order
to determine when an existing lock file is considered stale, i.e. left over
by a crashed process. This is useful for the case where the PID got reused
- meanwhile, so the only way to detect a stale lock file is by the fact that
+ meanwhile, so one way to detect a stale lock file is by the fact that
it has been around for a long time.
\sa staleLockTime()
diff --git a/src/corelib/io/qlockfile_p.h b/src/corelib/io/qlockfile_p.h
index 0cfaa42849..168062f467 100644
--- a/src/corelib/io/qlockfile_p.h
+++ b/src/corelib/io/qlockfile_p.h
@@ -75,6 +75,7 @@ public:
// Returns \c true if the lock belongs to dead PID, or is old.
// The attempt to delete it will tell us if it was really stale or not, though.
bool isApparentlyStale() const;
+ static QString processNameByPid(qint64 pid);
#ifdef Q_OS_UNIX
static int checkFcntlWorksAfterFlock();
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index b817a24c74..d6ea2f1f2d 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
+** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -48,6 +49,15 @@
#include <signal.h> // kill
#include <unistd.h> // gethostname
+#if defined(Q_OS_OSX)
+# include <libproc.h>
+#elif defined(Q_OS_LINUX)
+# include <unistd.h>
+# include <cstdio>
+#elif defined(Q_OS_BSD4) && !defined(Q_OS_IOS)
+# include <sys/user.h>
+#endif
+
QT_BEGIN_NAMESPACE
static QByteArray localHostName() // from QHostInfo::localHostName(), modified to return a QByteArray
@@ -185,16 +195,54 @@ bool QLockFilePrivate::isApparentlyStale() const
{
qint64 pid;
QString hostname, appname;
- if (!getLockInfo(&pid, &hostname, &appname))
- return false;
- if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
- if (::kill(pid, 0) == -1 && errno == ESRCH)
- return true; // PID doesn't exist anymore
+ if (getLockInfo(&pid, &hostname, &appname)) {
+ if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
+ if (::kill(pid, 0) == -1 && errno == ESRCH)
+ return true; // PID doesn't exist anymore
+ const QString processName = processNameByPid(pid);
+ if (!processName.isEmpty()) {
+ QFileInfo fi(appname);
+ if (fi.isSymLink())
+ fi.setFile(fi.symLinkTarget());
+ if (processName != fi.fileName())
+ return true; // PID got reused by a different application.
+ }
+ }
}
const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
return staleLockTime > 0 && age > staleLockTime;
}
+QString QLockFilePrivate::processNameByPid(qint64 pid)
+{
+#if defined(Q_OS_OSX)
+ char name[1024];
+ proc_name(pid, name, sizeof(name) / sizeof(char));
+ return QString::fromUtf8(name);
+#elif defined(Q_OS_LINUX)
+ if (!QFile::exists(QStringLiteral("/proc/version")))
+ return QString();
+ char exePath[64];
+ char buf[PATH_MAX];
+ memset(buf, 0, sizeof(buf));
+ sprintf(exePath, "/proc/%lld/exe", pid);
+ if (readlink(exePath, buf, sizeof(buf)) < 0) {
+ // The pid is gone. Return some invalid process name to fail the test.
+ return QStringLiteral("/ERROR/");
+ }
+ return QFileInfo(QString::fromUtf8(buf)).fileName();
+#elif defined(Q_OS_BSD4) && !defined(Q_OS_IOS)
+ kinfo_proc *proc = kinfo_getproc(pid);
+ if (!proc)
+ return QString();
+ QString name = QString::fromUtf8(proc->ki_comm);
+ free(proc);
+ return name;
+#else
+ return QString();
+#endif
+}
+
void QLockFile::unlock()
{
Q_D(QLockFile);
diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp
index 9fe86e1ad8..5bd1ba04c9 100644
--- a/src/corelib/io/qlockfile_win.cpp
+++ b/src/corelib/io/qlockfile_win.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
+** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -126,27 +127,75 @@ bool QLockFilePrivate::isApparentlyStale() const
{
qint64 pid;
QString hostname, appname;
- if (!getLockInfo(&pid, &hostname, &appname))
- return false;
// On WinRT there seems to be no way of obtaining information about other
// processes due to sandboxing
#ifndef Q_OS_WINRT
- if (hostname == QString::fromLocal8Bit(localHostName())) {
- HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
- if (!procHandle)
- return true;
- // We got a handle but check if process is still alive
- DWORD dwR = ::WaitForSingleObject(procHandle, 0);
- ::CloseHandle(procHandle);
- if (dwR == WAIT_TIMEOUT)
- return true;
+ if (getLockInfo(&pid, &hostname, &appname)) {
+ if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
+ HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
+ if (!procHandle)
+ return true;
+ // We got a handle but check if process is still alive
+ DWORD dwR = ::WaitForSingleObject(procHandle, 0);
+ ::CloseHandle(procHandle);
+ if (dwR == WAIT_TIMEOUT)
+ return true;
+ const QString processName = processNameByPid(pid);
+ if (!processName.isEmpty() && processName != appname)
+ return true; // PID got reused by a different application.
+ }
}
-#endif // !Q_OS_WINRT
+#else // !Q_OS_WINRT
+ Q_UNUSED(pid);
+ Q_UNUSED(hostname);
+ Q_UNUSED(appname);
+#endif // Q_OS_WINRT
const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
return staleLockTime > 0 && age > staleLockTime;
}
+QString QLockFilePrivate::processNameByPid(qint64 pid)
+{
+#if !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE)
+ typedef DWORD (WINAPI *GetModuleFileNameExFunc)(HANDLE, HMODULE, LPTSTR, DWORD);
+
+ HMODULE hPsapi = LoadLibraryA("psapi");
+ if (!hPsapi)
+ return QString();
+
+ GetModuleFileNameExFunc qGetModuleFileNameEx
+ = (GetModuleFileNameExFunc)GetProcAddress(hPsapi, "GetModuleFileNameExW");
+ if (!qGetModuleFileNameEx) {
+ FreeLibrary(hPsapi);
+ return QString();
+ }
+
+ HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, DWORD(pid));
+ if (!hProcess) {
+ FreeLibrary(hPsapi);
+ return QString();
+ }
+ wchar_t buf[MAX_PATH];
+ const DWORD length = qGetModuleFileNameEx(hProcess, NULL, buf, sizeof(buf) / sizeof(wchar_t));
+ CloseHandle(hProcess);
+ FreeLibrary(hPsapi);
+ if (!length)
+ return QString();
+ QString name = QString::fromWCharArray(buf, length);
+ int i = name.lastIndexOf(QLatin1Char('\\'));
+ if (i >= 0)
+ name.remove(0, i + 1);
+ i = name.lastIndexOf(QLatin1Char('.'));
+ if (i >= 0)
+ name.truncate(i);
+ return name;
+#else
+ Q_UNUSED(pid);
+ return QString();
+#endif
+}
+
void QLockFile::unlock()
{
Q_D(QLockFile);
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index c17b42ef81..af1bb56fe9 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -216,6 +216,11 @@ qint64 QNonContiguousByteDeviceByteArrayImpl::size()
return byteArray->size();
}
+qint64 QNonContiguousByteDeviceByteArrayImpl::pos()
+{
+ return currentPosition;
+}
+
QNonContiguousByteDeviceRingBufferImpl::QNonContiguousByteDeviceRingBufferImpl(QSharedPointer<QRingBuffer> rb)
: QNonContiguousByteDevice(), currentPosition(0)
{
@@ -253,6 +258,11 @@ bool QNonContiguousByteDeviceRingBufferImpl::atEnd()
return currentPosition >= size();
}
+qint64 QNonContiguousByteDeviceRingBufferImpl::pos()
+{
+ return currentPosition;
+}
+
bool QNonContiguousByteDeviceRingBufferImpl::reset()
{
currentPosition = 0;
@@ -381,6 +391,14 @@ qint64 QNonContiguousByteDeviceIoDeviceImpl::size()
return device->size() - initialPosition;
}
+qint64 QNonContiguousByteDeviceIoDeviceImpl::pos()
+{
+ if (device->isSequential())
+ return -1;
+
+ return device->pos();
+}
+
QByteDeviceWrappingIoDevice::QByteDeviceWrappingIoDevice(QNonContiguousByteDevice *bd) : QIODevice((QObject*)0)
{
byteDevice = bd;
diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h
index 8b5bf3080a..38089dedd7 100644
--- a/src/corelib/io/qnoncontiguousbytedevice_p.h
+++ b/src/corelib/io/qnoncontiguousbytedevice_p.h
@@ -61,6 +61,7 @@ public:
virtual const char* readPointer(qint64 maximumLength, qint64 &len) = 0;
virtual bool advanceReadPointer(qint64 amount) = 0;
virtual bool atEnd() = 0;
+ virtual qint64 pos() { return -1; }
virtual bool reset() = 0;
virtual qint64 size() = 0;
@@ -103,6 +104,7 @@ public:
bool atEnd() Q_DECL_OVERRIDE;
bool reset() Q_DECL_OVERRIDE;
qint64 size() Q_DECL_OVERRIDE;
+ qint64 pos() Q_DECL_OVERRIDE;
protected:
QByteArray* byteArray;
qint64 currentPosition;
@@ -118,6 +120,7 @@ public:
bool atEnd() Q_DECL_OVERRIDE;
bool reset() Q_DECL_OVERRIDE;
qint64 size() Q_DECL_OVERRIDE;
+ qint64 pos() Q_DECL_OVERRIDE;
protected:
QSharedPointer<QRingBuffer> ringBuffer;
qint64 currentPosition;
@@ -135,6 +138,7 @@ public:
bool atEnd() Q_DECL_OVERRIDE;
bool reset() Q_DECL_OVERRIDE;
qint64 size() Q_DECL_OVERRIDE;
+ qint64 pos() Q_DECL_OVERRIDE;
protected:
QIODevice* device;
QByteArray* currentReadBuffer;
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 38bd588c37..da6e0c87af 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -110,7 +110,6 @@ QT_BEGIN_NAMESPACE
\ingroup io
\ingroup misc
\ingroup shared
- \mainclass
\reentrant
\since 4.6
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index 078217ea0b..32fa4aa866 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -104,15 +104,21 @@ public:
WriteError,
UnknownError
};
+ Q_ENUM(ProcessError)
+
enum ProcessState {
NotRunning,
Starting,
Running
};
+ Q_ENUM(ProcessState)
+
enum ProcessChannel {
StandardOutput,
StandardError
};
+ Q_ENUM(ProcessChannel)
+
enum ProcessChannelMode {
SeparateChannels,
MergedChannels,
@@ -120,14 +126,19 @@ public:
ForwardedOutputChannel,
ForwardedErrorChannel
};
+ Q_ENUM(ProcessChannelMode)
+
enum InputChannelMode {
ManagedInputChannel,
ForwardedInputChannel
};
+ Q_ENUM(InputChannelMode)
+
enum ExitStatus {
NormalExit,
CrashExit
};
+ Q_ENUM(ExitStatus)
explicit QProcess(QObject *parent = 0);
virtual ~QProcess();
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index cb6de29532..251b10ea89 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -104,6 +104,10 @@ using namespace ABI::Windows::Storage;
#define Q_XDG_PLATFORM
#endif
+#if !defined(QT_NO_STANDARDPATHS) && (defined(Q_XDG_PLATFORM) || defined(Q_OS_IOS))
+#define QSETTINGS_USE_QSTANDARDPATHS
+#endif
+
// ************************************************************************
// QConfFile
@@ -1044,7 +1048,7 @@ static void initDefaultPaths(QMutexLocker *locker)
windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator());
#else
-#if defined(QT_NO_STANDARDPATHS) || !defined(Q_XDG_PLATFORM)
+#ifndef QSETTINGS_USE_QSTANDARDPATHS
// Non XDG platforms (OS X, iOS, Blackberry, Android...) have used this code path erroneously
// for some time now. Moving away from that would require migrating existing settings.
QString userPath;
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 5f764549e0..04848a38e5 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -274,45 +274,67 @@ QT_BEGIN_NAMESPACE
\endtable
\table
- \header \li Path type \li Android
+ \header \li Path type \li Android \li iOS
\row \li DesktopLocation
\li "<APPROOT>/files"
+ \li "<APPROOT>/<APPDIR>" (not writable)
\row \li DocumentsLocation
\li "<USER>/Documents", "<USER>/<APPNAME>/Documents"
+ \li "<APPROOT>/Documents"
\row \li FontsLocation
\li "/system/fonts" (not writable)
+ \li "<APPROOT>/Documents/.fonts"
\row \li ApplicationsLocation
\li not supported (directory not readable)
+ \li not supported
\row \li MusicLocation
\li "<USER>/Music", "<USER>/<APPNAME>/Music"
+ \li "<APPROOT>/Documents/Music"
\row \li MoviesLocation
\li "<USER>/Movies", "<USER>/<APPNAME>/Movies"
+ \li "<APPROOT>/Documents/Movies"
\row \li PicturesLocation
\li "<USER>/Pictures", "<USER>/<APPNAME>/Pictures"
+ \li "<APPROOT>/Documents/Pictures", "assets-library://"
\row \li TempLocation
\li "<APPROOT>/cache"
+ \li "<APPROOT>/tmp"
\row \li HomeLocation
\li "<APPROOT>/files"
+ \li "<APPROOT>/<APPDIR>" (not writable)
\row \li DataLocation
\li "<APPROOT>/files", "<USER>/<APPNAME>/files"
+ \li "<APPROOT>/Library/Application Support"
\row \li CacheLocation
\li "<APPROOT>/cache", "<USER>/<APPNAME>/cache"
+ \li "<APPROOT>/Library/Caches"
\row \li GenericDataLocation
\li "<USER>"
+ \li "<APPROOT>/Documents"
\row \li RuntimeLocation
\li "<APPROOT>/cache"
+ \li not supported
\row \li ConfigLocation
\li "<APPROOT>/files/settings"
+ \li "<APPROOT>/Documents"
\row \li GenericConfigLocation
\li "<APPROOT>/files/settings" (there is no shared settings)
+ \li "<APPROOT>/Documents"
\row \li DownloadLocation
\li "<USER>/Downloads", "<USER>/<APPNAME>/Downloads"
+ \li "<APPROOT>/Documents/Download"
\row \li GenericCacheLocation
\li "<APPROOT>/cache" (there is no shared cache)
+ \li "<APPROOT>/Library/Caches"
\row \li AppDataLocation
\li "<APPROOT>/files", "<USER>/<APPNAME>/files"
+ \li "<APPROOT>/Library/Application Support"
\row \li AppConfigLocation
\li "<APPROOT>/files/settings"
+ \li "<APPROOT>/Documents"
+ \row \li AppLocalDataLocation
+ \li "<APPROOT>/files", "<USER>/<APPNAME>/files"
+ \li "<APPROOT>/Library/Application Support"
\endtable
In the table above, \c <APPNAME> is usually the organization name, the
@@ -327,6 +349,12 @@ QT_BEGIN_NAMESPACE
\note On Android, applications with open files on the external storage (<USER> locations),
will be killed if the external storage is unmounted.
+ \note On iOS, if you do pass \c {QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last()}
+ as argument to \l{QFileDialog::setDirectory()},
+ a native image picker dialog will be used for accessing the user's photo album.
+ The filename returned can be loaded using QFile and related APIs.
+ This feature was added in Qt 5.5.
+
\sa writableLocation(), standardLocations(), displayName(), locate(), locateAll()
*/
@@ -494,13 +522,8 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
QStringList searchPaths = paths;
if (paths.isEmpty()) {
QByteArray pEnv = qgetenv("PATH");
-#if defined(Q_OS_WIN)
- const QLatin1Char pathSep(';');
-#else
- const QLatin1Char pathSep(':');
-#endif
// Remove trailing slashes, which occur on Windows.
- const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, QString::SkipEmptyParts);
+ const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(QDir::listSeparator(), QString::SkipEmptyParts);
searchPaths.reserve(rawPaths.size());
foreach (const QString &rawPath, rawPaths) {
QString cleanPath = QDir::cleanPath(rawPath);
diff --git a/src/corelib/io/qstandardpaths_ios.mm b/src/corelib/io/qstandardpaths_ios.mm
index 27d28526c2..eb85e2fd23 100644
--- a/src/corelib/io/qstandardpaths_ios.mm
+++ b/src/corelib/io/qstandardpaths_ios.mm
@@ -55,30 +55,31 @@ QString QStandardPaths::writableLocation(StandardLocation type)
QString location;
switch (type) {
- case DesktopLocation:
- location = pathForDirectory(NSDesktopDirectory);
- break;
case DocumentsLocation:
location = pathForDirectory(NSDocumentDirectory);
break;
case FontsLocation:
- location = bundlePath() + QLatin1String("/.fonts");
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/.fonts");
break;
case ApplicationsLocation:
- location = pathForDirectory(NSApplicationDirectory);
+ // NSApplicationDirectory points to a non-existing write-protected path.
break;
case MusicLocation:
- location = pathForDirectory(NSMusicDirectory);
+ // NSMusicDirectory points to a non-existing write-protected path. Use sensible fallback.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Music");
break;
case MoviesLocation:
- location = pathForDirectory(NSMoviesDirectory);
+ // NSMoviesDirectory points to a non-existing write-protected path. Use sensible fallback.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Movies");
break;
case PicturesLocation:
- location = pathForDirectory(NSPicturesDirectory);
+ // NSPicturesDirectory points to a non-existing write-protected path. Use sensible fallback.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Pictures");
break;
case TempLocation:
location = QString::fromNSString(NSTemporaryDirectory());
break;
+ case DesktopLocation:
case HomeLocation:
location = bundlePath();
break;
@@ -99,20 +100,12 @@ QString QStandardPaths::writableLocation(StandardLocation type)
location = pathForDirectory(NSDocumentDirectory);
break;
case DownloadLocation:
- location = pathForDirectory(NSDownloadsDirectory);
- break;
- default:
+ // NSDownloadsDirectory points to a non-existing write-protected path.
+ location = pathForDirectory(NSDocumentDirectory) + QLatin1String("/Download");
break;
- }
-
- switch (type) {
case RuntimeLocation:
break;
default:
- // All other types must return something, so use the document directory
- // as a reasonable fall-back (which will always exist).
- if (location.isEmpty())
- location = pathForDirectory(NSDocumentDirectory);
break;
}
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 7823787711..f82d0ff0a1 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -67,8 +67,20 @@
#endif
#if defined(Q_OS_BSD4)
-# define QT_STATFSBUF struct statvfs
-# define QT_STATFS ::statvfs
+# if defined(Q_OS_NETBSD)
+ define QT_STATFSBUF struct statvfs
+ define QT_STATFS ::statvfs
+# else
+# define QT_STATFSBUF struct statfs
+# define QT_STATFS ::statfs
+# endif
+
+# if !defined(ST_RDONLY)
+# define ST_RDONLY MNT_RDONLY
+# endif
+# if !defined(_STATFS_F_FLAGS)
+# define _STATFS_F_FLAGS 1
+# endif
#elif defined(Q_OS_ANDROID)
# define QT_STATFS ::statfs
# define QT_STATFSBUF struct statfs
@@ -122,11 +134,7 @@ public:
inline QByteArray device() const;
private:
#if defined(Q_OS_BSD4)
-# if defined(Q_OS_NETBSD)
- struct statvfs *stat_buf;
-# else
- struct statfs *stat_buf;
-# endif
+ QT_STATFSBUF *stat_buf;
int entryCount;
int currentIndex;
#elif defined(Q_OS_SOLARIS)
@@ -502,7 +510,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize;
bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize;
-#if defined(Q_OS_ANDROID)
+#if defined(Q_OS_ANDROID) || defined (Q_OS_BSD4)
#if defined(_STATFS_F_FLAGS)
readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0;
#endif
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 556bc6e760..bdf4392275 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -236,9 +236,9 @@ QTemporaryFileEngine::~QTemporaryFileEngine()
QFSFileEngine::close();
}
-bool QTemporaryFileEngine::isReallyOpen()
+bool QTemporaryFileEngine::isReallyOpen() const
{
- Q_D(QFSFileEngine);
+ Q_D(const QFSFileEngine);
if (!((0 == d->fh) && (-1 == d->fd)
#if defined Q_OS_WIN
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index 475298f264..341ae9bd3f 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -95,7 +95,7 @@ public:
~QTemporaryFileEngine();
- bool isReallyOpen();
+ bool isReallyOpen() const;
void setFileName(const QString &file);
void setFileTemplate(const QString &fileTemplate);
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 5fe4cfef9d..47b96d708f 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -464,7 +464,7 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes)
}
#if defined (QTEXTSTREAM_DEBUG)
qDebug("QTextStreamPrivate::fillReadBuffer(), using %s codec",
- codec->name().constData());
+ codec ? codec->name().constData() : "no");
#endif
#endif
@@ -476,9 +476,10 @@ bool QTextStreamPrivate::fillReadBuffer(qint64 maxBytes)
int oldReadBufferSize = readBuffer.size();
#ifndef QT_NO_TEXTCODEC
// convert to unicode
- readBuffer += codec->toUnicode(buf, bytesRead, &readConverterState);
+ readBuffer += Q_LIKELY(codec) ? codec->toUnicode(buf, bytesRead, &readConverterState)
+ : QString::fromLatin1(buf, bytesRead);
#else
- readBuffer += QString::fromLatin1(QByteArray(buf, bytesRead).constData());
+ readBuffer += QString::fromLatin1(buf, bytesRead);
#endif
// reset the Text flag.
@@ -564,7 +565,8 @@ void QTextStreamPrivate::flushWriteBuffer()
codec = QTextCodec::codecForLocale();
#if defined (QTEXTSTREAM_DEBUG)
qDebug("QTextStreamPrivate::flushWriteBuffer(), using %s codec (%s generating BOM)",
- codec->name().constData(), writeConverterState.flags & QTextCodec::IgnoreHeader ? "not" : "");
+ codec ? codec->name().constData() : "no",
+ !codec || (writeConverterState.flags & QTextCodec::IgnoreHeader) ? "not" : "");
#endif
// convert from unicode to raw data
@@ -572,7 +574,7 @@ void QTextStreamPrivate::flushWriteBuffer()
QByteArray data = Q_LIKELY(codec) ? codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState)
: writeBuffer.toLatin1();
#else
- QByteArray data = writeBuffer.toLocal8Bit();
+ QByteArray data = writeBuffer.toLatin1();
#endif
writeBuffer.clear();
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 945b7df930..e6c570d1db 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -186,7 +186,7 @@ public:
QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
QString toString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
QString toDisplayString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
- QUrl adjusted(FormattingOptions options) const;
+ QUrl adjusted(FormattingOptions options) const Q_REQUIRED_RESULT;
QByteArray toEncoded(FormattingOptions options = FullyEncoded) const;
static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode);
@@ -243,7 +243,7 @@ public:
QString fragment(ComponentFormattingOptions options = PrettyDecoded) const;
void setFragment(const QString &fragment, ParsingMode mode = TolerantMode);
- QUrl resolved(const QUrl &relative) const;
+ QUrl resolved(const QUrl &relative) const Q_REQUIRED_RESULT;
bool isRelative() const;
bool isParentOf(const QUrl &url) const;
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index 1502e5dada..2cc5741250 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -36,7 +36,6 @@
#include <qdebug.h>
#include <qelapsedtimer.h>
#include <qeventloop.h>
-#include <qtimer.h>
QT_BEGIN_NAMESPACE
@@ -45,13 +44,11 @@ QWindowsPipeReader::QWindowsPipeReader(QObject *parent)
handle(INVALID_HANDLE_VALUE),
readBufferMaxSize(0),
actualReadBufferSize(0),
- emitReadyReadTimer(new QTimer(this)),
+ stopped(true),
readSequenceStarted(false),
pipeBroken(false),
readyReadEmitted(false)
{
- emitReadyReadTimer->setSingleShot(true);
- connect(emitReadyReadTimer, SIGNAL(timeout()), SIGNAL(readyRead()));
dataReadNotifier = new QWinOverlappedIoNotifier(this);
connect(dataReadNotifier, &QWinOverlappedIoNotifier::notified, this, &QWindowsPipeReader::notified);
}
@@ -73,12 +70,7 @@ static bool qt_cancelIo(HANDLE handle, OVERLAPPED *overlapped)
QWindowsPipeReader::~QWindowsPipeReader()
{
- if (readSequenceStarted) {
- if (qt_cancelIo(handle, &overlapped))
- dataReadNotifier->waitForNotified(-1, &overlapped);
- else
- qErrnoWarning("QWindowsPipeReader: qt_cancelIo on handle %x failed.", handle);
- }
+ stop();
}
/*!
@@ -89,9 +81,9 @@ void QWindowsPipeReader::setHandle(HANDLE hPipeReadEnd)
readBuffer.clear();
actualReadBufferSize = 0;
handle = hPipeReadEnd;
- ZeroMemory(&overlapped, sizeof(overlapped));
pipeBroken = false;
readyReadEmitted = false;
+ stopped = false;
if (hPipeReadEnd != INVALID_HANDLE_VALUE) {
dataReadNotifier->setHandle(hPipeReadEnd);
dataReadNotifier->setEnabled(true);
@@ -100,13 +92,24 @@ void QWindowsPipeReader::setHandle(HANDLE hPipeReadEnd)
/*!
Stops the asynchronous read sequence.
- This function assumes that the file already has been closed.
- It does not cancel any I/O operation.
+ If the read sequence is running then the I/O operation is canceled.
*/
void QWindowsPipeReader::stop()
{
- dataReadNotifier->setEnabled(false);
+ stopped = true;
+ if (readSequenceStarted) {
+ if (qt_cancelIo(handle, &overlapped)) {
+ dataReadNotifier->waitForNotified(-1, &overlapped);
+ } else {
+ const DWORD dwError = GetLastError();
+ if (dwError != ERROR_NOT_FOUND) {
+ qErrnoWarning(dwError, "QWindowsPipeReader: qt_cancelIo on handle %x failed.",
+ handle);
+ }
+ }
+ }
readSequenceStarted = false;
+ dataReadNotifier->setEnabled(false);
handle = INVALID_HANDLE_VALUE;
}
@@ -119,7 +122,7 @@ qint64 QWindowsPipeReader::bytesAvailable() const
}
/*!
- Stops the asynchronous read sequence.
+ Copies at most \c{maxlen} bytes from the internal read buffer to \c{data}.
*/
qint64 QWindowsPipeReader::read(char *data, qint64 maxlen)
{
@@ -147,9 +150,7 @@ qint64 QWindowsPipeReader::read(char *data, qint64 maxlen)
}
if (!pipeBroken) {
- if (!actualReadBufferSize)
- emitReadyReadTimer->stop();
- if (!readSequenceStarted)
+ if (!readSequenceStarted && !stopped)
startAsyncRead();
if (readSoFar == 0)
return -2; // signal EWOULDBLOCK
@@ -172,13 +173,41 @@ void QWindowsPipeReader::notified(quint32 numberOfBytesRead, quint32 errorCode,
{
if (&overlapped != notifiedOverlapped)
return;
- if (!completeAsyncRead(numberOfBytesRead, errorCode)) {
+
+ switch (errorCode) {
+ case ERROR_SUCCESS:
+ break;
+ case ERROR_MORE_DATA:
+ // This is not an error. We're connected to a message mode
+ // pipe and the message didn't fit into the pipe's system
+ // buffer. We will read the remaining data in the next call.
+ break;
+ case ERROR_BROKEN_PIPE:
+ case ERROR_PIPE_NOT_CONNECTED:
pipeBroken = true;
+ break;
+ default:
+ emit winError(errorCode, QLatin1String("QWindowsPipeReader::completeAsyncRead"));
+ pipeBroken = true;
+ break;
+ }
+
+ readSequenceStarted = false;
+
+ // After the reader was stopped, the only reason why this function can be called is the
+ // completion of a cancellation. No signals should be emitted, and no new read sequence should
+ // be started in this case.
+ if (stopped)
+ return;
+
+ if (pipeBroken) {
emit pipeClosed();
return;
}
+
+ actualReadBufferSize += numberOfBytesRead;
+ readBuffer.truncate(actualReadBufferSize);
startAsyncRead();
- emitReadyReadTimer->stop();
readyReadEmitted = true;
emit readyRead();
}
@@ -206,6 +235,7 @@ void QWindowsPipeReader::startAsyncRead()
char *ptr = readBuffer.reserve(bytesToRead);
readSequenceStarted = true;
+ ZeroMemory(&overlapped, sizeof(overlapped));
if (ReadFile(handle, ptr, bytesToRead, NULL, &overlapped)) {
// We get notified by the QWinOverlappedIoNotifier - even in the synchronous case.
return;
@@ -241,38 +271,6 @@ void QWindowsPipeReader::startAsyncRead()
/*!
\internal
- Sets the correct size of the read buffer after a read operation.
- Returns \c false, if an error occurred or the connection dropped.
- */
-bool QWindowsPipeReader::completeAsyncRead(DWORD bytesRead, DWORD errorCode)
-{
- readSequenceStarted = false;
-
- switch (errorCode) {
- case ERROR_SUCCESS:
- break;
- case ERROR_MORE_DATA:
- // This is not an error. We're connected to a message mode
- // pipe and the message didn't fit into the pipe's system
- // buffer. We will read the remaining data in the next call.
- break;
- case ERROR_BROKEN_PIPE:
- case ERROR_PIPE_NOT_CONNECTED:
- return false;
- default:
- emit winError(errorCode, QLatin1String("QWindowsPipeReader::completeAsyncRead"));
- return false;
- }
-
- actualReadBufferSize += bytesRead;
- readBuffer.truncate(actualReadBufferSize);
- if (!emitReadyReadTimer->isActive())
- emitReadyReadTimer->start();
- return true;
-}
-
-/*!
- \internal
Returns the number of available bytes in the pipe.
Sets QWindowsPipeReader::pipeBroken to true if the connection is broken.
*/
diff --git a/src/corelib/io/qwindowspipereader_p.h b/src/corelib/io/qwindowspipereader_p.h
index 53872e2552..c8a66d9511 100644
--- a/src/corelib/io/qwindowspipereader_p.h
+++ b/src/corelib/io/qwindowspipereader_p.h
@@ -47,7 +47,6 @@
#include <qbytearray.h>
#include <qobject.h>
-#include <qtimer.h>
#include <private/qringbuffer_p.h>
#include <qt_windows.h>
@@ -89,7 +88,6 @@ private Q_SLOTS:
void notified(quint32 numberOfBytesRead, quint32 errorCode, OVERLAPPED *notifiedOverlapped);
private:
- bool completeAsyncRead(DWORD bytesRead, DWORD errorCode);
DWORD checkPipeState();
private:
@@ -99,7 +97,7 @@ private:
qint64 readBufferMaxSize;
QRingBuffer readBuffer;
qint64 actualReadBufferSize;
- QTimer *emitReadyReadTimer;
+ bool stopped;
bool readSequenceStarted;
bool pipeBroken;
bool readyReadEmitted;
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 60ac75133c..2f3cfc1c0a 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -479,6 +479,11 @@ public:
Q_GLOBAL_STATIC(QEmptyItemModel, qEmptyModel)
+
+QAbstractItemModelPrivate::~QAbstractItemModelPrivate()
+{
+}
+
QAbstractItemModel *QAbstractItemModelPrivate::staticEmptyModel()
{
return qEmptyModel();
diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h b/src/corelib/itemmodels/qabstractitemmodel_p.h
index 075e6a9018..acf376eff1 100644
--- a/src/corelib/itemmodels/qabstractitemmodel_p.h
+++ b/src/corelib/itemmodels/qabstractitemmodel_p.h
@@ -71,6 +71,8 @@ class Q_CORE_EXPORT QAbstractItemModelPrivate : public QObjectPrivate
public:
QAbstractItemModelPrivate() : QObjectPrivate(), supportedDragActions(-1), roleNames(defaultRoleNames()) {}
+ ~QAbstractItemModelPrivate();
+
void removePersistentIndexData(QPersistentModelIndexData *data);
void movePersistentIndexes(const QVector<QPersistentModelIndexData *> &indexes, int change, const QModelIndex &parent, Qt::Orientation orientation);
void rowsAboutToBeInserted(const QModelIndex &parent, int first, int last);
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index a215557aed..14c0f803b9 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -131,5 +131,22 @@ QAppleOperatingSystemVersion qt_apple_os_version()
return v;
}
+// -------------------------------------------------------------------------
+
+QMacAutoReleasePool::QMacAutoReleasePool()
+ : pool([[NSAutoreleasePool alloc] init])
+{
+}
+
+QMacAutoReleasePool::~QMacAutoReleasePool()
+{
+ // Drain behaves the same as release, with the advantage that
+ // if we're ever used in a garbage-collected environment, the
+ // drain acts as a hint to the garbage collector to collect.
+ [pool drain];
+}
+
+// -------------------------------------------------------------------------
+
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 05d58ac028..524bfd26cc 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -325,6 +325,7 @@ struct QCoreApplicationData {
#ifndef QT_NO_LIBRARY
app_libpaths = 0;
#endif
+ applicationNameSet = false;
}
~QCoreApplicationData() {
#ifndef QT_NO_LIBRARY
@@ -369,8 +370,8 @@ struct QCoreApplicationData {
QString orgName, orgDomain;
QString application; // application name, initially from argv[0], can then be modified.
- QString applicationNameCompat; // for QDesktopServices. Only set explicitly.
QString applicationVersion;
+ bool applicationNameSet; // true if setApplicationName was called
#ifndef QT_NO_LIBRARY
QStringList *app_libpaths;
@@ -752,7 +753,8 @@ void QCoreApplication::init()
QCoreApplication::self = this;
// Store app name (so it's still available after QCoreApplication is destroyed)
- coreappdata()->application = d_func()->appName();
+ if (!coreappdata()->applicationNameSet)
+ coreappdata()->application = d_func()->appName();
QLoggingRegistry::instance()->init();
@@ -2349,13 +2351,13 @@ QString QCoreApplication::organizationDomain()
*/
void QCoreApplication::setApplicationName(const QString &application)
{
+ coreappdata()->applicationNameSet = !application.isEmpty();
QString newAppName = application;
if (newAppName.isEmpty() && QCoreApplication::self)
newAppName = QCoreApplication::self->d_func()->appName();
if (coreappdata()->application == newAppName)
return;
coreappdata()->application = newAppName;
- coreappdata()->applicationNameCompat = newAppName;
#ifndef QT_NO_QOBJECT
if (QCoreApplication::self)
emit QCoreApplication::self->applicationNameChanged();
@@ -2373,7 +2375,7 @@ QString QCoreApplication::applicationName()
// Exported for QDesktopServices (Qt4 behavior compatibility)
Q_CORE_EXPORT QString qt_applicationName_noFallback()
{
- return coreappdata()->applicationNameCompat;
+ return coreappdata()->applicationNameSet ? coreappdata()->application : QString();
}
/*!
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
index cc8e961be1..1509996199 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp
@@ -203,9 +203,9 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
}
}
- // Dispatch accumulated user events
- if (sendPostedEvents(flags))
- return true;
+ // Additional user events have to be handled before timer events, but the function may not
+ // return yet.
+ const bool userEventsSent = sendPostedEvents(flags);
emit aboutToBlock();
const QVector<HANDLE> timerHandles = d->timerIdToHandle.values().toVector();
@@ -228,6 +228,9 @@ bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
return true;
}
emit awake();
+
+ if (userEventsSent)
+ return true;
} while (flags & QEventLoop::WaitForMoreEvents);
return false;
}
@@ -484,7 +487,8 @@ bool QEventDispatcherWinRT::event(QEvent *e)
QEventDispatcherWinRTPrivate::QEventDispatcherWinRTPrivate()
{
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- HRESULT hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(), &timerFactory);
+ HRESULT hr;
+ hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_System_Threading_ThreadPoolTimer).Get(), &timerFactory);
Q_ASSERT_SUCCEEDED(hr);
HANDLE interruptHandle = CreateEventEx(NULL, NULL, NULL, SYNCHRONIZE|EVENT_MODIFY_STATE);
timerIdToHandle.insert(INTERRUPT_HANDLE, interruptHandle);
diff --git a/src/corelib/kernel/qfunctions_winrt.h b/src/corelib/kernel/qfunctions_winrt.h
index 3fff52a22c..7efd042456 100644
--- a/src/corelib/kernel/qfunctions_winrt.h
+++ b/src/corelib/kernel/qfunctions_winrt.h
@@ -131,9 +131,13 @@ generate_inline_return_func2(_putenv_s, errno_t, const char *, const char *)
generate_inline_return_func0(tzset, void)
generate_inline_return_func0(_tzset, void)
-QT_BEGIN_NAMESPACE
+namespace Microsoft {
+ namespace WRL {
+ template <typename T> class ComPtr;
+ }
+}
-namespace Microsoft { namespace WRL { template <typename T> class ComPtr; } }
+QT_BEGIN_NAMESPACE
namespace QWinRTFunctions {
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index 097f641d19..108a01aab7 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
static inline QString keyBase()
{
- return QStringLiteral("%1%2%3");
+ return QStringLiteral("%1%2:%3");
}
static QString qt_convertJString(jstring string)
@@ -72,15 +72,15 @@ typedef QHash<QString, jclass> JClassHash;
Q_GLOBAL_STATIC(JClassHash, cachedClasses)
Q_GLOBAL_STATIC(QReadWriteLock, cachedClassesLock)
-static QString toDotEncodedClassName(const char *className)
+static QByteArray toBinaryEncClassName(const QByteArray &className)
{
- return QString::fromLatin1(className).replace(QLatin1Char('/'), QLatin1Char('.'));
+ return QByteArray(className).replace('/', '.');
}
-static jclass getCachedClass(const QString &classDotEnc, bool *isCached = 0)
+static jclass getCachedClass(const QByteArray &classBinEnc, bool *isCached = 0)
{
QReadLocker locker(cachedClassesLock);
- const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(classDotEnc);
+ const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(QString::fromLatin1(classBinEnc));
const bool found = (it != cachedClasses->constEnd());
if (isCached != 0)
@@ -89,10 +89,12 @@ static jclass getCachedClass(const QString &classDotEnc, bool *isCached = 0)
return found ? it.value() : 0;
}
-static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env)
+inline static jclass loadClass(const QByteArray &className, JNIEnv *env, bool binEncoded = false)
{
+ const QByteArray &binEncClassName = binEncoded ? className : toBinaryEncClassName(className);
+
bool isCached = false;
- jclass clazz = getCachedClass(classDotEnc, &isCached);
+ jclass clazz = getCachedClass(binEncClassName, &isCached);
if (clazz != 0 || isCached)
return clazz;
@@ -102,11 +104,12 @@ static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env)
QWriteLocker locker(cachedClassesLock);
// did we lose the race?
- const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(classDotEnc);
+ const QLatin1String key(binEncClassName);
+ const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(key);
if (it != cachedClasses->constEnd())
return it.value();
- QJNIObjectPrivate stringName = QJNIObjectPrivate::fromString(classDotEnc);
+ QJNIObjectPrivate stringName = QJNIObjectPrivate::fromString(key);
QJNIObjectPrivate classObject = classLoader.callObjectMethod("loadClass",
"(Ljava/lang/String;)Ljava/lang/Class;",
stringName.object());
@@ -114,27 +117,40 @@ static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env)
if (!exceptionCheckAndClear(env) && classObject.isValid())
clazz = static_cast<jclass>(env->NewGlobalRef(classObject.object()));
- cachedClasses->insert(classDotEnc, clazz);
+ cachedClasses->insert(key, clazz);
return clazz;
}
-inline static jclass loadClass(const char *className, JNIEnv *env)
-{
- return loadClassDotEnc(toDotEncodedClassName(className), env);
-}
-
typedef QHash<QString, jmethodID> JMethodIDHash;
Q_GLOBAL_STATIC(JMethodIDHash, cachedMethodID)
Q_GLOBAL_STATIC(QReadWriteLock, cachedMethodIDLock)
+static inline jmethodID getMethodID(JNIEnv *env,
+ jclass clazz,
+ const char *name,
+ const char *sig,
+ bool isStatic = false)
+{
+ jmethodID id = isStatic ? env->GetStaticMethodID(clazz, name, sig)
+ : env->GetMethodID(clazz, name, sig);
+
+ if (exceptionCheckAndClear(env))
+ return 0;
+
+ return id;
+}
+
static jmethodID getCachedMethodID(JNIEnv *env,
jclass clazz,
+ const QByteArray &className,
const char *name,
const char *sig,
bool isStatic = false)
{
- // TODO: We need to use something else then the ref. from clazz to avoid collisions.
- const QString key = keyBase().arg(size_t(clazz)).arg(QLatin1String(name)).arg(QLatin1String(sig));
+ if (className.isEmpty())
+ return getMethodID(env, clazz, name, sig, isStatic);
+
+ const QString key = keyBase().arg(QLatin1String(className)).arg(QLatin1String(name)).arg(QLatin1String(sig));
QHash<QString, jmethodID>::const_iterator it;
{
@@ -150,14 +166,7 @@ static jmethodID getCachedMethodID(JNIEnv *env,
if (it != cachedMethodID->constEnd())
return it.value();
- jmethodID id = 0;
- if (isStatic)
- id = env->GetStaticMethodID(clazz, name, sig);
- else
- id = env->GetMethodID(clazz, name, sig);
-
- if (exceptionCheckAndClear(env))
- id = 0;
+ jmethodID id = getMethodID(env, clazz, name, sig, isStatic);
cachedMethodID->insert(key, id);
return id;
@@ -168,13 +177,32 @@ typedef QHash<QString, jfieldID> JFieldIDHash;
Q_GLOBAL_STATIC(JFieldIDHash, cachedFieldID)
Q_GLOBAL_STATIC(QReadWriteLock, cachedFieldIDLock)
+static inline jfieldID getFieldID(JNIEnv *env,
+ jclass clazz,
+ const char *name,
+ const char *sig,
+ bool isStatic = false)
+{
+ jfieldID id = isStatic ? env->GetStaticFieldID(clazz, name, sig)
+ : env->GetFieldID(clazz, name, sig);
+
+ if (exceptionCheckAndClear(env))
+ return 0;
+
+ return id;
+}
+
static jfieldID getCachedFieldID(JNIEnv *env,
jclass clazz,
+ const QByteArray &className,
const char *name,
const char *sig,
bool isStatic = false)
{
- const QString key = keyBase().arg(size_t(clazz)).arg(QLatin1String(name)).arg(QLatin1String(sig));
+ if (className.isNull())
+ return getFieldID(env, clazz, name, sig, isStatic);
+
+ const QString key = keyBase().arg(QLatin1String(className)).arg(QLatin1String(name)).arg(QLatin1String(sig));
QHash<QString, jfieldID>::const_iterator it;
{
@@ -190,14 +218,7 @@ static jfieldID getCachedFieldID(JNIEnv *env,
if (it != cachedFieldID->constEnd())
return it.value();
- jfieldID id = 0;
- if (isStatic)
- id = env->GetStaticFieldID(clazz, name, sig);
- else
- id = env->GetFieldID(clazz, name, sig);
-
- if (exceptionCheckAndClear(env))
- id = 0;
+ jfieldID id = getFieldID(env, clazz, name, sig, isStatic);
cachedFieldID->insert(key, id);
return id;
@@ -251,7 +272,7 @@ JNIEnv *QJNIEnvironmentPrivate::operator->()
jclass QJNIEnvironmentPrivate::findClass(const char *className, JNIEnv *env)
{
- const QString &classDotEnc = toDotEncodedClassName(className);
+ const QByteArray &classDotEnc = toBinaryEncClassName(className);
bool isCached = false;
jclass clazz = getCachedClass(classDotEnc, &isCached);
@@ -260,9 +281,10 @@ jclass QJNIEnvironmentPrivate::findClass(const char *className, JNIEnv *env)
if (found)
return clazz;
+ const QLatin1String key(classDotEnc);
if (env != 0) { // We got an env. pointer (We expect this to be the right env. and call FindClass())
QWriteLocker locker(cachedClassesLock);
- const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(classDotEnc);
+ const QHash<QString, jclass>::const_iterator &it = cachedClasses->constFind(key);
// Did we lose the race?
if (it != cachedClasses->constEnd())
return it.value();
@@ -274,11 +296,11 @@ jclass QJNIEnvironmentPrivate::findClass(const char *className, JNIEnv *env)
}
if (clazz != 0)
- cachedClasses->insert(classDotEnc, clazz);
+ cachedClasses->insert(key, clazz);
}
if (clazz == 0) // We didn't get an env. pointer or we got one with the WRONG class loader...
- clazz = loadClassDotEnc(classDotEnc, QJNIEnvironmentPrivate());
+ clazz = loadClass(classDotEnc, QJNIEnvironmentPrivate(), true);
return clazz;
}
@@ -319,11 +341,12 @@ QJNIObjectPrivate::QJNIObjectPrivate(const char *className)
: d(new QJNIObjectData())
{
QJNIEnvironmentPrivate env;
- d->m_jclass = loadClass(className, env);
+ d->m_className = toBinaryEncClassName(className);
+ d->m_jclass = loadClass(d->m_className, env, true);
d->m_own_jclass = false;
if (d->m_jclass) {
// get default constructor
- jmethodID constructorId = getCachedMethodID(env, d->m_jclass, "<init>", "()V");
+ jmethodID constructorId = getCachedMethodID(env, d->m_jclass, d->m_className, "<init>", "()V");
if (constructorId) {
jobject obj = env->NewObject(d->m_jclass, constructorId);
if (obj) {
@@ -338,10 +361,11 @@ QJNIObjectPrivate::QJNIObjectPrivate(const char *className, const char *sig, ...
: d(new QJNIObjectData())
{
QJNIEnvironmentPrivate env;
- d->m_jclass = loadClass(className, env);
+ d->m_className = toBinaryEncClassName(className);
+ d->m_jclass = loadClass(d->m_className, env, true);
d->m_own_jclass = false;
if (d->m_jclass) {
- jmethodID constructorId = getCachedMethodID(env, d->m_jclass, "<init>", sig);
+ jmethodID constructorId = getCachedMethodID(env, d->m_jclass, d->m_className, "<init>", sig);
if (constructorId) {
va_list args;
va_start(args, sig);
@@ -359,10 +383,11 @@ QJNIObjectPrivate::QJNIObjectPrivate(const char *className, const char *sig, con
: d(new QJNIObjectData())
{
QJNIEnvironmentPrivate env;
- d->m_jclass = loadClass(className, env);
+ d->m_className = toBinaryEncClassName(className);
+ d->m_jclass = loadClass(d->m_className, env, true);
d->m_own_jclass = false;
if (d->m_jclass) {
- jmethodID constructorId = getCachedMethodID(env, d->m_jclass, "<init>", sig);
+ jmethodID constructorId = getCachedMethodID(env, d->m_jclass, d->m_className, "<init>", sig);
if (constructorId) {
jobject obj = env->NewObjectV(d->m_jclass, constructorId, args);
if (obj) {
@@ -380,7 +405,7 @@ QJNIObjectPrivate::QJNIObjectPrivate(jclass clazz)
d->m_jclass = static_cast<jclass>(env->NewGlobalRef(clazz));
if (d->m_jclass) {
// get default constructor
- jmethodID constructorId = getCachedMethodID(env, d->m_jclass, "<init>", "()V");
+ jmethodID constructorId = getMethodID(env, d->m_jclass, "<init>", "()V");
if (constructorId) {
jobject obj = env->NewObject(d->m_jclass, constructorId);
if (obj) {
@@ -398,7 +423,7 @@ QJNIObjectPrivate::QJNIObjectPrivate(jclass clazz, const char *sig, ...)
if (clazz) {
d->m_jclass = static_cast<jclass>(env->NewGlobalRef(clazz));
if (d->m_jclass) {
- jmethodID constructorId = getCachedMethodID(env, d->m_jclass, "<init>", sig);
+ jmethodID constructorId = getMethodID(env, d->m_jclass, "<init>", sig);
if (constructorId) {
va_list args;
va_start(args, sig);
@@ -420,7 +445,7 @@ QJNIObjectPrivate::QJNIObjectPrivate(jclass clazz, const char *sig, const QVaLis
if (clazz) {
d->m_jclass = static_cast<jclass>(env->NewGlobalRef(clazz));
if (d->m_jclass) {
- jmethodID constructorId = getCachedMethodID(env, d->m_jclass, "<init>", sig);
+ jmethodID constructorId = getMethodID(env, d->m_jclass, "<init>", sig);
if (constructorId) {
jobject obj = env->NewObjectV(d->m_jclass, constructorId, args);
if (obj) {
@@ -440,15 +465,15 @@ QJNIObjectPrivate::QJNIObjectPrivate(jobject obj)
QJNIEnvironmentPrivate env;
d->m_jobject = env->NewGlobalRef(obj);
- jclass objectClass = env->GetObjectClass(d->m_jobject);
- d->m_jclass = static_cast<jclass>(env->NewGlobalRef(objectClass));
- env->DeleteLocalRef(objectClass);
+ jclass cls = env->GetObjectClass(obj);
+ d->m_jclass = static_cast<jclass>(env->NewGlobalRef(cls));
+ env->DeleteLocalRef(cls);
}
template <>
void QJNIObjectPrivate::callMethodV<void>(const char *methodName, const char *sig, va_list args) const
{
QJNIEnvironmentPrivate env;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
env->CallVoidMethodV(d->m_jobject, id, args);
}
@@ -468,7 +493,7 @@ jboolean QJNIObjectPrivate::callMethodV<jboolean>(const char *methodName, const
{
QJNIEnvironmentPrivate env;
jboolean res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallBooleanMethodV(d->m_jobject, id, args);
}
@@ -490,7 +515,7 @@ jbyte QJNIObjectPrivate::callMethodV<jbyte>(const char *methodName, const char *
{
QJNIEnvironmentPrivate env;
jbyte res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallByteMethodV(d->m_jobject, id, args);
}
@@ -512,7 +537,7 @@ jchar QJNIObjectPrivate::callMethodV<jchar>(const char *methodName, const char *
{
QJNIEnvironmentPrivate env;
jchar res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallCharMethodV(d->m_jobject, id, args);
}
@@ -534,7 +559,7 @@ jshort QJNIObjectPrivate::callMethodV<jshort>(const char *methodName, const char
{
QJNIEnvironmentPrivate env;
jshort res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallShortMethodV(d->m_jobject, id, args);
}
@@ -556,7 +581,7 @@ jint QJNIObjectPrivate::callMethodV<jint>(const char *methodName, const char *si
{
QJNIEnvironmentPrivate env;
jint res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallIntMethodV(d->m_jobject, id, args);
}
@@ -578,7 +603,7 @@ jlong QJNIObjectPrivate::callMethodV<jlong>(const char *methodName, const char *
{
QJNIEnvironmentPrivate env;
jlong res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallLongMethodV(d->m_jobject, id, args);
}
@@ -600,7 +625,7 @@ jfloat QJNIObjectPrivate::callMethodV<jfloat>(const char *methodName, const char
{
QJNIEnvironmentPrivate env;
jfloat res = 0.f;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallFloatMethodV(d->m_jobject, id, args);
}
@@ -622,7 +647,7 @@ jdouble QJNIObjectPrivate::callMethodV<jdouble>(const char *methodName, const ch
{
QJNIEnvironmentPrivate env;
jdouble res = 0.;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallDoubleMethodV(d->m_jobject, id, args);
}
@@ -702,7 +727,7 @@ void QJNIObjectPrivate::callStaticMethodV<void>(const char *className,
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
env->CallStaticVoidMethodV(clazz, id, args);
}
@@ -728,7 +753,7 @@ void QJNIObjectPrivate::callStaticMethodV<void>(jclass clazz,
va_list args)
{
QJNIEnvironmentPrivate env;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
env->CallStaticVoidMethodV(clazz, id, args);
}
@@ -756,7 +781,7 @@ jboolean QJNIObjectPrivate::callStaticMethodV<jboolean>(const char *className,
jboolean res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticBooleanMethodV(clazz, id, args);
}
@@ -786,7 +811,7 @@ jboolean QJNIObjectPrivate::callStaticMethodV<jboolean>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jboolean res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticBooleanMethodV(clazz, id, args);
}
@@ -817,7 +842,7 @@ jbyte QJNIObjectPrivate::callStaticMethodV<jbyte>(const char *className,
jbyte res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticByteMethodV(clazz, id, args);
}
@@ -847,7 +872,7 @@ jbyte QJNIObjectPrivate::callStaticMethodV<jbyte>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jbyte res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticByteMethodV(clazz, id, args);
}
@@ -878,7 +903,7 @@ jchar QJNIObjectPrivate::callStaticMethodV<jchar>(const char *className,
jchar res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticCharMethodV(clazz, id, args);
}
@@ -908,7 +933,7 @@ jchar QJNIObjectPrivate::callStaticMethodV<jchar>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jchar res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticCharMethodV(clazz, id, args);
}
@@ -939,7 +964,7 @@ jshort QJNIObjectPrivate::callStaticMethodV<jshort>(const char *className,
jshort res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticShortMethodV(clazz, id, args);
}
@@ -969,7 +994,7 @@ jshort QJNIObjectPrivate::callStaticMethodV<jshort>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jshort res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticShortMethodV(clazz, id, args);
}
@@ -1000,7 +1025,7 @@ jint QJNIObjectPrivate::callStaticMethodV<jint>(const char *className,
jint res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticIntMethodV(clazz, id, args);
}
@@ -1030,7 +1055,7 @@ jint QJNIObjectPrivate::callStaticMethodV<jint>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jint res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticIntMethodV(clazz, id, args);
}
@@ -1061,7 +1086,7 @@ jlong QJNIObjectPrivate::callStaticMethodV<jlong>(const char *className,
jlong res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticLongMethodV(clazz, id, args);
}
@@ -1091,7 +1116,7 @@ jlong QJNIObjectPrivate::callStaticMethodV<jlong>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jlong res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticLongMethodV(clazz, id, args);
}
@@ -1122,7 +1147,7 @@ jfloat QJNIObjectPrivate::callStaticMethodV<jfloat>(const char *className,
jfloat res = 0.f;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticFloatMethodV(clazz, id, args);
}
@@ -1152,7 +1177,7 @@ jfloat QJNIObjectPrivate::callStaticMethodV<jfloat>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jfloat res = 0.f;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticFloatMethodV(clazz, id, args);
}
@@ -1183,7 +1208,7 @@ jdouble QJNIObjectPrivate::callStaticMethodV<jdouble>(const char *className,
jdouble res = 0.;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticDoubleMethodV(clazz, id, args);
}
@@ -1213,7 +1238,7 @@ jdouble QJNIObjectPrivate::callStaticMethodV<jdouble>(jclass clazz,
{
QJNIEnvironmentPrivate env;
jdouble res = 0.;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticDoubleMethodV(clazz, id, args);
}
@@ -1348,7 +1373,7 @@ QJNIObjectPrivate QJNIObjectPrivate::callObjectMethodV(const char *methodName,
{
QJNIEnvironmentPrivate env;
jobject res = 0;
- jmethodID id = getCachedMethodID(env, d->m_jclass, methodName, sig);
+ jmethodID id = getCachedMethodID(env, d->m_jclass, d->m_className, methodName, sig);
if (id) {
res = env->CallObjectMethodV(d->m_jobject, id, args);
if (res && env->ExceptionCheck())
@@ -1428,7 +1453,7 @@ QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethodV(const char *classNa
jobject res = 0;
jclass clazz = loadClass(className, env);
if (clazz) {
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getCachedMethodID(env, clazz, toBinaryEncClassName(className), methodName, sig, true);
if (id) {
res = env->CallStaticObjectMethodV(clazz, id, args);
if (res && env->ExceptionCheck())
@@ -1460,7 +1485,7 @@ QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethodV(jclass clazz,
{
QJNIEnvironmentPrivate env;
jobject res = 0;
- jmethodID id = getCachedMethodID(env, clazz, methodName, sig, true);
+ jmethodID id = getMethodID(env, clazz, methodName, sig, true);
if (id) {
res = env->CallStaticObjectMethodV(clazz, id, args);
if (res && env->ExceptionCheck())
@@ -1489,7 +1514,7 @@ jboolean QJNIObjectPrivate::getField<jboolean>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jboolean res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "Z");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "Z");
if (id)
res = env->GetBooleanField(d->m_jobject, id);
@@ -1501,7 +1526,7 @@ jbyte QJNIObjectPrivate::getField<jbyte>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jbyte res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "B");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "B");
if (id)
res = env->GetByteField(d->m_jobject, id);
@@ -1513,7 +1538,7 @@ jchar QJNIObjectPrivate::getField<jchar>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jchar res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "C");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "C");
if (id)
res = env->GetCharField(d->m_jobject, id);
@@ -1525,7 +1550,7 @@ jshort QJNIObjectPrivate::getField<jshort>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jshort res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "S");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "S");
if (id)
res = env->GetShortField(d->m_jobject, id);
@@ -1537,7 +1562,7 @@ jint QJNIObjectPrivate::getField<jint>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jint res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "I");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "I");
if (id)
res = env->GetIntField(d->m_jobject, id);
@@ -1549,7 +1574,7 @@ jlong QJNIObjectPrivate::getField<jlong>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jlong res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "J");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "J");
if (id)
res = env->GetLongField(d->m_jobject, id);
@@ -1561,7 +1586,7 @@ jfloat QJNIObjectPrivate::getField<jfloat>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jfloat res = 0.f;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "F");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "F");
if (id)
res = env->GetFloatField(d->m_jobject, id);
@@ -1573,7 +1598,7 @@ jdouble QJNIObjectPrivate::getField<jdouble>(const char *fieldName) const
{
QJNIEnvironmentPrivate env;
jdouble res = 0.;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "D");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "D");
if (id)
res = env->GetDoubleField(d->m_jobject, id);
@@ -1585,7 +1610,7 @@ jboolean QJNIObjectPrivate::getStaticField<jboolean>(jclass clazz, const char *f
{
QJNIEnvironmentPrivate env;
jboolean res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "Z", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "Z", true);
if (id)
res = env->GetStaticBooleanField(clazz, id);
@@ -1596,12 +1621,15 @@ template <>
jboolean QJNIObjectPrivate::getStaticField<jboolean>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jboolean res = 0;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jboolean>(clazz, fieldName);
+ if (clazz == 0)
+ return 0;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "Z", true);
+ if (id == 0)
+ return 0;
+
+ return env->GetStaticBooleanField(clazz, id);
}
template <>
@@ -1609,7 +1637,7 @@ jbyte QJNIObjectPrivate::getStaticField<jbyte>(jclass clazz, const char *fieldNa
{
QJNIEnvironmentPrivate env;
jbyte res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "B", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "B", true);
if (id)
res = env->GetStaticByteField(clazz, id);
@@ -1620,12 +1648,15 @@ template <>
jbyte QJNIObjectPrivate::getStaticField<jbyte>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jbyte res = 0;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jbyte>(clazz, fieldName);
+ if (clazz == 0)
+ return 0;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "B", true);
+ if (id == 0)
+ return 0;
+
+ return env->GetStaticByteField(clazz, id);
}
template <>
@@ -1633,7 +1664,7 @@ jchar QJNIObjectPrivate::getStaticField<jchar>(jclass clazz, const char *fieldNa
{
QJNIEnvironmentPrivate env;
jchar res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "C", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "C", true);
if (id)
res = env->GetStaticCharField(clazz, id);
@@ -1644,12 +1675,15 @@ template <>
jchar QJNIObjectPrivate::getStaticField<jchar>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jchar res = 0;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jchar>(clazz, fieldName);
+ if (clazz == 0)
+ return 0;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "C", true);
+ if (id == 0)
+ return 0;
+
+ return env->GetStaticCharField(clazz, id);
}
template <>
@@ -1657,7 +1691,7 @@ jshort QJNIObjectPrivate::getStaticField<jshort>(jclass clazz, const char *field
{
QJNIEnvironmentPrivate env;
jshort res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "S", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "S", true);
if (id)
res = env->GetStaticShortField(clazz, id);
@@ -1668,12 +1702,15 @@ template <>
jshort QJNIObjectPrivate::getStaticField<jshort>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jshort res = 0;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jshort>(clazz, fieldName);
+ if (clazz == 0)
+ return 0;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "S", true);
+ if (id == 0)
+ return 0;
+
+ return env->GetStaticShortField(clazz, id);
}
template <>
@@ -1681,7 +1718,7 @@ jint QJNIObjectPrivate::getStaticField<jint>(jclass clazz, const char *fieldName
{
QJNIEnvironmentPrivate env;
jint res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "I", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "I", true);
if (id)
res = env->GetStaticIntField(clazz, id);
@@ -1692,12 +1729,15 @@ template <>
jint QJNIObjectPrivate::getStaticField<jint>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jint res = 0;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jint>(clazz, fieldName);
+ if (clazz == 0)
+ return 0;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "I", true);
+ if (id == 0)
+ return 0;
+
+ return env->GetStaticIntField(clazz, id);
}
template <>
@@ -1705,7 +1745,7 @@ jlong QJNIObjectPrivate::getStaticField<jlong>(jclass clazz, const char *fieldNa
{
QJNIEnvironmentPrivate env;
jlong res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "J", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "J", true);
if (id)
res = env->GetStaticLongField(clazz, id);
@@ -1716,12 +1756,15 @@ template <>
jlong QJNIObjectPrivate::getStaticField<jlong>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jlong res = 0;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jlong>(clazz, fieldName);
+ if (clazz == 0)
+ return 0;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "J", true);
+ if (id == 0)
+ return 0;
+
+ return env->GetStaticLongField(clazz, id);
}
template <>
@@ -1729,7 +1772,7 @@ jfloat QJNIObjectPrivate::getStaticField<jfloat>(jclass clazz, const char *field
{
QJNIEnvironmentPrivate env;
jfloat res = 0.f;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "F", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "F", true);
if (id)
res = env->GetStaticFloatField(clazz, id);
@@ -1740,12 +1783,15 @@ template <>
jfloat QJNIObjectPrivate::getStaticField<jfloat>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jfloat res = 0.f;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jfloat>(clazz, fieldName);
+ if (clazz == 0)
+ return 0.f;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "F", true);
+ if (id == 0)
+ return 0.f;
+
+ return env->GetStaticFloatField(clazz, id);
}
template <>
@@ -1753,7 +1799,7 @@ jdouble QJNIObjectPrivate::getStaticField<jdouble>(jclass clazz, const char *fie
{
QJNIEnvironmentPrivate env;
jdouble res = 0.;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "D", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "D", true);
if (id)
res = env->GetStaticDoubleField(clazz, id);
@@ -1764,12 +1810,15 @@ template <>
jdouble QJNIObjectPrivate::getStaticField<jdouble>(const char *className, const char *fieldName)
{
QJNIEnvironmentPrivate env;
- jdouble res = 0.;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticField<jdouble>(clazz, fieldName);
+ if (clazz == 0)
+ return 0.;
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, "D", true);
+ if (id == 0)
+ return 0.;
+
+ return env->GetStaticDoubleField(clazz, id);
}
QJNIObjectPrivate QJNIObjectPrivate::getObjectField(const char *fieldName,
@@ -1777,7 +1826,7 @@ QJNIObjectPrivate QJNIObjectPrivate::getObjectField(const char *fieldName,
{
QJNIEnvironmentPrivate env;
jobject res = 0;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, sig);
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, sig);
if (id) {
res = env->GetObjectField(d->m_jobject, id);
if (res && env->ExceptionCheck())
@@ -1794,12 +1843,21 @@ QJNIObjectPrivate QJNIObjectPrivate::getStaticObjectField(const char *className,
const char *sig)
{
QJNIEnvironmentPrivate env;
- QJNIObjectPrivate res;
jclass clazz = loadClass(className, env);
- if (clazz)
- res = getStaticObjectField(clazz, fieldName, sig);
+ if (clazz == 0)
+ return QJNIObjectPrivate();
- return res;
+ jfieldID id = getCachedFieldID(env, clazz, toBinaryEncClassName(className), fieldName, sig, true);
+ if (id == 0)
+ return QJNIObjectPrivate();
+
+ jobject res = env->GetStaticObjectField(clazz, id);
+ if (res && env->ExceptionCheck())
+ res = 0;
+
+ QJNIObjectPrivate obj(res);
+ env->DeleteLocalRef(res);
+ return obj;
}
QJNIObjectPrivate QJNIObjectPrivate::getStaticObjectField(jclass clazz,
@@ -1808,7 +1866,7 @@ QJNIObjectPrivate QJNIObjectPrivate::getStaticObjectField(jclass clazz,
{
QJNIEnvironmentPrivate env;
jobject res = 0;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, sig, true);
+ jfieldID id = getFieldID(env, clazz, fieldName, sig, true);
if (id) {
res = env->GetStaticObjectField(clazz, id);
if (res && env->ExceptionCheck())
@@ -1824,7 +1882,7 @@ template <>
void QJNIObjectPrivate::setField<jboolean>(const char *fieldName, jboolean value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "Z");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "Z");
if (id)
env->SetBooleanField(d->m_jobject, id, value);
@@ -1834,7 +1892,7 @@ template <>
void QJNIObjectPrivate::setField<jbyte>(const char *fieldName, jbyte value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "B");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "B");
if (id)
env->SetByteField(d->m_jobject, id, value);
@@ -1844,7 +1902,7 @@ template <>
void QJNIObjectPrivate::setField<jchar>(const char *fieldName, jchar value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "C");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "C");
if (id)
env->SetCharField(d->m_jobject, id, value);
@@ -1854,7 +1912,7 @@ template <>
void QJNIObjectPrivate::setField<jshort>(const char *fieldName, jshort value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "S");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "S");
if (id)
env->SetShortField(d->m_jobject, id, value);
@@ -1864,7 +1922,7 @@ template <>
void QJNIObjectPrivate::setField<jint>(const char *fieldName, jint value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "I");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "I");
if (id)
env->SetIntField(d->m_jobject, id, value);
@@ -1874,7 +1932,7 @@ template <>
void QJNIObjectPrivate::setField<jlong>(const char *fieldName, jlong value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "J");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "J");
if (id)
env->SetLongField(d->m_jobject, id, value);
@@ -1884,7 +1942,7 @@ template <>
void QJNIObjectPrivate::setField<jfloat>(const char *fieldName, jfloat value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "F");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "F");
if (id)
env->SetFloatField(d->m_jobject, id, value);
@@ -1894,7 +1952,7 @@ template <>
void QJNIObjectPrivate::setField<jdouble>(const char *fieldName, jdouble value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "D");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "D");
if (id)
env->SetDoubleField(d->m_jobject, id, value);
@@ -1904,7 +1962,7 @@ template <>
void QJNIObjectPrivate::setField<jbooleanArray>(const char *fieldName, jbooleanArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[Z");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[Z");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1914,7 +1972,7 @@ template <>
void QJNIObjectPrivate::setField<jbyteArray>(const char *fieldName, jbyteArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[B");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[B");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1924,7 +1982,7 @@ template <>
void QJNIObjectPrivate::setField<jcharArray>(const char *fieldName, jcharArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[C");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[C");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1934,7 +1992,7 @@ template <>
void QJNIObjectPrivate::setField<jshortArray>(const char *fieldName, jshortArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[S");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[S");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1944,7 +2002,7 @@ template <>
void QJNIObjectPrivate::setField<jintArray>(const char *fieldName, jintArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[I");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[I");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1954,7 +2012,7 @@ template <>
void QJNIObjectPrivate::setField<jlongArray>(const char *fieldName, jlongArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[J");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[J");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1964,7 +2022,7 @@ template <>
void QJNIObjectPrivate::setField<jfloatArray>(const char *fieldName, jfloatArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[F");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[F");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1974,7 +2032,7 @@ template <>
void QJNIObjectPrivate::setField<jdoubleArray>(const char *fieldName, jdoubleArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "[D");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "[D");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1984,7 +2042,7 @@ template <>
void QJNIObjectPrivate::setField<jstring>(const char *fieldName, jstring value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, "Ljava/lang/String;");
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, "Ljava/lang/String;");
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -1996,7 +2054,7 @@ void QJNIObjectPrivate::setField<jobject>(const char *fieldName,
jobject value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, sig);
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, sig);
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -2008,7 +2066,7 @@ void QJNIObjectPrivate::setField<jobjectArray>(const char *fieldName,
jobjectArray value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, d->m_jclass, fieldName, sig);
+ jfieldID id = getCachedFieldID(env, d->m_jclass, d->m_className, fieldName, sig);
if (id)
env->SetObjectField(d->m_jobject, id, value);
@@ -2020,7 +2078,7 @@ void QJNIObjectPrivate::setStaticField<jboolean>(jclass clazz,
jboolean value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "Z", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "Z", true);
if (id)
env->SetStaticBooleanField(clazz, id, value);
}
@@ -2032,8 +2090,14 @@ void QJNIObjectPrivate::setStaticField<jboolean>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jboolean>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "Z", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticBooleanField(clazz, id, value);
}
template <>
@@ -2042,7 +2106,7 @@ void QJNIObjectPrivate::setStaticField<jbyte>(jclass clazz,
jbyte value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "B", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "B", true);
if (id)
env->SetStaticByteField(clazz, id, value);
}
@@ -2054,8 +2118,14 @@ void QJNIObjectPrivate::setStaticField<jbyte>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jbyte>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "B", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticByteField(clazz, id, value);
}
template <>
@@ -2064,7 +2134,7 @@ void QJNIObjectPrivate::setStaticField<jchar>(jclass clazz,
jchar value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "C", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "C", true);
if (id)
env->SetStaticCharField(clazz, id, value);
}
@@ -2076,8 +2146,14 @@ void QJNIObjectPrivate::setStaticField<jchar>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jchar>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "C", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticCharField(clazz, id, value);
}
template <>
@@ -2086,7 +2162,7 @@ void QJNIObjectPrivate::setStaticField<jshort>(jclass clazz,
jshort value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "S", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "S", true);
if (id)
env->SetStaticShortField(clazz, id, value);
}
@@ -2098,8 +2174,14 @@ void QJNIObjectPrivate::setStaticField<jshort>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jshort>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "S", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticShortField(clazz, id, value);
}
template <>
@@ -2108,7 +2190,7 @@ void QJNIObjectPrivate::setStaticField<jint>(jclass clazz,
jint value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "I", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "I", true);
if (id)
env->SetStaticIntField(clazz, id, value);
}
@@ -2120,8 +2202,14 @@ void QJNIObjectPrivate::setStaticField<jint>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jint>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "I", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticIntField(clazz, id, value);
}
template <>
@@ -2130,7 +2218,7 @@ void QJNIObjectPrivate::setStaticField<jlong>(jclass clazz,
jlong value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "J", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "J", true);
if (id)
env->SetStaticLongField(clazz, id, value);
}
@@ -2142,8 +2230,14 @@ void QJNIObjectPrivate::setStaticField<jlong>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jlong>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "J", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticLongField(clazz, id, value);
}
template <>
@@ -2152,7 +2246,7 @@ void QJNIObjectPrivate::setStaticField<jfloat>(jclass clazz,
jfloat value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "F", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "F", true);
if (id)
env->SetStaticFloatField(clazz, id, value);
}
@@ -2164,8 +2258,14 @@ void QJNIObjectPrivate::setStaticField<jfloat>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jfloat>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "F", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticFloatField(clazz, id, value);
}
template <>
@@ -2174,7 +2274,7 @@ void QJNIObjectPrivate::setStaticField<jdouble>(jclass clazz,
jdouble value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, "D", true);
+ jfieldID id = getFieldID(env, clazz, fieldName, "D", true);
if (id)
env->SetStaticDoubleField(clazz, id, value);
}
@@ -2186,8 +2286,14 @@ void QJNIObjectPrivate::setStaticField<jdouble>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jdouble>(clazz, fieldName, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, "D", true);
+ if (id == 0)
+ return;
+
+ env->SetStaticDoubleField(clazz, id, value);
}
template <>
@@ -2197,7 +2303,7 @@ void QJNIObjectPrivate::setStaticField<jobject>(jclass clazz,
jobject value)
{
QJNIEnvironmentPrivate env;
- jfieldID id = getCachedFieldID(env, clazz, fieldName, sig, true);
+ jfieldID id = getFieldID(env, clazz, fieldName, sig, true);
if (id)
env->SetStaticObjectField(clazz, id, value);
}
@@ -2210,8 +2316,14 @@ void QJNIObjectPrivate::setStaticField<jobject>(const char *className,
{
QJNIEnvironmentPrivate env;
jclass clazz = loadClass(className, env);
- if (clazz)
- setStaticField<jobject>(clazz, fieldName, sig, value);
+ if (clazz == 0)
+ return;
+
+ jfieldID id = getCachedFieldID(env, clazz, className, fieldName, sig, true);
+ if (id == 0)
+ return;
+
+ env->SetStaticObjectField(clazz, id, value);
}
QJNIObjectPrivate QJNIObjectPrivate::fromString(const QString &string)
diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h
index ae9c7c3a7e..1c23f2ab76 100644
--- a/src/corelib/kernel/qjni_p.h
+++ b/src/corelib/kernel/qjni_p.h
@@ -82,6 +82,7 @@ public:
jobject m_jobject;
jclass m_jclass;
bool m_own_jclass;
+ QByteArray m_className;
};
class Q_CORE_EXPORT QJNIObjectPrivate
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 1e2a860d8c..1b214e9f74 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -1357,12 +1357,16 @@ namespace QtPrivate
enum { Value = sizeof(checkType(static_cast<T*>(0))) == sizeof(yes_type) };
};
+ template<typename T, typename Enable = void>
+ struct IsGadgetHelper { enum { Value = false }; };
+
template<typename T>
- struct IsGadgetHelper
+ struct IsGadgetHelper<T, typename T::QtGadgetHelper>
{
- template<typename X> static typename X::QtGadgetHelper *checkType(X*);
- static char checkType(void*);
- enum { Value = sizeof(checkType(static_cast<T*>(0))) == sizeof(void*) };
+ template <typename X>
+ static char checkType(void (X::*)());
+ static void *checkType(void (T::*)());
+ enum { Value = sizeof(checkType(&T::qt_check_for_QGADGET_macro)) == sizeof(void *) };
};
@@ -1381,6 +1385,7 @@ QT_WARNING_DISABLE_CLANG("-Wlocal-type-template-args")
// qt_getEnumMetaObject(T) which returns 'char'
enum { Value = sizeof(qt_getEnumMetaObject(declval())) == sizeof(QMetaObject*) };
};
+ template<> struct IsQEnumHelper<void> { enum { Value = false }; };
QT_WARNING_POP
template<typename T, typename Enable = void>
@@ -1768,7 +1773,7 @@ template <typename T>
struct QMetaTypeIdQObject<T, QMetaType::IsGadget>
{
enum {
- Defined = 1
+ Defined = QtPrivate::is_default_constructible<T>::value
};
static int qt_metatype_id()
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index fb4c5cceb9..3ca9c890e8 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -65,6 +65,16 @@ QT_BEGIN_NAMESPACE
static int DIRECT_CONNECTION_ONLY = 0;
+
+QDynamicMetaObjectData::~QDynamicMetaObjectData()
+{
+}
+
+QAbstractDynamicMetaObject::~QAbstractDynamicMetaObject()
+{
+}
+
+
struct QSlotObjectBaseDeleter { // for use with QScopedPointer<QSlotObjectBase,...>
static void cleanup(QtPrivate::QSlotObjectBase *slot) {
if (slot) slot->destroyIfLastRef();
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index 1b64103e40..bd5ee006bf 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -406,7 +406,7 @@ void Q_CORE_EXPORT qDeleteInEventHandler(QObject *o);
struct QAbstractDynamicMetaObject;
struct Q_CORE_EXPORT QDynamicMetaObjectData
{
- virtual ~QDynamicMetaObjectData() {}
+ virtual ~QDynamicMetaObjectData();
virtual void objectDestroyed(QObject *) { delete this; }
virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *) = 0;
@@ -415,6 +415,8 @@ struct Q_CORE_EXPORT QDynamicMetaObjectData
struct Q_CORE_EXPORT QAbstractDynamicMetaObject : public QDynamicMetaObjectData, public QMetaObject
{
+ ~QAbstractDynamicMetaObject();
+
virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *) Q_DECL_OVERRIDE { return this; }
virtual int createProperty(const char *, const char *) { return -1; }
virtual int metaCall(QObject *, QMetaObject::Call c, int _id, void **a) Q_DECL_OVERRIDE
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 31e8a670e9..4d01264906 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -172,6 +172,7 @@ private: \
#define Q_GADGET \
public: \
static const QMetaObject staticMetaObject; \
+ void qt_check_for_QGADGET_macro(); \
typedef void QtGadgetHelper; \
private: \
Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index 4d37368b2e..5cc54b1def 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -163,6 +163,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
#if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED();
Q_UNUSED(mode)
+ Q_UNUSED(permissions)
memory = 0;
#elif defined(Q_OS_WINRT)
memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0);
diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp
index 19d84c2b3e..e333104add 100644
--- a/src/corelib/kernel/qsystemerror.cpp
+++ b/src/corelib/kernel/qsystemerror.cpp
@@ -145,7 +145,7 @@ static QString standardLibraryErrorString(int errorCode)
return ret.trimmed();
}
-QString QSystemError::toString()
+QString QSystemError::toString() const
{
switch(errorScope) {
case NativeError:
diff --git a/src/corelib/kernel/qsystemerror_p.h b/src/corelib/kernel/qsystemerror_p.h
index e7efb9bbf3..29e9e440e4 100644
--- a/src/corelib/kernel/qsystemerror_p.h
+++ b/src/corelib/kernel/qsystemerror_p.h
@@ -62,9 +62,9 @@ public:
inline QSystemError(int error, ErrorScope scope);
inline QSystemError();
- QString toString();
- inline ErrorScope scope();
- inline int error();
+ QString toString() const;
+ inline ErrorScope scope() const;
+ inline int error() const;
//data members
int errorCode;
@@ -83,12 +83,12 @@ QSystemError::QSystemError()
}
-QSystemError::ErrorScope QSystemError::scope()
+QSystemError::ErrorScope QSystemError::scope() const
{
return errorScope;
}
-int QSystemError::error()
+int QSystemError::error() const
{
return errorCode;
}
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index ed856a538c..3206ff66e3 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -54,12 +54,12 @@ QMimeTypePrivate::QMimeTypePrivate()
{}
QMimeTypePrivate::QMimeTypePrivate(const QMimeType &other)
- : name(other.d->name),
+ : loaded(other.d->loaded),
+ name(other.d->name),
localeComments(other.d->localeComments),
genericIconName(other.d->genericIconName),
iconName(other.d->iconName),
- globPatterns(other.d->globPatterns),
- loaded(other.d->loaded)
+ globPatterns(other.d->globPatterns)
{}
void QMimeTypePrivate::clear()
diff --git a/src/corelib/mimetypes/qmimetype_p.h b/src/corelib/mimetypes/qmimetype_p.h
index bf533bbcb0..2161dd8901 100644
--- a/src/corelib/mimetypes/qmimetype_p.h
+++ b/src/corelib/mimetypes/qmimetype_p.h
@@ -66,12 +66,12 @@ public:
void addGlobPattern(const QString &pattern);
+ bool loaded; // QSharedData leaves a 4 byte gap, so don't put 8 byte members first
QString name;
LocaleHash localeComments;
QString genericIconName;
QString iconName;
QStringList globPatterns;
- bool loaded;
};
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri
index 338b3d0972..8b64f93467 100644
--- a/src/corelib/plugin/plugin.pri
+++ b/src/corelib/plugin/plugin.pri
@@ -13,6 +13,7 @@ HEADERS += \
plugin/qmachparser_p.h
SOURCES += \
+ plugin/qfactoryinterface.cpp \
plugin/qpluginloader.cpp \
plugin/qfactoryloader.cpp \
plugin/quuid.cpp \
diff --git a/tests/auto/tools/qmake/testdata/functions/1.cpp b/src/corelib/plugin/qfactoryinterface.cpp
index 8bdc2e59e8..0307d58315 100644
--- a/tests/auto/tools/qmake/testdata/functions/1.cpp
+++ b/src/corelib/plugin/qfactoryinterface.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the test suite of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -30,3 +30,14 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include "qfactoryinterface.h"
+
+QT_BEGIN_NAMESPACE
+
+QFactoryInterface::~QFactoryInterface()
+{
+ // must be empty until ### Qt 6
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qfactoryinterface.h b/src/corelib/plugin/qfactoryinterface.h
index e20864cd31..86a46fabfa 100644
--- a/src/corelib/plugin/qfactoryinterface.h
+++ b/src/corelib/plugin/qfactoryinterface.h
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
struct Q_CORE_EXPORT QFactoryInterface
{
- virtual ~QFactoryInterface() {}
+ virtual ~QFactoryInterface();
virtual QStringList keys() const = 0;
};
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index f128acd54e..81b38ea4c4 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -101,7 +101,35 @@ QT_BEGIN_NAMESPACE
parallel group state.
*/
+/*!
+ \property QAbstractTransition::transitionType
+
+ \brief indicates whether this transition is an internal transition, or an external transition.
+
+ Internal and external transitions behave the same, except for the case of a transition whose
+ source state is a compound state and whose target(s) is a descendant of the source. In such a
+ case, an internal transition will not exit and re-enter its source state, while an external one
+ will.
+
+ By default, the type is an external transition.
+*/
+
+/*!
+ \enum QAbstractTransition::TransitionType
+
+ This enum specifies the kind of transition. By default, the type is an external transition.
+
+ \value ExternalTransition Any state that is the source state of a transition (which is not a
+ target-less transition) is left, and re-entered when necessary.
+ \value InternalTransition If the target state of a transition is a sub-state of a compound state,
+ and that compound state is the source state, an internal transition will
+ not leave the source state.
+
+ \sa QAbstractTransition::transitionType
+*/
+
QAbstractTransitionPrivate::QAbstractTransitionPrivate()
+ : transitionType(QAbstractTransition::ExternalTransition)
{
}
@@ -249,6 +277,24 @@ void QAbstractTransition::setTargetStates(const QList<QAbstractState*> &targets)
}
/*!
+ Returns the type of the transition.
+*/
+QAbstractTransition::TransitionType QAbstractTransition::transitionType() const
+{
+ Q_D(const QAbstractTransition);
+ return d->transitionType;
+}
+
+/*!
+ Sets the type of the transition to \a type.
+*/
+void QAbstractTransition::setTransitionType(TransitionType type)
+{
+ Q_D(QAbstractTransition);
+ d->transitionType = type;
+}
+
+/*!
Returns the state machine that this transition is part of, or 0 if the
transition is not part of a state machine.
*/
diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h
index 768a364a4b..bf32b3e825 100644
--- a/src/corelib/statemachine/qabstracttransition.h
+++ b/src/corelib/statemachine/qabstracttransition.h
@@ -59,7 +59,14 @@ class Q_CORE_EXPORT QAbstractTransition : public QObject
Q_PROPERTY(QState* sourceState READ sourceState)
Q_PROPERTY(QAbstractState* targetState READ targetState WRITE setTargetState NOTIFY targetStateChanged)
Q_PROPERTY(QList<QAbstractState*> targetStates READ targetStates WRITE setTargetStates NOTIFY targetStatesChanged)
+ Q_PROPERTY(TransitionType transitionType READ transitionType WRITE setTransitionType)
public:
+ enum TransitionType {
+ ExternalTransition,
+ InternalTransition
+ };
+ Q_ENUM(TransitionType)
+
QAbstractTransition(QState *sourceState = 0);
virtual ~QAbstractTransition();
@@ -69,6 +76,9 @@ public:
QList<QAbstractState*> targetStates() const;
void setTargetStates(const QList<QAbstractState*> &targets);
+ TransitionType transitionType() const;
+ void setTransitionType(TransitionType type);
+
QStateMachine *machine() const;
#ifndef QT_NO_ANIMATION
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index d89d057497..4b0644acd9 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -73,6 +73,7 @@ public:
void emitTriggered();
QList<QPointer<QAbstractState> > targetStates;
+ QAbstractTransition::TransitionType transitionType;
#ifndef QT_NO_ANIMATION
QList<QAbstractAnimation*> animations;
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index 096d667bc3..c10127fa68 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -102,6 +102,10 @@ QEventTransitionPrivate::QEventTransitionPrivate()
registered = false;
}
+QEventTransitionPrivate::~QEventTransitionPrivate()
+{
+}
+
QEventTransitionPrivate *QEventTransitionPrivate::get(QEventTransition *q)
{
return q->d_func();
diff --git a/src/corelib/statemachine/qeventtransition_p.h b/src/corelib/statemachine/qeventtransition_p.h
index 64ab945187..3e430d86a9 100644
--- a/src/corelib/statemachine/qeventtransition_p.h
+++ b/src/corelib/statemachine/qeventtransition_p.h
@@ -55,14 +55,15 @@ class Q_CORE_EXPORT QEventTransitionPrivate : public QAbstractTransitionPrivate
Q_DECLARE_PUBLIC(QEventTransition)
public:
QEventTransitionPrivate();
+ ~QEventTransitionPrivate();
static QEventTransitionPrivate *get(QEventTransition *q);
void unregister();
void maybeRegister();
- bool registered;
QObject *object;
+ bool registered;
QEvent::Type eventType;
};
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 28bb176b56..2ce0c13522 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -103,8 +103,8 @@ public:
QAbstractState *initialState;
QState::ChildMode childMode;
mutable bool childStatesListNeedsRefresh;
- mutable QList<QAbstractState*> childStatesList;
mutable bool transitionsListNeedsRefresh;
+ mutable QList<QAbstractState*> childStatesList;
mutable QList<QAbstractTransition*> transitionsList;
#ifndef QT_NO_PROPERTIES
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 3d2da77390..3a1a852ef5 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -177,6 +177,100 @@ QT_BEGIN_NAMESPACE
// #define QSTATEMACHINE_DEBUG
// #define QSTATEMACHINE_RESTORE_PROPERTIES_DEBUG
+struct CalculationCache {
+ struct TransitionInfo {
+ QList<QAbstractState*> effectiveTargetStates;
+ QSet<QAbstractState*> exitSet;
+ QAbstractState *transitionDomain;
+
+ bool effectiveTargetStatesIsKnown: 1;
+ bool exitSetIsKnown : 1;
+ bool transitionDomainIsKnown : 1;
+
+ TransitionInfo()
+ : transitionDomain(0)
+ , effectiveTargetStatesIsKnown(false)
+ , exitSetIsKnown(false)
+ , transitionDomainIsKnown(false)
+ {}
+ };
+
+ typedef QHash<QAbstractTransition *, TransitionInfo> TransitionInfoCache;
+ TransitionInfoCache cache;
+
+ bool effectiveTargetStates(QAbstractTransition *t, QList<QAbstractState *> *targets) const
+ {
+ Q_ASSERT(targets);
+
+ TransitionInfoCache::const_iterator cacheIt = cache.find(t);
+ if (cacheIt == cache.end() || !cacheIt->effectiveTargetStatesIsKnown)
+ return false;
+
+ *targets = cacheIt->effectiveTargetStates;
+ return true;
+ }
+
+ void insert(QAbstractTransition *t, const QList<QAbstractState *> &targets)
+ {
+ TransitionInfoCache::iterator cacheIt = cache.find(t);
+ TransitionInfo &ti = cacheIt == cache.end()
+ ? *cache.insert(t, TransitionInfo())
+ : *cacheIt;
+
+ Q_ASSERT(!ti.effectiveTargetStatesIsKnown);
+ ti.effectiveTargetStates = targets;
+ ti.effectiveTargetStatesIsKnown = true;
+ }
+
+ bool exitSet(QAbstractTransition *t, QSet<QAbstractState *> *exits) const
+ {
+ Q_ASSERT(exits);
+
+ TransitionInfoCache::const_iterator cacheIt = cache.find(t);
+ if (cacheIt == cache.end() || !cacheIt->exitSetIsKnown)
+ return false;
+
+ *exits = cacheIt->exitSet;
+ return true;
+ }
+
+ void insert(QAbstractTransition *t, const QSet<QAbstractState *> &exits)
+ {
+ TransitionInfoCache::iterator cacheIt = cache.find(t);
+ TransitionInfo &ti = cacheIt == cache.end()
+ ? *cache.insert(t, TransitionInfo())
+ : *cacheIt;
+
+ Q_ASSERT(!ti.exitSetIsKnown);
+ ti.exitSet = exits;
+ ti.exitSetIsKnown = true;
+ }
+
+ bool transitionDomain(QAbstractTransition *t, QAbstractState **domain) const
+ {
+ Q_ASSERT(domain);
+
+ TransitionInfoCache::const_iterator cacheIt = cache.find(t);
+ if (cacheIt == cache.end() || !cacheIt->transitionDomainIsKnown)
+ return false;
+
+ *domain = cacheIt->transitionDomain;
+ return true;
+ }
+
+ void insert(QAbstractTransition *t, QAbstractState *domain)
+ {
+ TransitionInfoCache::iterator cacheIt = cache.find(t);
+ TransitionInfo &ti = cacheIt == cache.end()
+ ? *cache.insert(t, TransitionInfo())
+ : *cacheIt;
+
+ Q_ASSERT(!ti.transitionDomainIsKnown);
+ ti.transitionDomain = domain;
+ ti.transitionDomainIsKnown = true;
+ }
+};
+
/* The function as described in http://www.w3.org/TR/2014/WD-scxml-20140529/ :
function isDescendant(state1, state2)
@@ -205,6 +299,17 @@ static bool containsDecendantOf(const QSet<QAbstractState *> &states, const QAbs
return false;
}
+static int descendantDepth(const QAbstractState *state, const QAbstractState *ancestor)
+{
+ int depth = 0;
+ for (const QAbstractState *it = state; it != 0; it = it->parentState()) {
+ if (it == ancestor)
+ break;
+ ++depth;
+ }
+ return depth;
+}
+
/* The function as described in http://www.w3.org/TR/2014/WD-scxml-20140529/ :
function getProperAncestors(state1, state2)
@@ -245,8 +350,14 @@ function getEffectiveTargetStates(transition)
targets.add(s)
return targets
*/
-static QSet<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *transition)
+static QList<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *transition, CalculationCache *cache)
{
+ Q_ASSERT(cache);
+
+ QList<QAbstractState *> targetsList;
+ if (cache->effectiveTargetStates(transition, &targetsList))
+ return targetsList;
+
QSet<QAbstractState *> targets;
foreach (QAbstractState *s, transition->targetStates()) {
if (QHistoryState *historyState = QStateMachinePrivate::toHistoryState(s)) {
@@ -266,7 +377,10 @@ static QSet<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *tran
targets.insert(s);
}
}
- return targets;
+
+ targetsList = targets.toList();
+ cache->insert(transition, targetsList);
+ return targetsList;
}
template <class T>
@@ -348,10 +462,25 @@ static int indexOfDescendant(QState *s, QAbstractState *desc)
bool QStateMachinePrivate::transitionStateEntryLessThan(QAbstractTransition *t1, QAbstractTransition *t2)
{
QState *s1 = t1->sourceState(), *s2 = t2->sourceState();
- if (s1 == s2)
- return QStatePrivate::get(s1)->transitions().indexOf(t1) < QStatePrivate::get(s2)->transitions().indexOf(t2);
- else
- return stateEntryLessThan(t1->sourceState(), t2->sourceState());
+ if (s1 == s2) {
+ QList<QAbstractTransition*> transitions = QStatePrivate::get(s1)->transitions();
+ return transitions.indexOf(t1) < transitions.indexOf(t2);
+ } else if (isDescendant(s1, s2)) {
+ return true;
+ } else if (isDescendant(s2, s1)) {
+ return false;
+ } else {
+ Q_ASSERT(s1->machine() != 0);
+ QStateMachinePrivate *mach = QStateMachinePrivate::get(s1->machine());
+ QState *lca = mach->findLCA(QList<QAbstractState*>() << s1 << s2);
+ Q_ASSERT(lca != 0);
+ int s1Depth = descendantDepth(s1, lca);
+ int s2Depth = descendantDepth(s2, lca);
+ if (s1Depth == s2Depth)
+ return (indexOfDescendant(lca, s1) < indexOfDescendant(lca, s2));
+ else
+ return s1Depth > s2Depth;
+ }
}
bool QStateMachinePrivate::stateEntryLessThan(QAbstractState *s1, QAbstractState *s2)
@@ -417,8 +546,9 @@ QState *QStateMachinePrivate::findLCCA(const QList<QAbstractState*> &states) con
return findLCA(states, true);
}
-QList<QAbstractTransition*> QStateMachinePrivate::selectTransitions(QEvent *event)
+QList<QAbstractTransition*> QStateMachinePrivate::selectTransitions(QEvent *event, CalculationCache *cache)
{
+ Q_ASSERT(cache);
Q_Q(const QStateMachine);
QVarLengthArray<QAbstractState *> configuration_sorted;
@@ -453,7 +583,7 @@ QList<QAbstractTransition*> QStateMachinePrivate::selectTransitions(QEvent *even
}
if (!enabledTransitions.isEmpty()) {
- removeConflictingTransitions(enabledTransitions);
+ removeConflictingTransitions(enabledTransitions, cache);
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": enabled transitions after removing conflicts:" << enabledTransitions;
#endif
@@ -486,15 +616,20 @@ function removeConflictingTransitions(enabledTransitions):
Note: the implementation below does not build the transitionsToRemove, but removes them in-place.
*/
-void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransition*> &enabledTransitions)
+void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransition*> &enabledTransitions, CalculationCache *cache)
{
+ Q_ASSERT(cache);
+
+ if (enabledTransitions.size() < 2)
+ return; // There is no transition to conflict with.
+
QList<QAbstractTransition*> filteredTransitions;
filteredTransitions.reserve(enabledTransitions.size());
std::sort(enabledTransitions.begin(), enabledTransitions.end(), transitionStateEntryLessThan);
foreach (QAbstractTransition *t1, enabledTransitions) {
bool t1Preempted = false;
- QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(QList<QAbstractTransition*>() << t1);
+ QSet<QAbstractState*> exitSetT1 = computeExitSet_Unordered(t1, cache);
QList<QAbstractTransition*>::iterator t2It = filteredTransitions.begin();
while (t2It != filteredTransitions.end()) {
QAbstractTransition *t2 = *t2It;
@@ -505,7 +640,7 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio
break;
}
- QSet<QAbstractState*> exitSetT2 = computeExitSet_Unordered(QList<QAbstractTransition*>() << t2);
+ QSet<QAbstractState*> exitSetT2 = computeExitSet_Unordered(t2, cache);
if (exitSetT1.intersect(exitSetT2).isEmpty()) {
// No conflict, no cry. Next patient please.
++t2It;
@@ -529,17 +664,20 @@ void QStateMachinePrivate::removeConflictingTransitions(QList<QAbstractTransitio
enabledTransitions = filteredTransitions;
}
-void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransition*> &enabledTransitions)
+void QStateMachinePrivate::microstep(QEvent *event, const QList<QAbstractTransition*> &enabledTransitions,
+ CalculationCache *cache)
{
+ Q_ASSERT(cache);
+
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": begin microstep( enabledTransitions:" << enabledTransitions << ')';
qDebug() << q_func() << ": configuration before exiting states:" << configuration;
#endif
- QList<QAbstractState*> exitedStates = computeExitSet(enabledTransitions);
+ QList<QAbstractState*> exitedStates = computeExitSet(enabledTransitions, cache);
QHash<RestorableId, QVariant> pendingRestorables = computePendingRestorables(exitedStates);
QSet<QAbstractState*> statesForDefaultEntry;
- QList<QAbstractState*> enteredStates = computeEntrySet(enabledTransitions, statesForDefaultEntry);
+ QList<QAbstractState*> enteredStates = computeEntrySet(enabledTransitions, statesForDefaultEntry, cache);
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q_func() << ": computed exit set:" << exitedStates;
@@ -598,42 +736,61 @@ function computeExitSet(transitions)
statesToExit.add(s)
return statesToExit
*/
-QList<QAbstractState*> QStateMachinePrivate::computeExitSet(const QList<QAbstractTransition*> &enabledTransitions)
+QList<QAbstractState*> QStateMachinePrivate::computeExitSet(const QList<QAbstractTransition*> &enabledTransitions,
+ CalculationCache *cache)
{
- QList<QAbstractState*> statesToExit_sorted = computeExitSet_Unordered(enabledTransitions).toList();
+ Q_ASSERT(cache);
+
+ QList<QAbstractState*> statesToExit_sorted = computeExitSet_Unordered(enabledTransitions, cache).toList();
std::sort(statesToExit_sorted.begin(), statesToExit_sorted.end(), stateExitLessThan);
return statesToExit_sorted;
}
-QSet<QAbstractState*> QStateMachinePrivate::computeExitSet_Unordered(const QList<QAbstractTransition*> &enabledTransitions)
+QSet<QAbstractState*> QStateMachinePrivate::computeExitSet_Unordered(const QList<QAbstractTransition*> &enabledTransitions,
+ CalculationCache *cache)
{
+ Q_ASSERT(cache);
+
QSet<QAbstractState*> statesToExit;
- for (int i = 0; i < enabledTransitions.size(); ++i) {
- QAbstractTransition *t = enabledTransitions.at(i);
- QList<QAbstractState *> effectiveTargetStates = getEffectiveTargetStates(t).toList();
- QAbstractState *domain = getTransitionDomain(t, effectiveTargetStates);
- if (domain == Q_NULLPTR && !t->targetStates().isEmpty()) {
- // So we didn't find the least common ancestor for the source and target states of the
- // transition. If there were not target states, that would be fine: then the transition
- // will fire any events or signals, but not exit the state.
- //
- // However, there are target states, so it's either a node without a parent (or parent's
- // parent, etc), or the state belongs to a different state machine. Either way, this
- // makes the state machine invalid.
- if (error == QStateMachine::NoError)
- setError(QStateMachine::NoCommonAncestorForTransitionError, t->sourceState());
- QList<QAbstractState *> lst = pendingErrorStates.toList();
- lst.prepend(t->sourceState());
-
- domain = findLCCA(lst);
- Q_ASSERT(domain != 0);
- }
+ foreach (QAbstractTransition *t, enabledTransitions)
+ statesToExit.unite(computeExitSet_Unordered(t, cache));
+ return statesToExit;
+}
- foreach (QAbstractState* s, configuration) {
- if (isDescendant(s, domain))
- statesToExit.insert(s);
- }
- }
+QSet<QAbstractState*> QStateMachinePrivate::computeExitSet_Unordered(QAbstractTransition *t,
+ CalculationCache *cache)
+{
+ Q_ASSERT(cache);
+
+ QSet<QAbstractState*> statesToExit;
+ if (cache->exitSet(t, &statesToExit))
+ return statesToExit;
+
+ QList<QAbstractState *> effectiveTargetStates = getEffectiveTargetStates(t, cache);
+ QAbstractState *domain = getTransitionDomain(t, effectiveTargetStates, cache);
+ if (domain == Q_NULLPTR && !t->targetStates().isEmpty()) {
+ // So we didn't find the least common ancestor for the source and target states of the
+ // transition. If there were not target states, that would be fine: then the transition
+ // will fire any events or signals, but not exit the state.
+ //
+ // However, there are target states, so it's either a node without a parent (or parent's
+ // parent, etc), or the state belongs to a different state machine. Either way, this
+ // makes the state machine invalid.
+ if (error == QStateMachine::NoError)
+ setError(QStateMachine::NoCommonAncestorForTransitionError, t->sourceState());
+ QList<QAbstractState *> lst = pendingErrorStates.toList();
+ lst.prepend(t->sourceState());
+
+ domain = findLCCA(lst);
+ Q_ASSERT(domain != 0);
+ }
+
+ foreach (QAbstractState* s, configuration) {
+ if (isDescendant(s, domain))
+ statesToExit.insert(s);
+ }
+
+ cache->insert(t, statesToExit);
return statesToExit;
}
@@ -695,8 +852,11 @@ void QStateMachinePrivate::executeTransitionContent(QEvent *event, const QList<Q
}
QList<QAbstractState*> QStateMachinePrivate::computeEntrySet(const QList<QAbstractTransition *> &enabledTransitions,
- QSet<QAbstractState *> &statesForDefaultEntry)
+ QSet<QAbstractState *> &statesForDefaultEntry,
+ CalculationCache *cache)
{
+ Q_ASSERT(cache);
+
QSet<QAbstractState*> statesToEnter;
if (pendingErrorStates.isEmpty()) {
foreach (QAbstractTransition *t, enabledTransitions) {
@@ -704,8 +864,8 @@ QList<QAbstractState*> QStateMachinePrivate::computeEntrySet(const QList<QAbstra
addDescendantStatesToEnter(s, statesToEnter, statesForDefaultEntry);
}
- QList<QAbstractState *> effectiveTargetStates = getEffectiveTargetStates(t).toList();
- QAbstractState *ancestor = getTransitionDomain(t, effectiveTargetStates);
+ QList<QAbstractState *> effectiveTargetStates = getEffectiveTargetStates(t, cache);
+ QAbstractState *ancestor = getTransitionDomain(t, effectiveTargetStates, cache);
foreach (QAbstractState *s, effectiveTargetStates) {
addAncestorStatesToEnter(s, ancestor, statesToEnter, statesForDefaultEntry);
}
@@ -742,33 +902,42 @@ function getTransitionDomain(t)
else:
return findLCCA([t.source].append(tstates))
*/
-QAbstractState *QStateMachinePrivate::getTransitionDomain(QAbstractTransition *t, const QList<QAbstractState *> &effectiveTargetStates) const
+QAbstractState *QStateMachinePrivate::getTransitionDomain(QAbstractTransition *t,
+ const QList<QAbstractState *> &effectiveTargetStates,
+ CalculationCache *cache) const
{
+ Q_ASSERT(cache);
+
if (effectiveTargetStates.isEmpty())
return 0;
-#if 0
- // Qt only has external transitions, so skip the special case for the internal transitions
- if (QState *tSource = t->sourceState()) {
- if (isCompound(tSource)) {
- bool allDescendants = true;
- foreach (QAbstractState *s, effectiveTargetStates) {
- if (!isDescendant(s, tSource)) {
- allDescendants = false;
- break;
+ QAbstractState *domain = Q_NULLPTR;
+ if (cache->transitionDomain(t, &domain))
+ return domain;
+
+ if (t->transitionType() == QAbstractTransition::InternalTransition) {
+ if (QState *tSource = t->sourceState()) {
+ if (isCompound(tSource)) {
+ bool allDescendants = true;
+ foreach (QAbstractState *s, effectiveTargetStates) {
+ if (!isDescendant(s, tSource)) {
+ allDescendants = false;
+ break;
+ }
}
- }
- if (allDescendants)
- return tSource;
+ if (allDescendants)
+ return tSource;
+ }
}
}
-#endif
QList<QAbstractState *> states(effectiveTargetStates);
if (QAbstractState *src = t->sourceState())
states.prepend(src);
- return findLCCA(states);
+ domain = findLCCA(states);
+ cache->insert(t, domain);
+ return domain;
}
void QStateMachinePrivate::enterStates(QEvent *event, const QList<QAbstractState*> &exitedStates_sorted,
@@ -1676,6 +1845,8 @@ void QStateMachinePrivate::_q_start()
registerMultiThreadedSignalTransitions();
+ startupHook();
+
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": starting";
#endif
@@ -1683,6 +1854,7 @@ void QStateMachinePrivate::_q_start()
processingScheduled = true; // we call _q_process() below
QList<QAbstractTransition*> transitions;
+ CalculationCache calculationCache;
QAbstractTransition *initialTransition = createInitialTransition();
transitions.append(initialTransition);
@@ -1690,7 +1862,7 @@ void QStateMachinePrivate::_q_start()
executeTransitionContent(&nullEvent, transitions);
QList<QAbstractState*> exitedStates = QList<QAbstractState*>();
QSet<QAbstractState*> statesForDefaultEntry;
- QList<QAbstractState*> enteredStates = computeEntrySet(transitions, statesForDefaultEntry);
+ QList<QAbstractState*> enteredStates = computeEntrySet(transitions, statesForDefaultEntry, &calculationCache);
QHash<RestorableId, QVariant> pendingRestorables;
QHash<QAbstractState*, QList<QPropertyAssignment> > assignmentsForEnteredStates =
computePropertyAssignments(enteredStates, pendingRestorables);
@@ -1745,50 +1917,46 @@ void QStateMachinePrivate::_q_process()
break;
}
QList<QAbstractTransition*> enabledTransitions;
+ CalculationCache calculationCache;
+
QEvent *e = new QEvent(QEvent::None);
- enabledTransitions = selectTransitions(e);
+ enabledTransitions = selectTransitions(e, &calculationCache);
if (enabledTransitions.isEmpty()) {
delete e;
e = 0;
}
- if (enabledTransitions.isEmpty() && ((e = dequeueInternalEvent()) != 0)) {
+ while (enabledTransitions.isEmpty() && ((e = dequeueInternalEvent()) != 0)) {
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": dequeued internal event" << e << "of type" << e->type();
#endif
- enabledTransitions = selectTransitions(e);
+ enabledTransitions = selectTransitions(e, &calculationCache);
if (enabledTransitions.isEmpty()) {
delete e;
e = 0;
}
}
- if (enabledTransitions.isEmpty()) {
- if ((e = dequeueExternalEvent()) != 0) {
+ while (enabledTransitions.isEmpty() && ((e = dequeueExternalEvent()) != 0)) {
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": dequeued external event" << e << "of type" << e->type();
#endif
- enabledTransitions = selectTransitions(e);
+ enabledTransitions = selectTransitions(e, &calculationCache);
if (enabledTransitions.isEmpty()) {
delete e;
e = 0;
}
- } else {
- if (isInternalEventQueueEmpty()) {
- processing = false;
- stopProcessingReason = EventQueueEmpty;
- }
- }
}
- if (!enabledTransitions.isEmpty()) {
- didChange = true;
- q->beginMicrostep(e);
- microstep(e, enabledTransitions);
- q->endMicrostep(e);
- }
- else {
+ if (enabledTransitions.isEmpty()) {
+ processing = false;
+ stopProcessingReason = EventQueueEmpty;
noMicrostep();
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": no transitions enabled";
#endif
+ } else {
+ didChange = true;
+ q->beginMicrostep(e);
+ microstep(e, enabledTransitions, &calculationCache);
+ q->endMicrostep(e);
}
delete e;
}
@@ -1976,12 +2144,17 @@ void QStateMachinePrivate::emitStateFinished(QState *forState, QFinalState *guil
Q_ASSERT(guiltyState);
#ifdef QSTATEMACHINE_DEBUG
+ Q_Q(QStateMachine);
qDebug() << q << ": emitting finished signal for" << forState;
#endif
QStatePrivate::get(forState)->emitFinished();
}
+void QStateMachinePrivate::startupHook()
+{
+}
+
namespace _QStateMachine_Internal{
class GoToStateTransition : public QAbstractTransition
@@ -2554,14 +2727,18 @@ void QStateMachine::setRunning(bool running)
event queue. Events are processed in the order posted. The state machine
takes ownership of the event and deletes it once it has been processed.
- You can only post events when the state machine is running.
+ You can only post events when the state machine is running or when it is starting up.
\sa postDelayedEvent()
*/
void QStateMachine::postEvent(QEvent *event, EventPriority priority)
{
Q_D(QStateMachine);
- if (d->state != QStateMachinePrivate::Running) {
+ switch (d->state) {
+ case QStateMachinePrivate::Running:
+ case QStateMachinePrivate::Starting:
+ break;
+ default:
qWarning("QStateMachine::postEvent: cannot post event when the state machine is not running");
return;
}
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index a66232ee88..426f2732df 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -75,6 +75,7 @@ class QState;
class QAbstractAnimation;
#endif
+struct CalculationCache;
class QStateMachine;
class Q_CORE_EXPORT QStateMachinePrivate : public QStatePrivate
{
@@ -124,17 +125,18 @@ public:
void clearHistory();
QAbstractTransition *createInitialTransition() const;
- void removeConflictingTransitions(QList<QAbstractTransition*> &enabledTransitions);
- void microstep(QEvent *event, const QList<QAbstractTransition*> &transitionList);
+ void removeConflictingTransitions(QList<QAbstractTransition*> &enabledTransitions, CalculationCache *cache);
+ void microstep(QEvent *event, const QList<QAbstractTransition*> &transitionList, CalculationCache *cache);
+ QList<QAbstractTransition *> selectTransitions(QEvent *event, CalculationCache *cache);
virtual void noMicrostep();
virtual void processedPendingEvents(bool didChange);
virtual void beginMacrostep();
virtual void endMacrostep(bool didChange);
- QList<QAbstractTransition *> selectTransitions(QEvent *event);
void exitStates(QEvent *event, const QList<QAbstractState *> &statesToExit_sorted,
const QHash<QAbstractState*, QList<QPropertyAssignment> > &assignmentsForEnteredStates);
- QList<QAbstractState*> computeExitSet(const QList<QAbstractTransition*> &enabledTransitions);
- QSet<QAbstractState*> computeExitSet_Unordered(const QList<QAbstractTransition*> &enabledTransitions);
+ QList<QAbstractState*> computeExitSet(const QList<QAbstractTransition*> &enabledTransitions, CalculationCache *cache);
+ QSet<QAbstractState*> computeExitSet_Unordered(const QList<QAbstractTransition*> &enabledTransitions, CalculationCache *cache);
+ QSet<QAbstractState*> computeExitSet_Unordered(QAbstractTransition *t, CalculationCache *cache);
void executeTransitionContent(QEvent *event, const QList<QAbstractTransition*> &transitionList);
void enterStates(QEvent *event, const QList<QAbstractState*> &exitedStates_sorted,
const QList<QAbstractState*> &statesToEnter_sorted,
@@ -145,9 +147,10 @@ public:
#endif
);
QList<QAbstractState*> computeEntrySet(const QList<QAbstractTransition*> &enabledTransitions,
- QSet<QAbstractState*> &statesForDefaultEntry);
+ QSet<QAbstractState*> &statesForDefaultEntry, CalculationCache *cache);
QAbstractState *getTransitionDomain(QAbstractTransition *t,
- const QList<QAbstractState *> &effectiveTargetStates) const;
+ const QList<QAbstractState *> &effectiveTargetStates,
+ CalculationCache *cache) const;
void addDescendantStatesToEnter(QAbstractState *state,
QSet<QAbstractState*> &statesToEnter,
QSet<QAbstractState*> &statesForDefaultEntry);
@@ -199,6 +202,7 @@ public:
void cancelAllDelayedEvents();
virtual void emitStateFinished(QState *forState, QFinalState *guiltyState);
+ virtual void startupHook();
#ifndef QT_NO_PROPERTIES
class RestorableId {
@@ -206,7 +210,8 @@ public:
QObject *obj;
QByteArray prop;
// two overloads because friends can't have default arguments
- friend uint qHash(const RestorableId &key, uint seed) Q_DECL_NOEXCEPT_EXPR(noexcept(std::declval<QByteArray>()))
+ friend uint qHash(const RestorableId &key, uint seed)
+ Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval<QByteArray>())))
{ return qHash(qMakePair(key.obj, key.prop), seed); }
friend uint qHash(const RestorableId &key) Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key, 0U)))
{ return qHash(key, 0U); }
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp
index acc3663936..01bbe70c88 100644
--- a/src/corelib/thread/qexception.cpp
+++ b/src/corelib/thread/qexception.cpp
@@ -107,6 +107,14 @@ QT_BEGIN_NAMESPACE
\internal
*/
+QException::~QException()
+#ifndef Q_COMPILER_NOEXCEPT
+ throw()
+#endif
+{
+ // must stay empty until ### Qt 6
+}
+
void QException::raise() const
{
QException e = *this;
@@ -118,6 +126,14 @@ QException *QException::clone() const
return new QException(*this);
}
+QUnhandledException::~QUnhandledException()
+#ifndef Q_COMPILER_NOEXCEPT
+ throw()
+#endif
+{
+ // must stay empty until ### Qt 6
+}
+
void QUnhandledException::raise() const
{
QUnhandledException e = *this;
diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h
index 55fc441020..edf361ebd3 100644
--- a/src/corelib/thread/qexception.h
+++ b/src/corelib/thread/qexception.h
@@ -53,6 +53,11 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QException : public std::exception
{
public:
+ ~QException()
+#ifndef Q_COMPILER_NOEXCEPT
+ throw()
+#endif
+ ;
virtual void raise() const;
virtual QException *clone() const;
};
@@ -60,6 +65,11 @@ public:
class Q_CORE_EXPORT QUnhandledException : public QException
{
public:
+ ~QUnhandledException()
+#ifndef Q_COMPILER_NOEXCEPT
+ throw()
+#endif
+;
void raise() const Q_DECL_OVERRIDE;
QUnhandledException *clone() const Q_DECL_OVERRIDE;
};
diff --git a/src/corelib/thread/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp
index 64a2613d27..04aa39a81e 100644
--- a/src/corelib/thread/qrunnable.cpp
+++ b/src/corelib/thread/qrunnable.cpp
@@ -31,6 +31,15 @@
**
****************************************************************************/
+#include "qrunnable.h"
+
+QT_BEGIN_NAMESPACE
+
+QRunnable::~QRunnable()
+{
+ // Must be empty until ### Qt 6
+}
+
/*!
\class QRunnable
\inmodule QtCore
@@ -98,3 +107,5 @@
\sa autoDelete(), QThreadPool
*/
+
+QT_END_NAMESPACE
diff --git a/src/corelib/thread/qrunnable.h b/src/corelib/thread/qrunnable.h
index f00c58d51d..28d14a46c0 100644
--- a/src/corelib/thread/qrunnable.h
+++ b/src/corelib/thread/qrunnable.h
@@ -38,20 +38,21 @@
QT_BEGIN_NAMESPACE
-
-class QRunnable
+class Q_CORE_EXPORT QRunnable
{
int ref;
friend class QThreadPool;
friend class QThreadPoolPrivate;
friend class QThreadPoolThread;
-
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ Q_DISABLE_COPY(QRunnable)
+#endif
public:
virtual void run() = 0;
QRunnable() : ref(0) { }
- virtual ~QRunnable() { }
+ virtual ~QRunnable();
bool autoDelete() const { return ref != -1; }
void setAutoDelete(bool _autoDelete) { ref = _autoDelete ? 0 : -1; }
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index b8544b1f0a..2008f76621 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -57,6 +57,16 @@
#include <algorithm>
+#ifdef Q_OS_WINRT
+namespace ABI {
+ namespace Windows {
+ namespace Foundation {
+ struct IAsyncAction;
+ }
+ }
+}
+#endif // Q_OS_WINRT
+
QT_BEGIN_NAMESPACE
class QAbstractEventDispatcher;
@@ -125,10 +135,6 @@ private:
#ifndef QT_NO_THREAD
-#ifdef Q_OS_WINRT
-namespace ABI { namespace Windows { namespace Foundation { struct IAsyncAction; } } }
-#endif
-
class QThreadPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QThread)
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index da5d00311a..36c1f42995 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -124,7 +124,7 @@ int qFindByteArray(
int qAllocMore(int alloc, int extra) Q_DECL_NOTHROW
{
Q_ASSERT(alloc >= 0 && extra >= 0);
- Q_ASSERT_X(uint(alloc) < QByteArray::MaxSize, "qAllocMore", "Requested size is too large!");
+ Q_ASSERT_X(uint(alloc) <= QByteArray::MaxSize, "qAllocMore", "Requested size is too large!");
unsigned nalloc = qNextPowerOfTwo(alloc + extra);
@@ -842,8 +842,9 @@ static inline char qToLower(char c)
\internal
\since 5.4
- The maximum size of a QByteArray, in bytes. Also applies to a the maximum
- storage size of QString and QVector, though not the number of elements.
+ The maximum size of a QByteArray (including a '\0' terminator), in bytes.
+ Also applies to the maximum storage size of QString and QVector, though
+ not the number of elements.
*/
/*!
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 9148ecf6fc..615b7a4e3e 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -87,7 +87,7 @@ QCollator::QCollator(const QCollator &other)
}
/*!
- Destroys the collator.
+ Destructor for QCollator.
*/
QCollator::~QCollator()
{
@@ -109,8 +109,8 @@ QCollator &QCollator::operator=(const QCollator &other)
return *this;
}
-/*
- \fn void QCollator::QCollator(QCollator &&other)
+/*!
+ \fn QCollator::QCollator(QCollator &&other)
Move constructor. Moves from \a other into this collator.
@@ -119,8 +119,8 @@ QCollator &QCollator::operator=(const QCollator &other)
one of the assignment operators is undefined.
*/
-/*
- \fn QCollator &QCollator::operator=(QCollator &&other)
+/*!
+ \fn QCollator & QCollator::operator=(QCollator && other)
Move-assigns from \a other to this collator.
@@ -367,6 +367,12 @@ QCollatorSortKey& QCollatorSortKey::operator=(const QCollatorSortKey &other)
}
/*!
+ \fn QCollatorSortKey &QCollatorSortKey::operator=(QCollatorSortKey && other)
+
+ Move-assigns \a other to this collator key.
+*/
+
+/*!
\fn bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
\relates QCollatorSortKey
@@ -377,6 +383,12 @@ QCollatorSortKey& QCollatorSortKey::operator=(const QCollatorSortKey &other)
*/
/*!
+ \fn void QCollatorSortKey::swap(QCollatorSortKey & other)
+
+ Swaps this collator key with \a other.
+*/
+
+/*!
\fn int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
Compares the key to \a otherKey. Returns a negative value if the key
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index 7e49253f9b..4cc3a2c293 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -119,8 +119,8 @@ public:
QStringList QCommandLineParserPrivate::aliases(const QString &optionName) const
{
- const NameHash_t::const_iterator it = nameHash.find(optionName);
- if (it == nameHash.end()) {
+ const NameHash_t::const_iterator it = nameHash.constFind(optionName);
+ if (it == nameHash.cend()) {
qWarning("QCommandLineParser: option not defined: \"%s\"", qPrintable(optionName));
return QStringList();
}
@@ -847,8 +847,8 @@ QString QCommandLineParser::value(const QString &optionName) const
QStringList QCommandLineParser::values(const QString &optionName) const
{
d->checkParsed("values");
- const NameHash_t::const_iterator it = d->nameHash.find(optionName);
- if (it != d->nameHash.end()) {
+ const NameHash_t::const_iterator it = d->nameHash.constFind(optionName);
+ if (it != d->nameHash.cend()) {
const int optionOffset = *it;
QStringList values = d->optionValuesHash.value(optionOffset);
if (values.isEmpty())
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index fc4fb1e7cb..41d198f9bc 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -291,7 +291,7 @@ QContiguousCache<T> &QContiguousCache<T>::operator=(const QContiguousCache<T> &o
{
other.d->ref.ref();
if (!d->ref.deref())
- freeData(d);
+ freeData(p);
d = other.d;
if (!d->sharable)
detach_helper();
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp
index 255e9557e2..eaa695ef27 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/tools/qdatetimeparser.cpp
@@ -1362,11 +1362,11 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
\internal
returns
- 0 if str == QDateTimeEdit::tr("AM")
- 1 if str == QDateTimeEdit::tr("PM")
- 2 if str can become QDateTimeEdit::tr("AM")
- 3 if str can become QDateTimeEdit::tr("PM")
- 4 if str can become QDateTimeEdit::tr("PM") and can become QDateTimeEdit::tr("AM")
+ 0 if str == tr("AM")
+ 1 if str == tr("PM")
+ 2 if str can become tr("AM")
+ 3 if str can become tr("PM")
+ 4 if str can become tr("PM") and can become tr("AM")
-1 can't become anything sensible
*/
@@ -1737,9 +1737,9 @@ QDateTime QDateTimeParser::getMaximum() const
QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const
{
if (ap == AmText) {
- return (cs == UpperCase ? QLatin1String("AM") : QLatin1String("am"));
+ return (cs == UpperCase ? tr("AM") : tr("am"));
} else {
- return (cs == UpperCase ? QLatin1String("PM") : QLatin1String("pm"));
+ return (cs == UpperCase ? tr("PM") : tr("pm"));
}
}
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index 55dc3bf7a0..9457e35ad5 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -54,7 +54,7 @@
# include "QtCore/qvariant.h"
#endif
#include "QtCore/qvector.h"
-
+#include "QtCore/qcoreapplication.h"
#define QDATETIMEEDIT_TIME_MIN QTime(0, 0, 0, 0)
#define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999)
@@ -72,6 +72,7 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QDateTimeParser
{
+ Q_DECLARE_TR_FUNCTIONS(QDateTimeParser)
public:
enum Context {
FromString,
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index c4c8c8f3cc..2080a22e23 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -353,6 +353,7 @@ public:
class const_iterator
{
friend class iterator;
+ friend class QSet<Key>;
QHashData::Node *i;
public:
@@ -451,6 +452,7 @@ private:
void detach_helper();
void freeData(QHashData *d);
Node **findNode(const Key &key, uint *hp = 0) const;
+ Node **findNode(const Key &key, uint h) const;
Node *createNode(uint h, const Key &key, const T &value, Node **nextNode);
void deleteNode(Node *node);
static void deleteNode2(QHashData::Node *node);
@@ -846,17 +848,10 @@ Q_INLINE_TEMPLATE bool QHash<Key, T>::contains(const Key &akey) const
}
template <class Key, class T>
-Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
- uint *ahp) const
+Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey, uint h) const
{
Node **node;
- uint h = 0;
- if (d->numBuckets || ahp) {
- h = qHash(akey, d->seed);
- if (ahp)
- *ahp = h;
- }
if (d->numBuckets) {
node = reinterpret_cast<Node **>(&d->buckets[h % d->numBuckets]);
Q_ASSERT(*node == e || (*node)->next);
@@ -869,6 +864,20 @@ Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(cons
}
template <class Key, class T>
+Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(const Key &akey,
+ uint *ahp) const
+{
+ uint h = 0;
+
+ if (d->numBuckets || ahp) {
+ h = qHash(akey, d->seed);
+ if (ahp)
+ *ahp = h;
+ }
+ return findNode(akey, h);
+}
+
+template <class Key, class T>
Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
{
if (size() != other.size())
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 1e002633df..e446a6625b 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -221,6 +221,11 @@ public:
inline iterator() : i(0) {}
inline iterator(Node *n) : i(n) {}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // can't remove it in Qt 5, since doing so would make the type trivial,
+ // which changes the way it's passed to functions by value.
+ inline iterator(const iterator &o): i(o.i){}
+#endif
inline T &operator*() const { return i->t(); }
inline T *operator->() const { return &i->t(); }
inline T &operator[](difference_type j) const { return i[j].t(); }
@@ -268,6 +273,11 @@ public:
inline const_iterator() : i(0) {}
inline const_iterator(Node *n) : i(n) {}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ // can't remove it in Qt 5, since doing so would make the type trivial,
+ // which changes the way it's passed to functions by value.
+ inline const_iterator(const const_iterator &o): i(o.i) {}
+#endif
#ifdef QT_STRICT_ITERATORS
inline explicit const_iterator(const iterator &o): i(o.i) {}
#else
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index 37a63a2ca4..c0818f07d7 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -44,18 +44,6 @@
QT_BEGIN_NAMESPACE
-namespace {
-class AutoReleasePool
-{
-public:
- AutoReleasePool(): pool([[NSAutoreleasePool alloc] init]) {}
- ~AutoReleasePool() { [pool release]; }
-
-private:
- NSAutoreleasePool *pool;
-};
-}
-
/******************************************************************************
** Wrappers for Mac locale system functions
*/
@@ -426,7 +414,7 @@ QLocale QSystemLocale::fallbackUiLocale() const
QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
{
- AutoReleasePool pool;
+ QMacAutoReleasePool pool;
switch(type) {
// case Name:
// return getMacLocaleName();
diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc
index 48555ed6d1..4452d2f0b8 100644
--- a/src/corelib/tools/qpair.qdoc
+++ b/src/corelib/tools/qpair.qdoc
@@ -96,6 +96,30 @@
\sa qMakePair()
*/
+\fn void QPair::swap(QPair &other)
+
+ \since 5.5
+ Swaps this pair with \a other.
+
+ Equivalent to
+ \code
+ qSwap(this->first, other.first);
+ qSwap(this->second, other.second);
+ \endcode
+
+ Swap overloads are found in namespace \c std as well as via
+ argument-dependent lookup (ADL) in \c{T}'s namespace.
+*/
+
+/*!
+\fn void swap(QPair<T1, T2> &lhs, QPair<T1, T2> &rhs)
+ \overload
+ \relates QPair
+ \since 5.5
+
+ Swaps \a lhs with \a rhs.
+*/
+
/*!
\fn QPair::QPair(const QPair<TT1, TT2> &p)
\since 5.2
@@ -108,37 +132,27 @@
*/
/*!
- \fn QPair &QPair::operator=(const QPair<TT1, TT2> &p)
+ \fn QPair::QPair(QPair<TT1, TT2> &&p)
\since 5.2
- Copies the pair \a p onto this pair.
-
- \sa qMakePair()
+ Move-constructs a QPair instance, making it point to the same object that
+ \a p was pointing to.
*/
/*!
- \fn void QPair::swap(QPair &other)
- \since 5.5
-
- Swaps this pair with \a other.
+ \fn QPair & QPair::operator=(const QPair<TT1, TT2> &p)
+ \since 5.2
- Equivalent to
- \code
- qSwap(this->first, other.first);
- qSwap(this->second, other.second);
- \endcode
+ Copies pair \a p into this pair.
- Swap overloads are found in namespace \c std as well as via
- argument-dependent lookup (ADL) in \c{T}'s namespace.
+ \sa qMakePair()
*/
/*!
- \fn void swap(QPair<T1, T2> &lhs, QPair<T1, T2> &rhs)
- \overload
- \relates QPair
- \since 5.5
+ \fn QPair & QPair::operator=(QPair<TT1, TT2> &&p)
+ \since 5.2
- Swaps \a lhs with \a rhs.
+ Move-assigns pair \a p into this pair instance.
*/
/*! \fn bool operator==(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 18dd2d12c2..47cad6349c 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -1830,6 +1830,13 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const
}
/*!
+ \fn QRegularExpression & QRegularExpression::operator=(QRegularExpression && re)
+
+ Move-assigns the regular expression \a re to this object, and returns a reference
+ to the copy. Both the pattern and the pattern options are copied.
+*/
+
+/*!
\fn bool QRegularExpression::operator!=(const QRegularExpression &re) const
Returns \c true if the regular expression is different from \a re, or
@@ -1956,6 +1963,13 @@ QRegularExpressionMatch &QRegularExpressionMatch::operator=(const QRegularExpres
}
/*!
+ \fn QRegularExpressionMatch &QRegularExpressionMatch::operator=(QRegularExpressionMatch &&match)
+
+ Move-assigns the match result \a match to this object, and returns a reference
+ to the copy.
+*/
+
+/*!
\fn void QRegularExpressionMatch::swap(QRegularExpressionMatch &other)
Swaps the match result \a other with this match result. This
@@ -2320,6 +2334,12 @@ QRegularExpressionMatchIterator &QRegularExpressionMatchIterator::operator=(cons
}
/*!
+ \fn QRegularExpressionMatchIterator &QRegularExpressionMatchIterator::operator=(QRegularExpressionMatchIterator &&iterator)
+
+ Move-assigns the \a iterator to this object.
+*/
+
+/*!
\fn void QRegularExpressionMatchIterator::swap(QRegularExpressionMatchIterator &other)
Swaps the iterator \a other with this iterator object. This operation is
diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp
new file mode 100644
index 0000000000..bcf6d2646e
--- /dev/null
+++ b/src/corelib/tools/qringbuffer.cpp
@@ -0,0 +1,309 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Alex Trotsenko <alex1973tr@gmail.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qringbuffer_p.h"
+#include <string.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \internal
+
+ Access the bytes at a specified position the out-variable length will
+ contain the amount of bytes readable from there, e.g. the amount still
+ the same QByteArray
+*/
+const char *QRingBuffer::readPointerAtPosition(qint64 pos, qint64 &length) const
+{
+ if (pos >= 0) {
+ pos += head;
+ for (int i = 0; i < buffers.size(); ++i) {
+ length = (i == tailBuffer ? tail : buffers[i].size());
+ if (length > pos) {
+ length -= pos;
+ return buffers[i].constData() + pos;
+ }
+ pos -= length;
+ }
+ }
+
+ length = 0;
+ return 0;
+}
+
+void QRingBuffer::free(qint64 bytes)
+{
+ while (bytes > 0) {
+ const qint64 blockSize = buffers.first().size() - head;
+
+ if (tailBuffer == 0 || blockSize > bytes) {
+ // keep a single block around if it does not exceed
+ // the basic block size, to avoid repeated allocations
+ // between uses of the buffer
+ if (bufferSize <= bytes) {
+ if (buffers.first().size() <= basicBlockSize) {
+ bufferSize = 0;
+ head = tail = 0;
+ } else {
+ clear(); // try to minify/squeeze us
+ }
+ } else {
+ Q_ASSERT(quint64(bytes) < QByteArray::MaxSize);
+ head += int(bytes);
+ bufferSize -= bytes;
+ }
+ return;
+ }
+
+ bufferSize -= blockSize;
+ bytes -= blockSize;
+ buffers.removeFirst();
+ --tailBuffer;
+ head = 0;
+ }
+}
+
+char *QRingBuffer::reserve(qint64 bytes)
+{
+ if (bytes <= 0 || quint64(bytes) >= QByteArray::MaxSize)
+ return 0;
+
+ const qint64 newSize = bytes + tail;
+ // if need buffer reallocation
+ if (newSize > buffers.last().size()) {
+ if (newSize > buffers.last().capacity() && (tail >= basicBlockSize
+ || quint64(newSize) >= QByteArray::MaxSize)) {
+ // shrink this buffer to its current size
+ buffe