summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/codeassist
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2012-09-07 13:31:29 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2012-09-13 10:14:53 +0200
commit405217c111d22ea2b2913fd08b4f870e4e43aa38 (patch)
tree0e4a5e760c7732396d7ed2c341ec3abeaae5558f /src/plugins/texteditor/codeassist
parent09674e47078a40a6f0cef8e707f380c46b211124 (diff)
downloadqt-creator-405217c111d22ea2b2913fd08b4f870e4e43aa38.tar.gz
Utils::HostOsInfo: Introduce controlModifier() method.
Change-Id: Ibd244963c5cd643fc0e8358ceabff0ad5f6599eb Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/texteditor/codeassist')
-rw-r--r--src/plugins/texteditor/codeassist/genericproposalwidget.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
index d7d6af7e1a..fce4f33299 100644
--- a/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
+++ b/src/plugins/texteditor/codeassist/genericproposalwidget.cpp
@@ -516,8 +516,6 @@ void GenericProposalWidget::updatePositionAndSize()
bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
{
- const Qt::KeyboardModifiers modifier = HostOsInfo::isMacHost()
- ? Qt::MetaModifier : Qt::ControlModifier;
if (e->type() == QEvent::FocusOut) {
abort();
#if (QT_VERSION < 0x050000) && defined(Q_OS_DARWIN) && ! defined(QT_MAC_USE_COCOA)
@@ -538,7 +536,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
switch (ke->key()) {
case Qt::Key_N:
case Qt::Key_P:
- if (ke->modifiers() == modifier) {
+ if (ke->modifiers() == Qt::KeyboardModifiers(HostOsInfo::controlModifier())) {
e->accept();
return true;
}
@@ -554,7 +552,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
case Qt::Key_P:
// select next/previous completion
d->m_explicitlySelected = true;
- if (ke->modifiers() == modifier) {
+ if (ke->modifiers() == Qt::KeyboardModifiers(HostOsInfo::controlModifier())) {
int change = (ke->key() == Qt::Key_N) ? 1 : -1;
int nrows = d->m_model->size();
int row = d->m_completionListView->currentIndex().row();