summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QTreeView: Reset the pressed index if the decoration was pressed onAndy Shaw2019-11-291-2/+16
| | | | | | | | | | | We need to reset the pressed index when the decoration was pressed on otherwise if the mouse ends up over an already selected item that was previously clicked on. This prevents it from thinking that the mouse has been released on this item right after pressing on it. Fixes: QTBUG-59067 Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* tst_qsslcertificate: fix subjectAndIssuerAttributesTimur Pocheptsov2019-11-282-14/+9
| | | | | | | | | Instead of OID as string, OpenSSL returns a human-readable name. No need to fail then, use such a name in QVERIFY if OID not found. Fixes: QTBUG-80329 Change-Id: I4392fc9f37367f7c34c05d172db015b44e2a8497 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* More polish of the manual High DPI testFriedemann Kleint2019-11-281-22/+76
| | | | | | | | | | | | | | | | The aim is to make it suitable to test for High DPI bugs, ideally removing the need to provide bug report examples. - Add descriptive window titles/output - Add options to force scaling on/off - Change the updating of the text to be done in screenChanged() and log the signal. - Rearrange the layout and show the descriptions as labels Task-number: QTBUG-80323 Change-Id: Ia44c184c2b38cb18045c40b440fe785c6c17925f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Polish the manual High DPI testFriedemann Kleint2019-11-283-114/+145
| | | | | | | | | | | | - Use C++ constructs like range-based for, member initialization - Fix formatting in a few places - Silence clang warnings: - Add override - Make member variables private Task-number: QTBUG-80323 Change-Id: I5b0fda06acb6c8054aafa4dd934b763f8493a6b3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Work around macOS's inconsistency in naming of India's time-zoneEdward Welbourne2019-11-281-0/+9
| | | | | | | | | | | | | macOS fails to create a zone for the name its own systemTimeZone claims to have (see new comment). So make sure we do consistently recognize the name systemTimeZoneId() returns, using systemTimeZone from which we got its name. Add minimal testing of system time-zone. Fixes: QTBUG-80173 Change-Id: I42f21efbd7c439158fee954d555414bb180e7f8f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QWidget: don't set WA_PendingMoveEvent when geometry does not changeChristian Ehrlicher2019-11-271-0/+34
| | | | | | | | | | | | | | When the geometry of a hidden widget was set with setGeometry(), WA_PendingMoveEvent and WA_PendingResizeEvent were set unconditionally even if the crect already had the correct value. This lead to unneeded Move/Resize events within sendPendingMoveAndResizeEvents(). Fixes: QTBUG-75475 Fixes: QTBUG-79906 Change-Id: Ibbe03882f039948b6b7c04887420741ed2e9c0f7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Be consistent in the RFC2822Date invalid character testsEdward Welbourne2019-11-273-41/+96
| | | | | | | | | | | | | The ones we reject used a zero offset while the one that does parse (though it shouldn't - revised comment) has a one hour offset. Made them all use that offset and added a partner test that has no invalid characters, so ensure the success of the invalid character tests isn't due to falsely rejecting the valid date/time text to which the invalid characters are added. Task-number: QTBUG-80038 Change-Id: I6e3dd79b981af6803e60877229c56599cfd719cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Permit leading space at start of RFC 2822 Date formatEdward Welbourne2019-11-273-0/+32
| | | | | | | Relevant RFCs explicitly permit such space. Change-Id: I8eb444e96287368cbbf973c77513b43d1d36f972 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make Qt::RFC2822Date's doc match up with its implementationEdward Welbourne2019-11-273-3/+3
| | | | | | | | | | | | | | | | | | The qdatetime implementation's rfcDateImpl() uses regexes which did not match its comments; nor did either the regexes or the comments match what was documented. A review of relevant RFCs suggests we should revise this in future, probably at Qt 6. The documentation also only addressed the formats recognized when parsing a date-time, without indicating how they are serialised or how dates and times are handled separately. Added a note to the tests for the read-only formats, to remind the reader that the RFCs merely recommend recognising these - be permissive in what you expect and strict in what you deliver. Change-Id: I0f0bec752e7a50bde98cceceb7e0d11be15c6a6f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCborValue: Extend the constructor to also create extended typesThiago Macieira2019-11-231-12/+59
| | | | | | | | | | | | | | | We already did that when parsing from CBOR binary data, so the code was already present. [ChangeLog][QtCore][QCborValue] The constructor taking a CBOR tag and a value to be tagged now attempts to convert to a QCborValue extended type. For example, if the tag is 0 (UnixTime_t) and the payload is a number, the resulting object will become tag 1 (DateTime) and the payload will be the the ISO-8601 date/time string. Fixes: QTBUG-79196 Change-Id: I6edce5101800424a8093fffd15cdf650fb2fc45c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix QCborValue::toCbor with non-ASCII URLsThiago Macieira2019-11-231-0/+3
| | | | | | | Found while fixing QTBUG-79196. Change-Id: Ia2aa807ffa8a4c798425fffd15d841657def99af Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fuzzing: Update location of testcases in ReadmeRobert Loehning2019-11-211-1/+2
| | | | | | | At the time of writing, they were still planned to be in qtbase. Change-Id: I27cba2bbd176d930990270ea68f077ec6e0a2d5b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* tst_QScopeGuard: Remove unused lambda captureKari Oikarinen2019-11-191-1/+1
| | | | | | | | | | qt5/qtbase/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp:100:38: warning: lambda capture 'caught' is not used [-Wunused-lambda-capture] auto cleanup = qScopeGuard([&caught] { s_globalState++; }); ~^~~~~~ Change-Id: I0d9b85896594f3ea35c8003846d4ac7ab5e33d16 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDom: use QLocale::C when converting a double to a xml attributeChristian Ehrlicher2019-11-191-0/+69
| | | | | | | | | | | | | | | QDomElement::setAttribute(QString, double) did not use QString::setNum() but qsnprintf(). This is wrong because qsnprintf() is using the current locale instead QLocale::C. It was also inconsistent to QDomElement::setAttributeNS() which was already using QString::setNum(). Also fix the documentation which stated that all QDomElement::setAttribute() format the values according the current locale. Fixes: QTBUG-80068 Change-Id: Iabb0b39c0d0723060527542c283a5435f26f31ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "[macOS] Skip test that triggers a buffer overflow in CoreFoundation"Edward Welbourne2019-11-181-6/+0
| | | | | | | | | | | | Allegedly Apple has fixed the bug that made this necessary, so we should be able to include these two test-cases once more. This reverts commit ba9585bd02ba975013d73a75fa2382ffa708c990. Fixes: QTBUG-69875 Change-Id: I5ac6019c0d647691eda6cdbb2a53e7471859d4a3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QLineEdit: Fix End key for input masksDaniel Teske2019-11-151-0/+8
| | | | | | | | | | | | | | | | | | | | | Consider this simple example: QLineEdit edit; edit.setInputMask( "9-9-9-9-9-9" ); edit.show(); Without any input, m_text will contain: " - - - - - ". text() removes the input mask's mask characters from that and returns " ". A string with 6 spaces. Thus currently the End key jumps to position 6, which is in the middle of the string. Using m_text the End key jumps to the actual end. [ChangeLog][QtWidgets][QLineEdit] Fixed End key in combination with certain input masks. Task-number: QTBUG-16187 Task-number: QTBUG-20414 Change-Id: Ibb30a1dfa2f78103611b5afc9971dc43e8bdcc4a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTreeView: make sure to not ask the old model during setModelChristian Ehrlicher2019-11-141-0/+14
| | | | | | | | | | | | Within QTreeView::setModel() the header might emit columnCountChanged which then tries to update the geometries based on the old model which is wrong. Fix it by setting geometryRecursionBlock to true so QTreeView::updateGeometries() will not ask the old model for it's data. Fixes: QTBUG-75982 Change-Id: Ia0dd36cd7c6c5347fbc285deac43da6941accbe7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Allow longer time-zone components on AndroidEdward Welbourne2019-11-142-4/+19
| | | | | | | | | | | | | | | Android uses its own time-zone naming, which includes a zone called "Canada/East-Saskatchewan", whose second component is 17 characters long. This violates a rule in the IANA naming scheme for zones, that limits components to 14 characters each. So tweak the isValidId() check to allow Android its long names. Android has added Outer Mongolian time-zones, which are as borked as many others in 1970, so blacklist those transitionEachZone() tests. Fixes: QTBUG-69128 Change-Id: I46f674f095431335b16900860d83b624257ae3bb Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Fuzzing: Add comment how to recude noise in iccparser's fuzzerRobert Loehning2019-11-131-0/+4
| | | | | | | | | With logging enabled, all the output will slow down execution and fill up your hard disc in about a day. Task-number: QTBUG-79050 Change-Id: I5dcac2f349f7dbe471a5e6dd7006b89d312aeeaf Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Move some tests of QTimeZonePrivate::isValidId() to where they belongEdward Welbourne2019-11-131-28/+24
| | | | | | | | | | | They were tucked away in the back-end of the isTimeZoneIdAvailable() test, but a separate isValidId() test had been added more recently, which made some (arguably all) of them redundant. Reworked this test in the process, so that the QSKIP() happens in _data() once instead of in the test that's never run because there are no data rows. Change-Id: Icaa6227ace9a1aa944d085691cdcfb3adf4a51dc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Diaglib/Windows: Output more information on geometry for native handlesFriedemann Kleint2019-11-081-4/+67
| | | | | | | | | Obtain the client area and output frame and position relative to the parent window. Task-number: QTBUG-79861 Change-Id: I193dfbcdec7e27d32a70ada08ba271260eedc969 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Fix accuracy of ARGB32->A2RGB30 conversionsAllan Sandfeld Jensen2019-11-071-0/+3
| | | | | | | | | | | | | It was converted over ARGB32PM, when it should have been directly converted to not lose accuracy, instead there was an unnecessary direct ARGB32->RGB30 conversion, which was converted to the necessary type. This also improves the selection of conversion over ARGB32PM or RGBA64PM for ARGB32 and RGBA8888 by using 32-bit conversion when alpha is not relevant. Change-Id: I5990d8a23b2909d3910d8c1213fa46477742b052 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Simplify two complex test conditionsEdward Welbourne2019-11-071-6/+4
| | | | | | | | | Since the test was fatuous for i == 0, iterate from i = 1, instead. Change-Id: I9b9c1b7b10639aefdd74f48051d592da4f84dc85 Reviewed-by: Jesus Fernandez <jsfdez@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-064-0/+80
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
| * If only family is set, prefer that in the families list after resolvingAndy Shaw2019-11-052-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a font with only a family set is resolved with one that has been setup with setFamilies() then the family needs to be prepended to the families list after resolving. This is so that the font still prefers the one set as just a family with no famillies set. This also amends the QFontDialog test to account for this too. [ChangeLog][QtGui][Text] Resolving a font that just has a family set with families set will prepend the family to the families so that it is still the first preference for the font. Task-number: QTBUG-46322 Change-Id: Icc4005732f95b2b4c684e592b06b31e133270e44 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Merge remote-tracking branch 'origin/5.13.2' into 5.13Qt Forward Merge Bot2019-10-301-0/+49
| |\ | | | | | | | | | Change-Id: Ieb5afc87086758119bcfc8efbe355f5c0a93fc04
| | * Merge 5.13 into 5.13.2Frederik Gladhorn2019-10-113-4/+13
| | |\ | | | | | | | | | | | | Change-Id: Id8852e90bfc5e4bd3e344435195992c5c7a0ab86
| | * | Schannel: no longer keep old ssl errors around when reusing socketMårten Nordheim2019-10-071-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And add a test for it so it can no longer happen in any current or future implementation. Change-Id: I3214aa90595e291b1e1c66befe185cfe1ea7bc6b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | | Ensure that child windows are visible again when showing their parentAndy Shaw2019-10-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a window is closed, then it will cause the child windows to be closed as well as a result. Therefore in order to ensure that they are shown again as a result, we need to remove the WA_WState_ExplicitShowHide attribute if the widget was not already hidden before. This enables us to test for this attribute when calling showChildren(), so that if the window has a windowHandle then we can make sure that this widget is shown again. Fixes: QTBUG-73021 Change-Id: I1186242b889899dfcd38d782a67567348e2055ee Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | | QTextMarkdownWriter: preserve empty listsv5.14.0-beta3Shawn Rutledge2019-11-052-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can save a "skeletal" document with list items to fill in later, the same as you can do in HTML or ODF format. Reading them back via QTextDocument::fromMarkdown() isn't always perfect though. Fixes: QTBUG-79217 Change-Id: Iacdb3e6792250ebdead05f314c9e3d00546eeb9f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | Avoid crashing when the end of an empty markdown list is detectedShawn Rutledge2019-11-051-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The markdown parser generates empty lists in some cases when a character that can be used as a bullet is found on a line by itself. cbEnterBlock() and cbLeaveBlock() are called symmetrically in such cases. QStack::pop() on an empty stack triggers an assert, so push and pop need to be done symmetrically too. But it's difficult to actually create the list as soon as the MD_BLOCK_UL or MD_BLOCK_OL callback occurs, without breaking the case fixed in 7224d0e427d71e559b928c44634839b4791c1416 (and probably other cases). That's because QTextCursor::insertList() creates a list item at the same time as it creates the list itself, and also inherits block formatting from the previous block. We now insert empty lists with empty items whenever the need for that is detected though, and there's a failsafe to prevent popping in case something still goes wrong with that logic. We aren't strict about reproducing the original markdown when regenerating it via toMarkdown(), but it's getting closer. Fixes: QTBUG-78870 Change-Id: Ided194ce7aec2710c60dbac42761ee4169ed9b78 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* | | | Avoid EGL_BAD_MATCH in tst_qrhi autotestLaszlo Agocs2019-10-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call adjustedFormat() as advised by the docs: "Applications are advised to set this format on their QWindow in order to avoid potential BAD_MATCH failures." Task-number: QTBUG-79659 Change-Id: Ibf415fb0ee64bdd3f01d4ba744244bce811c0d27 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | | Make tst_QNumeric more systematic about checking float as well as doubleEdward Welbourne2019-10-291-179/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do this by templating the floating-point tests, which removes some existing duplication as well as avoiding new duplication. Did some renaming in the process. Added some tests of fuzzyCompare that come closer to its boundary. Increased number of tests from 69 to 97. Use std::numeric_limits to replace assorted hard-coded constants and old C-library boundary-value macros. It turns out MSVC's float conflates quiet and signaling NaN (although MinGW's doesn't); and WebAssembly's old fastcomp compiler conflates NaNs for both float and double; so XFAIL the test for distinct NaNs in those cases. Change-Id: I0a1c0d2f68f75d51b8cda9e3ddfe7fa9c190a3e2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
* | | | wasm: add local file access manual testMorten Johan Sørvig2019-10-292-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Testes file load and save, computes a sha256 hash for verifying file content. Change-Id: Id7f697c4dfd41e051442350f4050f04b493cfc18 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | | | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-284-16/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/serialization/qjson_p.h Change-Id: I83cea141a4de8b3998478bfded84ca9029f7a2a9
| * | | Tidy up data-stream testEdward Welbourne2019-10-251-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While I was looking into a bug related to problems building the test without GUI, I noticed a lot of spurious #include lines so tidied up a bit. Split some long lines, while I was about it. Change-Id: Id87eb6f612c6b174f8240dfe9c00e0929244fb6c Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
| * | | Exclude tests that need GUI when GUI isn't availableEdward Welbourne2019-10-252-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Dmitriy Purgin for pointing out the serialization one. Task-number: QTBUG-79353 Change-Id: Ia3d750b17ddd8fbb7a83a55df7e4546ca78c358b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * | | tst_qgraphicspixmaptiem: Fix undefined behavior in containsJohan Klokkhammer Helsing2019-10-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See the comment in the test for details. Change-Id: Ie3d356e476ba0419d304bccd396fc18a831a30cd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | | Update CLDR to v36Edward Welbourne2019-10-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Released on October 4th. Adds Windows names for two time zones, Qyzylorda and Volgograd. Added languages Chickasaw (cic), Muscogee (mus) and Silesian (szl). Norwegian number formatting has flipped back to using colon rather than dot as time separator; it's flipped back and forth over the last several CLDR releases. The dot form is present as a variant, the colon form was long given as the normal pattern, then went away; but now it's back as a contributed draft and that's what we pick up. The MS-Win time-zone ID script was iterating a dict, causing random reshuffling when new entries are added. Fixed that by doing the critical iteration in sorted order. Omitted locales ccp_BD and ccp_IN due to QTBUG-69324. Task-number: QTBUG-79418 Change-Id: I43869ee1810ecc1fe876523947ddcbcddf4e550a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Don't try to define QT_NO_CAST_TO_ASCII when the test undefines itEdward Welbourne2019-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qmake config for tst_QString tried to impose QT_NO_CAST_TO_ASCII on it, but the source file explicitly #undef-s this symbol and its friends. Leave the define commented out in the .pro so that a comment can explain why it's no good. Change-Id: I7620f4e104f0cdab05fdc246b903c40026e63d76 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Move a test for feature ICU from .pro to .cppEdward Welbourne2019-10-253-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test QT_CONFIG(icu) in the code instead of testing qtConfig(icu) in the profile and setting an extra define just to shadow what's already defined. Also remove the matching define from qcollator.pro, whose test code didn't use it. Noticed while reviewing the conversions to CMake. Change-Id: I19d3b1026b2a8f50ec424c450614e721500fd38a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | QTableView: properly deselect row when column 0 is hidden/not visibleChristian Ehrlicher2019-10-241-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the first column is hidden or not visible in the current viewport, it is not possible to deselect the current row. Fix it by passing the correct column to QItemSelectionModel::selectedRows() when testing if the current index is selected. Fixes: QTBUG-79092 Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | | QFileSystemEngine: Consistently check for invalid file namesUlf Hermann2019-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stat() and friends expect a null-terminated C string. There is no way to generate anything useful from a string that has null bytes in the middle. It's important to catch this early, as otherwise, for example, a QDir::exists() on such a path can return true, as the path is silently truncated. Extend the checks for empty file names to windows and add checks for null bytes. Change-Id: Ie9794c3a7c4fd57f9a66bdbbab8b45a08b6f9170 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QStateMachine: Don't scream at the userRobert Loehning2019-10-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I171606d10985bc7338b0f24ceb142fc0d88e7932 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | | Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Qt Forward Merge Bot2019-10-246-34/+91
|\ \ \ \
| * | | | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-246-34/+91
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
| | * | | QODBC: Fix crash when a prepared statement is deleted after the db was removedChristian Ehrlicher2019-10-151-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a prepared statement is still alive after the database was removed with QSqlDatabase::removeDatabase(), the cleanup routine is trying to access the driver which is no longer alive which results in a crash. Fixes: QTBUG-79019 Change-Id: I4630e3b947a12b23ed062f015abc373fc0e246c1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | * | | QStandardPaths: Correct handling for XDG_RUNTIME_DIRSamuli Piippo2019-10-121-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always try to create the runtime directory and never change the permissions of an existing directory. Conform to the XDG Base Directory Specification: "If, when attempting to write a file, the destination directory is non-existent an attempt should be made to create it with permission 0700. If the destination directory exists already the permissions should not be changed." Fixes: QTBUG-68338 Change-Id: Iaf854d69225fc46e43abae86232d749e5c247df0 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | Fix QGraphicsScene::update() performanceAndre de la Rocha2019-10-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous fix has caused a performance degradation while adding a check for avoiding adding duplicated rectangles to the update list. This patch fixes it by using a std::set instead of a QList, avoiding duplication while using an O(log N) operation, instead of the O(N) used before. Fixes: QTBUG-77952 Change-Id: Ifa9fbf110e0bad60ee02a42d91281981fd98ceab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | | Q{Shared,Weak}Pointer: Reduce overload sets in implicit conversionsMilian Wolff2019-10-111-0/+54
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only allow implicit conversions when the types involved are compatible. That means, only allow construction and copy assignment when the type X* is convertible to type T*. This is done using SFINAE and the std::is_convertible type trait, which makes the previous QSHAREDPOINTER_VERIFY_AUTO_CAST obsolete. This patch fixes compilation when a function is overloaded with Q{Shared,Weak}Pointer of different, incompatible types. Previously, this resulted in a compilation error due to an ambiguous overload. Change-Id: I069d22f3582e69842f14284d4f27827326597ca2 Fixes: QTBUG-75222 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>