summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-20 16:22:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-23 21:20:47 +0200
commitcc778e1d2108806ef5d14b87eddd3ce8999c27ee (patch)
tree3dc7c17b8f6916ce9aa931b7c07b6e83665db0e0 /src/gui/kernel
parent505579ebe4acc7d3719683e257b0397bc6421925 (diff)
Remove some qBinaryFind usages from QtGui
This is done per the mailing list discussion at http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I9cbb1790f94e7726e127b9ad1bd5a58c433055a8 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qkeysequence.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 9464d97932..16324b3659 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -60,6 +60,8 @@
#include <Carbon/Carbon.h>
#endif
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
#if defined(Q_OS_MACX)
@@ -107,8 +109,8 @@ static const MacSpecialKey * const MacSpecialKeyEntriesEnd = entries + NumEntrie
QChar qt_macSymbolForQtKey(int key)
{
- const MacSpecialKey *i = qBinaryFind(entries, MacSpecialKeyEntriesEnd, key);
- if (i == MacSpecialKeyEntriesEnd)
+ const MacSpecialKey *i = std::lower_bound(entries, MacSpecialKeyEntriesEnd, key);
+ if ((i == MacSpecialKeyEntriesEnd) || (key < *i))
return QChar();
ushort macSymbol = i->macSymbol;
if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)