aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_textfield.qml
Commit message (Collapse)AuthorAgeFilesLines
* Editors: fix placeholder text alignmentJ-P Nurmi2017-01-101-5/+54
| | | | | | | | | | | | | | | | | | The internal QQuickPlaceholderText creates an "implicit binding" to the editor's horizontalAlignment, meaning that the placeholder respects the editor's horizontal alignment when explicitly set, and otherwise determines the alignment from the placeholder text's visual direction. [ChangeLog][Controls][TextField] Fixed the horizontal alignment of the placeholder text in right-to-left UIs. [ChangeLog][Controls][TextArea] Fixed the horizontal alignment of the placeholder text in right-to-left UIs. Task-number: QTBUG-55999 Change-Id: If1a8596c35c1920874996277520f1c54430c5f69 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_textfield: use TestCase's new createTemporaryObject functionsMitch Curtis2016-12-201-24/+9
| | | | | | | | This ensures that the appropriate objects are destroyed at the end of each test function, even if the test fails. Change-Id: I6d9d4fd85331777b6d29e25c6f25e0ced9662427 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-061-0/+19
|\ | | | | | | Change-Id: Ief98cd56abd13cfa4e30578e150207462a8243b8
| * TextField: improve the implicit size calculationJ-P Nurmi2016-09-051-0/+19
| | | | | | | | | | | | | | | | | | | | In general, we don't want TextField to grow while typing, but if there is no background nor placeholder, use content width as a fallback. Also take content height into account while calculating the implicit height. Task-number: QTBUG-55684 Change-Id: Iee0eff6861c3573045036a06d7e53f7fc313fbe8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-151-0/+19
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickswipedelegate.cpp tests/auto/controls/data/tst_swipedelegate.qml tests/auto/controls/data/tst_textarea.qml tests/auto/controls/data/tst_textfield.qml Change-Id: I244f4ead4d14238c41db0bd965d7a2938f2ea8fc
| * QQuickTextArea & -Field: fix double-click to select a wordJ-P Nurmi2016-07-111-0/+19
| | | | | | | | | | | | | | | | | | The delayed/intercepted mouse press event must be passed first, before letting the base class handle the double-click event. Change-Id: I029d06b0b619f34bb7be13ae12b8904f2efe6b5b Task-number: QTBUG-54615 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add pressed() and released() signals to TextField and TextAreaMitch Curtis2016-07-061-1/+169
| | | | | | | | | | | | | | | | | | | | | | | | Users need these to e.g. open context menus when editors are right-clicked. [ChangeLog][TextArea][TextField] Added pressed() and released() signals. Change-Id: I32b79a8de0120a4f9115fa1c3cb832aff0134a15 Task-number: QTBUG-51009 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Add hover support to TextArea & TextFieldJ-P Nurmi2016-06-291-0/+22
|/ | | | | | Task-number: QTBUG-50003 Change-Id: Ie101ba8840fba2a7503da8de77d9cf2a3c91d562 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Avoid "implicitWidth/Height redefined" warningsMitch Curtis2016-04-291-0/+6
| | | | | | | | | In the same way that QQuickImplicitSizeItem does. Task-number: QTBUG-49371 Change-Id: I1a8315c41e49139a9375f66a5714493331d22318 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* import Qt.labs.controls 1.0 => QtQuick.Controls 2.0J-P Nurmi2016-04-211-1/+1
| | | | | | | | | Docs, resources, .metainfo and plugins.qmltypes will be updated in follow up commits. Change-Id: I4438c5bfb8802bff0fa15c56431cfd288f179861 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix font comparisonsJ-P Nurmi2016-03-111-0/+48
| | | | | | | | | | | | | | | | | | | | When inheritance of explicitly set font attributes is involved, it is important to compare the resolve mask in addition to comparing the attribute values to avoid losing the information whether a specific attribute is set explicitly. For example, QFont::operator==() returns true for two fonts that are both bold regardless of whether only one of them has explicit weight set. Therefore, setFont() must not ignore fonts resolve mask. Furthermore, the fontChanged() notifier must be emitted only if the actual attribute values change, not if only the resolve mask changes. Change-Id: I2eb7a071c0eaecd2f8d2f6074c4ce6ed6764a6e9 Task-number: QTBUG-50984 Task-number: QTBUG-51696 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Refactor press and hold testsJ-P Nurmi2015-11-121-17/+0
| | | | | | | | | | | | | | | | | We can't rely on timers in auto tests. They are not fired accurately under heavy CPU load => random CI failures. This change make the press and hold tests independent of timeouts. The idea in a nutshell: the test creates two control instances, and sends press events to both of them. Both controls run their timers and emit pressAndHold() - unless canceled. The test waits as long as it takes for the second control to emit pressAndHold(). At that point we can reliably assume that the first control would have already emitted the signal, if it was not canceled as appropriate. Change-Id: I96aaf4d204db368171209271a4a0fa2ff15cc323 Task-number: QTBUG-47963 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Simplify TextField & TextArea placeholderJ-P Nurmi2015-10-301-2/+8
| | | | | | | | | | Better not expose the extra Text item in the API. Ideally it should be implemented as a scenegraph node. We might even want to promote the placeholderText property (and add placeholderColor) to TextInput and TextEdit in Qt Quick core. Change-Id: I4f443c77d1c696b87a50ee184f868713dd50316f Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* TextArea & TextField: fix placeholder alignmentJ-P Nurmi2015-10-201-0/+14
| | | | | | | | Placeholder text should follow the alignment of the control itself, so that text input appears in the same place where a placeholder was. Change-Id: I1dfa6c2aece10eb92e62a14f347c7e1ec5e610ea Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* TextField: fix implicit sizeJ-P Nurmi2015-10-041-0/+10
| | | | | Change-Id: Iceaa5af83b2a9f0eb03829829fcfc4e4a6261100 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Rename QtQuick.Controls 2.0 to Qt.labs.controls 1.0J-P Nurmi2015-10-011-1/+1
| | | | | Change-Id: I142622dd85e95ef70b11132e77ccf48701f2cabc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Ensure press-and-hold event keeps selectionGabriel de Dietrich2015-09-151-45/+7
| | | | | | | | | | | | | | | | | | | | This concerns TextField and TextArea. It is an almost universal UX pattern on touch platforms where the user long presses to pop the context menu up. In many cases the context menu is used for copy and cut operations, which means that poping it up should keep the selection. The implementation works by not forwarding the initial mouse press event to the parent class until we're sure it's not going to be a long press. If the long press timer is cancelled for any reason, we will then send the delayed mouse press event to the parent class followed by whichever event triggered the cancellation. Auto-tests refactored and updated. Change-Id: If3aa8075f07a80929f4bd723895d9599bf8d169e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix tst_textfield test_pressAndHold() skipJ-P Nurmi2015-08-281-1/+1
| | | | | | | Change-Id: I1ceb0d2bd269c66a5663dab258698e1eddbd7d25 Task-number: QTBUG-47963 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Skip tst_textfield::test_pressAndHold failing test on OS X.Mitch Curtis2015-08-271-0/+3
| | | | | | Change-Id: I479704184ceff878a239c2ee72d0c0929859b97b Task-number: QTBUG-47963 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Stabilize pressAndHold auto-tests for TextField, TextAreaGabriel de Dietrich2015-08-211-2/+2
| | | | | | | | | | | We just extend the wait interval. This is to make sure the control's press-and-hold timer will timeout before the wait. Since we're probably not using the most accurate timers, adding 20% to something that's around one second remains acceptable. Change-Id: I1d10c88a168e882c9069f9345e896c1aab2f2bda Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add pressAndHold support for TextFieldGabriel de Dietrich2015-07-241-0/+52
| | | | | Change-Id: I634da6568a456a5f21e30e6295d139a4e1a89e75 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add tst_label, tst_textfield, tst_textarea stubsJ-P Nurmi2015-07-161-0/+63
Not so much to test there, but test that at least creation succeeds. Change-Id: I81aa3e43602b511d12ca9bb017e8df7452f9eaf3 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>