当前位置: 首页>>代码示例>>C++>>正文


C++ QCursor::handle方法代码示例

本文整理汇总了C++中QCursor::handle方法的典型用法代码示例。如果您正苦于以下问题:C++ QCursor::handle方法的具体用法?C++ QCursor::handle怎么用?C++ QCursor::handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QCursor的用法示例。


在下文中一共展示了QCursor::handle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
PlayField::changeCursor(const QCursor& c) {
  if (cursor_.handle() == c.handle()) return;

  cursor_ = c;
  QWidget::setCursor(c);
}
开发者ID:KDE,项目名称:ksokoban,代码行数:7,代码来源:PlayField.cpp

示例2: grabMouse

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;
}
开发者ID:Afreeca,项目名称:qt,代码行数:10,代码来源:qwidget_qws.cpp

示例3: qt_symbian_setWindowGroupCursor

/*
 * 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
}
开发者ID:Marforius,项目名称:qt,代码行数:23,代码来源:qcursor_s60.cpp

示例4: GiveFeedback

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 );
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:40,代码来源:qdnd_win.cpp


注:本文中的QCursor::handle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。