those conditions were actually on the other way around
should be backported? CCMAIL:aseigo@kde.org svn path=/trunk/KDE/kdebase/runtime/; revision=1178397
This commit is contained in:
parent
872cc21959
commit
107a3d5758
@ -377,7 +377,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::KeyPress: {
|
case QEvent::KeyPress: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("keypress")) {
|
if (env && env->hasEventListeners("keypress")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createKeyEventObject(static_cast<QKeyEvent *>(event));
|
args << createKeyEventObject(static_cast<QKeyEvent *>(event));
|
||||||
env->callEventListeners("keypress", args);
|
env->callEventListeners("keypress", args);
|
||||||
@ -387,7 +387,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::KeyRelease: {
|
case QEvent::KeyRelease: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("keyrelease")) {
|
if (env && env->hasEventListeners("keyrelease")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createKeyEventObject(static_cast<QKeyEvent *>(event));
|
args << createKeyEventObject(static_cast<QKeyEvent *>(event));
|
||||||
env->callEventListeners("keyrelease", args);
|
env->callEventListeners("keyrelease", args);
|
||||||
@ -398,7 +398,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneHoverEnter: {
|
case QEvent::GraphicsSceneHoverEnter: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("hoverenter")) {
|
if (env && env->hasEventListeners("hoverenter")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createHoverEventObject(static_cast<QGraphicsSceneHoverEvent *>(event));
|
args << createHoverEventObject(static_cast<QGraphicsSceneHoverEvent *>(event));
|
||||||
env->callEventListeners("hoverenter", args);
|
env->callEventListeners("hoverenter", args);
|
||||||
@ -409,7 +409,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneHoverLeave: {
|
case QEvent::GraphicsSceneHoverLeave: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("hoverleave")) {
|
if (env && env->hasEventListeners("hoverleave")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createHoverEventObject(static_cast<QGraphicsSceneHoverEvent *>(event));
|
args << createHoverEventObject(static_cast<QGraphicsSceneHoverEvent *>(event));
|
||||||
env->callEventListeners("hoverleave", args);
|
env->callEventListeners("hoverleave", args);
|
||||||
@ -420,7 +420,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneHoverMove: {
|
case QEvent::GraphicsSceneHoverMove: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("hovermove")) {
|
if (env && env->hasEventListeners("hovermove")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createHoverEventObject(static_cast<QGraphicsSceneHoverEvent *>(event));
|
args << createHoverEventObject(static_cast<QGraphicsSceneHoverEvent *>(event));
|
||||||
env->callEventListeners("hovermove", args);
|
env->callEventListeners("hovermove", args);
|
||||||
@ -431,7 +431,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneMousePress: {
|
case QEvent::GraphicsSceneMousePress: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("mousepress")) {
|
if (env && env->hasEventListeners("mousepress")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||||
env->callEventListeners("mousepress", args);
|
env->callEventListeners("mousepress", args);
|
||||||
@ -442,7 +442,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneMouseRelease: {
|
case QEvent::GraphicsSceneMouseRelease: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("mouserelease")) {
|
if (env && env->hasEventListeners("mouserelease")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||||
env->callEventListeners("mouserelease", args);
|
env->callEventListeners("mouserelease", args);
|
||||||
@ -453,7 +453,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneMouseMove: {
|
case QEvent::GraphicsSceneMouseMove: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("mousemove")) {
|
if (env && env->hasEventListeners("mousemove")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||||
env->callEventListeners("mousemove", args);
|
env->callEventListeners("mousemove", args);
|
||||||
@ -464,7 +464,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneMouseDoubleClick: {
|
case QEvent::GraphicsSceneMouseDoubleClick: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("mousedoubleclick")) {
|
if (env && env->hasEventListeners("mousedoubleclick")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
args << createMouseEventObject(static_cast<QGraphicsSceneMouseEvent *>(event));
|
||||||
env->callEventListeners("mousedoubleclick", args);
|
env->callEventListeners("mousedoubleclick", args);
|
||||||
@ -475,7 +475,7 @@ bool SimpleJavaScriptApplet::eventFilter(QObject *watched, QEvent *event)
|
|||||||
|
|
||||||
case QEvent::GraphicsSceneWheel: {
|
case QEvent::GraphicsSceneWheel: {
|
||||||
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
ScriptEnv *env = ScriptEnv::findScriptEnv(m_engine);
|
||||||
if (env && !env->hasEventListeners("wheel")) {
|
if (env && env->hasEventListeners("wheel")) {
|
||||||
QScriptValueList args;
|
QScriptValueList args;
|
||||||
args << createWheelEventObject(static_cast<QGraphicsSceneWheelEvent *>(event));
|
args << createWheelEventObject(static_cast<QGraphicsSceneWheelEvent *>(event));
|
||||||
env->callEventListeners("wheel", args);
|
env->callEventListeners("wheel", args);
|
||||||
|
Loading…
Reference in New Issue
Block a user