summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add QStringView::split() methodsLars Knoll2020-06-011-13/+37
| | | | | | | | | | | | | Since QString::split() is not going away in Qt 6, we should aim to provide API symmetry here, and ease porting existing code from QString(Ref) to use QStringView. This is easier than having to port everything to use tokenize() at the same time. tokenize() will however lead to better performance and thus should be preferred. Change-Id: I1eb43300a90167c6e9389ab56f416f2bf7edf506 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMimeType::suffixForFileName shouldn't lowercase the file suffixDavid Faure2020-06-011-0/+6
| | | | | | | | | | | | | It was returning a lowercased suffix because it was extracting it from the pattern (*.txt) rather than from the filename ("README.TXT"). This broke expectations on the application side, since this method is documented to return a suffix from the given filename. Ref: https://bugs.kde.org/show_bug.cgi?id=402388 Change-Id: I7dae13db31280249d3f592fa9592c4067804e22d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port QRegularExpression to QStringView, drop QStringRefGiuseppe D'Angelo2020-05-311-10/+7
| | | | | | | | | | | | | | | | | | | | | | The idea is pretty simple -- add QRegularExpression matching over QStringView. When matching over a QString, keep the string alive (by taking a copy), and set the view onto that string. Otherwise, just use the view provided by the user (who is then responsible for ensuring the data stays valid while matching). Do just minor refactorings to support this use case in a cleaner fashion. In QRegularExpressionMatch drop the QStringRef-returning methods, as they cannot work any more -- in the general case there won't be a QString to build a QStringRef from. [ChangeLog][QtCore][QRegularExpression] All the APIs dealing with QStringRef have been ported to QStringView, following QStringRef deprecation in Qt 6.0. Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for count() to QStringViewLars Knoll2020-05-301-0/+51
| | | | | | | Make the API more symmetric with regards to both QString and QStringRef. Change-Id: Ia67c53ba708f6c33874d1a127de8e2857ad9b5b8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add toInt() and friends to QStringViewLars Knoll2020-05-291-0/+113
| | | | | | | | | Make the API more symmetric with regards to both QString and QStringRef. Having this available helps making QStringView more of a drop-in replacement for QStringRef. QStringRef is planned to get removed in Qt 6. Change-Id: Ife036c0b55970078f42e1335442ff9ee5f4a2f0d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add a way of notifying QFutureWatcher when pause is in effectSona Kurazyan2020-05-292-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | Because setting QFutureInterface to paused state does not mean that the computations that are already in progress will stop immediately, it may be useful to get notified when pause actually takes effect. Introduced the QFutureWatcher::suspended() signal, to be emitted when there are no more computations in progress, and no more result ready or progress reporting signals will be emitted, i.e. when pause took effect. Added {QFuture, QFutureWatcher}::isSuspended() methods for checking if pause took effect. QtConcurrent will now to send QFutureCallOutEvent::Suspended event when the state is paused and there are no more active threads. [ChangeLog][QtCore][QFutureWatcher] Added a new QFutureWatcher::suspended() signal, to be emitted when pause took effect, meaning that there are no more computations in progress. Added {QFuture, QFutureWatcher}::isSuspended() methods for checking if pause took effect. Fixes: QTBUG-12152 Change-Id: I88f2ad24d800cd6293dec63977d45bd35f9a09f0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Turn badly-named test into two data rows of another testEdward Welbourne2020-05-291-16/+6
| | | | | | | | | | | | Since ancient times, tst_QDateTime::fromString_LOCALE_ILDATE() has claimed to be Windows-only, although there is nothing MS-specific about it; its name also purports to implicate locale, which it doesn't. Turn it into two data rows for the more general fromStringDateFormat() test, with no extra #if-ery about it. Change-Id: I239c0f80f8f7fa42d498a0f801cc8edfb1db3d8c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Make tst_QTextLayout::textWidthVsWIdth() more robustEskil Abrahamsen Blomfeldt2020-05-291-0/+15
| | | | | | | | | | | | | | | Some fonts misreport the minimum right bearing, and in those cases we may not be able to do a perfect text layout inside the bounds set. This is a limitation we have chosen to accept. To avoid random failure when testing this, we detect the case and skip the test if we see that it may fail. Fixes: QTBUG-84415 Pick-to: 5.15 Change-Id: I6b53ea2631c5c6e476e2902b5514829a2141796f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement support for QProperty<T> with a static observerSimon Hausmann2020-05-281-0/+38
| | | | | | | | | | | | | | | | | | | | | | | A common pattern in Qt Quick will be QProperty members that are connected to a callback that needs to perform something when the value changes, for example emitting a compatibility signal or marking scene graph node data dirty. To make such a pattern more efficient, a new QNotifiedProperty type is introduced that offers the same API as QProperty<T>, with two changes: (1) The template instantiation not only takes the property type as parameter but also a callback pointer-to-member. (2) Since that member itself cannot be called without an instance and to avoid storing an instance pointer permanently, the API for setBinding and setValue are adjusted to also take the instance pointer. For the former it gets stored in the binding, for the latter it is used to invoke the callback after setting the new value. Change-Id: I85cc1d1d1c0472164c4ae87808cfdc0d0b1475e1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix ExtendedRgb and Rgb encoding comparisonsAllan Sandfeld Jensen2020-05-281-0/+20
| | | | | | | | ExtendedRgb should be treated as Rgb as it can be an automatic upgrade. Pick-to: 5.15 Change-Id: I2942a1067ed5cacb2f60f303f467887cb44c36dd Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* rhi: Harmonize create-destroy API pattern with the rest of QtLaszlo Agocs2020-05-2826-313/+313
| | | | | | | | | | For historical reasons we use build and release instead of create and destroy. This becomes confusing now that more modules in Qt start taking QRhi into use. Migrate to the more familiar naming, so those who have used QWindow or QOpenGLContext before will find it natural. Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Rework QLocale and QDateTime tests that expect CET abbreviationEdward Welbourne2020-05-282-42/+11
| | | | | | | | | | | | | | | | | | | | | | The name CET is locale-dependent; but QLocale doesn't know about localization of time zone names. Such abbreviated zone names are, in any case, potentially ambiguous - various zones around the world have collisions - so they can't be relied on. QTimeZone's various backends have differing handlings of how to abbreviate zone names (MS's provides no abbreviated names at all); and it appears macOS actually follows the relevant localizations. So it is hopeless to hard-code the expected zone abbreviations. Changed the tests to consult QTimeZone for the abbreviation and compare what it gets with the results of checks which should match this. This is less stringent, but it is at least robustly correct, thereby getting rid of assorted kludges and #if-ery. Pick-to: 5.15 Task-number: QTBUG-70149 Change-Id: I0c565de3fd8b5987c8f5a3f785ebd8f6e941e055 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add tests for a couple of edge casesDimitrios Apostolou2020-05-281-0/+18
| | | | | Change-Id: I1cd799cc671fa2191e20d4681632588dc79e98dd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QDateTimeParser recognize local time offsetsAndrei Golubev2020-05-281-1/+39
| | | | | | | Fixes: QTBUG-84209 Pick-to: 5.15 Change-Id: Iedbc7beafcaa55c72fec3ac5a5f519c6ed5f7770 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move windowsuiautomation API support into QtGuiFriedemann Kleint2020-05-272-5/+4
| | | | | | Task-number: QTBUG-83255 Change-Id: Ibface71931b6384494842ba9744d76f738c5ca85 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add a QPropertyAliasUlf Hermann2020-05-271-0/+47
| | | | | | | | | | | | A property alias is the equivalent of the "alias" keyword in QML. It provides the same API as QProperty, but redirects any access to the QProperty it was initialized with. When the original property is destroyed the binding becomes invalid and ignores any further acccess. Task-number: QTBUG-84370 Change-Id: I0aef8d50e73a2aa9e7703d51194d4c5480573578 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove deprecated QProcess methodsVolker Hilsheimer2020-05-273-186/+13
| | | | | | | | | | | | | Add default parameter for arguments in start, startDetached, and execute for better source compatibility with Qt 5.15. This has the risk of then hiding incorrect calls to the previous overload taking a single "command" strings if code is ported from pre-5.15 or ignores deprecation warnings. This is acceptable, given that the alternative is that all calls to these functions would require a default constructed QStringList as the second parameter. Change-Id: I1ba4df97ac4894d007da5083c8359015d784ddbb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QTextMarkdownImporter: allow nesting text span formattingShawn Rutledge2020-05-271-2/+112
| | | | | | | | | | | | | | | The bold+italic combination indicated by ***triple stars*** requires this; but it enables combinations of italics, bold, strikeout, anchor text (and associated link formatting), image alternate text, and inline code formatting (monospace). A code span overrides the formatting from surrounding spans (which might be a bug to fix in another patch, if we compare to how md2html formats code nested in bold-italics for example), but the format stack restores state when any char format span ends. Task-number: QTBUG-81306 Pick-to: 5.15 Change-Id: I289556fa53de400eb50a4d159b9b344eafc517da Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QProperty: Support multiple observersUlf Hermann2020-05-271-0/+36
| | | | | | | | | Previously, only the first observer would get notified. Also, make sure that the notifiers are always retained when switching between bindings and values. Change-Id: I9c25c0f2e288dac3a335b68e618f7ddeb44be25a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QProperty: Apply coding style and avoid warningsUlf Hermann2020-05-271-2/+2
| | | | | Change-Id: I14efdb293a4be39b3849b34bd8013fdab016ce7e Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* Don't queue events in QFutureWatcher when pause is requestedSona Kurazyan2020-05-271-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When QFutureWatcher (or QFutureInterface) is paused, it doesn't mean that it will take effect immediately: the pending tasks may still be in progress and keep reporting results. At the moment QFutureWatcher will queue those events and report only with the next resume. This behavior is wrong, QFutureWatcher should not decide when to report events, the sender should decide when is the right time. There's no benefit in reporting already happened events with delay. Because of this, even the pause event itself was being reported after resume. Fixed the behavior by removing the logic of queueing events when the state is set to "paused". It seems unlikely that the users of QFutureWatcher rely on reporting events with delay. [ChangeLog][Important Behavior Changes][QtCore] QFutureWatcher will not immediately stop delivering progress and result ready signals when the future is paused. At the moment of pausing there may be still computations that are in progress and cannot be stopped. Signals for such computations will be still delivered after pause, instead of being postponed and reported only after next resume. Fixes: QTBUG-12152 Change-Id: I9f0b545ac096578c52cc72d60575c018c01e3368 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* moc: handle include directives in enumsFabian Kosmale2020-05-274-0/+59
| | | | | | | | | | | | When including files, moc inserts a MOC_INCLUDE_BEGIN and MOC_INCLUDE_END token into the token stream. Those are already handled in the toplevel Moc::parse function, but parseEnum lacked support so far. Pick-to: 5.15 Fixes: QTBUG-80578 Change-Id: I35c8fd959347d94af20090b3a505dd9e6bfaff88 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a property to QSFPM to show children of accepted itemsGiulio Camuffo2020-05-261-0/+32
| | | | | | | | [ChangeLog][QtCore][QSortFilterProxyModel] Add a 'autoAcceptChildRows' property to always show children rows of accepted rows. Change-Id: I2402469ece438179d0f19888b9775cc27cf5c749 Reviewed-by: David Faure <david.faure@kdab.com>
* Blacklist imageAtRightAlignedTab in CentOSHeikki Halmet2020-05-251-0/+1
| | | | | | Task-number: QTBUG-46206 Change-Id: I98add304d052f3fc5c0ab80077ba66e8e159748e Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* BLACKLIST test_Gestures tests for new platformsHeikki Halmet2020-05-251-1/+11
| | | | | | Task-number: QTBUG-84258 Change-Id: I4722444ffd8a9b1ebc262a424778a19704881832 Reviewed-by: Liang Qi <liang.qi@qt.io>
* BLACKLIST QWidget tests for CentOSHeikki Halmet2020-05-251-0/+2
| | | | | | | | | Tests focusProxyAndInputMethods and multipleToplevelFocusCheck will be blacklisted Task-number: QTBUG-84259 Change-Id: I7d5baf1e700192eed3c7c8dcfe671e247f11b8c7 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Blacklist tst_QTimer::zeroTimer on Ubuntu 20.04Tony Sarajärvi2020-05-251-0/+2
| | | | | | Task-number: QTBUG-84291 Change-Id: I198cfe813617a5bb65b0e1059a43b6933d610720 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Blacklist tst_qfont tests on new platformsTony Sarajärvi2020-05-251-0/+6
| | | | | | Task-number: QTBUG-84248 Change-Id: I5285a12a9f1feaf748fc1734f122473c02d115e5 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Remove references to deleted file shift-jis.txtKari Oikarinen2020-05-242-2/+0
| | | | | | | Amends 33bb695a2895fb7199b256a4fd76923c32a8587a. Change-Id: I7a7d90dc406ffbf015e760a7c41534564bfbe13e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QSslCertificate: overhaul ASN.1 datetime parsingGiuseppe D'Angelo2020-05-221-0/+6
| | | | | | | | | | Instead of manual string splitting (EW!), use QDateTime parsing. Moreover, X.509 certificates *must* have a valid start/end date. In case of parsing failure, reject the certificate. An autotest for this last case is coming in a separate patch. Change-Id: I934bf9e6a4a92e4befdb3b0f9450f76f67bad067 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* RHI: Store texture handle as 64-bit intEskil Abrahamsen Blomfeldt2020-05-222-9/+5
| | | | | | | | | | | | | | | | | | When storing a void* pointer to the texture handle, we had to ensure that the variable would exist until the build phase, which is error prone and caused errors in QQuickWidget because we copied the texture ID from the FBO into a local variable before passing it into QQuickWindow::setRenderTarget(). The reason for using a void* was that we cannot know the width of the handles in the different backends, but we do know that they are 64-bit at maximum, so instead of storing potentially dangling pointers, we just make it a 64-bit integer and cast it back and forth in the backends. Task-number: QTBUG-78638 Change-Id: I7951e24351ddb209045ab6197d81eb1290b4da67 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Adjust resize() behavior of QString and QByteArray to match Qt 5Lars Knoll2020-05-212-2/+6
| | | | | | | | | | | | | resize() to a smaller size does not reallocate in Qt 5 if the container is not shared. Match this here. As a drive-by also fix resize calls on raw data strings to ensure they are null terminated after the resize. Change-Id: Ic4d8830e86ed3f247020d7ece3217cebd344ae96 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fuzzing: Add fuzz target for QImage::loadFromDataRobert Loehning2020-05-192-0/+55
| | | | | | | Pick-to: 5.15 Change-Id: Ie67eb9be80fe42d463c566c728c73c9c92c2081b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Liang Qi2020-05-193-5/+31
|\
| * Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-05-183-5/+31
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/text/qbytearray.cpp Change-Id: I63706409464d31391012bacdadfd1f6300509787
| | * Merge remote-tracking branch 'origin/5.15.0' into 5.15Qt Forward Merge Bot2020-05-142-5/+30
| | |\ | | | | | | | | | | | | Change-Id: I06396fa0a3d1687a0935e48d290358edbb0e59e8
| | | * QCborValue: catch overflow in QByteArray when decoding chunked stringsThiago Macieira2020-05-072-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We checked against integer overflow, but not against overflowing the QByteArray size limit. That caused a std::bad_alloc to be thrown, which is bad when decoding unknown data. QCborStreamReader wasn't affected, since it doesn't merge chunks. Change-Id: I99ab0f318b1c43b89888fffd160c36f495fada87 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | Blacklist imageAtRightAlignedTab in SLESTony Sarajärvi2020-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-46206 Change-Id: I8da530eedcef937f5dea6c7507be74cbe26186a1 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* | | | Enable setting custom QThreadPool for QtConcurrent methodsJarek Kobus2020-05-184-7/+589
|/ / / | | | | | | | | | | | | | | | Task-number: QTBUG-53465 Change-Id: Icff05d5f65dce453ff702502b85c35e20fca86a9 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | | QTaggedPointer: verify constexpr'ness of some ctorsMarc Mutz2020-05-161-0/+33
| | | | | | | | | | | | | | | Change-Id: I44196ba3a823ce04b7c82aacfb9da301cc0f1886 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Add support of cancellation handler callbacks to QFutureSona Kurazyan2020-05-151-16/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added QFuture::onCanceled() method, for attaching handlers to be called when the QFuture gets canceled. Change-Id: I1f01647d6173ba0c1db6641e14140108b33ac7c4 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Add support of connecting signals to QFutureSona Kurazyan2020-05-151-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduced QtFuture::connect(sender, signal) function returning a QFuture object, which is resolved when the signal is emitted. Task-number: QTBUG-81589 Change-Id: Idbe301eb247b468b9b34f3470c3359d6a7af2f3a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Remove deprecated method from QFont, QFontMetrics, and QFontInfoVolker Hilsheimer2020-05-151-16/+1
| | | | | | | | | | | | | | | Change-Id: Ifc8fb5c5d53359b33b8abab3bbee3de61bfef539 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | QMetaType: Support char16_t and char32_tFabian Kosmale2020-05-151-0/+6
| | | | | | | | | | | | | | | Change-Id: Ieec6d4bc64967d875ea12b31638aab05bc682ea3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Reduce QDesktopWidget API to bare minimumVolker Hilsheimer2020-05-155-202/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The class is documented as obsolete, and the majority of APIs is marked as deprecated. In this first phase, remove all explicitly deprecated APIs and trivial implementations. The test case is complete removed; what's left when code that uses any of those deprecated methods is removed is not testing anything meaningful. For some methods, there is no practical replacement using QScreen yet, and QDesktopWidget is still used in QWidget internals. Those require refactoring to only use QScreen before the rest can be removed. Change-Id: I8f7c968ec566820077221d37b817843758d51d49 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Deprecate QGuiApplication::paletteChanged() signalAndy Shaw2020-05-151-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than have a paletteChanged() signal which can be connected to for tracking when the application palette has changed, then it is better to use the event that is sent to all windows and the application itself. That way it is easy for a window/widget or item that cares about the change to the application font to catch it in the event() function. [ChangeLog][QtGui][QGuiApplication] Deprecated paletteChanged() signal in favor of QEvent::ApplicationPaletteChanged. Change-Id: I95da211e30590e357007cc14d8ee266baceba7b3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QString: fix an aliasing issue in remove(QString)Marc Mutz2020-05-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even in Qt 5, remove() can be passed an alias to *this. In Qt 6, with the advent of substring sharing, this will become even more pronounced. Use the same fix as was already used in QString::insert(). Pick-to: 5.15 Change-Id: I1a0d3d99fd7dff6e727661646d2cbfdc94df2682 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | tst_qstringref: remove some wtf?Marc Mutz2020-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As best as I can guess, this used the QString::operator=(char), which I locally removed. Before that lands in Qt, remove this ... wtf? Pick-to: 5.15 Change-Id: Ie083fe69500d6b5b633416f89f5dd1d7068c20b2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Make utf8_source the default for qmake buildsLars Knoll2020-05-141-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now assume that source code is encoded in UTF-8 by default on all platforms (and verify this with an auto test). Provide a CONFIG+=no_utf8_source option for backwards compatibility. [ChangeLog][qmake] qmake will tell the compiler that source code is encoded in utf-8 by default. This mainly has an effect on Windows, where MSVC still assumes source code is encoded in the current ANSI code page. Use CONFIG+=no_utf8_source to get back the Qt 5 behavior. Change-Id: I6dcafcaeefdea7d3907ccb723aeb7d23ccc0f04f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QStringView: add converting constructor from array-like containersGiuseppe D'Angelo2020-05-141-7/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Centralize, rather than keeping adding constructors from any array-like container. A more robust implementation, likely following the converting constructor for std::span ([span.cons]), is out of scope for C++17 and will require C++20's ranges and concepts. [ChangeLog][QtCore][QStringView] QStringView can now be constructed from any contiguous container, as long as they hold string-like data. For instance, it's now possible to create a QStringView object from a std::vector<char16_t>, a QVarLengthArray<ushort> and so on. Change-Id: I7043eb194f617e98bd1f8af1237777a93a6c5e75 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>