summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QSystemError: Make it format unknown Windows messagesThiago Macieira2017-07-181-0/+3
| | | | | | | Can happen if we're using HRESULT from weird facilities. Change-Id: I3d10feaa2e5854ff3c01b32dbd068309e5131d1b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge qt_error_string and QSystemErrorThiago Macieira2017-07-182-5/+38
| | | | | | | | | | | | | | | | | | | | | | This removes a lot of duplicated code that existed in both qglobal.cpp and qsystemerror.cpp, including the hack to get the correct strerror_r signature. This removes the incorrect use of EACCES, EMFILE, ENOENT, and ENOSPC from qt_error_string on Windows. qt_error_string is supposed to be used only with Win32 error codes from GetLastError(), despite there being a lot of uses in cross-platform and even Windows-specific code that pass errno constants. It may or may not work: that depends on whether the constants happen to match. ENOENT matches ERROR_FILE_NOT_FOUND and one could argue that ENOSPC matching ERROR_OUT_OF_PAPER is acceptable, but EMFILE isn't the same as ERROR_BAD_LENGTH nor is EACCES, ERROR_INVALID_DATA. Change-Id: I1eba2b016de74620bfc8fffd14cccb7f77f4b510 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix documentation of QEvent::LanguageChange propagationSimon Hausmann2017-07-131-2/+2
| | | | | | | | | | | | The documentation claims that QGuiApplication forwards the top-level windows. However this appears to be a search & replace mistake from the QApplication <> QGuiApplication separation times. Only QApplication forwards the event to top-level widgets and changeEvent() is a virtual method of QWidget. Nothing is implemented for plain QGuiApplication and QWindow. Change-Id: I71b05ecebc90f7c28e150590764438ebaa90e88f Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Handle conversion and comparison between qvarianthash and qvariantmapAllan Sandfeld Jensen2017-07-111-0/+12
| | | | | | | | | QVariant claims to be able to QVariantHash and QVariantMap, but the actual conversion implementation is missing. Task-number: QTBUG-61471 Change-Id: I0cba74642aa77dc423effed289bc7619922a89eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDeadlineTimer: round milliseconds up instead of downThiago Macieira2017-07-071-1/+1
| | | | | | | | | | | | | | | | | | | Code like: QElapsedTimer timer; timer.start(); QTest::qWait(30); QVERIFY(timer.elapsed() >= 30); is failing, because qWait sleeps in increments of 10 ms and the last chunk may be off by less than one millisecond, so we end up sleeping too little and thus returning before 30 ms have elapsed. This matches the QElapsedTimer::elapsed() code that rounds down: return nsecsElapsed() / Q_INT64_C(1000000); Task-number: QTBUG-61741 Change-Id: Ic3a088f9f08a4fd7ae91fffd14cea4a91d3f51a8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QVariant: Print a warning when deserialized user type is unknownMichael Winkelmann2017-07-051-0/+1
| | | | | | | | The deserialized user type is now shown to the user to figure which QMetaType registration is missing. Change-Id: I4b7624827e479b1bea67065ce3542183b7355165 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Prevent qmake to run moc on qobjectdefs.hOlivier Goffart2017-07-051-0/+1
| | | | | Change-Id: Ic453c88c36cbeb24f3dc4fa6b6b20aabe5d24e09 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* rework detection and use of clock_gettime()/librtOswald Buddenhagen2017-06-171-1/+1
| | | | | | | | recent versions of glibc include clock_gettime() inside libc itself. Task-number: QTBUG-41009 Change-Id: I7401773be99682a356bf06a69571d11c4b15978b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Fix deadlock when calling requestPermissionBogDan Vatra2017-06-072-9/+14
| | | | | | | | | | | | | | The hang happend when using QtAndroidPrivate::requestPermissions before the QApplication::exec. Android UI calls "sendRequestPermissionsResult" which was blocking until the event is delivered, but the qt main loop is blocked and waits for the main surface to be created by the Android UI thread which is already blocked. With this patch sendRequestPermissionsResult won't block for the result to be delivered. Change-Id: I48ada65fe9ea63471ab46d8a9d839ba1b91d17b3 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Doc: Fix a typo in QVariant::toPoint docsLeena Miettinen2017-06-011-1/+1
| | | | | | Task-number: QTBUG-61050 Change-Id: I517f95df9d1019d37b6484e00220e8e325ee2ecf Reviewed-by: Martin Smith <martin.smith@qt.io>
* QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted()Olivier Goffart2017-05-301-0/+1
| | | | | | | | | | | | Fixup of commit b4995eb7491c1b4784a1bf48db834c11c42b8d9d. We can't call QWidgetPrivate::get(w) on a deleted QWidget, because of the call to the member function QWidget::d_func. We can however call QObjectPrivate::get since we still are in the QObject destructor. tst_qstackedlayout now pass without ubsan Warnings. Change-Id: I4e839a97ddbd1cf21435a8fca76523b98a1f7d9b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-193-16/+2
|\ | | | | | | Change-Id: Ia8ac1960387c0f78c32f9d0385bb0aa9a8209af1
| * Revert "Add qt_safe_ftok wrapper for ftok"Thiago Macieira2017-05-183-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ac0184d6085d9e4f7f59352e563055311f4d8792. That commit added the use of qHash in qt_safe_ftok, which made ftok even more unsafe than previously. Since the algorithm in qHash can change across Qt versions, we need a stable algorithm instead. [ChangeLog][Important Behavior Changes] Reverted a change that caused Qt 5.6 through 5.8 not to connect to QSystemSemaphore and QSharedMemory created by running applications using Qt earlier than 5.6. Unfortunately, this means that Qt 5.9 will not connect to 5.6-5.8. Task-number: QTBUG-60771 Change-Id: Ibc3472e1c11d46358357fffd14bf51aeb48ef2c8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove unnecessary FunctionPointer::ChangeClassThiago Macieira2017-05-181-2/+0
| | | | | | | | | | | | | | Those were added by accident. Change-Id: I067fcfe299b34ab6a771fffd14bf28f2d3c096f0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Remove some more register keywordsMarc Mutz2017-05-061-2/+2
| | | | | | | | | | | | | | They're deprecated since C++11 and removed in C++17. Change-Id: Ia2acd9312707bfee96838743645a04ae1780e5dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtCore: include mocsThiago Macieira2017-05-0512-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compilation and link times in CPU seconds with GCC 7, using precompiled headers (not including moc, rcc, uic, etc. steps or headersclean): Before After Debug -O0 198,1 180,3 Debug -Og 240,7 229,2 Release -O3 267,1 249,2 Release LTO 239,4 229,8 QtCore required a little manual adjusting because some files are bootstrapped into moc itself and into qmake. Change-Id: I84e363d735b443cb9beefffd14b8b57c10e7da36 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | AreArgumentsCompatible: Replace a derived struct with template aliasThiago Macieira2017-05-051-1/+1
|/ | | | | | | | | | | | | There's no need to derive. This fixes the build with MSVC 2017 under /permissive-. I don't know what was wrong (ICC, Clang and GCC don't complain), but it must be related to "Lookup members in dependent base" in [1]. [1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance Change-Id: I9ad33fff8b634979bdbafffd14bb8016f5dc98b3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QCFSocketNotifier: fix registering a source in the run loopAlex Trotsenko2017-05-031-2/+11
| | | | | | | | | | | | | | Even if a callback type is not automatically re-enabled, callbacks are implicitly enabled when the source has been added to the run loop. In this case, calling CFSocketEnableCallBacks() could produce an extra notification if there is a pending event in the queue. The bug is quite unstable and completely depends on the internal OS delays. So, it can't be tested inside Qt. Task-number: QTBUG-59930 Change-Id: I751b8b8cf99cb86b80055f2214a42a638f01abe4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: correct minor link issuesNico Vertriest2017-05-031-2/+4
| | | | | | | | | qobject.cpp:4288: warning: Can't link to 'Q_ENUM_NS' qobject.cpp:4314: warning: Can't link to 'Q_FLAG_NS' Change-Id: I0fa5a1d4f9b4868a1a98ce6d3b5f6bb9b34c5dd2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Improve suppression of spurious socket notifications under WindowsAlex Trotsenko2017-05-032-17/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | There were still two cases where spurious notifications would be possible: - user calls hasPendingDatagrams()/pendingDatagramSize() on UDP socket somewhere outside the slot connected to readyRead() signal (::WSARecvFrom posts FD_READ notification, even if a notification for incoming datagram already exists in the message queue); - a socket was registered to receive several types of event and WM_QT_ACTIVATENOTIFIERS message is located between the different events for this socket in the queue. Provided patch ensures that the message queue is synchronized with the Qt event processing mechanism and adds a way to detect spurious notifications inside the window procedure. Task-number: QTBUG-58214 Change-Id: I49609dace601f300de09875ff1653617efabd72f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Peter Seiderer <ps.report@gmx.net>
* macOS: Add auto-release pools for Q*ApplicationPrivate::init()Tor Arne Vestbø2017-05-021-0/+4
| | | | | | | | | | So that any objects autoreleased during application initialization are released. Otherwise they will end up in the root level pool and only be released when the application exits and the application goes out of scope. Change-Id: If02d24fd70098f9b4b1b0ea3218e0a15e438b9db Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Include moc of qnamespace.h in qobject.cppThiago Macieira2017-04-291-0/+1
| | | | | | | Change-Id: I84e363d735b443cb9beefffd14b8bd4b39b00840 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* do not wrap QAbstractEventDispatcher::flush with QT_DEPRECATED_SINCEGatis Paeglis2017-04-281-3/+1
| | | | | | | | | | | | | | | | | | | ... as this would require us to remove usage of QAbstractEventDispatcher::flush from Qt source code as well. We can not do this already in Qt 5.9 as there are few event dispatchers in Qt that actually do override the ::flush (with non empty bodies). Removing this code could result in behavior changes (not very likely) for some user code. This method will be removed in Qt6. Instead mark it with a well known "### Qt{Version}" comment. This patch amends 41eefd7. The warning was: qcoreapplication.cpp: In static member function ‘static void QCoreApplication::flush()’: qcoreapplication.cpp:733:48: warning: ‘virtual void QAbstractEventDispatcher::flush()’ is deprecated [-Wdeprecated-declarations] self->d_func()->eventDispatcher->flush(); Change-Id: I48a1c68b84ff93268956205e1205e6d4b5d48664 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wrap QCoreApplication::flush with QT_DEPRECATED_SINCEGatis Paeglis2017-04-281-0/+2
| | | | | | | | | ... in cpp file as well. This patch amends 41eefd7. Change-Id: Id6a4dfd3a93a600fe3bb84bb74379451ad167aa8 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix warnings about unused private fields we can't removeThiago Macieira2017-04-261-0/+1
| | | | | | | | | | These are in public classes, so we can't remove them until we get to Qt 6. qtimer.h:231:20: warning: private field 'del' is not used [-Wunused-private-field] Change-Id: I84e363d735b443cb9beefffd14b8b5fb720c9e41 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Android: add logging to QtCore JNI_OnLoadVyacheslav Koscheev2017-04-261-0/+12
| | | | | Change-Id: I15609d14ac39f89bcba72df33d33a25ac23ad516 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Deprecate QCoreApplication::flush()Gatis Paeglis2017-04-224-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... as it has outlived its original purpose: Qt3 implementation on X11: void QApplication::flush() { flushX(); } void QApplication::flushX() { if (appDpy) XFlush( appDpy ); } Qt4 implementation on X11: Did nothing when QApplication::flush() was called (the flush() overrides in {unix,glib} event dispatchers with empty bodies). In Qt5 this function somehow has been repurposed (inconsistently) to do what QCoreApplication::sendPostedEvents already does: QAbstractEventDispatcher::flush() = 0; => QCocoaEventDispatcher::flush() {} => QEventDispatcherCoreFoundation::flush() {} => QIOSEventDispatcher (does not override ::flush()) => QEventDispatcherGlib::flush() {} => QPAEventDispatcherGlib (does not override ::flush()) => QEventDispatcherUNIX::flush() {} => QUnixEventDispatcherQPA (when QT_NO_GLIB=true) ::flush() { if (qApp) qApp->sendPostedEvents(); }) ==> QAndroidEventDispatcher (does not override ::flush()) => QEventDispatcherWin32::flush() {} => QOffscreenEventDispatcher::flush() { if (qApp) qApp->sendPostedEvents(); QEventDispatcherWin32::flush(); } => QWindowsGuiEventDispatcher (does not override ::flush()) => QWindowsDirect2DEventDispatcher (does not override ::flush()) => QEventDispatcherWinRT::flush() {} => QOffscreenEventDispatcher::flush() { if (qApp) qApp->sendPostedEvents(); QEventDispatcherWinRT::flush(); } => QWinRTEventDispatcher (qminimaleglintegration.cpp) (does not override ::flush()) => QWinRTEventDispatcher (qwinrteventdispatcher.h) (does not override ::flush()) Whatever this function was doing on macOS in Qt3 and Qt4 also has been dropped in Qt5. It appears that the other event dispatchers in Qt5 that have overrides for flush() have simply copy-pasted this logic. Clearly the documentation of QCoreApplication::flush() is outdated and has nothing to do with the actual implementation in Qt5. This function is rarely used in Qt5 sources. It should be safe to remove the calls to QCoreApplication::flush() from Qt source code, as this function has been doing nothing on most platforms anyways. Repurposing it even broke handling of posted events (see QTBUG-48717). [ChangeLog][QtCore][Event loop] QCoreApplication::flush() is now deprecated. Use QCoreApplication::processEvents() and QCoreApplication::sendPostedEvents() instead. Task-number: QTBUG-33489 Task-number: QTBUG-48717 Change-Id: Icc7347ff203024b7153ea74be6bf527dd07ce821 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* Fix QMetaMethod::invoke and automatic type registrationOlivier Goffart2017-04-221-5/+7
| | | | | | | | | | | | | | | | | This was simply not working for two reasons: - The index passed to QMetaObject::metacall was not right (there was an offset because of the return type) - If the registration succeeded, the arguments were not even initialized. The tests in tst_moc always called QMetaMethod::parameterType before calling invoke, which was properly registering the type. So this was not seen in the tests before. [ChangeLog][QtCore][QMetaMethod] Fixed crash in invoke() with QueuedConnection and types whose metatype gets automatically registered. Task-number: QTBUG-60185 Change-Id: I4247628484214fba0a8acc1813ed8f112f59c888 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Initialize QLoggingRegistry rules on first use, not qApp construction"Tor Arne Vestbø2017-04-191-0/+2
| | | | | | | | | | | | | This reverts commit 47cc9e23a313d67a4a3107242f205d2473842021. We use QCoreApplication::applicationDirPath in the logging initialization to find a possible qtlogging.ini file. Because QCoreApplication::applicationDirPath requires a QCoreApplication instance this leads to a qWarning, which in turn leads to a recursive call to the logging initialization, and in turn to a recursive mutex deadlock. Task-number: QTCREATORBUG-18031 Change-Id: Ic75e1e8c062eb647991725378489bf87c9648cca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Initialize QLoggingRegistry rules on first use, not qApp constructionTor Arne Vestbø2017-04-181-2/+0
| | | | | | | | | Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: Ia733105c5b6f28e22af511ced5271e45782da12b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant: implement QByteArray ↔ QUuid conversionv5.9.0-beta2Marc Mutz2017-04-141-5/+12
| | | | | | | | | | Seems like an obvious omission. [ChangeLog][QtCore][QVariant] Can now convert QUuid to and from QByteArray, not just QString. Change-Id: Ib56ae86ca0c27adaf1e095b6b85e64fe64ea8d18 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-122-5/+5
|\ | | | | | | Change-Id: I3bd83a839b16822035ed56a5cffe77bd6bc3f08d
| * Don't hide critical infoBogDan Vatra2017-04-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The developer should see what's wrong even on release builds. That code hides any mistakes we do in JNI which are pretty critical for developers because they can't see what's wrong with their code. e.g. QtAndroid::activity().callMethod<void>("wrongMethodName") *silently* fails, which is so wrong! Change-Id: I8b6a24946dfef716fcd86ab9bba82666974e3991 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * QVariant: fix docs regarding QUuidMarc Mutz2017-04-101-3/+5
| | | | | | | | | | | | | | | | - toUuid(): QUuid is a built-in type, so use type(), not userType() - canConvert()/toUuid(): QUuid converts to and from QString Change-Id: I5262ff7ab093040cb943b6ab9cfffe95491d2b9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QDataStream: add operator<< and >> for std::nullptr_tThiago Macieira2017-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::nullptr_t is nullary: it accepts only one value, nullptr. So we don't need to read or write anything. This commit simply adds the two operators that allow generic code to operate on std::nullptr_t if required. This commit also adds the actual use to QMetaType::load/save, even though there's no change in behavior. [ChangeLog][QtCore][QDataStream] Added operator<< and operator>> overloads that take std::nullptr_t, to facilitate generic code. Change-Id: Iae839f6a131a4f0784bffffd14aa37e7f62d2740 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-04-062-2/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/widgets/widgets/qtabbar.cpp Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
| * Mark to remove const from function parameters in QtCore public headersThiago Macieira2017-03-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some compilers are known to complain about this with a warning. GCC complains about const on return values on -Wignored-qualifiers (enabled at -Wextra), so it's not too much of a jump to assume that others do too. Besides, this is not Qt Library API policy. As maintainer for QtCore, I'm exercising my prerrogative in specifying certain unspecified parts of the coding style, like I've done for constructor initializer lists. Since all the classes involved are exported (including QVector, through derived classes), we can't remove the qualifier until Qt 6, since there are compilers known to encode the qualifier in the mangled name (suncc). I'm not introducing #ifdef to silence unknown compilers unless we get an actual complaint. Change-Id: I33850dcdb2ce4a47878efffd14a876edef843c46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Core: Replace LGPL21 with LGPL license headerKai Koehne2017-03-282-26/+38
| | | | | | | | | | | | | | | | Also use canonical contact url. Change-Id: I43f8c6a2c4949ee0e054045bccc17d82575b072c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* | Fix crash when QUrl::from{NS/CF}URL() was passed a nullptrTor Arne Vestbø2017-03-271-0/+4
| | | | | | | | | | | | | | Change-Id: Ib193447c4a91dd3d08746e97727f7d4764f33d80 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add documentation for TabletTrackingChange enum valueShawn Rutledge2017-03-271-0/+1
| | | | | | | | | | | | | | | | Amends 6aaf8532222759226a9b406bfe6c57787236cbf1 Change-Id: I2c264db235ea552ce6b4eb003d7daeeb2cecde6f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Increase the maximum recursive template depth on INTEGRITYKimmo Ollila2017-03-251-0/+3
| | | | | | | | | | | | | | | | | | | | Set the limit to 128 instead of the default 64 by adding QMAKE_CXXFLAGS += --pending_instantiations=128. This is needed by QMetaType::typeName array implementation. Change-Id: I3fd13967f862f492210572cfe7ee9ffc5e7c9745 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-212-7/+14
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/eglfs/eglfs-plugin.pro Change-Id: Id76cdbb41b7758572a3b8ea4dcb40d49bac968db
| * QMetaType & QVariant: "load" and "save" std::nullptr_tThiago Macieira2017-03-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't load and save pointers usually because the pointer value cannot be guaranteed to remain across program invocations. However, nullptr is an exception: a null pointer is always a null pointer. We don't actually have to read or write anything: there's only one value possible for a std::nullptr_t and it is nullptr. [ChangeLog][Important Behavior Changes] A QVariant containing a std::nullptr_t is now streamable to/from QDataStream. Task-number: QTBUG-59391 Change-Id: Iae839f6a131a4f0784bffffd14aa374f6475d283 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Protect better against timer ID replacementThiago Macieira2017-03-171-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timer IDs have been reused since Qt 4.5 or thereabouts, so just checking if the timer ID is in the timer dictionary is an incorrect check: our timer may have been deleted and replaced by another with the same ID. Instead of deleting the WinTimerInfo object, let's just mark it as unregistered by setting timerId to -1 and cooperate in deleting at the appropriate places. Since unregisterTimer skips deleting if inTimerEvent is true, the appropriate places are everywhere that set inTimerEvent to true. Change-Id: I057e93314e41372ae7a5ff93c467767c8a6d92ea Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Liang Qi2017-03-134-11/+11
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-134-11/+11
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| | * Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-062-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| | * QTimer: Avoid implicit conversion warningsStig Bjørlykke2017-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes compiling an application using QTimer and -Wshorten-64-to-32 on a 64-bit system without getting this warning: ... 5.8/clang_64/lib/QtCore.framework/Headers/qtimer.h:171:21: warning: implicit conversion loses integer precision: 'rep' (aka 'long long') to 'int' [-Wshorten-64-to-32] setInterval(value.count()); ~~~~~~~~~~~ ^~~~~~~~~~~~~ Change-Id: I3e0407a7193c841308f7271c41a8dd5a2eb2a534 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Properly use the "process" featureUlf Hermann2017-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace all QT_NO_PROCESS with QT_CONFIG(process), define it in qconfig-bootstrapped.h, add QT_REQUIRE_CONFIG(process) to the qprocess headers, exclude the sources from compilation when switched off, guard header inclusions in places where compilation without QProcess seems supported, drop some unused includes, and fix some tests that were apparently designed to work with QT_NO_PROCESS but failed to. Change-Id: Ieceea2504dea6fdf43b81c7c6b65c547b01b9714 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | moc: Support signals that return movable-only typeOlivier Goffart2017-03-131-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By adding std::move where it makes sense. This is not only good for move-only types, but for any type which can be moved as it saves copies of the return value in any case. [ChangeLog][moc] Move-only types are now supported as return types of signals and slots. Change-Id: Idc9453af993e7574a6bddd4a87210eddd3da48a9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>