Sigh, yet another Qt 5 bug.
https://bugreports.qt-project.org/browse/QTBUG-40807
I have implemented a workaround that prevents the incorrect item from being selected, but the search will still be done twice. For that to be fixed, we have to wait for the fix for Qt.