Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经实现了 mousePressEvent,这样当你点击一个点时,它就会使那个点变成不同的颜色。谁能告诉我我必须在 mouseMoveEvent 中放入什么以便所选点随鼠标移动?
您应该保留点的坐标并在方法结束时在您的mousePressEvent和调用中相应地更新它们。update()然后你应该在画图事件中画出你的观点。
mousePressEvent
update()