diff --git a/src/ui/toolbar/MainToolBarController.cc b/src/ui/toolbar/MainToolBarController.cc index 5af18e7cc2b076300e6f2b8d346b9b73a92dbc9f..286076e033f2493a2ae6c5f878f41bd5c900506a 100644 --- a/src/ui/toolbar/MainToolBarController.cc +++ b/src/ui/toolbar/MainToolBarController.cc @@ -47,10 +47,7 @@ MainToolBarController::MainToolBarController(QObject* parent) , _telemetryLRSSI(0) { _activeVehicleChanged(qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()); - // RSSI (didn't like standard connection) - connect(qgcApp()->toolbox()->mavlinkProtocol(), - SIGNAL(radioStatusChanged(LinkInterface*, unsigned, unsigned, int, int, unsigned, unsigned, unsigned)), this, - SLOT(_telemetryChanged(LinkInterface*, unsigned, unsigned, int, int, unsigned, unsigned, unsigned))); + connect(qgcApp()->toolbox()->mavlinkProtocol(), &MAVLinkProtocol::radioStatusChanged, this, &MainToolBarController::_telemetryChanged); connect(qgcApp()->toolbox()->multiVehicleManager(), &MultiVehicleManager::activeVehicleChanged, this, &MainToolBarController::_activeVehicleChanged); } diff --git a/src/ui/uas/UASInfoWidget.cc b/src/ui/uas/UASInfoWidget.cc index 9011543fe0044ce05c4f87427fd4126319da4d1d..8df20fea82c7f953b3ecf7044a2b9d202b4922c7 100644 --- a/src/ui/uas/UASInfoWidget.cc +++ b/src/ui/uas/UASInfoWidget.cc @@ -70,7 +70,7 @@ UASInfoWidget::UASInfoWidget(const QString& title, QAction* action, QWidget *par errors = QMap(); updateTimer = new QTimer(this); - connect(updateTimer, SIGNAL(timeout()), this, SLOT(refresh())); + connect(updateTimer, &QTimer::timeout, this, &UASInfoWidget::refresh); updateTimer->start(updateInterval); this->setVisible(false); @@ -102,19 +102,19 @@ void UASInfoWidget::hideEvent(QHideEvent* event) void UASInfoWidget::_activeVehicleChanged(Vehicle* vehicle) { if (activeUAS) { - disconnect(activeUAS, SIGNAL(batteryChanged(UASInterface*, double, double, double, int)), this, SLOT(updateBattery(UASInterface*, double, double, double, int))); - disconnect(activeUAS, SIGNAL(dropRateChanged(int,float)), this, SLOT(updateReceiveLoss(int,float))); - disconnect(activeUAS, SIGNAL(loadChanged(UASInterface*, double)), this, SLOT(updateCPULoad(UASInterface*,double))); - disconnect(activeUAS, SIGNAL(errCountChanged(int,QString,QString,int)), this, SLOT(updateErrorCount(int,QString,QString,int))); + disconnect(activeUAS, &UASInterface::batteryChanged, this, &UASInfoWidget::updateBattery); + disconnect(activeUAS, &UASInterface::dropRateChanged, this, &UASInfoWidget::updateReceiveLoss); + disconnect(static_cast(activeUAS), &UAS::loadChanged, this, &UASInfoWidget::updateCPULoad); + disconnect(activeUAS, &UASInterface::errCountChanged, this, &UASInfoWidget::updateErrorCount); activeUAS = NULL; } if (vehicle) { activeUAS = vehicle->uas(); - connect(activeUAS, SIGNAL(batteryChanged(UASInterface*, double, double, double, int)), this, SLOT(updateBattery(UASInterface*, double, double, double, int))); - connect(activeUAS, SIGNAL(dropRateChanged(int,float)), this, SLOT(updateReceiveLoss(int,float))); - connect(activeUAS, SIGNAL(loadChanged(UASInterface*, double)), this, SLOT(updateCPULoad(UASInterface*,double))); - connect(activeUAS, SIGNAL(errCountChanged(int,QString,QString,int)), this, SLOT(updateErrorCount(int,QString,QString,int))); + connect(activeUAS, &UASInterface::batteryChanged, this, &UASInfoWidget::updateBattery); + connect(activeUAS, &UASInterface::dropRateChanged, this, &UASInfoWidget::updateReceiveLoss); + connect(static_cast(activeUAS), &UAS::loadChanged, this, &UASInfoWidget::updateCPULoad); + connect(activeUAS, &UASInterface::errCountChanged, this, &UASInfoWidget::updateErrorCount); } } diff --git a/src/ui/uas/UASQuickView.cc b/src/ui/uas/UASQuickView.cc index 96fa299028d394a10095a85519ff05ced6a683d9..bf636aa064574d4b8a2c34e5bfa03efb9de671c4 100644 --- a/src/ui/uas/UASQuickView.cc +++ b/src/ui/uas/UASQuickView.cc @@ -41,16 +41,16 @@ UASQuickView::UASQuickView(QWidget *parent) : QWidget(parent), QAction *action = new QAction("Add/Remove Items",this); action->setCheckable(false); - connect(action,SIGNAL(triggered()),this,SLOT(actionTriggered())); + connect(action,&QAction::triggered,this, static_cast(&UASQuickView::actionTriggered)); this->addAction(action); QAction *columnaction = new QAction("Set Column Count",this); columnaction->setCheckable(false); - connect(columnaction,SIGNAL(triggered()),this,SLOT(columnActionTriggered())); + connect(columnaction,&QAction::triggered,this,&UASQuickView::columnActionTriggered); this->addAction(columnaction); updateTimer = new QTimer(this); - connect(updateTimer,SIGNAL(timeout()),this,SLOT(updateTimerTick())); + connect(updateTimer,&QTimer::timeout,this,&UASQuickView::updateTimerTick); updateTimer->start(1000); } @@ -83,9 +83,10 @@ void UASQuickView::actionTriggered() return; } quickViewSelectDialog = new UASQuickViewItemSelect(); - connect(quickViewSelectDialog,SIGNAL(destroyed()),this,SLOT(selectDialogClosed())); - connect(quickViewSelectDialog,SIGNAL(valueDisabled(QString)),this,SLOT(valueDisabled(QString))); - connect(quickViewSelectDialog,SIGNAL(valueEnabled(QString)),this,SLOT(valueEnabled(QString))); + connect(quickViewSelectDialog,&UASQuickViewItemSelect::destroyed,this,&UASQuickView::selectDialogClosed); + connect(quickViewSelectDialog,&UASQuickViewItemSelect::valueDisabled,this,&UASQuickView::valueDisabled); + connect(quickViewSelectDialog,&UASQuickViewItemSelect::valueEnabled,this,&UASQuickView::valueEnabled); + quickViewSelectDialog->setAttribute(Qt::WA_DeleteOnClose,true); for (QMap::const_iterator i = uasPropertyValueMap.constBegin();i!=uasPropertyValueMap.constEnd();i++) {