[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Jan 17 08:15:29 CET 2005
CVS commit by staikos:
add double-click handler
M +6 -0 kstviewobject.cpp 1.115
M +1 -0 kstviewobject.h 1.89
M +22 -0 kstviewwidget.cpp 1.66
M +1 -0 kstviewwidget.h 1.22
--- kdeextragear-2/kst/kst/kstviewobject.cpp #1.114:1.115
@@ -1146,4 +1146,10 @@ void KstViewObject::mousePressEvent(QWid
+void KstViewObject::mouseDoubleClickEvent(QWidget *view, QMouseEvent *e) {
+ Q_UNUSED(view)
+ Q_UNUSED(e)
+}
+
+
void KstViewObject::mouseReleaseEvent(QWidget *view, QMouseEvent *e) {
Q_UNUSED(view)
--- kdeextragear-2/kst/kst/kstviewobject.h #1.88:1.89
@@ -167,4 +167,5 @@ class KstViewObject : public KstObject {
virtual void mouseMoveEvent(QWidget *view, QMouseEvent *e);
virtual void mousePressEvent(QWidget *view, QMouseEvent *e);
+ virtual void mouseDoubleClickEvent(QWidget *view, QMouseEvent *e);
virtual void mouseReleaseEvent(QWidget *view, QMouseEvent *e);
virtual void keyPressEvent(QWidget *view, QKeyEvent *e);
--- kdeextragear-2/kst/kst/kstviewwidget.cpp #1.65:1.66
@@ -190,4 +190,26 @@ void KstViewWidget::mousePressEvent(QMou
+void KstViewWidget::mouseDoubleClickEvent(QMouseEvent *e) {
+ //kdDebug() << "DoubleClick event. button=" << e->button() << " state=" << e->state() << endl;
+
+ if (_view->viewMode() == KstTopLevelView::DisplayMode) {
+ KstViewObjectPtr vo;
+ if (_view->mouseGrabbed()) {
+ vo = _view->mouseGrabber();
+ } else {
+ vo = findChildFor(e->pos());
+ }
+ if (vo) {
+ //kdDebug() << "Found mouse handler " << vo->tagName() << endl;
+ vo->mouseDoubleClickEvent(this, e);
+ }
+ return;
+ }
+
+ //kdDebug() << " -> Passing up" << endl;
+ QWidget::mouseDoubleClickEvent(e);
+}
+
+
void KstViewWidget::wheelEvent(QWheelEvent *e) {
if (_view->viewMode() == KstTopLevelView::DisplayMode) {
--- kdeextragear-2/kst/kst/kstviewwidget.h #1.21:1.22
@@ -48,4 +48,5 @@ class KstViewWidget : public QWidget {
virtual void mouseMoveEvent(QMouseEvent *e);
virtual void mousePressEvent(QMouseEvent *e);
+ virtual void mouseDoubleClickEvent(QMouseEvent *e);
virtual void mouseReleaseEvent(QMouseEvent *e);
virtual void contextMenuEvent(QContextMenuEvent *e);
More information about the Kst
mailing list