|
|
|
@ -127,6 +127,7 @@ void MainWindow::initSignalConnection() {
|
|
|
|
|
&MainWindow::closeVideoSlot);
|
|
|
|
|
|
|
|
|
|
connect(&streamAddrSettingsDlg, &StreamAddrSettingsDlg::sendUavTypeIndex, ui->commandWidget, &CommandWidget::receiveUavTypeIndex);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::initNotifyMessageConnection() {
|
|
|
|
@ -539,6 +540,11 @@ void MainWindow::initPodParam()
|
|
|
|
|
lastLocation->hide();
|
|
|
|
|
|
|
|
|
|
connect(&settingDlg, &CommunicationSettingDlg::sendPodData, ui->commandWidget, &CommandWidget::setPodIPConfig);
|
|
|
|
|
|
|
|
|
|
connect(_wheelStopTime, &QTimer::timeout, this, [this]() {
|
|
|
|
|
ui->commandWidget->wheelZoomCtrl(0);
|
|
|
|
|
qDebug() << "滚轮停止了";
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::mousePressEvent(QMouseEvent* event)
|
|
|
|
@ -623,3 +629,50 @@ void MainWindow::mouseReleaseEvent(QMouseEvent* event)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::wheelEvent(QWheelEvent* event)
|
|
|
|
|
{
|
|
|
|
|
if (ui->videoWidget->underMouse())
|
|
|
|
|
{
|
|
|
|
|
// 获取滚轮的滚动方向和角度增量
|
|
|
|
|
_delta = event->angleDelta().y();
|
|
|
|
|
QPointF currentLocation = event->position();
|
|
|
|
|
// qDebug() << "当前位置:" << currentLocation;
|
|
|
|
|
|
|
|
|
|
if (_delta > 0)
|
|
|
|
|
{
|
|
|
|
|
// 向上滚动
|
|
|
|
|
qDebug() << "鼠标滚轮向上滚动" << " 步长:" << _delta;
|
|
|
|
|
// if(wheelSub->isVisible())
|
|
|
|
|
// {
|
|
|
|
|
// wheelSub->hide();
|
|
|
|
|
// }
|
|
|
|
|
// wheelPlus->move((currentLocation - QPoint(wheelPlus->width()/2, wheelPlus->height()/2)).toPoint());
|
|
|
|
|
// wheelPlus->show();
|
|
|
|
|
ui->commandWidget->wheelZoomCtrl(_delta);
|
|
|
|
|
}
|
|
|
|
|
else if (_delta < 0)
|
|
|
|
|
{
|
|
|
|
|
// 向下滚动
|
|
|
|
|
// if(wheelPlus->isVisible())
|
|
|
|
|
// {
|
|
|
|
|
// wheelPlus->hide();
|
|
|
|
|
// }
|
|
|
|
|
// wheelSub->move((currentLocation - QPoint(wheelSub->width()/2, wheelSub->height()/2)).toPoint());
|
|
|
|
|
// wheelSub->show();
|
|
|
|
|
ui->commandWidget->wheelZoomCtrl(_delta);
|
|
|
|
|
qDebug() << "鼠标滚轮事向下滚动" << " 步长:" << _delta;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_wheelStopTime->isActive())
|
|
|
|
|
{
|
|
|
|
|
_wheelStopTime->start();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
_wheelStopTime->stop();
|
|
|
|
|
_wheelStopTime->start();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
QWidget::wheelEvent(event);
|
|
|
|
|
}
|
|
|
|
|