diff --git a/src/gui/styles/qwindowsstyle.cpp b/src/gui/styles/qwindowsstyle.cpp index 6034671b6..84ef3afc8 100644 --- a/src/gui/styles/qwindowsstyle.cpp +++ b/src/gui/styles/qwindowsstyle.cpp @@ -71,7 +71,7 @@ enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; \internal */ QWindowsStylePrivate::QWindowsStylePrivate() - : alt_down(false), animationFps(10), animateTimer(0), animateStep(0) + : animationFps(10), animateTimer(0), animateStep(0) { startTime.start(); } @@ -96,13 +96,6 @@ void QWindowsStylePrivate::stopAnimation(QObject *o, QProgressBar *bar) } } -// Returns true if the toplevel parent of \a widget has seen the Alt-key -bool QWindowsStylePrivate::hasSeenAlt(const QWidget *widget) const -{ - widget = widget->window(); - return seenAlt.contains(widget); -} - /*! \reimp */ @@ -147,10 +140,6 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e) } 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(); @@ -160,8 +149,7 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e) if (static_cast(e)->key() == Qt::Key_Alt) { widget = widget->window(); - // Update state and repaint the menu bars. - d->alt_down = false; + // Repaint the menu bars. #ifndef QT_NO_MENUBAR QList l = widget->findChildren(); for (int i = 0; i < l.size(); ++i) @@ -169,11 +157,6 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e) #endif } break; - case QEvent::Close: - // Reset widget when closing - d->seenAlt.removeAll(widget); - d->seenAlt.removeAll(widget->window()); - break; #ifndef QT_NO_PROGRESSBAR case QEvent::StyleChange: case QEvent::Paint: @@ -1019,7 +1002,6 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, break; case PE_FrameFocusRect: if (const QStyleOptionFocusRect *fropt = qstyleoption_cast(opt)) { - //### check for d->alt_down if (!(fropt->state & State_KeyboardFocusChange) && !proxy()->styleHint(SH_UnderlineShortcut, opt)) return; p->save(); diff --git a/src/gui/styles/qwindowsstyle_p.h b/src/gui/styles/qwindowsstyle_p.h index 852e12ffa..037cc72f0 100644 --- a/src/gui/styles/qwindowsstyle_p.h +++ b/src/gui/styles/qwindowsstyle_p.h @@ -65,10 +65,6 @@ public: QWindowsStylePrivate(); void startAnimation(QObject *o, QProgressBar *bar); void stopAnimation(QObject *o, QProgressBar *bar); - bool hasSeenAlt(const QWidget *widget) const; - bool altDown() const { return alt_down; } - bool alt_down; - QList seenAlt; QList animatedProgressBars; int animationFps;