qt5base-lts/tests/auto/gui/kernel
Morten Johan Sørvig 8bccf93300 Make the QPlatformTheme::keyBindings() search deterministic
QPlatformTheme::keyBindings() performs a binary search
into an ordered list of StandardKey -> Key Sequence
mappings where each StandardKey can have multiple
key sequences.

Previously the order of the Key Sequences in the
returned list would be indeterministic and, except
for the designated pri-1 key sequence, would not
necessarily correspond to the list order. (The
ordering was dependent on where the binary search
"hits", which again depends on the size of the list.)

This caused trouble when adding mappings, since it
would change the order in the returned key sequence
list for existing mappings and confusingly cause
(apparently) unrelated test failures.

Fix this by replacing the manually coded binary search
with std::equal_range.

One test case needed to be fixed up because it had the
result in the wrong order (verified by looking at
QPlatformTheme::keyBindings).

Change-Id: I555ca2736b1a8e6454dc79645a8246f80119cfc2
Done-with: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-02-12 19:40:21 +00:00
..
qbackingstore Update copyright headers 2015-02-11 06:49:51 +00:00
qclipboard Update copyright headers 2015-02-11 06:49:51 +00:00
qdrag Update copyright headers 2015-02-11 06:49:51 +00:00
qevent Update copyright headers 2015-02-11 06:49:51 +00:00
qfileopenevent Update copyright headers 2015-02-11 06:49:51 +00:00
qguiapplication Update copyright headers 2015-02-11 06:49:51 +00:00
qguieventdispatcher QtGui tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-27 03:54:42 +01:00
qguieventloop Add auto-test for running the QEventLoop test with the GUI dispatcher 2013-08-12 14:27:57 +02:00
qguimetatype Update copyright headers 2015-02-11 06:49:51 +00:00
qguitimer QtGui tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-27 03:54:42 +01:00
qguivariant Update copyright headers 2015-02-11 06:49:51 +00:00
qinputmethod Update copyright headers 2015-02-11 06:49:51 +00:00
qkeysequence Make the QPlatformTheme::keyBindings() search deterministic 2015-02-12 19:40:21 +00:00
qmouseevent Update copyright headers 2015-02-11 06:49:51 +00:00
qmouseevent_modal Update copyright headers 2015-02-11 06:49:51 +00:00
qopenglwindow Update copyright headers 2015-02-11 06:49:51 +00:00
qpalette Update copyright headers 2015-02-11 06:49:51 +00:00
qpixelformat Update copyright headers 2015-02-11 06:49:51 +00:00
qrasterwindow Update copyright headers 2015-02-11 06:49:51 +00:00
qscreen Update copyright headers 2015-02-11 06:49:51 +00:00
qsurfaceformat Update copyright headers 2015-02-11 06:49:51 +00:00
qtouchevent Update copyright headers 2015-02-11 06:49:51 +00:00
qwindow Update copyright headers 2015-02-11 06:49:51 +00:00
kernel.pro Introduce QRasterWindow 2014-08-05 16:47:42 +02:00