summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
Commit message (Collapse)AuthorAgeFilesLines
* QAction: add QT_DEPRECATED_VERSION_6_0 to deprecated methodsIvan Solovev2022-07-211-1/+1
| | | | | | | | | And fix all the new warnings. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: I2a5791f495575d71d2344429aca3363f9922e31b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QGuiApplication: do not emit deprecated signalsIvan Solovev2022-07-211-0/+7
| | | | | | | | | | | | | | ... when QT_DISABLE_DEPRECATED_BEFORE is past the deprecation version. This commit actually stops using the deprecated signals when we build Qt with QT_DISABLE_DEPRECATED_BEFORE >= 0x060000. Otherwise we will get a compilation error because the signals will be removed. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: Ie513ecc9451bf2d88f80857cf19f3d2b4958d022 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QWidget: extend timeouts in flaky enterLeaveOnWindowShowHide testVolker Hilsheimer2022-07-171-2/+2
| | | | | | | | | | | | | That test has a very flaky history on Windows 11, presumably because there are even more fade-in/out effects. Wait longer for those to finish. Fixes: QTBUG-102239 Pick-to: 6.4 6.3 6.2 Change-Id: I1d59f4422469e60a8c4dc5a52c48f0344e954491 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGraphicsProxyWidget: make tolerance in mapToGlobal test at least 4Volker Hilsheimer2022-07-151-1/+1
| | | | | | | | | | a61bf508e3c138c429e0a73498c745c3c0d3f0f7 reduced the tolerance from 4 to 3 in one case, making the test more rather than less flaky on systems with a device-pixel-ratio of 1. Pick-to: 6.4 6.3 6.2 Change-Id: I245443f0dcb1aa40176c127025501b63f12f161b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QGraphicsWidget: skip test if graphics view fails to showVolker Hilsheimer2022-07-141-1/+2
| | | | | | | | | | | | | | | | | | We set Qt::X11BypassWindowManagerHint on the view, which regularly makes the test fail on X11 systems in the QVERIFY(QTest::qWaitForWindowActive(dummyView.data())) check. If the view fails to show, skip the test instead of failing, we are not testing anything X11 specific here, running this test on other platforms will be good enough. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-98921 Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QGraphicsProxyWidget: make tolerance for errors depend on DPIVolker Hilsheimer2022-07-141-2/+3
| | | | | | | | | | The test already accepts an error margin for coordinate mapping. It is still flaky, so make that margin larger if the DPI of the widget >1. Pick-to: 6.4 6.3 6.2 Change-Id: I0a598e5e94ac82c551cbeb935e2fa08cad048f84 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Try re-enabling test on WaylandEskil Abrahamsen Blomfeldt2022-07-141-2/+0
| | | | | | | | Running this test on Wayland passes for me, so maybe something has magically improved. Change-Id: I161b697c5be96af48938228267cb405048c78852 Reviewed-by: Inho Lee <inho.lee@qt.io>
* QCompleter: make filesystem test robust against slow I/OVolker Hilsheimer2022-07-131-2/+7
| | | | | | | | | | | | | | | Use a signal spy to watch for the relevant signal from the file system model and wait for that before checking whether the completer responded to that signal by showing (or not showing) the popup. If the file system model doesn't fire within the default timeout of 5 seconds, skip the rest of the test. Fixes: QTBUG-46113 Pick-to: 6.4 6.3 6.2 Change-Id: I9becfe19a220bdb178ed8275c327d55ea19aa342 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use debug stream in QTest::toString's default fallback if possibleVolker Hilsheimer2022-07-132-2/+2
| | | | | | | | | | | | | | | | | | | | For built-in types, this is a compile-time assert - we should not have any types in Qt for which we have neither debug streaming nor a QTest::toString specialization implemented. A build of most of Qt submodules passes with this change, after minor modifications to some tests. We cannot declare QSizeHint::Policy as a metatype after the QMetaType has already been instantiated for it, and the QDebug stream operator for QElaspedTimer needs to be correctly declared within the namespace. Add a self-test function for a custom type, and update reference files of the self-test. Task-number: QTBUG-104867 Pick-to: 6.4 Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Skip test which depends on window activations on WaylandEskil Abrahamsen Blomfeldt2022-07-131-2/+4
| | | | | | | | | | | Wayland does not support window activation, so rather than skipping tests based on platform name, we can use the platform capability (which will also cover future platforms with the same issue) Pick-to: 6.4 Task-number: QTBUG-104241 Change-Id: Ibf5f8968f3979b789ef68f92768419bef4500fb3 Reviewed-by: Inho Lee <inho.lee@qt.io>
* QKeySequenceEdit: Add a finishing key combinations propertyLaszlo Papp2022-07-091-0/+40
| | | | | | | | | | | | | | | | | | | | | Different shortcut editors seem to have different preferences. By default, QWidget seems to utilise Tab, Backtab, Return and Enter for navigation purposes. However, some shortcut editors would like to be able to record these keys as part of combinations to use in the application. Therefore, leave it with the application developers to decide what key combinations they would like to use for finishing the key sequence edit. This should provide enough flexibility for application developers to customize their shortcut editor behavior. [ChangeLog][QtWidgets][QKeySequenceEdit] Added a property to allow defining the finishing key combinations. Fixes: QTBUG-103844 Fixes: QTBUG-103843 Change-Id: Id84644086ca7a4f11618d510e59698a43735b99b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QWidget: use WA_InputMethodEnabled when ImEnabled is not implementedRichard Moe Gustavsen2022-07-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 6.3, a check for WA_InputMethodEnabled was removed in QWidget, to support IM queries also for read-only widgets (7c6e4af48). This caused a regression on iOS, which made the input panel open for widgets that didn't support IM at all. A patch was merged that solved the regression (3b12305575), but it didn't take the widget attribute into account. Since not doing so has the potential to cause regressions, this patch will modify the affected code once more, so that we instead fall back to test WA_InputMethodEnabled when ImEnabled is not implemented. This will match closely to the way ImEnabled was implemented in Qt 6.2. Since we, with this change, now require that either ImEnabled or WA_InputMethodEnabled is set, our own input widgets will fail to support IM text selection when they're read-only, since they actually don't implement ImEnabled. This patch will therefore also make sure that we do so. Task-number: QTBUG-104527 Pick-to: 6.4 6.3 Change-Id: I70ad910aec38d0a74f4dd7d3115d3c45c16d2b3b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_QGraphicsScene: fix -Wsuggest-overrideMarc Mutz2022-07-061-1/+1
| | | | | | | | | | Add the override keyword. Amends 2e12479e06d6869f568f0a7ee939453cda9afdbf. Pick-to: 6.4 6.3 6.2 Change-Id: Ic62dd33b1ee52983481e39e862b9bd87695f5044 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QListview: PageDown/Up infinite loopTang Haixiang2022-07-051-0/+21
| | | | | | | | | | | When item.height > viewport.height, the next item is not found correctly, resulting in an infinite loop. In this case, move directly to the next item. Pick-to: 6.4 6.3 6.2 Change-Id: I67a40a079ca9dd9189bf84ae550758c685b83d75 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Harden drag and drop handling in widget windowLaszlo Agocs2022-07-011-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User code in an event handler can do arbitrary things, including operations that lead to destroying the QWidgetWindow. An example is what the autotest does: reparenting the top-level widget to under another top-level upon the drop. Internally this leads to destroying the drop target's QWidgetWindow as the widget is now a child, not a top-level. In fact some of the existing drag and drop handling code seems to be prepared to handle the case of having the drag target widget destroyed in the user's event handler during a drag-move. But none of it is prepared for having the QWidgetWindow destroyed upon returning from forwardEvent(). The associated bug report has the same root cause, it is just popping up now via the new 6.4 behavior: adding a QOpenGLWidget to a widget hierarchy upon a drop leads to getting a new QWidgetWindow (if the window only had regular raster widgets before). To solve this, avoid touching members on 'this' after the forwardEvent(). It looks like the handlers for mouse events follow this pattern already, no member data is touched after forwarding events (not sure if that is intentional or just incidental but it is the safe solution, even if this is not feasible everywhere, but ideally input events should take this into account). Fixes: QTBUG-104596 Pick-to: 6.4 6.3 6.2 Change-Id: I96c704cadcd799fc5619b776e939dfdf313a27dd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QLayout: add className() to a warning messageAhmad Samir2022-07-012-2/+2
| | | | | | | | | | | | | | | | Since objectName() isn't always set, the className() makes it slightly easier to find and fix the issue. Also unify some wording "produce a warning", which is generic enough to fit: print warning in terminal print warning in logviewer (if you're unlucky and have to use Windows?) print warning in system journal (if you're unlucky have to use binary systemd journal logs) Pick-to: 6.4 Change-Id: I7522d65666cb5829c33c45039b8646dd535e21ea Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* IM: Don't let all widgets support IM by defaultRichard Moe Gustavsen2022-07-011-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new property Qt::ImEnabled was added in Qt 5.3. Since the already existing widgets with IM support (3rd party included) didn't implement this property, QWidget got the fall back logic that if a widget was queried for Qt::ImEnabled, and the returned QVariant was invalid (the widget didn't implement it), we would, for backwards compatibility with Qt 4, return "true" (meaning that the widget supports IM). But a side effect from this fallback logic, is that now any widget that doesn't implement ImEnabled (or input methods at all) report that they support IM. This will confuse platforms like iOS, which uses ImEnabled to decide if the input panel should show, and if text selection tools should be enabled. The result is therefore that if you click on a QPushButton, the input panel will open. This patch will implement a more careful strategy to check if a widget implements IM, if ImEnabled is missing. Rather than saying that all widgets that don't implement ImEnabled supports IM, we now require that the widget also returns a valid QVariant for Qt::ImSurroundingText. We assume then, that a widget that doesn't do so will anyway not be in need of input method support from the platform. Fixes: QTBUG-104527 Pick-to: 6.4 6.3 6.2 Change-Id: Ib391fd1daae92c4325e9ccb59730fbdd7c9328fc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QKeySequenceEdit: add a maximumSquenceLength propertyLaszlo Papp2022-06-271-0/+37
| | | | | | | | | | | | | | | At the very least, it would be important to have a single combination key sequence. This is commonly seen in keyboard shortcut editors where QKeySequenceEdit is very much applicable. [ChangeLog][QtWidgets][QKeySequenceEdit] Added a maximumSquenceLength property. Done-with: Marc Mutz <marc.mutz@qt.io> Change-Id: Id7fa5a8593eb150fa67d7e89308492c0a200ac36 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Support markdown in QTextEditMimeData; fix pasting trailing newlinesShawn Rutledge2022-06-241-0/+94
| | | | | | | | | | | | | | | | | | | - Since 4edcea762d9ce334c4c1a78234c90c118b81da87 the dropsite example shows markdown if available; and now it shows that when we do DnD of a selection from the richtext example, text/markdown is available. - If we artificially make html unavailable, copying and pasting between widget-based rich text editors uses markdown. In case markdown writer output contains unnecessary backticks due to monospace fonts getting used, the workaround from 1ad456c908467212bc30223a69eb7524b64b86e1 is applied. Pick-to: 6.4 Task-number: QTBUG-76105 Task-number: QTBUG-103484 Change-Id: Ie6ca4dbb450dbc36b3d09fd0df1ae5909aaebca7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-06-232-4/+0
| | | | | Change-Id: Ifb09a997d39fc2c92503e77cf372d443c13c4c2b Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Remove unused variable in tst_QTextEdit::setDocumentPreservesPalette()Shawn Rutledge2022-06-211-1/+0
| | | | | Change-Id: I96c0f39c2ee1bd03cf0d7939624652ee008c9726 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QGraphicsScene: respect that items can override selection changesVolker Hilsheimer2022-06-201-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsItems may override itemChange to prevent certain attribute changes. Overriding ItemSelectedChange this way is explicitly documented to be allowed. However QGraphicsScene::clearSelection did not test whether items were in fact deselected after the call to setSelection, and always cleared the stored set of selected items. Fix this by checking the actual selected state of the item as we iterate over them, and store those items that are still selected in a set that becomes the new selectedItems set (which will be empty if no item overrides, which is the default). Add a test that also checks that clearing the selection emits the selectionChanged signal correctly (and does not if all selected items block being deselected). Fixes: QTBUG-85474 Pick-to: 6.4 6.3 6.2 Change-Id: I665afc132876e02e6e1061b7be37f4f6e4be418f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* BLACKLIST tst_QApplication::sendEventsOnProcessEvents for Ubuntu 22.04Heikki Halmet2022-06-201-0/+1
| | | | | | | Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-87137 Change-Id: Ib09382af7504f5ee078d23cc021c1b0faf051e23 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* BLACKLIST tst_QMenuBar::check_menuPosition for Ubuntu 22.04Heikki Halmet2022-06-201-0/+1
| | | | | | | Pick-to: 6.4 6.3 6.2 5.15 Task-number: QTBUG-68865 Change-Id: I1eda9789a30737104c6e97de583a9f3022ae0bf6 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Update window state in QWindowsWindow and QXcbWindow geometry settersAxel Spoerl2022-06-171-0/+97
| | | | | | | | | | | | | | | | | When QWidget::resize() is called on a maximized or minimized QWidget, the window state of the widget and the corresponding QWindow is not updated (i.e. remains maximized or minimized). This patch updates the window state to Qt:WindowNoState when setGeometry() is called in QWindowsWindow or QXcbWindow. A test is added in tst_QWidget. Fixes: QTBUG-104201 Pick-to: 6.4 Change-Id: I07491fb9293d13509573fc403750da0a50f6a785 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMainWindow: fix restoreState() for toolbarsIvan Solovev2022-06-171-0/+5
| | | | | | | | | | | | | | | | | | Restoring the toolbar state of a QMainWindow could not update QWidgetPrivate::widgetItem for the QToolBar, because at that point it was still holding the pointer to the widgetItem of the previous state. Later on, when the new state was successfully applied, the previous state was deleted, and the corresponding widgetItem was reset to nullptr. This patch explicitly resets the QToolBar's widgetItem while updating the state, so that it is later correctly updated while creating a new QWidgetItemV2. Fixes: QTBUG-102395 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I17613d62423edcc0faf85ecb0a714865a50d87e8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QComboBox: emit currentIndexChanged() and currentTextChanged() when the ↵Ivan Solovev2022-06-161-0/+33
| | | | | | | | | | | | | | | | | | model is cleared QComboBox uses QPersistentModelIndex to store the current index of the underlying model. When the model is cleared, that index is automatically invalidated, so calling QComboBoxPrivate::setCurrentIndex(QModelIndex()) does not result in signals being emitted, because we do not detect the index change. This patch uses indexBeforeChange to detect such situation and emit all necessary signals. Fixes: QTBUG-103007 Pick-to: 6.4 6.3 6.2 Change-Id: I29326830a30a17900839e8d1737a08bd940081ea Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix typos in docs and commentsKai Köhne2022-06-152-2/+2
| | | | | | | | | Found by codespell Pick-to: 6.4 Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Don't crash when removing the last visible tabVolker Hilsheimer2022-06-131-0/+34
| | | | | | | | | | | | | | | | | | | | The code incorrectly tried to ensure that the firstVisible tab was a valid index, even though there might not be any visible tab left after removing the last visible tab. The same logic didn't exist of the lastVisible tab, so we tripped the assert in qBound, as max (being -1) ended up smaller than min (0). Fix this by removing the wrong correcting of firstVisible to be always valid. Make sure we emit currentChanged with -1 when no visible tab is left after removing the current tab. Add a test. Fixes: QTBUG-104003 Pick-to: 6.3 6.2 Change-Id: I27e6438a02d0a0f1ac4d0e0160cee4f33b3f3766 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix separate delete of window and windowcontainerAllan Sandfeld Jensen2022-05-231-2/+23
| | | | | | | | | | | | The documentation says we can change window parent to avoid the widget deleting the window. That didn't work as the widget didn't get the child-removed event as it wasn't the parent. This patch instead uses an event filter on the set parent. Pick-to: 6.3 6.2 Change-Id: I1f61d1832fcf3257722f305beeefd8f1abf1f656 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't hide a widget that is swapped into a hidden splitterVolker Hilsheimer2022-05-231-0/+43
| | | | | | | | | | | | | | | | | When replacing a widget in a hidden splitter, then we only need to keep the new widget hidden if the previous widget was hidden. If the new widget is not explicitly hidden, and the splitter is already visible, then we need to explicitly show the new widget. Augment test case; the existing test cases already cover swapping out a collapsed or hidden widget. Fixes: QTBUG-102134 Pick-to: 6.3 6.2 Change-Id: I9b60711a5c1cab79777ce4183783114a16ac3394 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix crash in tst_qquicktext::implicitSizeEskil Abrahamsen Blomfeldt2022-05-201-3/+2
| | | | | | | | | | | | | This reverts commit 1e938c348b936328fafbcaae4c0c7d91003143e5 and bb2f4d08d9d138e4f70d6d6db46e24e34500becc. bb2f4d08d9d causes the crash, but 1e938c348b93 amends it, so this reverts both. When the cause of the crash has been determined and mitigated, the patches can be recreated. Fixes: QTBUG-103719 Change-Id: Ifc36b3771a96f6c85387a5306a0402d4c508d006 Reviewed-by: David Faure <david.faure@kdab.com>
* xcb: Delete touch points without target windowsTang Haixiang2022-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When XCB_INPUT_TOUCH_BEGIN closes a popup, we then receive XCB_INPUT_TOUCH_END, and cannot find a target window (because it's destroyed). If we don't deliver it, we need to at least clear the stored point from QPointingDevicePrivate::activePoints. Then when we deliver the next touch press, m_fakeMouseSourcePointId also needs to be reset. It's now even more paramount that autotests (and real-world touchscreens) must never omit any active touchpoint from a touch event. If a point doesn't move, it must be included in the QTouchEvent, with Stationary state. If not, QGuiApp::processTouchEvent() could generate multiple TouchBegin events in a row, which gets other bits of logic confused, here and there. Fixes: QTBUG-94557 Fixes: QTBUG-98519 Fixes: QTBUG-102751 Fixes: QTBUG-103706 Pick-to: 6.2 6.3 5.15 Change-Id: Ia95e410a2bb8bc7784aa5d296fac2b89e53a9f55 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-05-182-8/+0
| | | | | | Pick-to: 6.2 6.3 Change-Id: I7d37dd58eaede1bd0d1b53fe264b45be83cbca57 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix memory leak in tst_qtreewidgetAndreas Buhr2022-05-181-0/+2
| | | | | | | | | | | Invalid inserts of items are tested. However, on an invalid insert of QTreeWidgetItem into QTreeWidget, the QTreeWidget does not take ownership of the to-be-inserted items. These items were leaked in the past. This patch introduces a scope-guard, so the items are not leaked. Change-Id: Ib53ac02605c3a3c0bd1ae69bbd0876f860d08093 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtWidgets: restore Qt 5 compatibility for save/restore stateGiuseppe D'Angelo2022-05-181-5/+32
| | | | | | | | | | | | | | | | | | | | | | | Several classes in QWidget use QDataStream internally in order to save and restore state. These QDataStream usages were not versioned, meaning that if Qt changes the serialization for some datatype, then the data saved between different Qt versions becomes incompatible. Note that the save/restore API in question just produce opaque blobs as QByteArrays -- the user has no control over the QDataStream objects and thus versions. Fix by version the usages. In QHeaderView this has caused a regression because QBitArray *did* change version between Qt 5 and 6. In general, using QDataStream without explicit versioning is a mistake, so deploy the same fix elsewhere as well. Fixes: QTBUG-99487 Pick-to: 5.15 6.2 6.3 Change-Id: I82bb5c266f4e5dedc0887cbef855dccab1015e29 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: <doctor.whom@gmail.com>
* QTextDocument/QGraphicsTextItem: skip layout in setTextWidth(0)David Faure2022-05-171-2/+3
| | | | | | | | | | | | | | | | | | In a QGraphicsTextItem without a width yet, there's no need to do any layouting. The use case is obviously items with an app-defined size, not the default where text items adapt to their contents. Results: 0.065 msecs to create a QGraphicsTextItem with some text (layouted) 0.036 msecs to set everything up in a QGraphicsTextItem with 0 width QTextEdit was abusing the width 0 to mean "no wrap, width comes from contents", but since the value -1 means that already in QTextDocument, QTextEdit now uses a width of -1 for that meaning. Change-Id: I67ad59c305e5dd34830886e4e6c56dde03c93668 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-16133-3593/+268
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add override keyword to avoid warning from compilerOliver Eftevaag2022-05-131-1/+1
| | | | | | | | | A class that reimplements a virtual function isn't using the override keyword, which generates a warning during compilation. Pick-to: 6.3 Change-Id: Ic39ea24993e031f95ac9e61c3285d3be05fe6c34 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Remove remnants of the old Intel C++ compilerThiago Macieira2022-05-112-2/+2
| | | | | | | | | | | | | We don't support it any more. I don't think it has ever properly compiled Qt 6 (and it's no longer working for me against GCC 12's libstdc++ headers). If you report a bug against it, Intel support's first question is if you can try instead the new Clang/LLVM-based oneAPI C++ compiler. So we support only that one, which identifies itself as Q_CC_CLANG. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb57a092c8439e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Blacklist: test cases blacklisted in tst_QDockWidget:CI Insignificant Platforms Monitor Bot2022-05-041-0/+2
| | | | | | | | | | - floatingTabs on qnx Pick-to: 6.2 Pick-to: 6.3 Task-number: QTBUG-103091 Change-Id: Ia8b4a60847ba27dd2e9e50148bbe1e37febe1498 Reviewed-by: CI Insignificant Platforms Monitor Bot <ci_insignificant_platforms_monitor_bot@qt.io>
* tst_qitemdelegate: make it more robustGiuseppe D'Angelo2022-04-271-2/+1
| | | | | | | | | Remove a processEvents() call followed by a QCOMPARE and turn it into a QTRY_COMPARE. Otherwise it seems to be randomly failing on Ubuntu 22.04. Change-Id: I3c1b9d55c857c79ffd36aeb98971db60267adace Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QApplication: deliver activation events for non-widget windowsRichard Moe Gustavsen2022-04-211-0/+48
| | | | | | | | | | | | | | | | | | Problem: if you create a hybrid Widgets and Quick Controls application, you would need to use QApplication rather than QGuiApplication. But in that case, the QQuickWindows would never receive window activation events from QApplication. And this causes problems for controls, since, for example, the palettes in use there will never update upon activation changes, and instead sometimes get stuck as e.g QPalette::Inactive after application startup. This patch will make sure that we send out activation events also for QWindows that are not QWidgetWindows. Pick-to: 6.3 6.2 Change-Id: I649f5c653081c0c5249f4faf28a7de2c92f17421 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix QDockWidget parenting and dock permissionsAxel Spoerl2022-04-193-2/+603
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check DockWidgetArea permissions of QDockWidgetGroupWindows with single dock widget. Obtain a dock widget's tab position from a dock widget group window if it can't be established otherwise. Remove hardcoded assumption that a dock widget is in the left dock. Both cases have lead to inconsistent entries and dangling pointers in QDockAreaLayoutInfo::item_list. Remove warning: QMainWindowLayout::tabPosition called with out-of-bounds value '0', which becomes obsolete by the fix. Create a QDockWidgetGroup window prepered to become a floating tab, whenever a dock widget is being hovered over. Store it in item_list so it can be found and deleted when required. No longer call e->ignore() after propagating close events to the first dock widget and thus preventing others from receiving the event. Add logging category qt.widgets.dockwidgets Update dock widget autotest with tests to check the fixes mentioned: plugging, unplugging, hiding, showing, closing and deleting. Blackist closeAndDelete, floatingTabs test on macos, QEMU, arm, android due to flaky isFloating() response after a dock widget has been closed or plugged. QSKIP dockPermissions and floatingTabs test on Windows due to mouse simulation malfunction. QSKIP hideAndShow test on Linux in case of xcb error (QTBUG-82059) Fixes: QTBUG-99136 Pick-to: 6.3 6.2 Change-Id: Ibd353e0acc9831a0d67c9f682429ab46b94bdbb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace uses of _qs with _s in testsSona Kurazyan2022-04-072-6/+9
| | | | | | Task-number: QTBUG-101408 Change-Id: If092a68828a1e8056259cf90d035d9a87989244b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Activate tst_qmessagebox for AndroidAndreas Buhr2022-04-051-1/+1
| | | | | | | | | | | | tst_qmessagebox was disabled because it crashed. It does not any more. Now it hangs, which is a new problem. Fixes: QTBUG-87671 Task-number: QTBUG-101217 Pick-to: 6.2 6.3 Change-Id: Iec15cf82a4112ee79182ec091622e40147bd3e7f Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QSplitter: Don't move handle in non-pressed stateNodir Temirkhodjaev2022-04-051-0/+21
| | | | | | | Fixes: QTBUG-102249 Pick-to: 6.2 6.3 Change-Id: Ib1d74447e346760d1fc9960e11486e8dc7ea3bc0 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Android: skip flaky tst_qcalendarwidget::showPrevNext()Assam Boudjelthia2022-04-041-0/+3
| | | | | | | Pick-to: 6.2 6.3 Task-number: QTBUG-102258 Change-Id: I96b5003e0b4266250e526439370603b47562cdea Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Revert "Activate all tst_qgridlayout tests on Android"Ivan Solovev2022-04-021-0/+3
| | | | | | | | | | This reverts commit b39d3cfe3077a22b6adeb820f625099dcbc1a46c. Reason for revert: the test fails in dev again Task-number: QTBUG-87404 Change-Id: Icc51e36e037e9c7e8154266def129dd8ad412775 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: skip few tst_qopenglwidget tests that crash on CIAssam Boudjelthia2022-04-021-1/+31
| | | | | | | | | | To allow other cases to run while finding the reason. Most of these cases fail only on CI and not locally. Pick-to: 6.3 6.2 Task-number: QTBUG-102043 Change-Id: Ib552ab00b4232f6aabdf85acf050633251d9e71d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>