Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.5.3
-
None
-
Windows Vista and Windows XP
Description
When you press Alt key the shortcuts are displayed but after that are never hided.
I investigated my self, and it seems to be a problem in the QWindowsStyle::eventFilter method - the QWindowsStylePrivate seenAlt member is never cleared and is continuously growing on each Alt key press. I think it should be cleared on Alt key release.
bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
{
// Records Alt- and Focus events
if (!o->isWidgetType())
return QObject::eventFilter(o, e);
QWidget widget = qobject_cast<QWidget>(o);
Q_D(QWindowsStyle);
switch(e->type()) {
case QEvent::KeyPress:
if (static_cast<QKeyEvent *>(e)->key() == Qt::Key_Alt) {
widget = widget->window();
// Alt has been pressed - find all widgets that care
QList<QWidget *> l = qFindChildren<QWidget *>(widget);
for (int pos=0 ; pos < l.size() ; ++pos)
// Update states before repainting
d->seenAlt.append(widget);
d->alt_down = true;
// Repaint all relevant widgets
for (int pos = 0; pos < l.size(); ++pos)
l.at(pos)->update();
}
break;
case QEvent::KeyRelease:
if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Alt)
break;