qt5base-lts/tests/auto/widgets
Volker Hilsheimer d2e88b8094 Fix auto completion in QFileDialog on Windows
Amends c0b3c06a7d.

The QCompleter used by QFileDialog uses starts-with matching of
the path parts, for all parts of the path. It uses the EditRole of the
underlying model for the data to match.

The path parts used for a path on Windows are "C:", "Users", "etc...",
and then finally whatever input has been typed so far. If we try to
match that against a starts-with rule against "Local Disk (C:)", then it
will fail and the completer will never have anything to show.

So, for the EditRole, return just the volume drive letter as we did before
c0b3c06a7d, not the volume name. Neither
can be edited anyway. This happens to then match the native file dialog
behavior, which doesn't complete "L" to "Local Disk (C:)" if the Computer
contents (ie. volumes) are shown.

Augment the QCompleter test case to cover that scenario (it already has
everything set up for this particular combination, even though we are
actually testing QFileSystemModel returning the correct data).

Fixes: QTBUG-94799
Task-number: QTBUG-78043
Pick-to: 5.15 6.2 6.1
Change-Id: I14844d91601e9b16dc07cff2ca48713acb7cdd09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-07-09 00:48:44 +02:00
..
dialogs Fix wrong C-style cast, use correct QTest::keyClick overload 2021-04-28 10:15:29 +02:00
effects Fix tst_qgraphicseffect on Wayland 2021-03-11 08:04:21 +01:00
graphicsview Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
itemviews BLACKLIST tst_QListView::internalDragDropMove for OpenSUSE leap 2021-06-21 08:20:27 +03:00
kernel QWidgetAction: add test for defaultWidget() being deleted before action 2021-06-22 11:38:32 +02:00
styles Repolish child widgets when parent style sheet changes 2021-07-05 17:36:04 +02:00
util Fix auto completion in QFileDialog on Windows 2021-07-09 00:48:44 +02:00
widgets Fix placement of placeholder text in QLineEdits with action icons 2021-07-06 23:09:51 +02:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00