Commit 28ba4dac authored by Tomaz Canabrava's avatar Tomaz Canabrava

More signals to new syntax

Now I'v discovered a Slot that returns a bool, this is not very
good because Qt expects a slot to have the same return type
as the signal, void, always.
Signed-off-by: 's avatarTomaz Canabrava <tomaz.canabrava@intel.com>
parent 6a84a9a9
...@@ -78,7 +78,7 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget ...@@ -78,7 +78,7 @@ MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget
connect(m_ui->systemIdSpinBox,static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), protocol, &MAVLinkProtocol::setSystemId); connect(m_ui->systemIdSpinBox,static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), protocol, &MAVLinkProtocol::setSystemId);
// Multiplexing // Multiplexing
connect(protocol, &MAVLinkProtocol::multiplexingChanged, m_ui->multiplexingCheckBox, &QCheckBox::setChecked); connect(protocol, &MAVLinkProtocol::multiplexingChanged, m_ui->multiplexingCheckBox, &QCheckBox::setChecked);
connect(m_ui->multiplexingCheckBox, SIGNAL(toggled(bool)), protocol, SLOT(enableMultiplexing(bool))); connect(m_ui->multiplexingCheckBox, &QCheckBox::toggled, protocol, &MAVLinkProtocol::enableMultiplexing);
// Parameter guard // Parameter guard
connect(protocol, &MAVLinkProtocol::paramGuardChanged, m_ui->paramGuardCheckBox, &QCheckBox::setChecked); connect(protocol, &MAVLinkProtocol::paramGuardChanged, m_ui->paramGuardCheckBox, &QCheckBox::setChecked);
connect(m_ui->paramGuardCheckBox, &QCheckBox::toggled, protocol, &MAVLinkProtocol::enableParamGuard); connect(m_ui->paramGuardCheckBox, &QCheckBox::toggled, protocol, &MAVLinkProtocol::enableParamGuard);
......
...@@ -204,7 +204,7 @@ MainWindow::MainWindow() ...@@ -204,7 +204,7 @@ MainWindow::MainWindow()
emit initStatusChanged(tr("Initializing 3D mouse interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); emit initStatusChanged(tr("Initializing 3D mouse interface"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
mouse = new Mouse6dofInput(this); mouse = new Mouse6dofInput(this);
connect(this, SIGNAL(x11EventOccured(XEvent*)), mouse, SLOT(handleX11Event(XEvent*))); connect(this, &MainWindow::x11EventOccured, mouse, &Mouse6dofInput::handleX11Event);
#endif //QGC_MOUSE_ENABLED_LINUX #endif //QGC_MOUSE_ENABLED_LINUX
// Set low power mode // Set low power mode
...@@ -253,7 +253,7 @@ MainWindow::MainWindow() ...@@ -253,7 +253,7 @@ MainWindow::MainWindow()
_ui.actionFlight->setChecked(true); _ui.actionFlight->setChecked(true);
connect(&windowNameUpdateTimer, SIGNAL(timeout()), this, SLOT(configureWindowName())); connect(&windowNameUpdateTimer, &QTimer::timeout, this, &MainWindow::configureWindowName);
windowNameUpdateTimer.start(15000); windowNameUpdateTimer.start(15000);
emit initStatusChanged(tr("Done"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141)); emit initStatusChanged(tr("Done"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
...@@ -302,8 +302,7 @@ void MainWindow::_buildCommonWidgets(void) ...@@ -302,8 +302,7 @@ void MainWindow::_buildCommonWidgets(void)
// Add generic MAVLink decoder // Add generic MAVLink decoder
// TODO: This is never deleted // TODO: This is never deleted
mavlinkDecoder = new MAVLinkDecoder(qgcApp()->toolbox()->mavlinkProtocol(), this); mavlinkDecoder = new MAVLinkDecoder(qgcApp()->toolbox()->mavlinkProtocol(), this);
connect(mavlinkDecoder, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)), connect(mavlinkDecoder, &MAVLinkDecoder::valueChanged, this, &MainWindow::valueChanged);
this, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)));
// Log player // Log player
// TODO: Make this optional with a preferences setting or under a "View" menu // TODO: Make this optional with a preferences setting or under a "View" menu
...@@ -517,11 +516,11 @@ void MainWindow::connectCommonActions() ...@@ -517,11 +516,11 @@ void MainWindow::connectCommonActions()
{ {
// Audio output // Audio output
_ui.actionMuteAudioOutput->setChecked(qgcApp()->toolbox()->audioOutput()->isMuted()); _ui.actionMuteAudioOutput->setChecked(qgcApp()->toolbox()->audioOutput()->isMuted());
connect(qgcApp()->toolbox()->audioOutput(), SIGNAL(mutedChanged(bool)), _ui.actionMuteAudioOutput, SLOT(setChecked(bool))); connect(qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mutedChanged, _ui.actionMuteAudioOutput, &QAction::setChecked);
connect(_ui.actionMuteAudioOutput, SIGNAL(triggered(bool)), qgcApp()->toolbox()->audioOutput(), SLOT(mute(bool))); connect(_ui.actionMuteAudioOutput, &QAction::triggered, qgcApp()->toolbox()->audioOutput(), &GAudioOutput::mute);
// Application Settings // Application Settings
connect(_ui.actionSettings, SIGNAL(triggered()), this, SLOT(showSettings())); connect(_ui.actionSettings, &QAction::triggered, this, &MainWindow::showSettings);
// Views actions // Views actions
connect(_ui.actionFlight, &QAction::triggered, qgcApp(), &QGCApplication::showFlyView); connect(_ui.actionFlight, &QAction::triggered, qgcApp(), &QGCApplication::showFlyView);
...@@ -561,7 +560,7 @@ void MainWindow::showSettings() ...@@ -561,7 +560,7 @@ void MainWindow::showSettings()
void MainWindow::_vehicleAdded(Vehicle* vehicle) void MainWindow::_vehicleAdded(Vehicle* vehicle)
{ {
connect(vehicle->uas(), SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)), this, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64))); connect(vehicle->uas(), &UAS::valueChanged, this, &MainWindow::valueChanged);
} }
/// Stores the state of the toolbar, status bar and widgets associated with the current view /// Stores the state of the toolbar, status bar and widgets associated with the current view
......
...@@ -62,16 +62,21 @@ QGCDataPlot2D::QGCDataPlot2D(QWidget *parent) : ...@@ -62,16 +62,21 @@ QGCDataPlot2D::QGCDataPlot2D(QWidget *parent) :
ui->gridCheckBox->setChecked(plot->gridEnabled()); ui->gridCheckBox->setChecked(plot->gridEnabled());
// Connect user actions // Connect user actions
connect(ui->selectFileButton, SIGNAL(clicked()), this, SLOT(selectFile())); connect(ui->selectFileButton, &QPushButton::clicked, this, &QGCDataPlot2D::selectFile);
connect(ui->saveCsvButton, SIGNAL(clicked()), this, SLOT(saveCsvLog())); connect(ui->saveCsvButton, &QPushButton::clicked, this, &QGCDataPlot2D::saveCsvLog);
connect(ui->reloadButton, SIGNAL(clicked()), this, SLOT(reloadFile())); connect(ui->reloadButton, &QPushButton::clicked, this, &QGCDataPlot2D::reloadFile);
connect(ui->savePlotButton, SIGNAL(clicked()), this, SLOT(savePlot())); connect(ui->savePlotButton, &QPushButton::clicked, this, &QGCDataPlot2D::savePlot);
connect(ui->printButton, SIGNAL(clicked()), this, SLOT(print())); connect(ui->printButton, &QPushButton::clicked, this, &QGCDataPlot2D::print);
connect(ui->legendCheckBox, SIGNAL(clicked(bool)), plot, SLOT(showLegend(bool))); connect(ui->legendCheckBox, &QCheckBox::clicked, plot, &IncrementalPlot::showLegend);
connect(ui->symmetricCheckBox, SIGNAL(clicked(bool)), plot, SLOT(setSymmetric(bool))); connect(ui->symmetricCheckBox,&QCheckBox::clicked, plot, &IncrementalPlot::setSymmetric);
connect(ui->gridCheckBox, SIGNAL(clicked(bool)), plot, SLOT(showGrid(bool))); connect(ui->gridCheckBox, &QCheckBox::clicked, plot, &IncrementalPlot::showGrid);
connect(ui->style, static_cast<void (QComboBox::*)(const QString&)>(&QComboBox::currentIndexChanged),
plot, &IncrementalPlot::setStyleText);
//TODO: calculateRegression returns bool, slots are expected to return void, this makes
// converting to new style way too hard.
connect(ui->regressionButton, SIGNAL(clicked()), this, SLOT(calculateRegression())); connect(ui->regressionButton, SIGNAL(clicked()), this, SLOT(calculateRegression()));
connect(ui->style, SIGNAL(currentIndexChanged(QString)), plot, SLOT(setStyleText(QString)));
// Allow style changes to propagate through this widget // Allow style changes to propagate through this widget
connect(qgcApp(), &QGCApplication::styleChanged, plot, &IncrementalPlot::styleChanged); connect(qgcApp(), &QGCApplication::styleChanged, plot, &IncrementalPlot::styleChanged);
...@@ -324,7 +329,7 @@ void QGCDataPlot2D::loadRawLog(QString file, QString xAxisName, QString yAxisFil ...@@ -324,7 +329,7 @@ void QGCDataPlot2D::loadRawLog(QString file, QString xAxisName, QString yAxisFil
// Postprocess log file // Postprocess log file
logFile = new QTemporaryFile("qt_qgc_temp_log.XXXXXX.csv"); logFile = new QTemporaryFile("qt_qgc_temp_log.XXXXXX.csv");
compressor = new LogCompressor(file, logFile->fileName()); compressor = new LogCompressor(file, logFile->fileName());
connect(compressor, SIGNAL(finishedFile(QString)), this, SLOT(loadFile(QString))); connect(compressor, &LogCompressor::finishedFile, this, static_cast<void (QGCDataPlot2D::*)(QString)>(&QGCDataPlot2D::loadFile));
compressor->startCompression(); compressor->startCompression();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment