📄 qgraphicssceneevent.cpp
字号:
QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent(){}/*! Returns the position of the mouse cursor in item coordinates at the moment the the hover event was sent. \sa scenePos(), screenPos()*/QPointF QGraphicsSceneHoverEvent::pos() const{ Q_D(const QGraphicsSceneHoverEvent); return d->pos;}/*! \fn void QGraphicsSceneHoverEvent::setPos(const QPointF &point) \internal Sets the position associated with the hover event to the given \a point in item coordinates.*/void QGraphicsSceneHoverEvent::setPos(const QPointF &pos){ Q_D(QGraphicsSceneHoverEvent); d->pos = pos;}/*! Returns the position of the mouse cursor in scene coordinates at the moment the the hover event was sent. \sa pos(), screenPos()*/QPointF QGraphicsSceneHoverEvent::scenePos() const{ Q_D(const QGraphicsSceneHoverEvent); return d->scenePos;}/*! \fn void QGraphicsSceneHoverEvent::setScenePos(const QPointF &point) \internal Sets the position associated with the hover event to the given \a point in scene coordinates.*/void QGraphicsSceneHoverEvent::setScenePos(const QPointF &pos){ Q_D(QGraphicsSceneHoverEvent); d->scenePos = pos;}/*! Returns the position of the mouse cursor in screen coordinates at the moment the the hover event was sent. \sa pos(), scenePos()*/QPoint QGraphicsSceneHoverEvent::screenPos() const{ Q_D(const QGraphicsSceneHoverEvent); return d->screenPos;}/*! \fn void QGraphicsSceneHoverEvent::setScreenPos(const QPoint &point) \internal Sets the position associated with the hover event to the given \a point in screen coordinates.*/void QGraphicsSceneHoverEvent::setScreenPos(const QPoint &pos){ Q_D(QGraphicsSceneHoverEvent); d->screenPos = pos;}class QGraphicsSceneHelpEventPrivate : public QGraphicsSceneEventPrivate{public: QPointF scenePos; QPoint screenPos;};/*! \internal Constructs a graphics scene help event of the specified \a type.*/QGraphicsSceneHelpEvent::QGraphicsSceneHelpEvent(Type type) : QGraphicsSceneEvent(*new QGraphicsSceneHelpEventPrivate, type){}/*! Destroys the event.*/QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent(){}/*! Returns the position of the mouse cursor in scene coordinates at the moment the the help event was sent. \sa screenPos()*/QPointF QGraphicsSceneHelpEvent::scenePos() const{ Q_D(const QGraphicsSceneHelpEvent); return d->scenePos;}/*! \fn void QGraphicsSceneHelpEvent::setScenePos(const QPointF &point) \internal Sets the position associated with the context menu to the given \a point in scene coordinates.*/void QGraphicsSceneHelpEvent::setScenePos(const QPointF &pos){ Q_D(QGraphicsSceneHelpEvent); d->scenePos = pos;}/*! Returns the position of the mouse cursor in screen coordinates at the moment the the help event was sent. \sa scenePos()*/QPoint QGraphicsSceneHelpEvent::screenPos() const{ Q_D(const QGraphicsSceneHelpEvent); return d->screenPos;}/*! \fn void QGraphicsSceneHelpEvent::setScreenPos(const QPoint &point) \internal Sets the position associated with the context menu to the given \a point in screen coordinates.*/void QGraphicsSceneHelpEvent::setScreenPos(const QPoint &pos){ Q_D(QGraphicsSceneHelpEvent); d->screenPos = pos;}class QGraphicsSceneDragDropEventPrivate : public QGraphicsSceneEventPrivate{ Q_DECLARE_PUBLIC(QGraphicsSceneDragDropEvent)public: inline QGraphicsSceneDragDropEventPrivate() : source(0), mimeData(0) { } QPointF pos; QPointF scenePos; QPoint screenPos; Qt::MouseButtons buttons; Qt::KeyboardModifiers modifiers; Qt::DropActions possibleActions; Qt::DropAction proposedAction; Qt::DropAction dropAction; QWidget *source; const QMimeData *mimeData;};/*! \internal Constructs a new QGraphicsSceneDragDropEvent of the specified \a type. The type can be either QEvent::GraphicsSceneDragEnter, QEvent::GraphicsSceneDragLeave, QEvent::GraphicsSceneDragMove, or QEvent::GraphicsSceneDrop.*/QGraphicsSceneDragDropEvent::QGraphicsSceneDragDropEvent(Type type) : QGraphicsSceneEvent(*new QGraphicsSceneDragDropEventPrivate, type){}/*! Destroys the object.*/QGraphicsSceneDragDropEvent::~QGraphicsSceneDragDropEvent(){}/*! Returns the mouse position of the event relative to the view that sent the event. \sa QGraphicsView, screenPos(), scenePos()*/QPointF QGraphicsSceneDragDropEvent::pos() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->pos;}/*! \internal Sets the position of the mouse to \a pos; this should be relative to the widget that generated the event, which normally is a QGraphicsView. \sa pos(), setScenePos(), setScreenPos()*/void QGraphicsSceneDragDropEvent::setPos(const QPointF &pos){ Q_D(QGraphicsSceneDragDropEvent); d->pos = pos;}/*! Returns the position of the mouse in scene coordinates. \sa pos(), screenPos()*/QPointF QGraphicsSceneDragDropEvent::scenePos() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->scenePos;}/*! \internal Sets the scene position of the mouse to \a pos. \sa scenePos(), setScreenPos(), setPos()*/void QGraphicsSceneDragDropEvent::setScenePos(const QPointF &pos){ Q_D(QGraphicsSceneDragDropEvent); d->scenePos = pos;}/*! Returns the position of the mouse relative to the screen. \sa pos(), scenePos()*/QPoint QGraphicsSceneDragDropEvent::screenPos() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->screenPos;}/*! \internal Sets the mouse position relative to the screen to \a pos. \sa screenPos(), setScenePos(), setPos()*/void QGraphicsSceneDragDropEvent::setScreenPos(const QPoint &pos){ Q_D(QGraphicsSceneDragDropEvent); d->screenPos = pos;}/*! Returns a Qt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated. \sa Qt::MouseButtons*/Qt::MouseButtons QGraphicsSceneDragDropEvent::buttons() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->buttons;}/*! \internal Sets the mouse buttons that were pressed when the event was created to \a buttons. \sa Qt::MouseButtons, buttons()*/void QGraphicsSceneDragDropEvent::setButtons(Qt::MouseButtons buttons){ Q_D(QGraphicsSceneDragDropEvent); d->buttons = buttons;}/*! Returns the keyboard modifiers that were pressed when the drag and drop event was created. \sa Qt::KeyboardModifiers*/Qt::KeyboardModifiers QGraphicsSceneDragDropEvent::modifiers() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->modifiers;}/*! \internal Sets the keyboard modifiers that were pressed when the event was created to \a modifiers. \sa Qt::KeyboardModifiers, modifiers()*/void QGraphicsSceneDragDropEvent::setModifiers(Qt::KeyboardModifiers modifiers){ Q_D(QGraphicsSceneDragDropEvent); d->modifiers = modifiers;}/*! Returns the possible drop actions that the drag and drop can result in. \sa Qt::DropActions*/Qt::DropActions QGraphicsSceneDragDropEvent::possibleActions() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->possibleActions;}/*! \internal Sets the possible drop actions that the drag can result in to \a actions. \sa Qt::DropActions, possibleActions()*/void QGraphicsSceneDragDropEvent::setPossibleActions(Qt::DropActions actions){ Q_D(QGraphicsSceneDragDropEvent); d->possibleActions = actions;}/*! Returns the drop action that is proposed, i.e., preferred. The action must be one of the possible actions as defined by \c possibleActions(). \sa Qt::DropAction, possibleActions() */Qt::DropAction QGraphicsSceneDragDropEvent::proposedAction() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->proposedAction;}/*! \internal Sets the proposed action to \a action. The proposed action is a Qt::DropAction that is one of the possible actions as given by \c possibleActions(). \sa proposedAction(), Qt::DropAction, possibleActions()*/void QGraphicsSceneDragDropEvent::setProposedAction(Qt::DropAction action){ Q_D(QGraphicsSceneDragDropEvent); d->proposedAction = action;}/*! Sets the proposed action as accepted, i.e, the drop action is set to the proposed action. This is equal to: \code setDropAction(proposedAction()); \endcode When using this function, one should not call \c accept(). \sa dropAction(), setDropAction(), proposedAction()*/void QGraphicsSceneDragDropEvent::acceptProposedAction(){ Q_D(QGraphicsSceneDragDropEvent); d->dropAction = d->proposedAction;}/*! Returns the action that was performed in this drag and drop. This should be set by the receiver of the drop and is returned by QDrag::start(). \sa setDropAction(), acceptProposedAction()*/Qt::DropAction QGraphicsSceneDragDropEvent::dropAction() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->dropAction;}/*! This function lets the receiver of the drop set the drop action that was performed to \a action, which should be one of the \l{QGraphicsSceneDragDropEvent::possibleActions()}{possible actions}. Call \c accept() in stead of \c acceptProposedAction() if you use this function. \sa dropAction(), accept(), possibleActions()*/void QGraphicsSceneDragDropEvent::setDropAction(Qt::DropAction action){ Q_D(QGraphicsSceneDragDropEvent); d->dropAction = action;}/*! This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.*/QWidget *QGraphicsSceneDragDropEvent::source() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->source;}/*! \internal This function set the source widget, i.e., the widget that created the drop event, to \a source.*/void QGraphicsSceneDragDropEvent::setSource(QWidget *source){ Q_D(QGraphicsSceneDragDropEvent); d->source = source;}/*! This function returns the MIME data of the event.*/const QMimeData *QGraphicsSceneDragDropEvent::mimeData() const{ Q_D(const QGraphicsSceneDragDropEvent); return d->mimeData;}/*! \internal This function sets the MIME data for the event.*/void QGraphicsSceneDragDropEvent::setMimeData(const QMimeData *data){ Q_D(QGraphicsSceneDragDropEvent); d->mimeData = data;}#endif // QT_NO_GRAPHICSVIEW
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -