summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-27 16:01:16 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-27 16:01:26 (GMT)
commit56c8393c5830045f599a22edbe4fd17c18dc827d (patch)
tree0bda8c988706930beab2c204a1447092a43d7741 /src/gui/widgets
parent71c2cfee4bcd81b2552b66b676895dcd9a6a794b (diff)
parentf93097671f512f38790ba2d56bd5b1e037810266 (diff)
downloadQt-56c8393c5830045f599a22edbe4fd17c18dc827d.zip
Qt-56c8393c5830045f599a22edbe4fd17c18dc827d.tar.gz
Qt-56c8393c5830045f599a22edbe4fd17c18dc827d.tar.bz2
Merge commit 'upstream/4.6' into oslo-staging-2/4.6
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp8
-rw-r--r--src/gui/widgets/qmenu_mac.mm6
2 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 334a925..87975c3 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -1671,6 +1671,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
}
#endif // QT_NO_SHORTCUT
else {
+ bool handled = false;
#ifdef Q_WS_MAC
if (event->key() == Qt::Key_Up || event->key() == Qt::Key_Down) {
Qt::KeyboardModifiers myModifiers = (event->modifiers() & ~Qt::KeypadModifier);
@@ -1688,6 +1689,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
event->key() == Qt::Key_Up ? home(0) : end(0);
}
}
+ handled = true;
}
#endif
if (event->modifiers() & Qt::ControlModifier) {
@@ -1720,7 +1722,8 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
break;
#endif
default:
- unknown = true;
+ if (!handled)
+ unknown = true;
}
} else { // ### check for *no* modifier
switch (event->key()) {
@@ -1753,7 +1756,8 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
#endif
default:
- unknown = true;
+ if (!handled)
+ unknown = true;
}
}
}
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 9510cc6..30bbd31 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -763,7 +763,9 @@ QMacMenuAction::~QMacMenuAction()
{
#ifdef QT_MAC_USE_COCOA
[menu release];
- if (action) {
+ // Update the menu item if this action still owns it. For some items
+ // (like 'Quit') ownership will be transferred between all menu bars...
+ if (action && action.data() == reinterpret_cast<QAction *>([menuItem tag])) {
QAction::MenuRole role = action->menuRole();
// Check if the item is owned by Qt, and should be hidden to keep it from causing
// problems. Do it for everything but the quit menu item since that should always
@@ -774,8 +776,8 @@ QMacMenuAction::~QMacMenuAction()
&& menuItem != [getMenuLoader() quitMenuItem]) {
[menuItem setHidden:YES];
}
+ [menuItem setTag:nil];
}
- [menuItem setTag:nil];
[menuItem release];
#endif
}