diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2021-08-30 16:12:16 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-06 19:23:08 +0000 |
commit | fbe68ba784ff4bc499fda222a2d8556989e20e07 (patch) | |
tree | d0c6bd302126c231eacb527cdef1f05a987c4abb /tests | |
parent | dbcc2e7d56fca7cfe9209d1cb5b0640a0d3203d0 (diff) |
Make TextField.implicitWidth fixed
Previously, implicitWidth was based on contentSize() (which was based
on the full textwidth inside the TextField)
This had the unfortunate consequence that an empty TextField (which is
very normal) was very narrow on startup (18 pixels on macOS style), but
would grow wider as the user kept on typing. When the TextField was in a
layout, this would in addition lead to a relayout, even though it
usually was barely noticeable. This change aligns that behavior to the
other non-native styles.
This also fixes a test on native style windows:
TextField::test_implicitWidth where it assumes that the implicitWidth of
TextField without a background is simply equal to left+right padding.
This failed because the calculation of the geometry of the placeholder
item was wrong.
Task-number: QTBUG-95679
Change-Id: Ie658411664d88df6cb6a337376bdcf897e8c1790
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit e0990f8b4069ca912de5a27df00a8039aa4a4731)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quickcontrols2/controls/windows/BLACKLIST | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/tests/auto/quickcontrols2/controls/windows/BLACKLIST b/tests/auto/quickcontrols2/controls/windows/BLACKLIST index 422683648a..b69aa99619 100644 --- a/tests/auto/quickcontrols2/controls/windows/BLACKLIST +++ b/tests/auto/quickcontrols2/controls/windows/BLACKLIST @@ -17,14 +17,6 @@ * [ComboBox::test_font] * -[ComboBox::test_implicitContentWidthPolicy_WidestText:Array] -* -[ComboBox::test_implicitContentWidthPolicy_WidestText:ListModel] -* -[ComboBox::test_implicitContentWidthPolicy_WidestTextWhenCompleted:Array] -* -[ComboBox::test_implicitContentWidthPolicy_WidestTextWhenCompleted:ListModel] -* [Popup::test_font] * [ScrollBar::test_flashing] @@ -89,5 +81,3 @@ * [TextArea::test_implicitSize] * -[TextField::test_implicitSize] -* |