summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Speed up tst_QApplication::testDeleteLaterProcessEvents2()Friedemann Kleint2020-03-311-1/+2
| | | | | | | | Quit the event loop once the object is destroyed. Change-Id: I6df1cfe867daacb6af56eb84646be91d98a2f545 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QApplication::testDeleteLaterProcessEvents(): Split the testFriedemann Kleint2020-03-311-69/+80
| | | | | | | The test can trigger timeouts in COIN, split into subtests. Change-Id: I1fa5d52422275f89b2858d90c5979632aa7058e2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* itemviews: Use the start of the current selection when getting the rangeAndy Shaw2020-03-301-0/+58
| | | | | | | | | | | | | | | When doing a shift-select while moving the mouse then the start point should be based on the start of the current selection and not the pressed position. If there is no current selection start index, then we can safely depend on pressed position as this will be the previous index pressed on. This resolves an issue introduced by e02293a76d21e7077f1952d4ed8af6c6d1970190 when fixing QTBUG-78797 Fixes: QTBUG-81542 Change-Id: Ia66c42b220452fdcbc8cfccc05dbc8a3911c3f5e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* tst_QCborValue: Prepare for 64-bit QVectors in Qt 6Thiago Macieira2020-03-271-7/+15
| | | | | Change-Id: Ief61acdfbe4d4b5ba1f0fffd15fe1e921aab0a72 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CBOR support: prevent overflowing QByteArray's max allocationThiago Macieira2020-03-275-16/+223
| | | | | | | | | | | | QByteArray doesn't like it. Apply the same protection to QString, which we know uses the same backend but uses elements twice as big. That means it can contain slightly more than half as many elements, but exact half will suffice for our needs. Change-Id: Iaa63461109844e978376fffd15f9d4c7a9137856 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCborValue::fromCbor: Apply a recursion limit to decodingThiago Macieira2020-03-251-0/+54
| | | | | | | | | | | | | | | | | | | A simple 16k file can produce deep enough recursion in Qt to cause stack overflow. So prevent that. I tested 4096 recursions just fine on my Linux system (8 MB stack), but decided 1024 was sufficient, as this code will also be run on embedded systems that could have smaller stacks. [ChangeLog][QtCore][QCborValue] fromCbor() now limits decoding to at most 1024 nested maps, arrays, and tags to prevent stack overflows. This should be sufficient for most uses of CBOR. An API to limit further or to relax the limit will be provided in 5.15. Meanwhile, if decoding more is required, QCborStreamReader can be used (note that each level of map and array allocates memory). Change-Id: Iaa63461109844e978376fffd15fa0fbefbf607a2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_QMenu: make QSKIP message truthfulTimur Pocheptsov2020-03-181-1/+1
| | | | | | | | | | | | | | Since the test was refactored and QCursor::setPosition() replaced with QTest::mouseMove(), the test is completely crippled on macOS, since it relies on the parts in widget's code, ifdefed with condition !Q_OS_OSX and commented as "Cocoa tracks popups". Yes it does, but not for "fake" events generated by QTest. The original test was introduced when fixing different problems on non-Apple platform(s) anyway. Let's make QSKIP message saying the truth. Task-number: QTBUG-63031 Change-Id: If54f195ccc0d4409cc2e7f4ae0b0fbf43989b286 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QTreeView: don't call model.index(-1, 0) when using spanning itemsDavid Faure2020-03-161-0/+10
| | | | | | | | | | | | drawTree() does QPoint hoverPos = d->viewport->mapFromGlobal(QCursor::pos()); d->hoverBranch = d->itemDecorationAt(hoverPos); and itemDecorationAt does const QModelIndex index = q->indexAt(pos); which might very well be an invalid index. Change-Id: I7db98871543bd7e1c57fcc475d2646757bf2bb42 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Stabilize and rename tst_qmessagebox::expandDetails_QTBUG_32473Shawn Rutledge2020-03-121-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This has been flaky on OpenSuSE; if the stored geom.topLeft() is 0,0 it apparently means the window manager (probably kwin) didn't get around to decorating and repositioning the dialog by the time qWaitForWindowExposed() returns. Because we check later to see whether it moved, we need to be certain of its initial position. Waiting for the extra "fleece" widget to be shown was based on the theory that by the time the X server has processed messages related to that new window, the WM should be done processing the consequences of the resized dialog window. But there's no such guarantee, so let's try removing that. On the other hand, removing the delay does open us up to miss a regression (maybe the dialog gets moved after we have checked that it didn't move). Rename because we don't name autotests after bugs. Amends 26ddb586acd49834c7cffac781ce504ec78635cc Task-number: QTBUG-32473 Change-Id: I6bbfe2b4baaee389db0d4112f0fec3b7cb9da554 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Fix 'out of process' autotestsTimur Pocheptsov2020-03-111-28/+54
| | | | | | | | | | | | | We are, arguably, not testing QProcess and its ability to start or finish, we test QUdpSocket. If, for some reason (as we discovered on some specific machines recently) the process does not start or does not produce any output (canReadLine), we QSKIP instead of failing. Also, all those QCOMPARE will bypass the part there we stop processes - so must be RAII-protected. Fixes: QTBUG-82717 Change-Id: Idfb0d4a483d753f336b3827875eeaf51c79270e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix non-trivial soft-hyphen line breaksAllan Sandfeld Jensen2020-03-101-13/+149
| | | | | | | | | | | | | | | The effect of the soft-hyphen needs to be updated once the final the break point has been found. This change cleans the logic by using two variables keeping track of soft-hyphen at current evaluated position and at last confirmed break point. Also adds tests for supression of soft-hyphens in the tight WrapAnywhere case. Fixes: QTBUG-35940 Fixes: QTBUG-44257 Change-Id: I7a89a8ef991b87691879bb7ce40cec4a3605fdd5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Un-blacklist QElapsedTimer::elapsed testVolker Hilsheimer2020-03-041-3/+0
| | | | | | | | The test was fixed and metrics show no flaky failures anymore. Task-number: QTBUG-58713 Change-Id: I50c0844db099f45bb5b7ca51a510bf0318554c44 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QLibrary: stop setting errorString after resolve()Thiago Macieira2020-03-031-1/+1
| | | | | | | | | | | | | | resolve() is technically thread-safe if the library has been loadaed. We don't promise that, but it's there. More importantly, because QLibraryPrivate is shared among QPluginLoader and QLibrary that point to the same file, we can't thread-safely set the error string. [ChangeLog][Important Behavior Changes] QLibrary::resolve() will no longer set or clear the error string based on the success of finding the symbol. The error string will reflect the result of loading the library. Change-Id: I46bf1f65e8db46afbde5fffd15e1a4f4c2713c17 Reviewed-by: David Faure <david.faure@kdab.com>
* QDom: use correct precision when converting float/double valuesChristian Ehrlicher2020-03-031-7/+17
| | | | | | | | | | | | d7cb21ac085117f879a8aa1d7727b2ca52d3353d change the way a double is converted which resulted in less precision. Fix it by explictily setting the precision in QString::setNum() Task-number: QTBUG-80068 Change-Id: I1fd9d00837155ceb707e84bfeb9deff03b5ab57e Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: Fix logic for minimized stateJiDe Zhang2020-03-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | When _NET_WM_STATE_HIDDEN is not contains in the _NET_WM_STATE window property, the window should not be considered to be minimized According to https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html _NET_WM_STATE_HIDDEN should be set by the Window Manager to indicate that a window would not be visible on the screen if its desktop/viewport were active and its coordinates were within the screen bounds. The canonical example is that minimized windows should be in the _NET_WM_STATE_HIDDEN state. Pagers and similar applications should use _NET_WM_STATE_HIDDEN instead of WM_STATE to decide whether to display a window in miniature representations of the windows on a desktop. For mutter/GNOME Shell, without _NET_WM_STATE_HIDDEN, window manager will not reply XCB_ICCCM_WM_STATE_ICONIC settings in WM_CHANGE_STATE client message. Task-number: QTBUG-76147 Task-number: QTBUG-76354 Task-number: QTBUG-68864 Done-With: Liang Qi <liang.qi@qt.io> Change-Id: Ic9d26d963979b7f0ef4d1cf322c54ef8c40fa004 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Try again to make QDeadlineTimer test robust against context switchesVolker Hilsheimer2020-02-281-16/+34
| | | | | | | | | | | | | Instead of comparing to absolute values, compare the result from QDeadlineTimer with the reference clock types from std::chrono. Pass the test as long as we are within 10% of that reference. In addition, handle the case where QTest::qSleep sleeps for more than 10% longer or shorter than what is requested, and if so, abort the test. Change-Id: If8b77aea55a8c5c53e96427b2fff2f78281d0f82 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QTextMarkdownImporter: fix use after free; add fuzz-generated testsShawn Rutledge2020-02-284-0/+32
| | | | | | | | | | | | | | It was possible to end up with a dangling pointer in m_listStack. This is now avoided by using QPointer and doing nullptr checks before accessing any QTextList pointer stored there. We have 2 specimens of garbage that caused crashes before; now they don't. But only fuzz20450 triggered the dangling pointer in the list stack. The crash caused by fuzz20580 was fixed by updating md4c from upstream: 4b0fc030777cd541604f5ebaaad47a2b76d61ff9 Change-Id: I8e1eca23b281256a03aea0f55e9ae20f1bdd2a38 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Fix flaky QElapsedTimer::elapsed test caseVolker Hilsheimer2020-02-271-17/+30
| | | | | | | | | | | | | | | | | Much of this test case was testing that the machine it runs on didn't take more than an expected amount of time, which is an assumption that won't hold in a virtual environment where the hypervisor might decide to not allocate any CPU time to the machine at certain times. Instead, take the samples that we want to compare with once, then use them as reference for further comparisons. Also, split the test in two, with the comparison operators and msecsTo test moved into a separate test function. Change-Id: I7db12b8e02552f4d63af933c1b0fee9d62b591eb Fixes: QTBUG-58713 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Stabilize task255529_transformationAnchorMouseAndViewportMarginsVolker Hilsheimer2020-02-271-1/+3
| | | | | | | | | | | This test doesn't test whether window activation works, so there is no reason to fail the test if it doesn't. Instead, abort the test, so that we can record it as a skipped test. Change-Id: Ia44308ef17f110d40c6455d7ee85d90914face4f Fixes: QTBUG-22455 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io>
* Fix bounding box of zero-width entities in QFontEngineFTAllan Sandfeld Jensen2020-02-271-0/+24
| | | | | | | | | | | | Freetype can give us non empty bounds for zero-width characters, this change just makes us skip metrics of characters already found to not contribute to text advance. The coretext and windows font-engines already uses the already calculated advance. Change-Id: I82b3521a4fb92614be509be5982cd5ab9c1eb7de Fixes: QTBUG-58854 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Make QDeadlineTimer test more resilient against VM starvationVolker Hilsheimer2020-02-261-4/+19
| | | | | | | | | | | | | | | Flaky fails in this test suggest that the VM on which the test is executed does not get CPU resources allocated for enough time to make this test pass. This change makes the test more resilient by taking the measurements as quickly as possible. In addition, use a sanity-check based on std::chrono APIs to abort the test completely if we see that the clock has advanced too far to make the following tests meaningful. Change-Id: Ie6ac4ffb52f20e7774014f8222c9cd8f54d8a263 Fixes: QTBUG-64517 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QObject: treat T* -> bool conversions as narrowingMarc Mutz2020-02-261-0/+6
| | | | | | | | | | | | | | | | | | | | Following wg21.link/LWG3228, it was found that a proper variant fix requires that T* -> bool conversions be treated as narrowing conversions in subclause wg21.link/dcl.init.lst. wg21.link/P1957R2 was accepted in Prague 2020 as a DR and retroactively applies to older C++ standards. Since we hard-code the algorithm of [dcl.init.lst], we can and must add this manually. [ChangeLog][QtCore][QObject] For the purposes of QT_NO_NARROWING_CONVERSIONS_IN_CONNECT, pointer (incl. pointer-to-member) to bool conversions are now considered narrowing. This matches the resolution of a defect report in C++ itself. Change-Id: Ifa9a3724c9c8ccd3dd6614928dbbe37477591dc1 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* tst_QSettings: Fix leaking registry keyFriedemann Kleint2020-02-251-2/+3
| | | | | | | | | | | | On Windows, the test was leaking a registry key HKEY_CURRENT_USER\Software\tst_QSettings_trailingWhitespace Fix by using .ini-Format in the temporary directory created by the test. Amends e66a878838f17a0626b0b10b340b1ca4dba56cc1. Task-number: QTBUG-22461 Change-Id: If141a9e72e8faebc3fc46b94dab7b4b728a75292 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tests/xcb: fix tst_QWidget::updateWhileMinimized() on mutter/GNOME ShellLiang Qi2020-02-252-6/+11
| | | | | | Task-number: QTBUG-68862 Change-Id: I6247867ae4ec126ab0549741f2d2d491a7f2e8a0 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QAbstractItemView: Make sure to update the editor geometriesChristian Ehrlicher2020-02-231-0/+2
| | | | | | | | | | QAbstractItemView::setIndexWidget() does not trigger a relayouting when a new widget is set. This results in a wrong editor geometry under some circumstances. Fix it by triggering a delayed relayout. Fixes: QTBUG-81763 Change-Id: I75d0e19bd5e56d63effe4990d782d202fb39e3e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tst_qtcpsocket::bind - amend the recent fixTimur Pocheptsov2020-02-221-3/+24
| | | | | | | | | | | | | | | | | | 0. The recent patch fixed the case when we can suddenly (meaning from a particular version of Darwin) bind on a port number 1. Unfortunately, it's not the case for IPv4 and while fixing one test case, the patch broke another - so this patch addresses this. 1. Unfortunately, binding on a fixed port 1 on macOS made the test flaky - we run this 'bind' several times and sometimes OS thinks port is already bound (because of the previous test case) - closing the connection seems to fix this problem (thus this patch do this also). 2. As a bonus a proper resource management added (aka RAII) where we would previously leak a socket in case some QCOMPARE failed. Fixes: QTBUG-81905 Change-Id: I90c128a332903bb44ab37de4775ca00d390dc162 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Stabilize QFileSystemModel::dirsBeforeFiles testVolker Hilsheimer2020-02-221-10/+18
| | | | | | | | | | | | | | | | | | | | Make the test operate in its own temporary directory, so that entries left behind by other test functions don't impact this test. Also, call QFileSystemModel::sort explicitly; it would otherwise only be done once through a single-shot timer, and the test processes events until the model is populated, which might not process that delayed sorting. Since dirsBeforeFiles tests the sorting algorithm and not the sorting logic, best to do this explicitly. In case of sort failure, print diagnostics. Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io> Fixes: QTBUG-75452 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 4e796e0b0dcf4c0848044471021db3afce16ee5d) Change-Id: I144b68a17280a38cc7d6daf7ec343eea4453623d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Detect double timer during single timeout in registerTimer test, and skipVolker Hilsheimer2020-02-221-5/+17
| | | | | | | | | | | | | | | | | We observe this happening on macOS in the CI system, and it might happen if a VM doesn't get CPU cycles for long enough time so that two timers time out. Then event processing will process two timer events, and we overwrite the timerIdFromEvent with the second event. Instead, skip the test when this happens. This is an ammendment to 5c520f4b0ad4b539dc0184c764ca9f12c98730d9 Fixes: QTBUG-71751 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 67491e2df5357706dbf88ddaf1f030ff095b4528) Change-Id: I30eef8cfc94988e6cad500dd5e6722488c2985be
* Discover the conditions under which registerTimer is flaky, and skipVolker Hilsheimer2020-02-221-0/+22
| | | | | | | | | | | On macOS, the registerTimer test case fails frequently, and blocks valid integrations. With this change we try to detect the condition and skip the test. Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 5c520f4b0ad4b539dc0184c764ca9f12c98730d9) Change-Id: I97644b5b4654b4c96fbc99858bbf191e6edb5977 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QShaderGenerator: Allow more expressions in input nodesNicolas Guichard2020-02-201-0/+50
| | | | | | | | | | | | | | | | | | Currently QShaderGenerator will crash when encountering some expressions in input nodes. For example, this node prototype would make it crash: "VERTEX_COLOR": { "outputs": ["color", "alpha"], "rules": [ "headerSnippets": ["in vec4 vertexColor;"], "substitution": "vec3 $color = vertexColor.rgb; float $alpha = vertexColor.a;" ] } Change-Id: I37abb8099d376843a4cb13228140467dc1b8f60c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QShaderGenerator: Don't crash when a node has multiple outputsNicolas Guichard2020-02-201-0/+73
| | | | | | | | | | | | | | | | | | | | | | It was already possible to declare a node prototype with multiple outputs, but trying to assign to all those outputs was not possible and instead resulted in a crash. It is now possible to declare nodes like this without crashing: "SEPERATE_XYZ": { "inputs": ["vector"], "outputs": ["x", "y", "z"], "rules": [ { "substitution": "float $x = $vector.x; float $y = $vector.y; float $z = $vector.z;" } ] } Change-Id: I748e77e84c9120dc688c573eee33dc13c6bfbace Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QShaderGraph: don't generate statements with undefined inputsNicolas Guichard2020-02-191-8/+4
| | | | | | | | | | | | | | | This fixes the shader generation for graphs like this one: Function0 ------> Output0 (with unbound input) Input ------> Function1 ------> Output1 With those graphs, createStatements will not return any statement for nodes Function0 and Output0. Change-Id: Iec32aa51623e176b03ae23e580f06d14df80a194 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix QShaderGenerator crashing when a node port name prefixed another oneNicolas Guichard2020-02-191-0/+70
| | | | | | | | | | | | | | QShaderGenerator didn't handle substitutions like `vec4 $color = mix($color1, $color2, $fac);` Note that `$color` is a prefix to `$color1` and `$color2`. For the substitution `QByteArray::replace` was used so if `$color` was handled first and replaced by `v1`, `$color1` and `$color2` were never correctly replaced and instead became `v11` and `v12` which caused a crash later on. Change-Id: Idaf800fdac468f33c323eb722701da5f8eb918d6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QShaderGraph: Fix statement creation for graphs with dangling branchesNicolas Guichard2020-02-171-0/+45
| | | | | | | | | | | | | | | | | | For graphs like this one: Input ----> Function1 ----> Output \ ---> Function2 (unbound output) We would have generated only 2 statements, for Function1 and Output. This change fixes this by treating Function2 like an output. Therefore it generates 4 statements: Input, Function1, Output and Function2. Change-Id: Iaada40b9b949d771806dd47efad4f7ef2a775b48 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Only read the first BOM as a BOM; the rest are ZWNBS !Edward Welbourne2020-02-141-0/+6
| | | | | | | | | | QUtf32::convertToUnicode() was forgetting to set headerdone when it dealt with the header (for contrast, Utf16::convertToUnicode() does). Fixes: QTBUG-62011 Change-Id: Ia254782ce0967a6cf9ce0e81eb06d41521150eed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Autotest: adapt to certain OSes always allowing binding to low portsThiago Macieira2020-02-133-12/+33
| | | | | | | | Apple changed on macOS 10.14 (Mojave). Windows has always allowed. Fixes: QTBUG-81905 Change-Id: I572733186b73423b89e5fffd15f12fee3f03c055 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QTcpSocket::bind: fix issue found by BLACKLISTThiago Macieira2020-02-132-8/+1
| | | | | | | | | | | The comment in QNativeSocketEnginePrivate::fetchConnectionParameters() talked about IPv6 v4-mapped addresses. However, toIPv4Address also converts the unspecified address (::), which resulted in QAbstractSocket saying that it had bound to QHostAddress::Any instead of QHostAddress::AnyV6 Change-Id: I572733186b73423b89e5fffd15f138579c5c0c50 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Extend tst_qstringapisymmetry for member compare()Marc Mutz2020-02-091-2/+158
| | | | | | | | | | | | | | | | | | | | | There were a few surprises: - QByteArray::compare() are missing noexcept (will add) - ibid., called with non-ascii content and CaseInsensitive fails (this was discussed on the ML, with tentative agreement that it's a feature, not a bug; waiting for QUtf8String(View) for a fix, then). - As was the case when we did this exercise with the relational operators, QString(Ref)/QChar is not noexcept (will fix) These have been QEXPECT_FAIL'ed. Not much of the cartesian product is implemented at all, yet. These have been #ifdef'ed with NOT_YET_IMPLEMENTED to see what's still missing. Change-Id: I7d9b21e292b98f980aacdc6248e88188f7472ba2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QComboBox: send font change event to popup menu when font changedWang Chuan2020-02-071-0/+43
| | | | | | | | | | | | The font change in QComboBox might cause incorrect appearance of popup menu since it doesn't notify popup menu to relayout itself Fixes the issue by send font change event to the item view of popup menu when received a font change event in QComboBox Fixes: QTBUG-75846 Change-Id: I4821015cca95a7e233a22262596a6fbf27f10aef Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* uic/Python: Add imports for Q(Date)Time, QKeySequenceFriedemann Kleint2020-02-061-4/+4
| | | | | | | | | Those types are used as properties of Q(Date)TimeEdit, QKeySequenceEdit. Fixes: PYSIDE-1215 Change-Id: I8b9ffebb8229fff447aa7dd6bee6e037d708333c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* tst_qnetworkreply: Print proxy warning to stderr instead of stdoutMorten Johan Sørvig2020-02-051-3/+3
| | | | | | | This way we produce valid xml also for the no-proxy case. Change-Id: I5a277255d22c3814fe463c0cd013c04ddc6ad919 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* widgets: Don't create winId when the widget is being destroyedVaL Doroshchuk2020-02-051-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QWidget is being destroyed, its winId is cleared, and a QEvent::WinIdChange is sent. If a listener of this event reacted by calling winId() again, we might crash. A crash can be observed when this child widget is destroyed in dtor of its parent. E.g. here is a hierarchy of widgets: 1:QWidget 2:QObject 3:QWidget 4:QWidget If a listener subscribed for WinIdChange events from (4), and there is a connection to destroy (4) when (2) is destroyed. This will lead to infinite loop: 1. QWidget::~QWidget 2. QWidget::destroy 3. QWidgetPrivate::setWinId(0) 4. QCoreApplication::sendEvent(q, QEvent::WinIdChange); 5. eventFilter 6. QWidget::winId 7. QWidgetPrivate::createWinId (this=0x555555957600) at kernel/qwidget.cpp:2380 8. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 9. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163 10. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 11. QWidget::create (this=0x5555558f2010, window=0, initializeWindow=true, destroyOldWindow=true) at kernel/qwidget.cpp:1163 12. QWidgetPrivate::createWinId (this=0x55555596b040) at kernel/qwidget.cpp:2387 Fixes: QTBUG-81849 Change-Id: Ib4c33ac97d9a79c701431ae107bddfb22720ba0d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* uic/Python: Set form object name correctlyFriedemann Kleint2020-02-051-1/+1
| | | | | | | | Add missing "not" for the isEmpty() check. Fixes: PYSIDE-1210 Change-Id: I3798d483df9d077300ff69dc5d3a8d08812f534e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Take care of NULL data from QStringView in QCollatorEdward Welbourne2020-02-051-1/+13
| | | | | | | | | | | | | Back-ends need to catch NULL data so as not to call system APIs with invalid pointers. [ChangeLog][QtCore][QCollator] Fixed a regression introduced in 5.14.0 that caused QCollator not to operate with default-constructed QStrings and print a warning on Windows. Fixes: QTBUG-81673 Change-Id: I2eafe1e188b436afcca3cf2ecdf98bba707c44c9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enable system locale to skip digit-grouping if configured to do soEdward Welbourne2020-02-031-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On macOS it's possible to configure the system locale to not do digit grouping (separating "thousands", in most western locales); it then returns an empty string when asked for the grouping character, which QLocale's system-configuration then ignored, falling back on using the base UI locale's grouping separator. This could lead to the same separator being used for decimal and grouping, which should never happen, least of all when configured to not group at all. In order to notice when this happens, query() must take care to return an empty QString (as a QVariant, which is then non-null) when it *has* a value for the locale property, and that value is empty, as opposed to a null QVariant when it doesn't find a configured value. The caller can then distinguish the two cases. Furthermore, the group and decimal separators need to be distinct, so we need to take care to avoid cases where the system overrides one with what the CLDR has given for the other and doesn't over-ride that other. Only presently implemented for macOS and MS-Win, since the (other) Unix implementation of the system locale returns single QChar values for the numeric tokens - see QTBUG-69324, QTBUG-81053. Fixes: QTBUG-80459 Change-Id: Ic3fbb0fb86e974604a60781378b09abc13bab15d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Markdown importer: properly set hyperlinksGiuseppe D'Angelo2020-02-032-0/+26
| | | | | | | | The "title" in markdown is the tooltip, not the name attribute of a link. Also, tell the char format that it's an anchor. Change-Id: I2978848ec6705fe16376d6fe17f31007cce4b801 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Blacklist failing tests on macOS 10.14Morten Johan Sørvig2020-01-302-0/+3
| | | | | | | | | These tests fail locally, and have been reported to fail on the CI system. Change-Id: Ia76bb15c288af4171ebe47b3c30f3651a63df3f2 Task-number: QTBUG-75786 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QGraphicsProxyWidget: fix handling of proxy focusGiuseppe D'Angelo2020-01-291-0/+70
| | | | | | | | | | | If a widget inside a QGPW has a proxy focus, the code would keep sending focus in events to the proxy even if the proxy was already focused. Amend the check in place to prevent this from happening. Change-Id: Id28d3bfe4f396da5c9477df713441ca7d506662f Fixes: QTBUG-51856 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.14.1' into 5.14Liang Qi2020-01-281-0/+24
|\ | | | | | | | | | | | | | | Conflicts: mkspecs/features/create_cmake.prf Done-With: Artem Pisarenko <artem.k.pisarenko@gmail.com> Change-Id: I2ecb9fdca06fe687be8ab3457a58dd81e5e81c4c
| * Merge 5.14 into 5.14.1Kari Oikarinen2020-01-1526-89/+270
| |\ | | | | | | | | | Change-Id: Ie90edfd16f48e1907fd18288473ac403f62b9032