aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextedit
Commit message (Collapse)AuthorAgeFilesLines
* TextEdit: ignore all key release eventsVolker Hilsheimer2021-07-142-0/+74
| | | | | | | | | | | | | | | | | Input events are accepted by default, and get ignored by the default event handler implementations. By overriding an event handler, the events get accepted, unless ignored explicitly. Since QQuickTextControl does not handle any key release events, it should explicitly ignore all of them, not just Key_Back (ignoring of which was added in 798112b6532a3c66abff630327d29a980a525f25). Fixes: QTBUG-95073 Change-Id: I09105fd8ebef73c03eb2083149643d188a2f1360 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 6ca31ca88a7ee86308e329afd6cd2c90a050d4d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use QKeyCombination to fix compiler warningVolker Hilsheimer2021-04-281-1/+1
| | | | | | | | | Avoid deprecated implicit cast to int. Change-Id: If89381eda7d92a1b17005d91472070b6ba31fb66 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit a2cf615516309d2baac503444c439ecab7e40ab3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove the qmake project filesFabian Kosmale2021-01-151-17/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add tst_qquicktextedit::inFlickable testsShawn Rutledge2020-11-172-0/+126
| | | | | | Task-number: QTBUG-88169 Change-Id: Iaea3959365a580f3f8d2dd7ab2b227933e79cf59 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't copy or assign QEvent instances in testsVolker Hilsheimer2020-11-161-12/+16
| | | | | | | | | | | | | | | Copying/assigning polymorphic types is a code smell, use separate instances instead in the tests. Those should perhaps be rewritten to use a data driven testing approach, there's a lot of code repetition. In the test API implementation, first evaluate the parameters for the event, then construct the event once with the correct values. Change-Id: I2572772698cb0204f5ff950741b9fe3805fae15d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix some compiler warnings in testsVolker Hilsheimer2020-10-261-7/+3
| | | | | | | | | | | Use char16_t instead of quint16 for arrays of 16bit strings. Use QKeyCombination API. As a drive-by, remove superfluous 0 from characters specified in hexadecimal. Change-Id: Ic52b1fdceaf3348a9b81c40814031e9c2e557dd9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTextEdit: ensure we update document width when padding has changedRichard Moe Gustavsen2020-10-082-0/+33
| | | | | | | | | | | | | | | We use an if-test to check if the document width has changed before we set the new value. The problem is that the value we test against is different than the value we set. The result is that we can sometimes skip setting a new width on the document, even if padding has changed. This patch ensures that we use the same width for both testing and setting. Pick-to: 5.15 Change-Id: Ia8391999e8cc2b5be72fe525d396bf8c17ba0fa2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-4/+4
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QQuickTextNodeEngine: prevent renderring transparent selection colorWang Chuan2020-06-052-0/+44
| | | | | | | | | | It is not necessary to render selection color which is transparent. Pick-to: 5.15 Fixes: QTBUG-83819 Change-Id: I45c086652e194192619aad025121e6064ab37a58 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-05-151-0/+3
|\ | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktextedit/BLACKLIST Change-Id: If1868d27ea40fdc206971c2f7a24e91c5e62b1bf
| * Blacklist a failing hAlignVisual in SLESTony Sarajärvi2020-05-111-0/+3
| | | | | | | | | | | | Task-number: QTBUG-76719 Change-Id: I034f15471e64a272f365cfe636d757478ab418d8 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* | Fix font-related test failures triggered by Qt Base updateEskil Abrahamsen Blomfeldt2020-04-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change f761ad3cd9ad1252f24b76ae413298dc7bed8af3 in qtbase exposes a pre-existing difference in measuring the height of QTextLayouts versus QTextDocuments when the leading is large enough to impact the font height. See QTBUG-82954 for details on this. Since the two were assumed to be the same, this change causes a test failure with certain fonts. To work around it, we expect the test failure for the case where the text format is RichText (and QTextDocument is going to be used internally), and we detect that the font exhibits the problem. For TextEdits, QTextDocument is always used, so we also expect failure there. Note that this is equivalent to the fix for the same issue in the QLabel test: c4ef0b92d5fb2c621e880347bd48d01b6f31eb24 Fixes: QTBUG-83839 Task-number: QTBUG-82954 Change-Id: Ic32e0d835480b42b68bb452301ec4bfa6ce30d3a Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Port the remaining tests from QRegExp to QRegularExpressionLars Knoll2020-04-031-10/+14
| | | | | | | | | | Change-Id: If258701759c5da206948407feccd94e323af6b36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-201-1/+1
|\| | | | | | | Change-Id: I6f320ea43b5837444226228c118e57c4bda8702a
| * Fix copy-pasted typo minimimal -> minimalAllan Sandfeld Jensen2020-03-181-1/+1
| | | | | | | | | | Change-Id: I4afef3fdbb9e3c3ec20ba5d00307992131b9ba3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-171-3/+3
| | | | | | | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-121-0/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * | Blacklist tst_QQuickTextEdit::linkHover() on macOSFabian Kosmale2020-02-121-0/+4
| |/ | | | | | | | | | | Task-number: QTBUG-82052 Change-Id: I2718ab6004ba7a278b1917a6164566d6e541fbdc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate qtdeclarativeAlexandru Croitor2020-02-121-6/+2
| | | | | | | | | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-162-2/+6
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * Avoid initializing QFlags with 0 or nullptr in further casesFriedemann Kleint2019-11-251-2/+2
| | | | | | | | | | | | | | Amends 744e77b841878fb017c0f2d60607090008f28180. Change-Id: I16e37aaf503eb62f67fca0e48be4c92c4a72ae46 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-11-221-0/+4
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlextensionplugin.cpp tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: Ic58d36a8532015bae30f2690063db9829b3bf372
| | * Blacklist tst_qquicktextedit::mouseSelectionMode on OpenSuse 15Ulf Hermann2019-11-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-78846 Change-Id: I74d0f35b5ee1d22b10564c28edeb833689bbc6d9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-251-1/+23
|\| | | | | | | | | | | Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
| * | Handle -no-feature-shortcutFriedemann Kleint2019-10-181-1/+23
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Preparing for the extraction of QGuiShortcut, the shortcut feature will changed to follow the convention of using QT_REQUIRE_CONFIG(shortcut) in the affected class headers. Add the required exclusions to prevent compile errors when disabling shortcuts. Task-number: QTBUG-76493 Change-Id: Icad95584ae12aa97a56b56ef27206cef1b1ba48f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-4/+4
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate testsAlexandru Croitor2019-11-141-11/+2
| | | | | | | | | | | | Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-141-11/+12
|\| | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-121-11/+12
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/quick/handlers/qquicktaphandler.cpp src/quick/items/qquicktableview.cpp Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io> Done-With: Ulf Hermann <ulf.hermann@qt.io> Done-With: Shawn Rutledge <shawn.rutledge@qt.io> Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
| | * Make mouseSelection test more stableJan Arve Sæther2019-08-281-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTestLib assumes that the double click interval is below 500ms. Therefore it adds a 500ms delay after all synthesized single- and doubleclick releases to prevent unintentional synthesizing of double click events. This has two unfortunate side-effects: 1. If the double click interval is smaller than 500 ms, it is not possible to synthesize a triple click. (Triple clicks are used for selecting paragraphs in text). This is why the workaround in the block (if clicks ==2) was needed. 2. If the double click interval is bigger than 500ms we might still accidentally trigger a double click event with two successive single click events, so it doesn't even work reliably for that case (!). Therefore, the hardcoded 500ms in QTestLib should probably be revisited. Anyway, to fix this test we therefore have to cancel the 500ms delta QTestLib adds in order to properly synthesize the triple click by adjusting the internal QTest::lastMouseTimestamp. Task-number: QTBUG-77389 Change-Id: Ic738f51b294270ddf99b6d91d256f6ec4b34d039 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * Fix flakiness in QQuickTextEdit::mouseSelectionJan Arve Sæther2019-08-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid that the last click from the previous test data and the first click in the current test data happens so close in time that they are interpreted as a double click. Task-number: QTBUG-77389 Change-Id: Ia2d159452dcdb58cacccf7101cc3360175b39594 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-111-0/+2
|\| | | | | | | | | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * | Blacklist tst_qquicktextedit::mouseSelection in openSuse leapFabian Kosmale2019-08-121-0/+2
| |/ | | | | | | | | | | | | | | | | This autotest is blacklisted as it is deemed flaky. Task-number: QTBUG-77389 Change-Id: I3561c98f0248507755f99fd7b6fe24c3d24cb522 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* / Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+64
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-162-0/+57
|\ | | | | | | Change-Id: Ia93dc734ce25b3134b0f905f473a0c30777ceaf1
| * TextEdit: use I-beam cursor by default, pointing cursor for linksShawn Rutledge2019-05-152-0/+57
| | | | | | | | | | | | | | | | | | | | But do not interfere with any custom cursor that user code sets: remember and restore it when the mouse is no longer hovering a link. Task-number: QTBUG-14769 Fixes: QTBUG-50482 Change-Id: Ia4633c22d0ad42d07203d4dc3e330b90a5f94a7c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | TextEdit: Fix persistentSelection for readonly controlsNils Jeisecke2019-02-151-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TextEdit items with readOnly:true do not clear the selection on losing focus which is expected with persistentSelection:false. The reason is that a readonly TextEdit does never show a blinking cursor and thus the selection clearing within setCursorVisible never happens. This change adapts the implementation from TextInput. Fixes: QTBUG-50587 Change-Id: Ie66baaa0ccbc006359473862d8e9dbecd46a59f6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fix Keys.onShortcutOverride for TextEditJan Arve Sæther2018-12-132-0/+66
|/ | | | | | | | | | | | | | It was not possible to override a shortcut with Keys.onShortcutOverride for TextEdit. This was because the ShortcutOverride event sent to the TextEdit was not passed on to the default event() implementation (of the base class) in the case that the QQuickTextEdit did not handle the ShortcutOverride event. Fixes: QTBUG-68711 Change-Id: I981738d8f92c77eadb8dd98b4245290d430525d3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-107/+107
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tests: Wrap qWaitForWindow{Active,Exposed} in QVERIFYv5.11.0-beta1Kari Oikarinen2018-02-231-32/+32
| | | | | | | | | | | The functions are marked Q_REQUIRED_RESULT, so they give compilation warnings when not handling the bool return value. Failing the test early at an unexpected event is also better behavior anyway. Task-number: QTBUG-66559 Change-Id: I6c4db29379ec01528208c3e4ee54346b4230616c Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-061-1/+1
|\ | | | | | | Change-Id: I1ed923d72566af663555898c3ec708191eef8ae9
| * Update the cursor rectangle when select all is triggeredAndy Shaw2017-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When select all is triggered then the cursor rectangle should be updated to ensure that the selection handles are visible if they are displayed on a given platform. For instance, on iOS the loupe handles should appear in this case. This also has the added effect that when using Backspace on the iOS keyboard, it will delete the selected text as opposed to just a single character as it will handle that situation correctly. The tst_qquicktextedit::inputMethodUpdate() test is modified to account for the extra event sent now when selectAll() is called. Task-number: QTBUG-63835 Change-Id: I94fb0576b286c006dd12c65d0b322d712ed2a96f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-221-0/+13
|\| | | | | | | Change-Id: I3878bbf2ac7b62651215938c98ead7171be49c74
| * QQuickTextEdit: call implicitWidth() even if requireImplicitWidth is trueTim Jenssen2017-09-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before once requireImplicitWidth was set to true by requesting the implicit width, the implicit (and width) was never updated again, even if the text was updated/changed. Adding also a test Task-number: QTBUG-63153 Change-Id: Ie3bac4baeb14c2e69acc43d11a351ac91d5400da Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* | Enable tests for boot2qtSami Nurmenniemi2017-09-211-0/+4
|/ | | | | | | | | | | | | | Some tests needed fixing - Disabled tests too heavy for qemu - Skipped tests requiring OpenGL without support from the platform - Skipped tests requiring functionality on broken offscreen platform - Skipped tests that take too long on qemu + software renderer - Blacklisted tests for created bugs QTBUG-63049, QTBUG-63053 QTBUG-63055 and QTBUG-63057 Task-number: QTBUG-60268 Change-Id: I0346b0e436cf286d7d9cbc140acf324a4087cfb9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-141-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp src/qml/qml/qqmlimport.cpp src/quick/items/context2d/qquickcontext2dtexture_p.h tools/qmleasing/splineeditor.h Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
| * Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-7/+7
| | | | | | | | | | | | | | | | Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | tst_qquicktextedit: remove useless call to image.save()Mitch Curtis2016-11-281-1/+0
|/ | | | | Change-Id: I433ba9ef0dc403e7b15eeaee1fd682cf443870cf Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Simon Hausmann2016-11-152-0/+58
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4string.cpp The conflict resolution for qv4tsring.cpp is to essentially omit the change of commit 64714ea431f2fd355ed27edc69dba4e992511e75 as the code in 5.8 already uses the add/mul_overflow functions. This merge also reverts commit f4ac007f4a19bc095ff15d415a6629986de78e49 as we can deal with dead store elimination now. Change-Id: Iee08c87cbe1a2ff23a73ce621d56262b4e007c56
| * TextEdit: set cursor delegate's height to match the selected fontMitch Curtis2016-11-122-0/+58
| | | | | | | | | | | | | | | | | | | | RichText can have blocks of text with varying font sizes, so we must ensure that the cursor delegate's height is also set when it's moved to a different position in the text. Change-Id: I00691a94a2360c7d3272571fc4ba0da28b01006a Task-number: QTBUG-54934 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>