summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QTimer: add support for <chrono> functionsThiago Macieira2016-07-092-18/+147
| | | | | | | | | [ChangeLog][QtCore][QTimer] Added support for std::chrono duration objects for QTimer methods, like QTimer::singleShot and QTimer::setInterval. Change-Id: I87e17314d8b24ae983b1fffd14536e24d5b12424 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* winrt: Fix launch as background taskMaurice Kalinowski2016-07-061-27/+86
| | | | | | | | | | | | In case a background task wants to use Qt, winmain is not invoked. Neither can we create the same objects like winmain do (as in creating a application view). Instead runOnXamlThread uses the thread pool enabling the event loop to run successfully. Task-number: QTBUG-54396 Change-Id: Ia3ba23ed0fd6cd7d2ed8d43675e88073b9aec8b5 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Move QElapsedTimer to src/corelib/kernelThiago Macieira2016-07-027-0/+1137
| | | | | | | | | | | | It's really a kernel functionality, as it implements really low-level functionality and it's used by the event dispatcher. It was in tools/ only because QTime is. QDeadlineTimer is also coming to kernel/. Change-Id: Ifea6e497f11a461db432ffff14491c6d9b839eb0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CoreLib: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-07-022-6/+7
| | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Change-Id: Id9ea11b16947220cd27787c0b529de62d10b6c26 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make sure all private headers in Qt Core include qglobal_p.hThiago Macieira2016-06-2518-5/+21
| | | | | | | | | | | | The rule was: - if the header included qglobal.h, turn that into qglobal_p.h - otherwise, insert the #include after the "We mean it" warning qglobal_p.h currently only includes qglobal.h. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-216-29/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qsysinfo.h src/corelib/kernel/qcoreapplication_win.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/plugins/platforms/windows/qwindowsglcontext.cpp src/plugins/platforms/windows/qwindowsglcontext.h Change-Id: Ib3500acc2b28553bde06758cd9a2e19eb7fe2978
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-205-30/+41
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And blacklisted a few tests in tst_QUdpSocket. Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtNative.java src/corelib/global/qglobal.cpp src/corelib/global/qsystemdetection.h src/corelib/io/qfileselector.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp tests/auto/network/socket/qudpsocket/BLACKLIST Task-number: QTBUG-54205 Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
| | * Correct a type mismatch in the QNX PPS codeJames McDonnell2016-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a problem when building for 64-bit where the two types no longer match. Change-Id: I8c31915caf81a60d635c79816a3a2d5d36742ff9 Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Fixed developer build for MinGWOliver Wolff2016-06-152-2/+3
| | | | | | | | | | | | | | | | | | | | | 0 must not be used as a null pointer constant Change-Id: I082d0e99c105fb02980b9cf390e7f6e4c9ad0869 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * winrt: Fix potential crash in QCoreApplicationMaurice Kalinowski2016-06-131-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GetModuleFileName exists for Windows 10 and upwards, hence use the generic version from the win32 mkspec. This allows to create a QCoreApplication object with nullptr argv, as the application filename is identified via the binary itself and not via arguments. A couple of auto-tests use this method to create multiple application objects during runtime. Unfortunately we cannot apply this for msvc2013, even though MSDN states the GetModuleFileName exists, it fails to compile for Windows Phone 8.1. Change-Id: I2b8b988107487ef3785462f8ca40b0a6e0623e32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * winrt: Close IAsyncInfo manually in case of errorMaurice Kalinowski2016-06-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case QEventDispatcherWinRT::runOnXamlThread returns an error the runtime sets the status of IAsyncInfo to Error. At the point when the IAsyncInfo destructor is invoked, an unhandled exception is thrown indicating the error has not been handled, causing any application to just crash deep inside the Windows platform libraries. Hence, in case runOnXamlThread returns non-S_OK we have to manually invoke Close() of the IAsyncInfo to tell the system we have taken care of everything. Change-Id: I3ac1e2ec2726f42e44f4f9a92191e454711120dd Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * | Fix warning about non-void function not returning anythingThiago Macieira2016-06-171-3/+1
| | | | | | | | | | | | | | | | | | | | | Found by ICC 17 Beta on Windows. Change-Id: Ib57b52598e2f452985e9fffd1458b6990b70837a Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | | darwin: Add Foundation conversion functions for QSize/QSizeFTor Arne Vestbø2016-06-141-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fromCGPoint function was left out for QSize, as the foundation type is using CGFloats internally. Clients should use an explicit QSizeF::toSize() when potentially throwing away precision. Change-Id: I12d43ae0881f09ad8d79f2caaa000c3983f4ef30 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | darwin: Add Foundation conversion functions for QPoint/QPointFTor Arne Vestbø2016-06-141-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fromCGPoint function was left out for QPoint, as the foundation type is using CGFloats internally. Clients should use an explicit QPointF::toPoint() when potentially throwing away precision. Change-Id: I12a37e8f81c86b7ada56066cc18ee29709cc21e3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-136-446/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-064-13/+15
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| | * Fix crash when connecting a non-PMF with Qt::UniqueConnection...Thiago Macieira2016-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...if a PMF connection had already happened. Since UniqueConnection isn't implemented for non-PMFs (functors and lambdas aren't comparable, even if static member functions or non-member functions are), we pass a null pointer for comparison argument. The disconnect() code already protected against a null pointer there, but not the connect code path with Qt::UniqueConnection Change-Id: I87e17314d8b24ae983b1fffd145324beced0494d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Dario Freddi <dario.freddi@ispirata.com>
| | * Fix build with ICC on OS X: __Z18qt_getQtMetaObjectv was undefiendThiago Macieira2016-05-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's inline, but the compiler did not inline it properly from Objective C++ sources. Undefined symbols for architecture x86_64: "__Z18qt_getQtMetaObjectv", referenced from: __ZN2Qt20qt_getEnumMetaObjectENS_15ScrollBarPolicyE in qlocale_mac.o ... Change-Id: Ie9fd7afe060b4e4a8052fffd144fda60c50a9779 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Compile fix: for OpenBSD: <sys/select.h> not included by <sys/types.h>Ralf Nolden2016-05-252-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On OpenBSD, <sys/select.h> isn't included in <sys/types.h>, so that leads to compile errors on files that include qcore_unix_p.h: qcore_unix_p.h:335:69: error: 'fd_set' has not been declared Just move the whole select include section from qcore_unix.cpp, no functional changes. The patch is adapted from OpenBSD ports maintainer Vadim Zhukov <persgray@gmail.com> patch for qt ports. Change-Id: I35ba693440b1c1644bcfcdb69823e2b37870ad97 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Remove the code for QObject::connect for non-C++11 compilersThiago Macieira2016-06-023-433/+0
| | | | | | | | | | | | | | | | | | | | | | | | It's required now in Qt 5.7 (at least the required features of rvalue references and variadic templates) Change-Id: I87e17314d8b24ae983b1fffd145364c52f9bb6c3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Revert "QObject::connect: reduce generated code size for statics and functors"Thiago Macieira2016-06-011-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2e4191eadce4cfe944afd0baf37f06bbcb65c5f4. The change is backwards compatible but not forwards, so it can't appear past the .0 release. Change-Id: I390c5e80795a9b3b27f6edcab79f7892a79c3564 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | QObject::connect: reduce generated code size for statics and functorsThiago Macieira2016-05-311-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of placing the assignment of false in the impl() function, move it to the inline QSlotObjectBase::compare() function. That means it's assigned in one place (two, actually, inside qobject.cpp), instead of for every static member, non-member or functor we connect or disconnect. Change-Id: I87e17314d8b24ae983b1fffd1453623ad4c4dcb2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | darwin: Add Foundation conversion functions for QRect/QRectFTor Arne Vestbø2016-06-101-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fromCGRect function was left out for QRect, as the foundation type is using CGFloats internally. Clients should use an explicit QRectF::toRect() when potentially throwing away precision. Change-Id: I0d4c5c5a4e6a45ea3287e3f37a00b69b0bfdefcf Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Simplify Foundation conversion function documentationTor Arne Vestbø2016-06-061-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | The \fn command to specify the function signature is not needed when the documentation precedes the function itself. Change-Id: I9de0d1ae73af443f0beded77538d62cea85b5e72 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | | QObject::connect: reduce generated code size for statics and functorsThiago Macieira2016-06-031-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of placing the assignment of false in the impl() function, move it to the inline QSlotObjectBase::compare() function. That means it's assigned in one place (two, actually, inside qobject.cpp), instead of for every static member, non-member or functor we connect or disconnect. Change-Id: I87e17314d8b24ae983b1fffd1453623ad4c4dcb2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Remove Windows CE vestigesJoerg Bornemann2016-06-021-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | Remove every usage of the _WIN32_WCE macro outside of 3rd party source code directories. Change-Id: Ia7e859bd6dcaef10c66674612c8e440f9a2dee56 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Remove _bit_scan_{forward,reverse}Erik Verbruggen2016-05-311-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use qCountTrailingZeroBits and qCountLeadingZeroBits from qalgorithms.h instead. Also extended these versions for MSVC. The _bit_scan_* versions stem from a time before the glorious days of qalgorithms.h. A big advantage is that these functions can be used on all platforms. Change-Id: I5a1b886371520310a7fe16e617635ea335046beb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-231-1/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-1/+21
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| | * Fix QVariant conversion to an enum type.Olivier Goffart2016-05-161-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QVariant::canConvert<Enum> was returning true for everything can can be converted to integer, but not for integer itself. That's because in QVariant::canConvert we set the targetType to Int of it's an enum, but the Int->Int case was not on the conversion matrix. So this commits adds it to the conversion matrix and now QVariant::canConvert<Enum> returns consistently true for int itself. But even tough canConvert returned true, it did not actualy do any conversion to the enum type itself. Fix that by handling the case properlt in 'convert' [ChangeLog][QtCore][QVariant] Fixed QVariant::canConvert and conversion from integer types to enumeration types. Task-number: QTBUG-53384 Change-Id: I6ac066f3900e31bfcea7af77836ddfc7730bd60b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | winrt: Remove explicit exit callMaurice Kalinowski2016-05-191-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8c3ae221 introduced a mean to actually close an application. Otherwise the application was in an undefined state and did not exit. Since 5.6 we switched to Xaml and the explicit call to Exit() is not required anymore. This also allows using multiple application objects sequentially as the unit tests do in some cases. Change-Id: I9030afec72a4534e818c77c373dc3a81b922a480 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Collate conversion functions for Core Foundation/Foundation typesTor Arne Vestbø2016-05-192-1/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it easier to apply similar changes across all related functions, and to implement functions for new types by having the previous approaches available in one place. Change-Id: I3f0590d67d0e6deb1c6c856ab1de96b55b6af058 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | Add support for Apple tvOSMike Krus2016-05-173-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass -xplatform macx-tvos-clang to configure to build. Builds device and simulator by default. Added ‘uikit’ platform with the common setup. Also added QT_PLATFORM_UIKIT define (undocumented). qmake config defines tvos (but not ios). tvOS is 64bits only (QT_ARCH is arm64) and requires bitcode to be embedded in the binary. A new ‘bitcode’ configuration was added. For ReleaseDevice builds (which get archived and push to the store), bitcode is actually embedded (-fembed-bitcode passed to clang). For all other configurations, only using bitcode markers to keep file size down (-fembed-bitcode-marker). Build disables Widgets in qtbase, and qtscript (unsupported, would require fixes to JavaScriptCore source code). Qpa same as on iOS but disables device orientation, status bar, clipboard, menus, dialogs which are not supported on tvOS. Change-Id: I645804fd933be0befddeeb43095a74d2c178b2ba Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-1212-29/+96
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | Be more specific what is in Core and what is notJędrzej Nowacki2016-05-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | !isComplex is quite good heuristic, but we know for sure which types should be included. Change-Id: I609d021b8a668e6c1945ed2b11d69f5a82b5e2bf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-4/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| | * normalize structure of plugandpaint exampleOswald Buddenhagen2016-05-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | as in other examples which come with plugins, use an additional hierarchy level which contains the app and plugin subdirs. Change-Id: I2487755967aa3474c337c8c8af10be49627b63d0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * | Tune fast-exit for signal activation for QML.Erik Verbruggen2016-05-032-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using QML, it quite often happens that only the QML engine is connected to a signal, and no C++ handlers. By splitting up the fast-exit case and handling QML separately, we can prevent a call to QThread::currentThreadId, and locking+unlocking the mutex. On x86 this saves ~130 instructions according to valgrind. Change-Id: I947fe42afe351922339ac982a6d498bc2f7b5192 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-293-4/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| | * Make it clear that QObject::tr() falls back to QString::fromUtf8()Sérgio Martins2016-04-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The reference to trUtf8() made it even more confusing, so remove it. It's redundant and deprecated anyway. Change-Id: I9921297160db3660bb5099692bbfdaf6e85637aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * Silence MSVC warnings when using certain std algorithmsMarc Mutz2016-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MSVC STL warns when passing naked pointers as non-bounded iterators to algorithms such as std::equal and std::copy, in an attempt to inform users that the range specified by that iterator has an implicit minimum size that the caller of the algorithm must ensure is met: warning C4996: 'std::_Equal1': Function call with parameters that may be unsafe - \ this call relies on the caller to check that the passed values are correct. To \ disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to \ use Visual C++ 'Checked Iterators' When building Qt, as well as when building user projects with qmake (cf. 0a76b6bc7f98900ea884cd10ccca1a332e5bdba5), we globally disable this warning (with -D_SCL_SECURE_NO_WARNINGS), but since we started using STL algorithms in public headers (e.g. in qvector.h), users get this warning in their own projects now, unless they, too, define said macro. But such a requirement is against the Qt policy to have headers that are warning-free as much as possible. The suggested way of fixing this warning is to wrap the naked pointer in a stdext::unchecked_array_iterator before passing it to the algorithm, cf. examples in https://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.120%29.aspx or, together with the capacity-made-explicit, in a stdext::checked_array_iterator. To avoid ifdefs for platforms that don't have these extensions (which, incidentally, for the unchecked case, includes MSVC 2012), wrap the calls in macros. The end game here is to drop -D_SCL_SECURE_NO_WARNINGS, at least for public headers, even though this commit also adds the wrapper to implementation and private header files. An alternative to the wrapper would have been the version of std::equal that takes four iterators. However, that is a C++14 library feature, while this version of Qt still needs to compile with a C++98 compiler, and, more importantly, there isn't, and never will be, a corresponding 4-iterator version of std::copy. Task-number: QTBUG-47948 Done-with: Stephen Kelly <steveire@gmail.com> Change-Id: I1bbab257fb5f1c5042939c382a412b596112ff26 Reviewed-by: Stephen Kelly <ske@ableton.com>
| | * Add missing initializersTimur Pocheptsov2016-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | Coverity, CIDs: 10724, 10725. Data member _iterator is not initialized. Change-Id: I0c94f5cef031e208aab1687209282fae0317f0ab Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| * | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-04-266-8/+60
| |\ \
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-256-8/+60
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test configure src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java src/corelib/global/qglobal.cpp src/widgets/kernel/qapplication.cpp src/widgets/styles/qwindowsvistastyle.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp Change-Id: I067083f34e5290aa5f7565e40c30a069cc37b83a
| | | * Improve performance of socket notifications on WinCEAlex Trotsenko2016-04-192-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEventDispatcherWin32 on WinCE uses a separate low-priority thread to monitor sockets activity, so changing the state of notifiers occurs asynchronously to the main thread. This makes a message-based socket activation mechanism ineffective. To avoid timeouts in the helper thread, update the thread's pool directly from the (un)registerSocketNotifier() functions. Change-Id: I702c32d69dce09323ca5f65dc2ee1407842e41ef Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | | * QWinEventNotifier: compile with -Wzero-as-null-pointer-constantMarc Mutz2016-04-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems to be the last 5.6 QtBase public header that didn't, paving the way to add the warning to the headersclean check. Change-Id: Ib2655782e34ec58e5d9b1b9c0ec31a965a38f9b7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | | * Fix build when Qt is used in an automatic reference-counted environmentTor Arne Vestbø2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When automatic reference-counting (ARC) is enabled on Darwin platforms the NSAutoReleasePool class should not be used directly, which caused a build error if qglobal.h was included after the Foundation.h in client code. The preferred alternative for ARC is the scoped @autoreleasepool construct, which allows the compiler to reason about needing to insert _objc_autoreleasePoolPush and _objc_autoreleasePoolPop calls. Note that ARC translation units can be combined with non-ARC translation units, so Qt and the QMacAutoReleasePool class can still be used in ARC client code even if Qt is not built with ARC. Task-number: QTBUG-51332 Change-Id: I7ef1c3146aa416a9d6a1dc299ce7b17f22f889e5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
| | | * Don't copy the functor object for each signal emissionOlivier Goffart2016-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The behavior was different in the variadic template code and in the C++98 code. The code without variadic template support was not copying the functor object (e.g. a lambda) before calling it. However, in the variadic template section, QtPrivate::FunctorCall::call took the functor by value instead of by reference resulting in a copy. QtPrivate::FunctorCall::call is a helper function for QtPrivate::FunctionPointer::call which is only needed for variadic template expension. [ChangeLog][QtCore][QObject] If the compiler supports variadic templates, no longer copy functor connected to a signal each time the signal is emitted. Restoring the C++98 behavior. Task-number: QTBUG-52542 Change-Id: I3ca20ef6910893b8a288e70af7de4c7b69502173 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * winrt: Try to acquire CoreDispatcher from multiple sourcesMaurice Kalinowski2016-04-131-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the system launches the application via different activation mode (eg. app registered for sharing) no main window will be created. Hence accessing the core window will return null and event dispatcher initialization will fail. In that case iterate through all available views and try to get access to their dispatcher to be able to invoke code on the xaml thread. Task-number: QTBUG-49276 Change-Id: I8c78baa27747a0465ff7a1b2ead6c9e03f0e05a8 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * | | QtCore: mark more types as primitive/movableMarc Mutz2016-04-251-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | These types are held in QVarLengthArrays, so benefit from being trivially relocatable. They are also part of the private API, so there's no BC issues with potential uses of these types in QList. Change-Id: I8adc0c801885f8fffa05eb1f173d7e4bb085ba7b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>