QMoveEvent Class

QMoveEvent 类包含移动事件的事件参数。更多

头文件: #include <QMoveEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承: QEvent

公共函数

QMoveEvent(const QPoint &pos, const QPoint &oldPos)
const QPoint &oldPos() const
const QPoint &pos() const

详细说明

移动事件会发送给相对于父对象移动到新位置的部件。

事件处理程序QWidget::moveEvent() 接收移动事件。

另请参阅 QWidget::move() 和QWidget::setGeometry()。

成员函数文档

QMoveEvent::QMoveEvent(const QPoint &pos, const QPoint &oldPos)

用新的和旧的 widget 位置(分别为posoldPos )构建一个移动事件。

const QPoint &QMoveEvent::oldPos() const

返回 widget 的旧位置。

const QPoint &QMoveEvent::pos() const

返回 widget 的新位置。这不包括顶层 widget 的窗口框架。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.