예제 #1
0
bool BreakpointDockWidget::eventFilter(QObject *obj, QEvent *event)
{
   if ( obj == ui->tableView || obj == ui->tableView->viewport() )
   {
      if ( event->type() == QEvent::DragEnter )
      {
         QDragEnterEvent* newEvent = static_cast<QDragEnterEvent*>(event);
         dragEnterEvent(newEvent);
         return true;
      }
      if ( event->type() == QEvent::DragMove )
      {
         QDragMoveEvent* newEvent = static_cast<QDragMoveEvent*>(event);
         dragMoveEvent(newEvent);
         return true;
      }
      if ( event->type() == QEvent::Drop )
      {
         QDropEvent* newEvent = static_cast<QDropEvent*>(event);
         dropEvent(newEvent);
         return true;
      }
   }
   return false;
}
예제 #2
0
int Frame::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QFrame::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: press_top_mid((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 1: move_top_mid((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 2: press_bottom_left((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 3: move_bottom_left((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 4: press_bottom_right((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 5: move_bottom_right((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 6: press_bottom_mid((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 7: move_bottom_mid((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 8: press_right((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 9: move_right((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 10: press_left((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 11: move_left((*reinterpret_cast< QMouseEvent*(*)>(_a[1]))); break;
        case 12: destroy_it(); break;
        case 13: maximize_it(); break;
        case 14: iconify_it(); break;
        case 15: dragEnterEvent((*reinterpret_cast< QDragEnterEvent*(*)>(_a[1]))); break;
        case 16: dragMoveEvent((*reinterpret_cast< QDragMoveEvent*(*)>(_a[1]))); break;
        case 17: dropEvent((*reinterpret_cast< QDropEvent*(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 18;
    }
    return _id;
}
예제 #3
0
void QDateEdit_QtDShell::__override_dragEnterEvent(QDragEnterEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QWidget::dragEnterEvent((QDragEnterEvent* )arg__1);
    } else {
        dragEnterEvent((QDragEnterEvent* )arg__1);
    }
}
void QGraphicsEllipseItem_QtDShell::__override_dragEnterEvent(QGraphicsSceneDragDropEvent*  event0, bool static_call)
{
    if (static_call) {
        QGraphicsItem::dragEnterEvent((QGraphicsSceneDragDropEvent* )event0);
    } else {
        dragEnterEvent((QGraphicsSceneDragDropEvent* )event0);
    }
}
void QAbstractPageSetupDialog_QtDShell::__override_dragEnterEvent(QDragEnterEvent*  arg__1, bool static_call)
{
    if (static_call) {
        QWidget::dragEnterEvent((QDragEnterEvent* )arg__1);
    } else {
        dragEnterEvent((QDragEnterEvent* )arg__1);
    }
}
예제 #6
0
bool WelcomePageWidget::eventFilter(QObject *watched, QEvent *event) {
    CHECK(this == watched, false);
    switch (event->type()) {
        case QEvent::DragEnter:
            dragEnterEvent(dynamic_cast<QDragEnterEvent*>(event));
            return true;
        case QEvent::DragMove:
            dragMoveEvent(dynamic_cast<QDragMoveEvent*>(event));
            return true;
        case QEvent::Drop:
            dropEvent(dynamic_cast<QDropEvent*>(event));
            return true;
        case QEvent::FocusIn:
            setFocus();
            return true;
        default:
            return false;
    }
}
예제 #7
0
bool ListDnd::eventFilter( QObject *, QEvent * event )
{
    switch ( event->type() ) {
    case QEvent::DragEnter:
	return dragEnterEvent( (QDragEnterEvent *) event );
    case QEvent::DragLeave:
	return dragLeaveEvent( (QDragLeaveEvent *) event );
    case QEvent::DragMove:
	return dragMoveEvent( (QDragMoveEvent *) event );
    case QEvent::Drop:
	return dropEvent( (QDropEvent *) event );
    case QEvent::MouseButtonPress:
	return mousePressEvent( (QMouseEvent *) event );
    case QEvent::MouseMove:
	return mouseMoveEvent( (QMouseEvent *) event );
    default:
	break;
    }
    return FALSE;
}
예제 #8
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;
}
예제 #9
0
bool CMindMapEventHandler::onEvent(CDiagramPrivateData *p, QEvent *evt)
{
	bool					r = false;
	CDiagram				*d = NULL;
	CDiagramItem			*item = NULL;
	CMindMapNode			*node = NULL;
	QList<CDiagramItem*>	items;
	
	if ( !p || !p->m_d || p->m_d->mode() == CDiagram::EditTextMode )
		return r;

	d = p->m_d;
	m_pdata = p;

	switch(evt->type())
	{
	case QEvent::GraphicsSceneDragEnter:
        r = dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent*>(evt));
		break;

	case QEvent::GraphicsSceneDragMove:
        r = dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent*>(evt));
		break;

	case QEvent::GraphicsSceneDrop:
        r = dropEvent(static_cast<QGraphicsSceneDragDropEvent*>(evt));
		break;

	case QEvent::GraphicsSceneMousePress:
        if (m_draggedImage->scene() == d)
            d->removeItem(m_draggedImage);
		m_pdata->m_customPressedItem = NULL;
		m_target = NULL;
		break;

	case QEvent::GraphicsSceneMouseMove:
		{
			QGraphicsSceneMouseEvent	*event = NULL;
			QPointF						endPos;
			QPointF						startPos;
			QDrag						*drag = NULL;
			QMimeData					*mime = NULL;
			QByteArray					mimeData;
			QDataStream					dataStream(&mimeData, QIODevice::WriteOnly);

			event = static_cast<QGraphicsSceneMouseEvent*>(evt);
			if (event && d->mode() == CDiagram::CursorMode)
			{
				if (event->buttons() & Qt::LeftButton )
				{
					endPos = event->scenePos();
					startPos = event->buttonDownScenePos(Qt::LeftButton);

					if (!m_pdata->m_customPressedItem)
					{
						items = d->selectedTopLevelItems();
						if (items.length() == 1)
						{
							node = dynamic_cast<CMindMapNode*>(items.first());
                            if (node && node->isMovable() && node->mapToScene( node->boundingRect() ).containsPoint(event->scenePos(), Qt::WindingFill ) )
							{
								m_pdata->m_customPressedItem = node;
							}
							else if (node && node->isRoot())
							{
								r = true;
							}
						}
						else
						{
							foreach (item, items)
							{
								node = dynamic_cast<CMindMapNode*>(item);
								if (node && node->isRoot())
								{
									r = true;
									break;
								}
							}
						}
					}

					// check whether we should start the moving action
					// using manhattanLength.
					if (m_pdata->m_customPressedItem && 
						m_draggedImage->scene() != d && 
						((startPos, endPos).manhattanLength() > QApplication::startDragDistance() ) )
					{
						((CMindMapDragImage*)m_draggedImage)->updateDraggedItemsRect(d, m_pdata->m_customPressedItem);
                        m_pdata->m_d->addItem(m_draggedImage);
						m_draggedImage->setVisible(true);
						m_draggedImageInitPos = m_draggedImage->pos();
						
						dataStream << event->buttonDownScenePos(Qt::LeftButton);
						mime = new QMimeData();
						mime->setData(DND_DRAGMINDMAPNODE, mimeData);

                        drag = new QDrag( d->getMainView() );
						drag->setMimeData(mime);
						
						if (drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::MoveAction) == Qt::MoveAction)
						{
							// Should do something here.
						}

						event->accept();
                        r = true;
					}
				}
			}
예제 #10
0
void DhQGLWidget::DvhdragEnterEvent(QDragEnterEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #11
0
void DhQAbstractSpinBox::DvhdragEnterEvent(QDragEnterEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #12
0
void DhQPushButton::DvhdragEnterEvent(QDragEnterEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #13
0
void DhQGraphicsItemGroup::DvhdragEnterEvent(QGraphicsSceneDragDropEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #14
0
void DhQGroupBox::DvhdragEnterEvent(QDragEnterEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #15
0
void DhQScrollArea::DvhdragEnterEvent(QDragEnterEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #16
0
void KOAttendeeListView::contentsDragEnterEvent( QDragEnterEvent *e )
{
  dragEnterEvent(e);
}
예제 #17
0
void DhQStackedWidget::DvhdragEnterEvent(QDragEnterEvent* x1) {
    return dragEnterEvent(x1);
}
예제 #18
0
void DhQGraphicsEllipseItem::DvhdragEnterEvent(QGraphicsSceneDragDropEvent* x1) {
  return dragEnterEvent(x1);
}
예제 #19
0
void DhQSlider::DvhdragEnterEvent(QDragEnterEvent* x1) {
  return dragEnterEvent(x1);
}