summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-0215-25/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * Fix overflow-checking additions and multiplication on MinGWMatt Hoosier2015-12-021-1/+1
| | | | | | | | | | | | | | | | | | Intrinsics headers are associated with compilers, not OS's. This change fixes a broken MinGW build triggered by 29bc68cf169b8cf87d306a1c72e12eb9b6fbfce7. Change-Id: Ib9e4ea3e25bf49d38a754a246b9433bc078bbb18 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * doc: add a note about cmd.exe and the QProcess string splitting/joiningThiago Macieira2015-12-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | cmd.exe uses a different set of characters to split arguments on, which is not compatible with CommandLineToArgvW(). See https://technet.microsoft.com/en-us/library/bb490880.aspx. Task-number: QTBUG-49641 Change-Id: Ic90fe6b1cbe84978a02fffff141b8f961a43ad28 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Doc: Omit default argument in describing a function callTopi Reinio2015-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QKeySequence::PortableText is the default value for argument passed to QKeySequence::toString(), and it doesn't need to be mentioned specifically in description for Qt::AA_MacDontSwapCtrlAndMeta enum value. Dropping the parameter shortens the text string, allows browser to better wrap the table text, and gets rid of the automatic horizontal scrollbar in online style. This improves readability for the entire table. Change-Id: I7051f5415a7a100b8c76f23b06b6cb9a2b0699ef Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| * Doc: improvement in if condition about inserting item in listNico Vertriest2015-11-301-2/+2
| | | | | | | | | | | | Task-number: QTBUG-41708 Change-Id: Ibbb115a8ad81f7fba0ce162ae131d4843b19c188 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| * Doc: added QQuickItem also uses UngrabMouseNico Vertriest2015-11-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-37311 Change-Id: I8beac262d92ddb16c225da65aa8a3f80da59074f Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * Remove a reference to Mac OS X 10.4Lars Knoll2015-11-301-2/+2
| | | | | | | | | | | | | | It's been a while since we stopped supporting that version :) Change-Id: I2fa4900945551024ac920c36c47d20b47aee50c0 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
| * Document platform limitations for QCollator::ignorePunctuationLars Knoll2015-11-301-0/+2
| | | | | | | | | | | | | | | | | | OS X and iOS do have a flag for this in their API, but it does not seem to work. We can't support this on Linux without ICU. Change-Id: I81613ad425cb054597f23fac112be665f8d958b6 Task-number: QTBUG-41978 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
| * QVector: prevent resize() from shedding capacityMarc Mutz2015-11-282-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ...even if reserve() hasn't been called before. [ChangeLog][QtCore][QVector] resize() will no longer shrink the capacity. That means resize(0) now reliably preserves capacity(). Task-number: QTBUG-39293 Done-with: Robin Burchell <robin.burchell@viroteck.net> Change-Id: Ie7e4e597126832990b6cfb83bba875c3963b143e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QtBase: combine adjacent qDebug()/qCritical() linesMarc Mutz2015-11-282-5/+5
| | | | | | | | | | | | | | | | | | For qDebug() and qWarning(), this is just an optimization. For qCritical(), which can be fatal, the old code was just wrong. Change-Id: I6d8ab1d7531d766cd41b49569dc0fd4420ecab8b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-285-11/+9
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-272-2/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_p.h src/network/ssl/qsslsocket_mac.cpp src/network/ssl/qsslsocket_mac_p.h src/widgets/kernel/qwidget.cpp Change-Id: I39592cb37d710dfaf8640769ba3c1b637927d7f4
| | * Remove arch/qatomic_mips.h from src/corelib/arch/arch.pri.Friedemann Kleint2015-11-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amend change 110a8c339fa078a4edd09a70239280e482b149f1, fixing: WARNING: Failure to find: arch/qatomic_mips.h Task-number: QTBUG-49168 Change-Id: I7009037d3f4c51c9ed9713b6e94ee43022fe2645 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * OS X: Fix QStandardPaths::standardLocations()Andrew McCann2015-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-49443 Change-Id: I0699dfd3cb4c710ab96c324219444c6294c9d732 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | | Use __builtin_clz/ctz when available.Erik Verbruggen2015-12-011-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | Nicely ask the compiler if it has a built-in for clz/ctz before resorting to CPU specific brute force measurements. Change-Id: Ifa992267ec4528219d7da14524af738316ceeaea Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add qt_safe_pollLouai Al-Khanji2015-12-013-6/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is introduced to safely provide poll(2)-like semantics for socket multiplexing on Unix-like platforms. For platforms where no poll system call is available, an implementation based on select(2) is provided. Change-Id: I320e97dae5924316675a74d1897c48cae292ac6d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-299-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QXmlStreamStringRef: overload ctor from QString with an rvalue versionMarc Mutz2015-11-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only tricky part here is to take the size of the moved-to member, not the moved-from parameter QString object. To avoid accidents, give the lvalue version the same structure. Change-Id: Ic68bb896f1d817c21d913feab43522235c51029b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QFile: document a default constructor as publicAlex Trotsenko2015-11-291-1/+1
| | | | | | | | | | | | | | | Change-Id: Ia45b7e9d2c985432bbac9b5428b5424f8d0d78c7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | QDebug: reduce template bloatMarc Mutz2015-11-282-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When streaming non-Q_FLAG QFlags, factor the common code into a helper function only templated on QFlags<T>::Int and pass what varies as parameters. Then overload the helper function for the most common int type (int) as an out-of-line function, implemented via the primary template to avoid the two going out of sync. That leaves the primary helper template only for special cases (such as future extensions). Change-Id: I70e0001bcfacab9f8765c9b1075fe80b596223f1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QDebug: refactor streaming of sequential containers and add suppoprt for STL ↵Marc Mutz2015-11-282-15/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | types What triggered this change was the use of QVector::toList() in op<<(QDebug, QVector). Only added support for STL types of which we already include the headers. [ChangeLog][QtCore][QDebug] Can now output std::vector, std::list, std::map, and std::multimap. Change-Id: I49581e3038daa7626b00169430b72d3d5175eae7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2015-11-272-21/+26
|\| | | | | | | | | | | Change-Id: Ib43c6f126998eefcfed9a7c1f2bcbac8b4dd05ec
| * | Detect NEON on AArch64Allan Sandfeld Jensen2015-11-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __ARM_NEON is the standard define for NEON instructions support __ARM_NEON__ is only legacy, and specifically not defined in AArch64 builds, which causes us not to detect NEON support there. The NEON assembler files doesn't build with AArch64, so the NEON drawhelper methods must be excluded for now. Change-Id: Ie32f855bde94ee7efd8a8ddb7766c931778e729b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Proof-reading fixes to QCoreApplication documentation.Edward Welbourne2015-11-251-20/+21
| | | | | | | | | | | | | | | | | | | | | Things I noticed while reading - so I fixed them. Change-Id: I48f6f2eef7ac3cf901e2f1305c503fb18f5ab2ae Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * | Revert "Fix deadlock when setting environment variables."Oliver Wolff2015-11-241-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5b62a5e7aabcc818408f2fe28b9760082f474def. This commit is reverted due to two reasons: 1) It was written incorrectly and does not work as is. The ifdefs should be ifndefs. In its current state, it does the exact opposite of what it is supposed to be doing. 2) There is another environment access inside qsimd.cpp (which checks QT_NO_CPU_FEATURE). This access causes the app to hang. All in all that approach is not sustainable as we might get bitten by environment access again and again. Instead we should use another environment container or use a recursive mutex for WinRT and Windows CE. Task-number: QTBUG-49529 Change-Id: Iaca76404dc1023551a7c25489a609681135765fd Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
| * | Fix deadlock when setting environment variables.Samuel Nevala2015-11-231-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt uses QHash as the container for faking environment variables on Windows Runtime and CE. Environment variable manipulation functions are protected by mutex. Accessing the QT_HASH_SEED environment variable inside QHash can lead to situation where qputenv() call leads to qgetenv() call and that leads to a deadlock. Since the application environment is faked anyway, drop support for QT_HASH_SEED and ifdef that functionality out on those platforms. Documentation is updated to reflect changes. Task-number: QTBUG-49529 Change-Id: I1b1c28cb0b041fe2a63ca3dce57068fcb46505a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | | Aarch64: fix Q_PROCESSOR_ARM_V8 detection.Erik Verbruggen2015-11-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The macro __ARM64_ARCH_8 is only set by Apple's flavor of clang. GCC and mainline clang set __ARM_ARCH to 8, and set __ARM_ARCH_8A (when applicable). Change-Id: I356b785ffdbfedf8f1ed682840db431db2779ba5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Centralize dropping of trailing zeroes when converting doublesUlf Hermann2015-11-242-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | We're never interested in trailing zeroes, unless the number is exactly 0. qdtoa would return an empty string if the result was exactly '0', which is also fixed by this change. Change-Id: I3ba2f7e835b92d54d9008ad03fdf6ce5fb3af8a4 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Don't call setlocale(3) in bootstrap codeUlf Hermann2015-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When bootstrapping we might rely on sscanf(3) for parsing doubles from strings. We don't want this to be localized. Task-number: QTBUG-49616 Change-Id: I1607bb750b479fd7007dd0d875d600be59caa859 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | QFileSystemWatcher: print out path in case of error.David Faure2015-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory After: QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch("/home/dfaure/.local/share/user-places.xbel") failed: No such file or directory (assuming "%{function}:" in $QT_MESSAGE_PATTERN) Change-Id: I6cc68529516b33683bd69fbb61e04df8a8aa880d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2015-11-238-24/+117
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-11-238-24/+117
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/thread/qthread_unix.cpp Change-Id: Ia08d613c3f0bd08cb6dc3e3a57257207dfd4a099
| | * | OSX: fix build.Erik Verbruggen2015-11-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the QT_USE_NAMESPACE up, so any use of Q* classes won't result in compilation errors when Qt is configured to be in a namespace. Change-Id: Id559c86798529f6cad43a75fce303c108ce820bc Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * | Doc: added doc about removal option qmljsdebugger by QCoreApplicationNico Vertriest2015-11-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-46597 Change-Id: I2ed42480bd96119f04828a7a965c348f7c773acd Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| | * | winrt: Merge Languages and ManifestLanguages for QLocale::uiLanguagesOliver Wolff2015-11-191-7/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-48140 Change-Id: I904ad48e7bc48867a362e3f6c5ca1516e55ed872 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| | * | OS X: Add opt-in for CoreFoundation event dispatcherMorten Johan Sørvig2015-11-192-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt-in by setting QT_EVENT_DISPATCHER_CORE_FOUNDATION=1 This will make QCoreApplication and QThread create a QEventDispatcherCoreFoundation instead of a QEventDispatcherUNIX. With this change we can now support calling native API that requires a running Core Foundation event loop on the QCoreApplication main thread and secondary threads. Previously this was only supported on the QGuiApplication main thread. Rewrite the #ifdef event dispatcher logic slightly: both OSX and GLIB now gets an "else" branch for the UNIX event dispatcher, instead of the current "dangling else" pattern which only works for one #ifdef case. Change-Id: If853567fa097fe007502b0804c2307a989719866 Task-number: QTBUG-46625 Task-number: QTBUG-48758 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | QXmlStreamStringRef: unbreak move special member functionsMarc Mutz2015-11-191-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QXmlStreamAttribute move operations expect QXmlStreamStringRef to have move special member functions, but in fact the non-trivial QXmlStreamStringRef dtor prevented them from being generated by the compiler. We can't remove the dtor, because it's exported :( So provide all the move special member functions by hand, and since their presence in turn prevents the copy special member functions from being generated, provide those too. Change-Id: I494aea24981cdb661abe33a96976a363cfe7ef1b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * | QXmlStreamStringRef: mark as shared-not-movable-until-qt6Marc Mutz2015-11-192-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requires adding member swap. Member-swap is also necessary to fix the deleted move-assignment operator of this class, on which QXmlStreamAttribute heavily relies for its own move assignment operator. That's why it's not proposed for dev, but 5.6. Change-Id: Id7d0823d44fc6e55ada7c096ae95444f6bb50963 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * | Replace backwards Java-style iteration with new reverse_iteratorsMarc Mutz2015-11-191-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Faster, and, thanks to the new reverse_iterators, just as convenient. Change-Id: Ibc6c64051a8ede4a47428e9271ffbeaa921fc255 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
| | * | qfactoryloader: static qt compile fixTim Blechmann2015-11-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | statically linked qt does not compile, as versionKeyLiteral() is unused, causing clang to complain: error: unused function 'versionKeyLiteral' [-Werror,-Wunused-function] Change-Id: I6a233081e7c58fce75ece82616f937f29a23a81b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | | Use "shortest" double conversion for JSONUlf Hermann2015-11-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-42419 Change-Id: I649c4de96a2e41078e139c0f382e5a6cf96d3bb9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | | Add flags to omit/reject padding in scientific notation exponentsUlf Hermann2015-11-239-68/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EcmaScript format for printing doubles in exponent form differs from Qt's format only in this aspect. EcmaScript explicitly prohibits leading zeroes in exponents. It is thus worthwhile to add those flags in order to be able to generate and parse doubles in compliance with EcmaScript. [ChangeLog][QtCore][QLocale] Additional flags in QLocale::NumberOption allow generating and parsing doubles in EcmaScript compliant format. Change-Id: Ia7b82c2e67bb8b80bd890014ff5cd4563faf2a03 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | | Interpret precision == -128 as "shortest" double conversionUlf Hermann2015-11-236-32/+65
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use this for converting doubles with QVariant. We generally want exact results there, rather than adding rounding errors whenever we convert. [ChangeLog][QtCore][QLocale] Added special value for double conversion precision to get shortest accurate representation. Change-Id: I905b8a103f39adf31d24b6ce2c8a283cf271b597 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Remove remaining support for BlackberryLouai Al-Khanji2015-11-2125-1447/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | The platform is no longer supported or actively maintained, and is in the way for improvements to the Unix event dispatcher and QProcess implementations. Change-Id: I3935488ca12e2139ea5f46068d7665a453e20526 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Long live qUtf16Printable()Marc Mutz2015-11-213-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::asprintf() has the ability to take a ushort* array as obtained from QString::utf16() and insert that into the output with an %ls conversion. But no-one ever used this, because just passing QString::utf16() to QString::asprintf() creates a warning about wchar_t* expected, but ushort* provided. The new qUtf16Printable() macro adds the necessary casts (via void* to prevent any "type-punned pointer" warnings) to make passing QString::utf16() to QString::asprintf() work silently. This should greatly reduce the need to do a round-trip via utf-8 just to print the contents of a QString. [ChangeLog][QtCore] Added qUtf16Printable(). Change-Id: I7ddd8d2b2a2191c9faa26aca95d49850d94b287c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QPair: use std::type_traits for exception specificationsMarc Mutz2015-11-201-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should solve problems with our use of the noexcept operator, because that's how std::pair is defined, too. Mid-term, we should kill QPair and use std::pair instead. It really has gotten way too complicated to implement a C++11 pair correctly. Task-number: QTBUG-48780 Change-Id: Ied0acd220e5131000a957dc356d6efcdd8f83828 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QString::vasprintf: remove egcs-2.91.66 workaroundMarc Mutz2015-11-201-2/+1
| | | | | | | | | | | | | | | | | | | | | We don't support that compiler anymore. Change-Id: I6d100a2d149ce4e506c7f8be3b56a33fa9d7092f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Add {add,sub,mul}_overflow for signed integers.Erik Verbruggen2015-11-201-1/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C++, signed overflow math is Undefined Behavior. However, many CPUs do implement some way to check for overflow. Some compilers expose intrinsics to use this functionality. If the no intrinsic is exposed, overflow checking can be done by widening the result type and "manually" checking for overflow. Or, for X86, by using inline assembly to use the CPU features. Used in QtQml. Change-Id: I2ef2523ccaa98f6757a45e24862a2fa730a26bb0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QString::vasprintf: avoid allocating memory for format text copied verbatimMarc Mutz2015-11-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by using the new QUtf8::convertToUnicode() function in conjunction with QString::resize(). For this to be a clear optimization, resize() must be banned from shrinking capacity, which another patch will implement. Change-Id: I6394af95ef1aaae131e23a4227734eb76fa685cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Add a QUtf8::convertToUnicode() overload that operates on an existing bufferMarc Mutz2015-11-192-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and therefore doesn't need to allocate and thus can be marked as nothrow. Technically, the function doesn't have a wide contract, because it has the precondition that the buffer pointed to by the first argument needs to be large enough to hold the result. But that precondition can't be checked from within the function, so no failure can be generated for it and thus the nothrow guarantee is acceptable (and desireable). Change-Id: Iaf6ea6788ef6b4bbb6d8de59a3d0b14d66582307 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>