summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Let QItemSelectionModel::columnIntersectsSelection honor the parentChristian Ehrlicher2019-12-141-0/+4
| | | | | | | | | | | | | QItemSelectionModel::columnIntersectsSelection() should honor the parent according to the docs. For rowIntersectsSelection() this was fixed a long time ago but columnIntersectsSelection() was forgotten. Sync the both functions and use range-based for loops as a drive-by. Fixes: QTBUG-80644 Change-Id: Iaf08f85e2225204d1e6564fa4bb0bc826352ed53 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QVariant: introduce ShouldDeleteVariantData flagFabian Kosmale2019-12-111-1/+96
| | | | | | | | | | | | | | | | This flag is used in QSequentialIterable and QAssociativeIterable to indicate that the data pointer in VariantData should be deleted after the variant has been constructed. The use case for this is https://codereview.qt-project.org/c/qt/qtdeclarative/+/284151, where we have a proxy iterator and cannot easily return a pointer to already owned data, as it is hard to manage its lifetime in the iterator. In contrast, it is clear that we can release the memory in the QSequentialIterable functions, as it has already been copied into the QVariant there. Change-Id: I2b33497d991cd4f752153e0ebda767b82e4bb851 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix more mis-handling of spaces in ISO date format stringsEdward Welbourne2019-12-101-0/+38
| | | | | | | | | | | | | | | | | ISO date format doesn't allow spaces within a date, although 3339 does allow a space to replace the T between date and time. Sixteen tests added to check this all failed. So clean up the handling of spaces in the parsing of ISO date-time strings. [ChangeLog][QtCore][QDateTime] ISO 8601: parsing of dates now requires a punctuator as separator (it previously allowed any non-digit; officially only a dash should be allowed) and parsing of date-times no longer tolerates spaces in the numeric fields: an internal space is only allowed in an ISO 8601 date-time as replacement for the T between date and time. Change-Id: I24d110e71d416ecef74e196d5ee270b59d1bd813 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QSqlQuery: fix some testsChristian Ehrlicher2019-12-101-39/+36
| | | | | | | | | | | | | | Fix some tests in tst_QSqlQuery: - make sure to use QSql::HighPrecision in tst_QSqlQuery::precision() (needed for psql) - remove outdated stuff for mysql 3.x - psql_bindWithDoubleColonCastOperator: the placeholder are stored as named placeholders in psql - avoid some useless old-style casts Change-Id: I54d29a7e24f17d853cce6baa09a67d9278098810 Reviewed-by: Robert Szefner <robertsz27@interia.pl> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-108-18/+18
| | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWidget: React to platform surface being created or destroyedTor Arne Vestbø2019-12-091-0/+54
| | | | | | | | | | | | | The platform window may create or destroy its surface from other entry points than the QWidget API, in which case QWidget needs to sync up its own state to match. In particular WA_WState_Created and the winId needs to be recomputed. Fixes: QTBUG-69289 Fixes: QTBUG-77350 Change-Id: I769e58ead3c2efcf8c451c363108848feade9388 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* tst_QNetworkInterface: don't force an IPv4 link-local addressThiago Macieira2019-12-072-21/+31
| | | | | | | | | | | | | | | | | | | | | | | | Windows apparently has special code to deal with those addresses. If all your network interfaces are up and have acquired addresses, then the link-local network at 169.254.0.0/16 is unreachable. I had never caught this because both my Windows VM and my bare metal Windows have inactive interfaces (like the Bluetooth PAN one) and, when inactive, Windows assigns a link-local address. But in the CI, the interface(s) were all up and running, causing this issue. Unix systems don't treat IPv4 link-local any differently, so they always worked, so long as any interface was up and there had to be one to reach the network test server. This commit reworks the test to add test addresses based on the addresses found on up & running interfaces (see tst_qudpsocket.cpp). For IPv4, we flip the bits in the local portion of the address. For IPv6, we add a node with an address I generated randomly (non-universal), with the same scope. Fixes: QTBUG-65667 Change-Id: I568dea4813b448fe9ba6fffd15dd9f482db34991 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix updating the text cursor position after editingSona Kurazyan2019-12-061-0/+46
| | | | | | | | | | | | | In some cases when editing the text (for example when removing the selected text, or pasting a text block) the text cursor position is updated, but its visual x position is not updated. This causes the next cursor movements to start from a wrong position. Force the update for those cases. Fixes: QTBUG-78479 Change-Id: Ia496be62beec58660f5e1695e5aafae09c79684e Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Allow lower-case for the T and Z in ISO 8601 date formatEdward Welbourne2019-12-061-0/+2
| | | | | | | | | Cite RFC 3339 as basis for allowing a space in place of the T, too. The RFC mentions that ISO 8601 accepts t and z for T and Z, so test for them case-insensitively. Add a test for this. Change-Id: Iba700c8d74d485df154d27300aab7b1958e1ccef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of trailing space at the end of an ISO date-timeEdward Welbourne2019-12-061-0/+11
| | | | | | | | | | | | | | | | If milliseconds were followed by a space, the space was included in the count of "digits" read as the fractional part; since we read (up to) four digits (so that we round correctly if extras are given), a harmless apce could cause scaling down by too large a power of ten. Since QString::toInt() ignores leading space, we were also allowing interior space at the start of the milliseconds, which we should not, so catch that at the same time. Added tests, including one for the rounding that's the reason for reading the extra digit, when present. Fixes: QTBUG-80445 Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix crash when a date-time has an invalid time-zoneEdward Welbourne2019-12-061-14/+38
| | | | | | | | | | | | | | | | QDateTime is a friend of QTimeZone, so can access its internals; but it must check the zone is valid before doing so. Expanded tst_QDateTime::invalid() and made it data-driven to catch the failure cases. Commented on a test-case that caught a mistake in my first attempt at this, and on QDateTimeParser's surprising reliance on a quirk of QDateTime::toMSecsSinceEpoch()'s behavior. Fixes: QTBUG-80146 Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Manual High DPI test: Add a page logging all screen change signals to MetricsFriedemann Kleint2019-12-051-7/+130
| | | | | | | | | | | | Turn the Metrics widget into a QTabWidget and add a tab logging all changed signals of QScreen. This is useful when for example debugging issues with lock screens and laptop hibernation. Task-number: QTBUG-79248 Task-number: QTBUG-76902 Change-Id: Ie86789fe1514cb3333a5f3def7f613f217fa6802 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Copy formatting attributes when cloning an empty QTextDocumentSona Kurazyan2019-12-051-0/+27
| | | | | | | | | | | | | | | When cloning a QTextDocument, the text fragment of the original document is copied into the new one, which results into copying also the formatting attributes. However, when the text document is empty, the corresponding text fragment is also empty, so nothing is copied. If we want to transfer the formatting attributes for an empty document, we need to set them explicitly. Fixes: QTBUG-80399 Change-Id: I382cd0821723436120af47c06ec7bfa849636307 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QCborValue: fix replacing of elements with byte data with ones withoutThiago Macieira2019-12-051-0/+28
| | | | | | | | | | | | We forgot to reset the flags when replacing the element, so we ended up with an integer with HasByteData after: testMap[0] = QStringLiteral("value"); testMap[0] = 42; Fixes: QTBUG-80342 Change-Id: Ia2aa807ffa8a4c798425fffd15dabfa066ea84b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* docker-compose now brings up the docker images tagged as "latest"Dimitrios Apostolou2019-12-052-28/+30
| | | | | | | | | | | | | | | | | This is so that we can do simple changes to the docker images in provisioning, without needing to update the tag here. If a backwards-incompatible change in the docker images needs to be committed in provisioning and here, it is possible because the images retain their old unique SHA1 tag, in addition to being tagged as latest. See comment for more details. Requires the change in qt5 repository, with commit sha: e4f9ac5607a329bae045567a339d36469bc4fff6 Task-number: QTBUG-79867 Change-Id: I1bc72edec62487530575d7e113a25afe16d09129 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix flaky test tst_QFiledialog::clearLineEdit()Dimitrios Apostolou2019-12-031-0/+1
| | | | | | Task-number: QTBUG-76989 Change-Id: I3ec7f65500476346e1a8f1017c6452517a660860 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix assert in QTextDocument CSS parser on "border-width: 1pt"David Faure2019-12-031-0/+38
| | | | | | | | | | | | | | | | | The code was assuming that if the parsing of the value worked, then it must be a list of 4 variants. But in this case it's just a single length. This came from <td> using 4 values for border-width while other elements use a single value. But the storage is shared. So the fix is to use 4 values everywhere. When reading 4 and there's only one, it gets duplicated, so the caller can just use the first one in that case. Task-number: QTBUG-80496 Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix serializing QUuid with QDataStream with Qt 4 stream versionsJoni Poikelin2019-12-032-0/+41
| | | | | | | Fixes: QTBUG-76103 Change-Id: Iac92c33539940f5f67d014db5240c6dc14bfb772 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* 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>