when there are no scrollbars just ignore wheel events

BUG:205879

svn path=/trunk/KDE/kdelibs/; revision=1019292
This commit is contained in:
Marco Martin 2009-09-03 09:58:01 +00:00
parent ce98c29765
commit f25dda51df
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,7 @@
#include <QPainter>
#include <QScrollBar>
#include <QGraphicsSceneWheelEvent>
#include <kmimetype.h>
#include <ktextbrowser.h>
@ -154,6 +155,16 @@ void TextBrowser::resizeEvent(QGraphicsSceneResizeEvent *event)
QGraphicsProxyWidget::resizeEvent(event);
}
void TextBrowser::wheelEvent(QGraphicsSceneWheelEvent *event)
{
if (d->native->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff &&
d->native->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff) {
event->ignore();
} else {
QGraphicsProxyWidget::wheelEvent(event);
}
}
} // namespace Plasma
#include <textbrowser.moc>

View File

@ -99,6 +99,7 @@ Q_SIGNALS:
protected:
void resizeEvent(QGraphicsSceneResizeEvent *event);
void wheelEvent(QGraphicsSceneWheelEvent *event);
private:
TextBrowserPrivate * const d;