diff options
| author | 2010-07-29 14:49:26 +0000 | |
|---|---|---|
| committer | 2010-07-29 14:49:26 +0000 | |
| commit | 85d0ce2142b5860ce5375d2b6228e70c04d3a32c (patch) | |
| tree | a12222428d2e18859d15378e34d1a7a71a547e21 /src/modules/objects/class_widget.cpp | |
| parent | Removed unused code in kvs socket class (diff) | |
| download | KVIrc-85d0ce2142b5860ce5375d2b6228e70c04d3a32c.tar.gz KVIrc-85d0ce2142b5860ce5375d2b6228e70c04d3a32c.tar.bz2 KVIrc-85d0ce2142b5860ce5375d2b6228e70c04d3a32c.zip | |
More fixes in kvs classes memory leaks
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4709 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_widget.cpp')
| -rw-r--r-- | src/modules/objects/class_widget.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp index 48ea3edd4..11f55dd36 100644 --- a/src/modules/objects/class_widget.cpp +++ b/src/modules/objects/class_widget.cpp @@ -895,34 +895,50 @@ bool KviKvsObject_widget::eventFilter(QObject *o,QEvent *e) } break; case QEvent::MouseButtonPress: - if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; + { + if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; else { if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1; else aparam = 2; } - if(!callFunction(this,"mousePressEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y()) - ))) brokenhandler = true; // ignore results of a broken event handler - break; + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant((kvs_int_t)aparam)); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); + if (!callFunction(this,"mousePressEvent",0,&lParams)) brokenhandler = true; // ignore results of a broken event handler + } + break; case QEvent::MouseButtonRelease: + { if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; else { if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1; else aparam = 2; } - if(!callFunction(this,"mouseReleaseEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y()) - ))) brokenhandler = true; // ignore results of a broken event handler + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant((kvs_int_t)aparam)); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); + if (!callFunction(this,"mouseReleaseEvent",0,&lParams)) brokenhandler = true; // ignore results of a broken event handler + } break; case QEvent::MouseButtonDblClick: + { if(( (QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; else { if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1; else aparam = 2; } - if(!callFunction(this,"mouseDoubleClickEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y()) - ))) brokenhandler = true; // ignore results of a broken event handler + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant((kvs_int_t)aparam)); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); + if (!callFunction(this,"mouseDoubleClickEvent",0,&lParams)) brokenhandler = true; // ignore results of a broken event handler + } break; - case QEvent::MouseMove: + case QEvent::MouseMove: + { if( (((QMouseEvent *)e)->button()) & Qt::LeftButton) aparam = 0; else { @@ -933,8 +949,12 @@ bool KviKvsObject_widget::eventFilter(QObject *o,QEvent *e) else aparam = -1; } } - if(!callFunction(this,"mouseMoveEvent",retv,new KviKvsVariantList(new KviKvsVariant((kvs_int_t)aparam),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x()),new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y()) - ))) brokenhandler = true; // ignore results of a broken event handler + KviKvsVariantList lParams; + lParams.append(new KviKvsVariant((kvs_int_t)aparam)); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); + lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); + if (!callFunction(this,"mouseMoveEvent",0,&lParams)) brokenhandler = true; // ignore results of a broken event handler + } break; case QEvent::FocusIn: if(!callFunction(this,"focusInEvent",retv,0))brokenhandler = true; |
