Ejemplo n.º 1
0
void
PlayField::changeCursor(const QCursor& c) {
  if (cursor_.handle() == c.handle()) return;

  cursor_ = c;
  QWidget::setCursor(c);
}
Ejemplo n.º 2
0
void QWidget::grabMouse(const QCursor &cursor)
{
    if (qt_mouseGrb)
        qt_mouseGrb->releaseMouse();

    qwsDisplay()->grabMouse(this,true);
    qwsDisplay()->selectCursor(this, cursor.handle());
    qt_mouseGrb = this;
    qt_pressGrab = 0;
}
Ejemplo n.º 3
0
/*
 * Makes the specified cursor appear above a specific native window group
 * Called from QSymbianControl and QApplication::restoreOverrideCursor
 *
 * Window server is needed for this, so there is no equivalent when using
 * the sprite workaround.
 */
void qt_symbian_setWindowGroupCursor(const QCursor &cursor, RWindowTreeNode &node)
{
    Qt::HANDLE handle = cursor.handle();
    if (handle) {
        RWsPointerCursor *pcurs = reinterpret_cast<RWsPointerCursor *> (handle);
        node.SetCustomPointerCursor(*pcurs);
    } else
#ifdef Q_SYMBIAN_HAS_SYSTEM_CURSORS
    {
        TInt shape = qt_symbian_translate_cursor_shape(cursor.shape());
        node.SetPointerCursor(shape);
    }
#else
    qWarning("qt_s60_setWindowGroupCursor - null handle");
#endif
}
Ejemplo n.º 4
0
STDMETHODIMP QOleDropSource::GiveFeedback( DWORD dwEffect )
{
    QCursor * cur;
    QDropEvent::Action action = translateToQDropAction( dwEffect );

#ifdef DEBUG_QDND_SRC

    qDebug( "QOleDropSource::GiveFeedback(dwEffect = %d)", action );
#endif

    if ( currentAction != action ) {
        currentAction = action;
    }

    if ( ( ( dwEffect & DROPEFFECT_COPY ) == DROPEFFECT_COPY ) &&
            ( ( drag_mode == QDragObject::DragCopy ) ||
              ( drag_mode == QDragObject::DragCopyOrMove ) ||
              ( drag_mode == QDragObject::DragDefault ) ) ) {
        cur = copyCursor;
    } else if ( ( ( dwEffect & DROPEFFECT_MOVE ) == DROPEFFECT_MOVE ) &&
                ( ( drag_mode == QDragObject::DragMove ) ||
                  ( drag_mode == QDragObject::DragCopy ) ||      // windows-bug?
                  ( drag_mode == QDragObject::DragCopyOrMove ) ||
                  ( drag_mode == QDragObject::DragDefault ) ) ) {
        cur = moveCursor;
    } else if ( ( ( dwEffect & DROPEFFECT_LINK ) == DROPEFFECT_LINK ) &&
                ( ( drag_mode == QDragObject::DragLink ) ||
                  ( drag_mode == QDragObject::DragDefault ) ) ) {
        cur = linkCursor;
    } else {
        return ResultFromScode( DRAGDROP_S_USEDEFAULTCURSORS );
    }
    SetCursor( cur->handle() );
#ifndef QT_NO_CURSOR

    qApp->setOverrideCursor( *cur, TRUE );
#endif

    return ResultFromScode( S_OK );
}