make wheel events work, based on a patch by afiestas
CCMAIL:alex@eyeos.org svn path=/trunk/KDE/kdelibs/; revision=890354
This commit is contained in:
parent
4a7699ce82
commit
807b2cf637
@ -19,10 +19,11 @@
|
||||
|
||||
#include "slider.h"
|
||||
|
||||
#include <QSlider>
|
||||
#include <QApplication>
|
||||
#include <QPainter>
|
||||
#include <QSlider>
|
||||
#include <QStyleOptionSlider>
|
||||
|
||||
#include <QGraphicsSceneWheelEvent>
|
||||
#include <kmimetype.h>
|
||||
|
||||
#include "theme.h"
|
||||
@ -125,6 +126,13 @@ void Slider::paint(QPainter *painter,
|
||||
d->handle->paintFrame(painter, handleRect.topLeft());
|
||||
}
|
||||
|
||||
void Slider::wheelEvent(QGraphicsSceneWheelEvent *event)
|
||||
{
|
||||
QWheelEvent e(event->pos().toPoint(), event->delta(),event->buttons(),event->modifiers(),event->orientation());
|
||||
QApplication::sendEvent(widget(), &e);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void Slider::setMaximum(int max)
|
||||
{
|
||||
static_cast<QSlider*>(widget())->setMaximum(max);
|
||||
|
@ -91,6 +91,7 @@ public:
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void wheelEvent(QGraphicsSceneWheelEvent *event);
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user