mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-20 19:44:59 +00:00
按键点击转换测试成功
This commit is contained in:
parent
842a5989ea
commit
c294839464
1 changed files with 9 additions and 1 deletions
|
@ -91,6 +91,14 @@ void VideoForm::updateShowSize(const QSize &newSize)
|
|||
|
||||
void VideoForm::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QRect rc(event->pos(), ui->videoWidget->frameSize());
|
||||
QSize frameSize = ui->videoWidget->frameSize();
|
||||
QSize widgetWize = size();
|
||||
|
||||
QPoint pos = event->pos();
|
||||
// convert pos
|
||||
pos.setX(pos.x() * 1.0f * frameSize.width() / widgetWize.width());
|
||||
pos.setY(pos.y() * 1.0f * frameSize.height() / widgetWize.height());
|
||||
|
||||
QRect rc(pos, frameSize);
|
||||
m_controller.test(rc);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue