port from qgraphics events
This commit is contained in:
parent
50cf107730
commit
7d7698360c
@ -117,7 +117,7 @@ class PLASMA_EXPORT ContainmentActions : public QObject
|
|||||||
* Implement this to respond to events.
|
* Implement this to respond to events.
|
||||||
* The user can configure whatever button and modifier they like, so please don't look at
|
* The user can configure whatever button and modifier they like, so please don't look at
|
||||||
* those parameters.
|
* those parameters.
|
||||||
* The event may be a QGraphicsSceneMouseEvent or a QGraphicsSceneWheelEvent.
|
* The event may be a QMouseEvent or a QWheelEvent.
|
||||||
*/
|
*/
|
||||||
virtual void contextEvent(QEvent *event);
|
virtual void contextEvent(QEvent *event);
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QGraphicsSceneWheelEvent>
|
#include <QWheelEvent>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <kdebug.h>
|
#include <kdebug.h>
|
||||||
@ -76,18 +76,15 @@ void ContainmentActionsPluginsConfig::addPlugin(QEvent *trigger, const QString &
|
|||||||
|
|
||||||
void ContainmentActionsPluginsConfig::addPlugin(Qt::KeyboardModifiers modifiers, Qt::MouseButton button, const QString &name)
|
void ContainmentActionsPluginsConfig::addPlugin(Qt::KeyboardModifiers modifiers, Qt::MouseButton button, const QString &name)
|
||||||
{
|
{
|
||||||
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
|
QMouseEvent event(QEvent::MouseButtonPress, QPoint(), button, button, modifiers);
|
||||||
event.setButton(button);
|
|
||||||
event.setModifiers(modifiers);
|
|
||||||
QString s = ContainmentActions::eventToString(&event);
|
QString s = ContainmentActions::eventToString(&event);
|
||||||
d->plugins.insert(s, name);
|
d->plugins.insert(s, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainmentActionsPluginsConfig::addPlugin(Qt::KeyboardModifiers modifiers, Qt::Orientation wheelDirection, const QString &name)
|
void ContainmentActionsPluginsConfig::addPlugin(Qt::KeyboardModifiers modifiers, Qt::Orientation wheelDirection, const QString &name)
|
||||||
{
|
{
|
||||||
QGraphicsSceneWheelEvent event(QEvent::GraphicsSceneWheel);
|
//most of those parameters are just fillers
|
||||||
event.setOrientation(wheelDirection);
|
QWheelEvent event(QPoint(0,0), 0, Qt::NoButton, modifiers, wheelDirection);
|
||||||
event.setModifiers(modifiers);
|
|
||||||
QString s = ContainmentActions::eventToString(&event);
|
QString s = ContainmentActions::eventToString(&event);
|
||||||
d->plugins.insert(s, name);
|
d->plugins.insert(s, name);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user