remove unused QWindowsStylePrivate members and methods

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2020-08-07 17:29:26 +03:00
parent 04790541b2
commit 56bba7ea76
2 changed files with 2 additions and 24 deletions

View file

@ -71,7 +71,7 @@ enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight };
\internal \internal
*/ */
QWindowsStylePrivate::QWindowsStylePrivate() QWindowsStylePrivate::QWindowsStylePrivate()
: alt_down(false), animationFps(10), animateTimer(0), animateStep(0) : animationFps(10), animateTimer(0), animateStep(0)
{ {
startTime.start(); 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 \reimp
*/ */
@ -147,10 +140,6 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
} }
pos++; pos++;
} }
// Update states before repainting
d->seenAlt.append(widget);
d->alt_down = true;
// Repaint all relevant widgets // Repaint all relevant widgets
for (int pos = 0; pos < l.size(); ++pos) for (int pos = 0; pos < l.size(); ++pos)
l.at(pos)->update(); l.at(pos)->update();
@ -160,8 +149,7 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Alt) { if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Alt) {
widget = widget->window(); widget = widget->window();
// Update state and repaint the menu bars. // Repaint the menu bars.
d->alt_down = false;
#ifndef QT_NO_MENUBAR #ifndef QT_NO_MENUBAR
QList<QMenuBar *> l = widget->findChildren<QMenuBar *>(); QList<QMenuBar *> l = widget->findChildren<QMenuBar *>();
for (int i = 0; i < l.size(); ++i) for (int i = 0; i < l.size(); ++i)
@ -169,11 +157,6 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
#endif #endif
} }
break; break;
case QEvent::Close:
// Reset widget when closing
d->seenAlt.removeAll(widget);
d->seenAlt.removeAll(widget->window());
break;
#ifndef QT_NO_PROGRESSBAR #ifndef QT_NO_PROGRESSBAR
case QEvent::StyleChange: case QEvent::StyleChange:
case QEvent::Paint: case QEvent::Paint:
@ -1019,7 +1002,6 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
break; break;
case PE_FrameFocusRect: case PE_FrameFocusRect:
if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) { if (const QStyleOptionFocusRect *fropt = qstyleoption_cast<const QStyleOptionFocusRect *>(opt)) {
//### check for d->alt_down
if (!(fropt->state & State_KeyboardFocusChange) && !proxy()->styleHint(SH_UnderlineShortcut, opt)) if (!(fropt->state & State_KeyboardFocusChange) && !proxy()->styleHint(SH_UnderlineShortcut, opt))
return; return;
p->save(); p->save();

View file

@ -65,10 +65,6 @@ public:
QWindowsStylePrivate(); QWindowsStylePrivate();
void startAnimation(QObject *o, QProgressBar *bar); void startAnimation(QObject *o, QProgressBar *bar);
void stopAnimation(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<const QWidget *> seenAlt;
QList<QProgressBar *> animatedProgressBars; QList<QProgressBar *> animatedProgressBars;
int animationFps; int animationFps;