summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* define QT_NO_EXCEPTIONS reliably when using ClangR.J.V. Bertin2017-06-032-1/+11
| | | | | | | | | | | | | | | Clang's definition of the __EXCEPTIONS macro is inconsistent across platforms. When compiling for Darwin, Clang 3.6 and newer will set the token when exceptions are enabled in either C++ or ObjC. This change adds the reliable check described in the Clang 3.6 release notes to ensure that QT_NO_EXCEPTIONS is defined when required. The check requires the use of the Clang-specific __has_feature() syntax for which a new proxy macro QT_HAS_FEATURE(x) is added in qcompilerdetection.h Task-number: QTBUG-61034 Change-Id: Ie7b482dfa1a4a5b700a6b97562c26b626be1fc04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Disable bogus GCC 7 warning about string op overflowThiago Macieira2017-06-031-0/+6
| | | | | | | | | | | Analysis proves this is a false positive: qarraydataops.h:69:17: error: ‘void* memset(void*, int, size_t)’: specified size between 18446744056529682436 and 18446744065119617024 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] Change-Id: I7814054a102a407d876ffffd14b6ab0be9e222fc Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringLiteral/QByteArrayLiteral: fix/add documentationGiuseppe D'Angelo2017-06-012-30/+47
| | | | | | | | | Various editorial fixes. Also, in 5.9 QStringLiteral does not fall back to fromUtf8 any longer, but guarantees a compile-time construction. Change-Id: Ida4698cf8e32a6e3de97b2c16b997fc9630c9db9 Reviewed-by: Edward Welbourne <edward.welbourne@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>
* qEnvironmentVariableIntValue: fix the case of a non-numeric valueThiago Macieira2017-06-011-7/+14
| | | | | | | | | | | | | | | The documentation says that it's equivalent to qgetenv(varName).toInt() But the implementation wasn't. QByteArray::toInt() verifies that the entire string was consumed, so QByteArray("1a").toInt() == 0, but qstrtoll alone doesn't. That is, qstrtoll("1a", ...) == 1. The implementation also detected the base, a behavior I kept. Instead, I updated the documentation. Change-Id: I0031aa609e714ae983c3fffd14676ea6061a9268 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QAbstractItemModel::supportedDragActions: fix regressionDavid Faure2017-05-311-1/+1
| | | | | | | | | | | This method now returns -1 by default, due to commit 6255cb893d which mistakenly replaced -1 with Qt::IgnoreAction (0x0). As a result, dropping is forbidden in a number of applications (I detected this in zanshin). Change-Id: I4922451216e08d5d3fe36f8ba87364a361b691bf Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QStorageInfo: Pass MNT_NOWAIT to getmntinfoThiago Macieira2017-05-301-1/+5
| | | | | | | | | | | | | This forces the API not to wait for synchronous I/O from the filesystems and get the information, but instead just use the cached information directly. It's a good idea if we have an unresponsive FS, like NFS with an unreachable server. Task-number: QTBUG-61096 Change-Id: Iddeeffb6f4ad4a2894a2fffd14c32f6e90664a63 Reviewed-by: Tobias C. Berner Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@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>
* Add Integrity ARMv8 detectionTero Alamäki2017-05-291-4/+5
| | | | | | | Change-Id: I352c9b16077011aad1175e31ffaadfa44d2403ea Reviewed-by: Nikola Velinov <nvelinov@ghs.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Replace "Macintosh" with something suitable or omit itLeena Miettinen2017-05-231-4/+4
| | | | | Change-Id: I3067bd7e6ae2d6d68d5232a56eaf368a0415876c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Doc: fix grammar in QScopedPointer's detailed descriptionMitch Curtis2017-05-231-1/+1
| | | | | Change-Id: I3ce9650d62f3b53683c6b6f210c1413e94ae006c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QItemSelection: fix a quadratic loopMarc Mutz2017-05-221-12/+20
| | | | | | | | | | | | | | | | | | | | QList::erase(it) is a linear operation. Calling it in a loop constitutes quadratic behavior. Fix by using the erase-remove idiom. Write a generic function object QtFunctionObjects::IsNotValid, instead of a lambda, because I am building up a collection of such function objects in my tree, to be submitted any time now™, so this will reduce the churn once that gets merged. Wrap it in the unnamed namespace to avoid ODR violations in case this pattern repeats. Replace an existing erase-remove idiom's isNotValid lambda function with the new function object. Change-Id: I4f0af04e7b201eb168e79beeda332eee3c6f33c3 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-196-2748/+10505
|\ | | | | | | 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>
| * QMimeDatabase: update freedesktop.org.xml to shared-mime-info 1.8David Faure2017-05-081-2719/+10499
| | | | | | | | | | | | | | | | | | | | | | | | ... and update the unittest accordingly. Compared to the 1.8 release there is one change in freedesktop.org.xml, the magic for application/x-java-keystore was changed from host32 to big32, as done upstream, see https://bugs.freedesktop.org/show_bug.cgi?id=99328 Task-number: QTBUG-60608 Change-Id: I47de71c9396cfc3eabc884d5679c73a3e4850a17 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Eliminate ambiguous casts involving qfloat16Glen Mabey2017-05-071-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | The operator double() and operator long double() members of qfloat16 are causing cast ambiguities. This removes them, leaving only operator float() which seems to be adequate. Also, additional arithmetic operator tests were added which without this removal fail to compile. Change-Id: Id52a101b318fd754969b3de13c1e528d0aac2387 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Merge 5.9 into 5.9.0v5.9.0-beta4Oswald Buddenhagen2017-05-0412-34/+74
| |\ | | | | | | | | | Change-Id: Id3fc911f024cba292a5c426b36aa94ff9f3c0ef7
| * | QItemSelectionRange: don't compare pointers with op<Marc Mutz2017-04-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | ... use std::less<> to avoid undefined behavior. Change-Id: Ib6736f86359c4a16fd90ca63b57a8517c6137ead Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | 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>
* | | QDirIterator docs: add a cool recursive file-finding snippetShawn Rutledge2017-05-162-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | This is one of the main use cases for QDirIterator, but it wasn't obvious enough that it's possible. Change-Id: Idae11cfe75dd0e16f1a960bba2470b1695d11241 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | | Fix missing handling of columns when merging selection rangesFilippo Cucchetto2017-05-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes two bugs: 1) Two ranges should not be merged if they are of different columns. The old code would have merged (0,0) with (1, 1). Tranforming a selection of just two indexes in a rectangle of four indexes. 2) The QItemSelectionRange appended had wrong column and worked only for indexes of the first column. For example if 'tl' was (0, 1) than br was (0, 1) so the QItemSelectionRange would have be ((0,1), (0, 1-1)) so ((0,1), (0,0)). This QItemSelectionRange is invalid because topLeft columns is greater than bottomRight column. The fix take in consideration the bottomRight column. Task-number: QTBUG-58871 Change-Id: I591ef0bcc63926f24a7b1ced002af9b7737a4b6e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | Warn if files are not found because of features.filesystemiteratorStephan Binner2017-05-081-0/+2
| | | | | | | | | | | | | | | | | | Change-Id: Ife3197aa1c56ba3ab6e7f530fbcbcf761f223b16 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | 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>
* | | Fix description starting with a fullstopFrederik Schwarzer2017-05-051-1/+1
| | | | | | | | | | | | | | | Change-Id: Ie8ed872547aa16a2bca2b3886d8c58bffb92b279 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Prevent 2 unnecessary QString allocations for QString::number(0u)Erik Verbruggen2017-05-051-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLocaleData::unsLongLongToString uses qulltoa, which will allocate a zero-length QArrayData. Then with padding a single 0 was put in a QString, which gets prepended to the result. By taking care of this special case, we can now also fast-path the common case where base=10 and no flags nor precision was provided. Change-Id: Ia893b0ea4c77634c24e7cef5aafb06d0ef44c507 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QHash/QMultiHash: fix operator==Giuseppe D'Angelo2017-05-051-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing QHash::operator== does not work when the same keys appear in different order between the two hashes being compared. However, relying on iteration order on a QHash is (as usual) a bad idea and one should never do it. Task-number: QTBUG-60395 Change-Id: Ifb39a6779230e26bbd6fdba82ccc0247b9cdc6ed Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QtCore: include mocsThiago Macieira2017-05-0544-1/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | QInternal::unregisterCallback: don't crash on unregistering during exitThiago Macieira2017-05-051-2/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-60558 Change-Id: Ica9894dc9b5e48278fd4fffd14bb34c6d98d2555 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | 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>
* | | Doc: Do not abbreviate directory in documentationKai Koehne2017-05-041-5/+5
| |/ |/| | | | | | | | | Change-Id: I26e8c5caca31e842adc7a09151b6de2cc17698ed Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | alloca: detect whether alloca.h existsOswald Buddenhagen2017-05-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't depend on QT_HAS_INCLUDE for such an important functionality in QtQml, so detect at configure time. alloca() is not a POSIX function (it apparently first appeared in Version 32V AT&T UNIX), so the actual header that defines it varies from system to system. Clearly, if alloca.h exists, that's the one, so we try it first. On most other systems that don't define it, it's in stdlib.h. The only exception is Windows, where it's actually defined in malloc.h. Task-number: QTBUG-59700 Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: Icd0e0d4b27cb4e5eb892fffd14b4b2b389a4684e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | 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>
* | [doc] QSet: fix return type of insert()Marc Mutz2017-05-031-1/+1
| | | | | | | | | | | | | | It's an iterator, not a const_iterator. Let QDoc figure out the correct one. Change-Id: I7ddd1568adbf811b801c170794465ba14ceed05e Reviewed-by: Edward Welbourne <edward.welbourne@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>
* | QWindowsPipeReader: fix possible invalid invocation of ReadFileEx()Alex Trotsenko2017-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | If the user calls QLocalSocket::setReadBufferSize() with a value less than the current size of the pipe buffer, startAsyncRead() would call ReadFileEx() with invalid parameters: ReadFileEx(handle, nullptr, some_big_value, ...); Change-Id: I3d153e3ec34f8038dc001c1c896aeceb666a8979 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add two missing hyphensEdward Welbourne2017-04-302-2/+2
| | | | | | | | | | | | Change-Id: Ic320c96208fe7f8340c7eb9e9d068813d769056a Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | 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>
* | QSysInfo: Make use of the QT_WARNING_DISABLE_DEPRECATED macroThiago Macieira2017-04-271-5/+1
|/ | | | | | | We have it for a reason. Change-Id: I84e363d735b443cb9beefffd14b8f355aeb8a31c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* 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>
* Fix Clang build: it does not have __attribute__((optimize(x)))Thiago Macieira2017-04-261-1/+1
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8b5f3885b84d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix ICC build with Q_FALLTHROUGHThiago Macieira2017-04-261-1/+1
| | | | | | | | ICC 17 does not yet implement C++17 [[fallthrough]] nor does it support GCC's __attribute__((fallthrough)) Change-Id: I84e363d735b443cb9beefffd14b8aba60a7e3f81 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Android: add logging to QtCore JNI_OnLoadVyacheslav Koscheev2017-04-261-0/+12
| | | | | Change-Id: I15609d14ac39f89bcba72df33d33a25ac23ad516 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QUrl: fix IDN conversion when the ACE form is invalidThiago Macieira2017-04-251-9/+36
| | | | | | | | | | | | | | | | We guarded against the Unicode form being invalid and did not produce an encoded form. But we did not guard against proper Punycode sequences that decode to forms that had not passed the proper Nameprep stage. So check for that and, if it fails, just keep the label in the form we found it in (it's valid STD3 anyway). [ChangeLog][QtCore][QUrl] Fixed a bug that caused certain domain names that look like Internationalized Domain Names to become corrupt in decoded forms of QUrl, notably toString() and toDisplayString(). Task-number: QTBUG-60364 Change-Id: Iadfecb6f28984634979dfffd14b833142cca8d0d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QT_ASCII_CAST_WARN more informativeTor Arne Vestbø2017-04-241-1/+1
| | | | | Change-Id: I4b9aad9cc2f2605a01635c2760e76fde7023f92f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: fix IDN whitelist checking when the TLD is in UnicodeThiago Macieira2017-04-241-2/+2
| | | | | | | | | | The whitelist is kept in ACE form, so if the TLD came in Unicode, we need to run ToASCII before we can check the whitelist. This is slightly inefficient because we'll run the same operation later in this domain. Change-Id: Iadfecb6f28984634979dfffd14b831f37b0f4818 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
* 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>