Exemple #1
0
bool SceneItem::event(QEvent* event) {
    switch (event->type()) {
    case QEvent::KeyPress:
        keyPressEvent(static_cast<QKeyEvent*>(event));
        break;
    case QEvent::KeyRelease:
        keyReleaseEvent(static_cast<QKeyEvent*>(event));
        break;
    case SceneMouseEvent::DOUBLE_CLICK_TYPE:
        mouseDoubleClickEvent(static_cast<SceneMouseEvent*>(event));
        break;
    case SceneMouseEvent::MOVE_TYPE:
        mouseMoveEvent(static_cast<SceneMouseEvent*>(event));
        break;
    case SceneMouseEvent::PRESS_TYPE:
        mousePressEvent(static_cast<SceneMouseEvent*>(event));
        break;
    case SceneMouseEvent::RELEASE_TYPE:
        mouseReleaseEvent(static_cast<SceneMouseEvent*>(event));
        break;
    case QEvent::Wheel:
        wheelEvent(static_cast<QWheelEvent*>(event));
        break;
    default:
        return false;
    }
    return true;
}
Exemple #2
0
bool NextClient::eventFilter(TQObject *o, TQEvent *e)
{
    if (TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(widget()))
	return false;
    switch (e->type()) {
    case TQEvent::Resize:
	resizeEvent(TQT_TQRESIZEEVENT( e ));
	return true;
    case TQEvent::Paint:
	paintEvent(TQT_TQPAINTEVENT( e ));
	return true;
    case TQEvent::MouseButtonDblClick:
	mouseDoubleClickEvent(TQT_TQMOUSEEVENT( e ));
	return true;
    case TQEvent::Wheel:
	wheelEvent( TQT_TQWHEELEVENT( e ));
	return true;
    case TQEvent::MouseButtonPress:
	processMousePressEvent(TQT_TQMOUSEEVENT( e ));
	return true;
    case TQEvent::Show:
	showEvent(TQT_TQSHOWEVENT( e ));
	return true;
    default:
	break;
    }
    return false;
}
Exemple #3
0
bool KWMThemeClient::eventFilter( QObject* o, QEvent* e )
{
	if ( o != widget() )
		return false;

	switch ( e->type() )
	{
		case QEvent::Resize:
			resizeEvent( static_cast< QResizeEvent* >( e ) );
			return true;

		case QEvent::Paint:
			paintEvent( static_cast< QPaintEvent* >( e ) );
			return true;

		case QEvent::MouseButtonDblClick:
			mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) );
			return true;

		case QEvent::MouseButtonPress:
			processMousePressEvent( static_cast< QMouseEvent* >( e ) );
			return true;

		case QEvent::Show:
			showEvent( static_cast< QShowEvent* >( e ) );
			return true;

		default:
	    		return false;
	}
}
Exemple #4
0
void Tool::toolEvent(QEvent *event)
{
	switch((int)event->type())
	{
		case QEvent::KeyPress:
			keyPressEvent(static_cast<QKeyEvent *>(event));
			return;
		case QEvent::KeyRelease:
			keyReleaseEvent(static_cast<QKeyEvent *>(event));
			return;
		case EventCanvasMouseMove:
			mouseMoveEvent(static_cast<CanvasMouseEvent *>(event));
			return;
		case EventCanvasMousePress:
			mousePressEvent(static_cast<CanvasMouseEvent *>(event));
			return;
		case EventCanvasMouseRelease:
			mouseReleaseEvent(static_cast<CanvasMouseEvent *>(event));
			return;
		case EventCanvasMouseDoubleClick:
			mouseDoubleClickEvent(static_cast<CanvasMouseEvent *>(event));
			return;
		case EventCanvasTabletMove:
			tabletMoveEvent(static_cast<CanvasTabletEvent *>(event));
			return;
		case EventCanvasTabletPress:
			tabletPressEvent(static_cast<CanvasTabletEvent *>(event));
			return;
		case EventCanvasTabletRelease:
			tabletReleaseEvent(static_cast<CanvasTabletEvent *>(event));
			return;
		default:
			return;
	}
}
Exemple #5
0
bool KCommonDecoration::eventFilter( QObject* o, QEvent* e )
{
    if( o != widget())
        return false;
    switch( e->type())
    {
        case QEvent::Resize:
            resizeEvent(static_cast<QResizeEvent*>(e) );
            return true;
        case QEvent::Paint:
            paintEvent( static_cast< QPaintEvent* >( e ));
            return true;
        case QEvent::MouseButtonDblClick:
            mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ));
            return true;
        case QEvent::MouseButtonPress:
            processMousePressEvent( static_cast< QMouseEvent* >( e ));
            return true;
        case QEvent::Wheel:
            wheelEvent( static_cast< QWheelEvent* >( e ));
            return true;
        default:
            return false;
    }
}
Exemple #6
0
void EventListener::onEvent(Event* e) {
    /*
        since we already checked which type we have we can safely use
        the faster static_cast (rl)
    */
    if (typeid(*e) == typeid(MouseEvent)) {
        MouseEvent* me = static_cast<MouseEvent*>(e);
        if (me->action() == MouseEvent::PRESSED)
            mousePressEvent(me);
        else if (me->action() == MouseEvent::RELEASED)
            mouseReleaseEvent(me);
        else if (me->action() == MouseEvent::MOTION)
            mouseMoveEvent(me);
        else if (me->action() == MouseEvent::DOUBLECLICK)
            mouseDoubleClickEvent(me);
        else if (me->action() == MouseEvent::WHEEL)
            wheelEvent(me);
    }
    else if (typeid(*e) == typeid(KeyEvent)) {
        keyEvent(static_cast<KeyEvent*>(e));
    }
    else if (typeid(*e) == typeid(TimeEvent)) {
        timerEvent(static_cast<TimeEvent*>(e));
    }
    else if (typeid(*e) == typeid(TouchEvent)) {
        touchEvent(static_cast<TouchEvent*>(e));
    }
}
Exemple #7
0
bool QWSManager::event(QEvent *e)
{
    if (QObject::event(e))
        return true;

    switch (e->type()) {
    case QEvent::MouseMove:
        mouseMoveEvent((QMouseEvent*)e);
        break;

    case QEvent::MouseButtonPress:
        mousePressEvent((QMouseEvent*)e);
        break;

    case QEvent::MouseButtonRelease:
        mouseReleaseEvent((QMouseEvent*)e);
        break;

    case QEvent::MouseButtonDblClick:
        mouseDoubleClickEvent((QMouseEvent*)e);
        break;

    case QEvent::Paint:
        paintEvent((QPaintEvent*)e);
        break;

    default:
        return false;
        break;
    }

    return true;
}
void QAbstractPageSetupDialog_QtDShell::__override_mouseDoubleClickEvent(QMouseEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QWidget::mouseDoubleClickEvent((QMouseEvent* )arg__1);
    } else {
        mouseDoubleClickEvent((QMouseEvent* )arg__1);
    }
}
Exemple #9
0
void QDateEdit_QtDShell::__override_mouseDoubleClickEvent(QMouseEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QWidget::mouseDoubleClickEvent((QMouseEvent* )arg__1);
    } else {
        mouseDoubleClickEvent((QMouseEvent* )arg__1);
    }
}
void QGraphicsEllipseItem_QtDShell::__override_mouseDoubleClickEvent(QGraphicsSceneMouseEvent*  event0, bool static_call)
{
    if (static_call) {
        QGraphicsItem::mouseDoubleClickEvent((QGraphicsSceneMouseEvent* )event0);
    } else {
        mouseDoubleClickEvent((QGraphicsSceneMouseEvent* )event0);
    }
}
Exemple #11
0
bool KisToolProxy::forwardEvent(ActionState state, KisTool::ToolAction action, QEvent *event, QEvent *originalEvent, QTabletEvent *lastTabletEvent, const QPoint &canvasOriginWorkaround)
{
    bool retval = true;

    QTabletEvent *tabletEvent = dynamic_cast<QTabletEvent*>(event);
    QTouchEvent *touchEvent = dynamic_cast<QTouchEvent*>(event);
    QMouseEvent *mouseEvent = dynamic_cast<QMouseEvent*>(event);

    if (tabletEvent) {
        QPointF docPoint = tabletToDocument(tabletEvent->hiResGlobalPos(), canvasOriginWorkaround);
        tabletEvent->accept();
        this->tabletEvent(tabletEvent, docPoint);
        forwardToTool(state, action, tabletEvent, docPoint);
        retval = tabletEvent->isAccepted();
    } else if (touchEvent) {
        if (state == END && touchEvent->type() != QEvent::TouchEnd) {
            //Fake a touch end if we are "upgrading" a single-touch gesture to a multi-touch gesture.
            QTouchEvent fakeEvent(QEvent::TouchEnd, touchEvent->deviceType(), touchEvent->modifiers(), touchEvent->touchPointStates(), touchEvent->touchPoints());
            this->touchEvent(&fakeEvent);
        } else {
            this->touchEvent(touchEvent);
        }
    } else if (mouseEvent) {
        if (lastTabletEvent) {
            QPointF docPoint = tabletToDocument(lastTabletEvent->hiResGlobalPos(), canvasOriginWorkaround);
            lastTabletEvent->accept();
            this->tabletEvent(lastTabletEvent, docPoint);
            forwardToTool(state, action, lastTabletEvent, docPoint);
            retval = lastTabletEvent->isAccepted();
        } else {
            QPointF docPoint = widgetToDocument(mouseEvent->posF());
            mouseEvent->accept();
            if (mouseEvent->type() == QEvent::MouseButtonPress) {
                mousePressEvent(mouseEvent, docPoint);
            } else if (mouseEvent->type() == QEvent::MouseButtonDblClick) {
                mouseDoubleClickEvent(mouseEvent, docPoint);
            } else if (mouseEvent->type() == QEvent::MouseButtonRelease) {
                mouseReleaseEvent(mouseEvent, docPoint);
            } else if (mouseEvent->type() == QEvent::MouseMove) {
                mouseMoveEvent(mouseEvent, docPoint);
            }
            forwardToTool(state, action, originalEvent, docPoint);
            retval = mouseEvent->isAccepted();
        }
    } else if(event->type() == QEvent::KeyPress) {
        QKeyEvent* kevent = static_cast<QKeyEvent*>(event);
        keyPressEvent(kevent);
    } else if(event->type() == QEvent::KeyRelease) {
        QKeyEvent* kevent = static_cast<QKeyEvent*>(event);
        keyReleaseEvent(kevent);
    }

    return retval;
}
Exemple #12
0
void TimelineVis::mouseReleaseEvent(QMouseEvent * event)
{
    mousePressed = false;
    // Treat single click as double for now
    if (event->x() == pressx && event->y() == pressy)
        mouseDoubleClickEvent(event);
    else if (rightPressed)
    {
        rightPressed = false;
        rightDrag(event);
    }
}
bool QMapWidget::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: paintEvent((QPaintEvent*)static_QUType_ptr.get(_o+1)); break;
    case 1: resizeEvent((QResizeEvent*)static_QUType_ptr.get(_o+1)); break;
    case 2: keyPressEvent((QKeyEvent*)static_QUType_ptr.get(_o+1)); break;
    case 3: mousePressEvent((QMouseEvent*)static_QUType_ptr.get(_o+1)); break;
    case 4: mouseMoveEvent((QMouseEvent*)static_QUType_ptr.get(_o+1)); break;
    case 5: mouseReleaseEvent((QMouseEvent*)static_QUType_ptr.get(_o+1)); break;
    case 6: mouseDoubleClickEvent((QMouseEvent*)static_QUType_ptr.get(_o+1)); break;
    default:
	return QWidget::qt_invoke( _id, _o );
    }
    return TRUE;
}
Exemple #14
0
int ZoneDeDessin::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setColor((*reinterpret_cast< QColor(*)>(_a[1]))); break;
        case 1: mousePressEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 2: mouseReleaseEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 3: mouseMoveEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 4: mouseDoubleClickEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
int fl_gui::GuiGrapher::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: onChangeInputValue(); break;
        case 1: updateUi(); break;
        case 2: onChangeSliderValue((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 3: onEditInputValue(); break;
        case 4: mouseDoubleClickEvent((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
Exemple #16
0
void EvaSystemTray::mousePressEvent(TQMouseEvent *me)
{
	if(me->button() == MidButton){
		mouseDoubleClickEvent(me);
		me->accept();
		return;
	}
	
	if(me->button() == RightButton && sysMenu){
		sysMenu->popup(me->globalPos());
		if(clickTimer->isActive()) clickTimer->stop();
		me->accept();
		return;
	}
		
	if(me->button() == LeftButton && !clickTimer->isActive())
		clickTimer->start(TQApplication::doubleClickInterval(), false);
	
	me->accept();
}
Exemple #17
0
/**
  \reimp
*/
bool TrayIcon::event( QEvent *e )
{
    switch ( e->type() ) {
    case QEvent::MouseMove:
	mouseMoveEvent( (QMouseEvent*)e );
	break;

    case QEvent::MouseButtonPress:
	mousePressEvent( (QMouseEvent*)e );
	break;

    case QEvent::MouseButtonRelease:
	mouseReleaseEvent( (QMouseEvent*)e );
	break;

    case QEvent::MouseButtonDblClick:
	mouseDoubleClickEvent( (QMouseEvent*)e );
	break;
    default:
	return QObject::event( e );
    }

    return TRUE;
}
Exemple #18
0
// Handle events on behalf of the text area.
bool QsciScintillaBase::eventFilter(QObject *o, QEvent *e)
{
    if (o != txtarea)
        return QWidget::eventFilter(o, e);

    bool used = true;

    switch (e->type())
    {
    case QEvent::ContextMenu:
        contextMenuEvent(static_cast<QContextMenuEvent *>(e));
        break;

    case QEvent::DragEnter:
        dragEnterEvent(static_cast<QDragEnterEvent *>(e));
        break;

    case QEvent::DragLeave:
        dragLeaveEvent(static_cast<QDragLeaveEvent *>(e));
        break;

    case QEvent::DragMove:
        dragMoveEvent(static_cast<QDragMoveEvent *>(e));
        break;

    case QEvent::Drop:
        dropEvent(static_cast<QDropEvent *>(e));
        break;

    case QEvent::MouseButtonDblClick:
        mouseDoubleClickEvent(static_cast<QMouseEvent *>(e));
        break;

    case QEvent::MouseButtonPress:
        mousePressEvent(static_cast<QMouseEvent *>(e));
        break;

    case QEvent::MouseButtonRelease:
        mouseReleaseEvent(static_cast<QMouseEvent *>(e));
        break;

    case QEvent::MouseMove:
        mouseMoveEvent(static_cast<QMouseEvent *>(e));
        break;

    case QEvent::Paint:
        paintEvent(static_cast<QPaintEvent *>(e));
        break;

    case QEvent::Resize:
        resizeEvent(static_cast<QResizeEvent *>(e));
        break;

    case QEvent::Wheel:
        {
            QWheelEvent *we = static_cast<QWheelEvent *>(e);

            setFocus();

            if (we->orientation() == Horizontal || we->state() & ShiftButton)
                QApplication::sendEvent(hsb, we);
            else if (we->orientation() == Vertical)
                QApplication::sendEvent(vsb, we);

            break;
        }

    default:
        used = false;
    }

    return used;
}
Exemple #19
0
void DhQGLWidget::DvhmouseDoubleClickEvent(QMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
bool QDeclarativeViewInspector::eventFilter(QObject *obj, QEvent *event)
{
    if (obj == data->view) {
        // Event from view
        if (event->type() == QEvent::ChildRemoved) {
            // Might mean that viewport has changed
            if (data->view->viewport() != data->viewport.data())
                data->setViewport(data->view->viewport());
        }
        return QObject::eventFilter(obj, event);
    }

    // Event from viewport
    switch (event->type()) {
    case QEvent::Leave: {
        if (leaveEvent(event))
            return true;
        break;
    }
    case QEvent::MouseButtonPress: {
        if (mousePressEvent(static_cast<QMouseEvent*>(event)))
            return true;
        break;
    }
    case QEvent::MouseMove: {
        if (mouseMoveEvent(static_cast<QMouseEvent*>(event)))
            return true;
        break;
    }
    case QEvent::MouseButtonRelease: {
        if (mouseReleaseEvent(static_cast<QMouseEvent*>(event)))
            return true;
        break;
    }
    case QEvent::KeyPress: {
        if (keyPressEvent(static_cast<QKeyEvent*>(event)))
            return true;
        break;
    }
    case QEvent::KeyRelease: {
        if (keyReleaseEvent(static_cast<QKeyEvent*>(event)))
            return true;
        break;
    }
    case QEvent::MouseButtonDblClick: {
        if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
            return true;
        break;
    }
    case QEvent::Wheel: {
        if (wheelEvent(static_cast<QWheelEvent*>(event)))
            return true;
        break;
    }
    default: {
        break;
    }
    } //switch

    // standard event processing
    return QObject::eventFilter(obj, event);
}
Exemple #21
0
void DhQScrollArea::DvhmouseDoubleClickEvent(QMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
 void ViewportManager::emitMouseDoubleClickEvent(Viewport* vp, QMouseEvent* e)
 {
    LOG_INFO("Emitting event - [mouseDoubleClickEvent]");
    emit mouseDoubleClickEvent(vp, e);
 }
Exemple #23
0
void DhQPushButton::DvhmouseDoubleClickEvent(QMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
void DhQAbstractSpinBox::DvhmouseDoubleClickEvent(QMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
Exemple #25
0
void DhQGroupBox::DvhmouseDoubleClickEvent(QMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
Exemple #26
0
bool CScreenShotView::eventFilter(QObject *obj, QEvent *event)
{
#ifdef Q_OS_MAC
    if(/*obj == qApp && */event->type() == QEvent::KeyPress || this->isVisible())
    {
        QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
        if(keyEvent)
        {
            if(keyEvent->key() == Qt::Key_Escape)
            {
                setShotStatus(CSCREEN_SHOT_STATE_CANCEL);
                event->accept();
                return true;
            }
            else if(keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return)
            {
                if(m_shotStatus == CSCREEN_SHOT_STATE_EDITED
                        || m_shotStatus == CSCREEN_SHOT_STATE_SELECTED)
                {
                    doFinished();
                    event->accept();
                    return true;
                }
            }
        }
    }
    if(this->isVisible())
    {
        //弥补界面最下面、最右边差1px的事件范围
        QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
        if(mouseEvent && m_desktopScreen)
        {
            QPoint globalPos = mouseEvent->globalPos();
            QRect geometry = m_desktopScreen->geometry();
            bool isContains = globalPos.x() >= geometry.x()
                    && globalPos.x() <= (geometry.x() + geometry.width())
                    && globalPos.y() >= geometry.y()
                    && globalPos.y() <= (geometry.y() + geometry.height());
            bool onBoundary = (globalPos.x() == (geometry.x() + geometry.width()) || globalPos.y() == (geometry.y() + geometry.height()));
            if(isContains && onBoundary)
            {
                switch (event->type())
                {
                case QEvent::MouseButtonPress:
                    mousePressEvent(mouseEvent);
                    break;
                case QEvent::MouseMove:
                    mouseMoveEvent(mouseEvent);
                    break;
                case QEvent::MouseButtonDblClick:
                    mouseDoubleClickEvent(mouseEvent);
                    break;
                default:
                    break;
                }
            }
        }
    }
#endif
    return QGraphicsView::eventFilter(obj,event);
}
void DhQGraphicsItemGroup::DvhmouseDoubleClickEvent(QGraphicsSceneMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
Exemple #28
0
bool CLockedEdit::eventFilter(QObject *object, QEvent *event)
{
   if ( event->type() == QEvent::Show )
   {
      showEvent(dynamic_cast<QShowEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::ShowToParent )
   {
      showEvent(dynamic_cast<QShowEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::Hide )
   {
      hideEvent(dynamic_cast<QHideEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::Move )
   {
      moveEvent(dynamic_cast<QMoveEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::Paint )
   {
      paintEvent(dynamic_cast<QPaintEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::FocusIn )
   {
      focusInEvent(dynamic_cast<QFocusEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::FocusOut )
   {
      focusOutEvent(dynamic_cast<QFocusEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::MouseButtonPress )
   {
      mousePressEvent(dynamic_cast<QMouseEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::MouseButtonRelease )
   {
      mouseReleaseEvent(dynamic_cast<QMouseEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::MouseButtonDblClick )
   {
      mouseDoubleClickEvent(dynamic_cast<QMouseEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::MouseMove )
   {
      mouseMoveEvent(dynamic_cast<QMouseEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::Wheel )
   {
      wheelEvent(dynamic_cast<QWheelEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::Resize )
   {
      resizeEvent(dynamic_cast<QResizeEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::KeyPress )
   {
      keyPressEvent(dynamic_cast<QKeyEvent*>(event));
      return true;
   }
   if ( event->type() == QEvent::KeyRelease )
   {
      keyReleaseEvent(dynamic_cast<QKeyEvent*>(event));
      return true;
   }
//   qDebug("eventFilter: unhandled %d object %s", event->type(), object->objectName().toAscii().constData());
   return false;
}
Exemple #29
0
void DhQSlider::DvhmouseDoubleClickEvent(QMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}
void DhQGraphicsEllipseItem::DvhmouseDoubleClickEvent(QGraphicsSceneMouseEvent* x1) {
  return mouseDoubleClickEvent(x1);
}