From bc18da54de22412ed99c4bc94bf4e0b7d299675a Mon Sep 17 00:00:00 2001 From: "U-BAMS\\philippe.renon" Date: Thu, 18 Aug 2022 21:10:51 +0200 Subject: [PATCH] gcs: fix compilation warnings --- ground/gcs/src/libs/aggregation/aggregate.h | 8 ++++---- ground/gcs/src/libs/extensionsystem/pluginmanager.cpp | 2 +- ground/gcs/src/libs/extensionsystem/pluginview.cpp | 2 +- ground/gcs/src/libs/opmapcontrol/src/core/cache.cpp | 8 ++++---- .../gcs/src/libs/opmapcontrol/src/core/urlfactory.cpp | 2 +- ground/gcs/src/libs/qwt/src/qwt_compass.cpp | 2 +- ground/gcs/src/libs/qwt/src/qwt_counter.cpp | 2 +- ground/gcs/src/libs/qwt/src/qwt_date_scale_draw.cpp | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_barchart.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_curve.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_histogram.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_intervalcurve.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_marker.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_multi_barchart.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_rasteritem.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_seriesitem.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_shapeitem.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_spectrocurve.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_spectrogram.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_svgitem.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_tradingcurve.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_plot_xml.cpp | 4 ++-- ground/gcs/src/libs/qwt/src/qwt_text.h | 2 +- ground/gcs/src/libs/qwt/src/qwt_thermo.cpp | 4 ++-- ground/gcs/src/libs/utils/welcomemodetreewidget.h | 2 +- .../antennatrack/antennatrackgadgetoptionspage.cpp | 2 +- .../src/plugins/coreplugin/dialogs/settingsdialog.cpp | 10 +++++----- .../plugins/coreplugin/dialogs/shortcutsettings.cpp | 2 +- ground/gcs/src/plugins/dial/dialgadgetwidget.cpp | 6 +++--- .../plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp | 2 +- .../src/plugins/lineardial/lineardialgadgetwidget.cpp | 2 +- ground/gcs/src/plugins/notify/notifyplugin.cpp | 2 +- ground/gcs/src/plugins/scope/scopegadgetwidget.cpp | 2 +- .../gcs/src/plugins/serialconnection/serialplugin.cpp | 2 +- .../plugins/uavobjectbrowser/uavobjecttreemodel.cpp | 2 +- .../gcs/src/plugins/uploader/uploadergadgetwidget.cpp | 2 +- .../generators/gcs/uavobjectgeneratorgcs.cpp | 7 +------ ground/uavobjgenerator/uavobjectparser.cpp | 8 ++++---- 38 files changed, 55 insertions(+), 60 deletions(-) diff --git a/ground/gcs/src/libs/aggregation/aggregate.h b/ground/gcs/src/libs/aggregation/aggregate.h index d150f2089..6386c498e 100644 --- a/ground/gcs/src/libs/aggregation/aggregate.h +++ b/ground/gcs/src/libs/aggregation/aggregate.h @@ -50,7 +50,7 @@ public: template T *component() { - QReadLocker(&lock()); + QReadLocker &lock(); foreach(QObject * component, m_components) { if (T * result = qobject_cast(component)) { return result; @@ -61,7 +61,7 @@ public: template QList components() { - QReadLocker(&lock()); + QReadLocker &lock(); QList results; foreach(QObject * component, m_components) { if (T * result = qobject_cast(component)) { @@ -99,7 +99,7 @@ template T *query(QObject *obj) } T *result = qobject_cast(obj); if (!result) { - QReadLocker(&lock()); + QReadLocker &lock(); Aggregate *parentAggregation = Aggregate::parentAggregate(obj); result = (parentAggregation ? query(parentAggregation) : 0); } @@ -120,7 +120,7 @@ template QList query_all(QObject *obj) if (!obj) { return QList(); } - QReadLocker(&lock()); + QReadLocker &lock(); Aggregate *parentAggregation = Aggregate::parentAggregate(obj); QList results; if (parentAggregation) { diff --git a/ground/gcs/src/libs/extensionsystem/pluginmanager.cpp b/ground/gcs/src/libs/extensionsystem/pluginmanager.cpp index c41a6a5ff..e66055ee5 100644 --- a/ground/gcs/src/libs/extensionsystem/pluginmanager.cpp +++ b/ground/gcs/src/libs/extensionsystem/pluginmanager.cpp @@ -730,7 +730,7 @@ void PluginManagerPrivate::readPluginPaths() } resolveDependencies(); // ensure deterministic plugin load order by sorting - qSort(pluginSpecs.begin(), pluginSpecs.end(), lessThanByPluginName); + std::sort(pluginSpecs.begin(), pluginSpecs.end(), lessThanByPluginName); emit q->pluginsChanged(); } diff --git a/ground/gcs/src/libs/extensionsystem/pluginview.cpp b/ground/gcs/src/libs/extensionsystem/pluginview.cpp index 0ee7b7734..5eb8388eb 100644 --- a/ground/gcs/src/libs/extensionsystem/pluginview.cpp +++ b/ground/gcs/src/libs/extensionsystem/pluginview.cpp @@ -129,7 +129,7 @@ void PluginView::updateList() item->setToolTip(4, QDir::toNativeSeparators(spec->filePath())); item->setIcon(0, spec->hasError() ? errorIcon : okIcon); - item->setData(0, Qt::UserRole, qVariantFromValue(spec)); + item->setData(0, Qt::UserRole, QVariant::fromValue(spec)); items.append(item); if (currPlugin == spec) { currentItem = item; diff --git a/ground/gcs/src/libs/opmapcontrol/src/core/cache.cpp b/ground/gcs/src/libs/opmapcontrol/src/core/cache.cpp index 973286cb8..24b478663 100644 --- a/ground/gcs/src/libs/opmapcontrol/src/core/cache.cpp +++ b/ground/gcs/src/libs/opmapcontrol/src/core/cache.cpp @@ -63,7 +63,7 @@ QString Cache::GetGeocoderFromCache(const QString &urlEnd) #ifdef DEBUG_GetGeocoderFromCache qDebug() << "Entered GetGeocoderFromCache"; #endif - QString ret = QString::null; + QString ret = QString(); QString filename = geoCache + QString(urlEnd) + ".geo"; #ifdef DEBUG_GetGeocoderFromCache qDebug() << "GetGeocoderFromCache: Does file exist?:" << filename; @@ -87,7 +87,7 @@ QString Cache::GetGeocoderFromCache(const QString &urlEnd) } void Cache::CacheGeocoder(const QString &urlEnd, const QString &content) { - QString ret = QString::null; + QString ret = QString(); QString filename = geoCache + QString(urlEnd) + ".geo"; #ifdef DEBUG_CACHE @@ -127,7 +127,7 @@ QString Cache::GetPlacemarkFromCache(const QString &urlEnd) #ifdef DEBUG_CACHE qDebug() << "Entered GetPlacemarkFromCache"; #endif // DEBUG_CACHE - QString ret = QString::null; + QString ret = QString(); QString filename = placemarkCache + QString(urlEnd) + ".plc"; #ifdef DEBUG_CACHE qDebug() << "GetPlacemarkFromCache: Does file exist?:" << filename; @@ -151,7 +151,7 @@ QString Cache::GetPlacemarkFromCache(const QString &urlEnd) } void Cache::CachePlacemark(const QString &urlEnd, const QString &content) { - QString ret = QString::null; + QString ret = QString(); QString filename = placemarkCache + QString(urlEnd) + ".plc"; #ifdef DEBUG_CACHE diff --git a/ground/gcs/src/libs/opmapcontrol/src/core/urlfactory.cpp b/ground/gcs/src/libs/opmapcontrol/src/core/urlfactory.cpp index 010a5aa62..a517e3e70 100644 --- a/ground/gcs/src/libs/opmapcontrol/src/core/urlfactory.cpp +++ b/ground/gcs/src/libs/opmapcontrol/src/core/urlfactory.cpp @@ -465,7 +465,7 @@ QString UrlFactory::MakeImageUrl(const MapType::Types &type, const Point &pos, c break; } - return QString::null; + return QString(); } void UrlFactory::GetSecGoogleWords(const Point &pos, QString &sec1, QString &sec2) { diff --git a/ground/gcs/src/libs/qwt/src/qwt_compass.cpp b/ground/gcs/src/libs/qwt/src/qwt_compass.cpp index 4e2c9ffdf..2445f436e 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_compass.cpp +++ b/ground/gcs/src/libs/qwt/src/qwt_compass.cpp @@ -95,7 +95,7 @@ QMap QwtCompassScaleDraw::labelMap() const label() looks in the labelMap() for a corresponding label for value or returns an null text. - \return Label, or QString::null + \return Label, or QString() \sa labelMap(), setLabelMap() */ diff --git a/ground/gcs/src/libs/qwt/src/qwt_counter.cpp b/ground/gcs/src/libs/qwt/src/qwt_counter.cpp index 31c05c8df..8d3eed46c 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_counter.cpp +++ b/ground/gcs/src/libs/qwt/src/qwt_counter.cpp @@ -155,7 +155,7 @@ void QwtCounter::setValid( bool on ) } else { - d_data->valueEdit->setText( QString::null ); + d_data->valueEdit->setText( QString() ); } } } diff --git a/ground/gcs/src/libs/qwt/src/qwt_date_scale_draw.cpp b/ground/gcs/src/libs/qwt/src/qwt_date_scale_draw.cpp index cebde7b30..7135c975d 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_date_scale_draw.cpp +++ b/ground/gcs/src/libs/qwt/src/qwt_date_scale_draw.cpp @@ -157,7 +157,7 @@ QString QwtDateScaleDraw::dateFormat( return d_data->dateFormats[ intervalType ]; } - return QString::null; + return QString(); } /*! diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_barchart.h b/ground/gcs/src/libs/qwt/src/qwt_plot_barchart.h index d47bfb972..2a5d8397e 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_barchart.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_barchart.h @@ -67,7 +67,7 @@ public: LegendBarTitles }; - explicit QwtPlotBarChart( const QString &title = QString::null ); + explicit QwtPlotBarChart( const QString &title = QString() ); explicit QwtPlotBarChart( const QwtText &title ); virtual ~QwtPlotBarChart(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_curve.h b/ground/gcs/src/libs/qwt/src/qwt_plot_curve.h index 3421abf81..e9aead6bc 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_curve.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_curve.h @@ -210,7 +210,7 @@ public: //! Paint attributes typedef QFlags PaintAttributes; - explicit QwtPlotCurve( const QString &title = QString::null ); + explicit QwtPlotCurve( const QString &title = QString() ); explicit QwtPlotCurve( const QwtText &title ); virtual ~QwtPlotCurve(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_histogram.h b/ground/gcs/src/libs/qwt/src/qwt_plot_histogram.h index b96bdddc0..90eb95c18 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_histogram.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_histogram.h @@ -76,7 +76,7 @@ public: UserStyle = 100 }; - explicit QwtPlotHistogram( const QString &title = QString::null ); + explicit QwtPlotHistogram( const QString &title = QString() ); explicit QwtPlotHistogram( const QwtText &title ); virtual ~QwtPlotHistogram(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_intervalcurve.h b/ground/gcs/src/libs/qwt/src/qwt_plot_intervalcurve.h index 624d82f1b..48b2c51c1 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_intervalcurve.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_intervalcurve.h @@ -76,7 +76,7 @@ public: //! Paint attributes typedef QFlags PaintAttributes; - explicit QwtPlotIntervalCurve( const QString &title = QString::null ); + explicit QwtPlotIntervalCurve( const QString &title = QString() ); explicit QwtPlotIntervalCurve( const QwtText &title ); virtual ~QwtPlotIntervalCurve(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_marker.h b/ground/gcs/src/libs/qwt/src/qwt_plot_marker.h index 2c726ce54..bde48fdfa 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_marker.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_marker.h @@ -68,7 +68,7 @@ public: Cross }; - explicit QwtPlotMarker( const QString &title = QString::null ); + explicit QwtPlotMarker( const QString &title = QString() ); explicit QwtPlotMarker( const QwtText &title ); virtual ~QwtPlotMarker(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_multi_barchart.h b/ground/gcs/src/libs/qwt/src/qwt_plot_multi_barchart.h index 834925522..091acbde4 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_multi_barchart.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_multi_barchart.h @@ -61,7 +61,7 @@ public: Stacked }; - explicit QwtPlotMultiBarChart( const QString &title = QString::null ); + explicit QwtPlotMultiBarChart( const QString &title = QString() ); explicit QwtPlotMultiBarChart( const QwtText &title ); virtual ~QwtPlotMultiBarChart(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_rasteritem.h b/ground/gcs/src/libs/qwt/src/qwt_plot_rasteritem.h index f411816ea..9cd46fb27 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_rasteritem.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_rasteritem.h @@ -83,7 +83,7 @@ public: //! Paint attributes typedef QFlags PaintAttributes; - explicit QwtPlotRasterItem( const QString& title = QString::null ); + explicit QwtPlotRasterItem( const QString& title = QString() ); explicit QwtPlotRasterItem( const QwtText& title ); virtual ~QwtPlotRasterItem(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_seriesitem.h b/ground/gcs/src/libs/qwt/src/qwt_plot_seriesitem.h index f58334ac0..24555081f 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_seriesitem.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_seriesitem.h @@ -23,7 +23,7 @@ class QWT_EXPORT QwtPlotSeriesItem: public QwtPlotItem, public virtual QwtAbstractSeriesStore { public: - explicit QwtPlotSeriesItem( const QString &title = QString::null ); + explicit QwtPlotSeriesItem( const QString &title = QString() ); explicit QwtPlotSeriesItem( const QwtText &title ); virtual ~QwtPlotSeriesItem(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_shapeitem.h b/ground/gcs/src/libs/qwt/src/qwt_plot_shapeitem.h index 76f78a126..4ebdccd9f 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_shapeitem.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_shapeitem.h @@ -64,7 +64,7 @@ public: LegendColor }; - explicit QwtPlotShapeItem( const QString &title = QString::null ); + explicit QwtPlotShapeItem( const QString &title = QString() ); explicit QwtPlotShapeItem( const QwtText &title ); virtual ~QwtPlotShapeItem(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_spectrocurve.h b/ground/gcs/src/libs/qwt/src/qwt_plot_spectrocurve.h index 1972c3e6e..74a7583ac 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_spectrocurve.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_spectrocurve.h @@ -35,7 +35,7 @@ public: //! Paint attributes typedef QFlags PaintAttributes; - explicit QwtPlotSpectroCurve( const QString &title = QString::null ); + explicit QwtPlotSpectroCurve( const QString &title = QString() ); explicit QwtPlotSpectroCurve( const QwtText &title ); virtual ~QwtPlotSpectroCurve(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_spectrogram.h b/ground/gcs/src/libs/qwt/src/qwt_plot_spectrogram.h index 1aa6989a6..8de2d6240 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_spectrogram.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_spectrogram.h @@ -55,7 +55,7 @@ public: //! Display modes typedef QFlags DisplayModes; - explicit QwtPlotSpectrogram( const QString &title = QString::null ); + explicit QwtPlotSpectrogram( const QString &title = QString() ); virtual ~QwtPlotSpectrogram(); void setDisplayMode( DisplayMode, bool on = true ); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_svgitem.h b/ground/gcs/src/libs/qwt/src/qwt_plot_svgitem.h index 1d98dee84..74585f4e3 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_svgitem.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_svgitem.h @@ -27,7 +27,7 @@ class QByteArray; class QWT_EXPORT QwtPlotSvgItem: public QwtPlotItem { public: - explicit QwtPlotSvgItem( const QString& title = QString::null ); + explicit QwtPlotSvgItem( const QString& title = QString() ); explicit QwtPlotSvgItem( const QwtText& title ); virtual ~QwtPlotSvgItem(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_tradingcurve.h b/ground/gcs/src/libs/qwt/src/qwt_plot_tradingcurve.h index 8a4121f5d..94f1d437a 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_tradingcurve.h +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_tradingcurve.h @@ -101,7 +101,7 @@ public: //! Paint attributes typedef QFlags PaintAttributes; - explicit QwtPlotTradingCurve( const QString &title = QString::null ); + explicit QwtPlotTradingCurve( const QString &title = QString() ); explicit QwtPlotTradingCurve( const QwtText &title ); virtual ~QwtPlotTradingCurve(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_plot_xml.cpp b/ground/gcs/src/libs/qwt/src/qwt_plot_xml.cpp index 5332a78f4..532ddc743 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_plot_xml.cpp +++ b/ground/gcs/src/libs/qwt/src/qwt_plot_xml.cpp @@ -28,7 +28,7 @@ void QwtPlot::applyProperties( const QString & /* xmlDocument */ ) This method is intended for manipulating the plot widget from a specific editor in the Qwt designer plugin. - \return QString::null + \return QString() \warning The plot editor has never been implemented. */ QString QwtPlot::grabProperties() const @@ -37,6 +37,6 @@ QString QwtPlot::grabProperties() const // Temporary dummy code, for designer tests return title().text(); #else - return QString::null; + return QString(); #endif } diff --git a/ground/gcs/src/libs/qwt/src/qwt_text.h b/ground/gcs/src/libs/qwt/src/qwt_text.h index 0d1865889..30148c70c 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_text.h +++ b/ground/gcs/src/libs/qwt/src/qwt_text.h @@ -139,7 +139,7 @@ public: //! Layout attributes typedef QFlags LayoutAttributes; - QwtText( const QString & = QString::null, + QwtText( const QString & = QString(), TextFormat textFormat = AutoText ); QwtText( const QwtText & ); ~QwtText(); diff --git a/ground/gcs/src/libs/qwt/src/qwt_thermo.cpp b/ground/gcs/src/libs/qwt/src/qwt_thermo.cpp index ab6ae807b..b568448ff 100644 --- a/ground/gcs/src/libs/qwt/src/qwt_thermo.cpp +++ b/ground/gcs/src/libs/qwt/src/qwt_thermo.cpp @@ -560,9 +560,9 @@ void QwtThermo::drawLiquid( QVector values = qwtTickList( scaleDraw()->scaleDiv() ); if ( scaleMap.isInverting() ) - qSort( values.begin(), values.end(), qGreater() ); + std::sort( values.begin(), values.end(), qGreater() ); else - qSort( values.begin(), values.end(), qLess() ); + std::sort( values.begin(), values.end(), qLess() ); int from; if ( !values.isEmpty() ) diff --git a/ground/gcs/src/libs/utils/welcomemodetreewidget.h b/ground/gcs/src/libs/utils/welcomemodetreewidget.h index 8805cf6c2..6745f56b7 100644 --- a/ground/gcs/src/libs/utils/welcomemodetreewidget.h +++ b/ground/gcs/src/libs/utils/welcomemodetreewidget.h @@ -52,7 +52,7 @@ class QTCREATOR_UTILS_EXPORT WelcomeModeTreeWidget : public QTreeWidget { public: WelcomeModeTreeWidget(QWidget *parent = 0); ~WelcomeModeTreeWidget(); - QTreeWidgetItem *addItem(const QString &label, const QString &data, const QString &toolTip = QString::null); + QTreeWidgetItem *addItem(const QString &label, const QString &data, const QString &toolTip = QString()); public slots: void slotAddNewsItem(const QString &title, const QString &description, const QString &link); diff --git a/ground/gcs/src/plugins/antennatrack/antennatrackgadgetoptionspage.cpp b/ground/gcs/src/plugins/antennatrack/antennatrackgadgetoptionspage.cpp index 56c5fbc40..c7582d8be 100644 --- a/ground/gcs/src/plugins/antennatrack/antennatrackgadgetoptionspage.cpp +++ b/ground/gcs/src/plugins/antennatrack/antennatrackgadgetoptionspage.cpp @@ -54,7 +54,7 @@ QWidget *AntennaTrackGadgetOptionsPage::createPage(QWidget *parent) // PORTS QList ports = QSerialPortInfo::availablePorts(); - qSort(ports.begin(), ports.end(), sortPorts); + std::sort(ports.begin(), ports.end(), sortPorts); foreach(QSerialPortInfo port, ports) { qDebug() << "Adding port: " << port.systemLocation() << " (" << port.portName() << ")"; options_page->portComboBox->addItem(port.portName(), port.portName()); diff --git a/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp index b09cc54d9..5740629c8 100644 --- a/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp +++ b/ground/gcs/src/plugins/coreplugin/dialogs/settingsdialog.cpp @@ -168,10 +168,10 @@ Q_DECLARE_METATYPE(::PageData) SettingsDialog::SettingsDialog(QWidget *parent, c // the plugin options page list is sorted by untranslated category and names // this is done to facilitate access to the language settings when GCS is not running in a language understood by the user. - qStableSort(pluginPages.begin(), pluginPages.end(), compareOptionsPageByCategoryAndId); + std::stable_sort(pluginPages.begin(), pluginPages.end(), compareOptionsPageByCategoryAndId); // the plugin options page list is sorted by translated names - qStableSort(gadgetPages.begin(), gadgetPages.end(), compareOptionsPageByCategoryAndNameTr); + std::stable_sort(gadgetPages.begin(), gadgetPages.end(), compareOptionsPageByCategoryAndNameTr); // will hold the initially selected item if any QTreeWidgetItem *initialItem = 0; @@ -256,12 +256,12 @@ QTreeWidgetItem *SettingsDialog::addPage(IOptionsPage *page) categoryItem = new QTreeWidgetItem(pageTree); categoryItem->setIcon(0, page->icon()); categoryItem->setText(0, page->trCategory()); - categoryItem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + categoryItem->setData(0, Qt::UserRole, QVariant::fromValue(pageData)); } QTreeWidgetItem *item = new QTreeWidgetItem(categoryItem); item->setText(0, page->trName()); - item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + item->setData(0, Qt::UserRole, QVariant::fromValue(pageData)); switch (categoryItemList->size()) { case 0: @@ -390,7 +390,7 @@ void SettingsDialog::insertPage(IOptionsPage *page) QTreeWidgetItem *item = new QTreeWidgetItem; item->setText(0, page->trName()); - item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + item->setData(0, Qt::UserRole, QVariant::fromValue(pageData)); categoryItem->addChild(item); categoryItemList->append(item); diff --git a/ground/gcs/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/ground/gcs/src/plugins/coreplugin/dialogs/shortcutsettings.cpp index 1ab59ee53..b6f84ffcf 100644 --- a/ground/gcs/src/plugins/coreplugin/dialogs/shortcutsettings.cpp +++ b/ground/gcs/src/plugins/coreplugin/dialogs/shortcutsettings.cpp @@ -318,7 +318,7 @@ void ShortcutSettings::initialize() } item->setText(2, s->m_key.toString()); - item->setData(0, Qt::UserRole, qVariantFromValue(s)); + item->setData(0, Qt::UserRole, QVariant::fromValue(s)); } } diff --git a/ground/gcs/src/plugins/dial/dialgadgetwidget.cpp b/ground/gcs/src/plugins/dial/dialgadgetwidget.cpp index ac7f9e46b..9b6ddfafc 100644 --- a/ground/gcs/src/plugins/dial/dialgadgetwidget.cpp +++ b/ground/gcs/src/plugins/dial/dialgadgetwidget.cpp @@ -108,7 +108,7 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1, // qDebug() << "Connected Object 1 (" << object1 << ")."; connect(obj1, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle1(UAVObject *))); if (nfield1.contains("-")) { - QStringList fieldSubfield = nfield1.split("-", QString::SkipEmptyParts); + QStringList fieldSubfield = nfield1.split("-", Qt::SkipEmptyParts); field1 = fieldSubfield.at(0); subfield1 = fieldSubfield.at(1); haveSubField1 = true; @@ -128,7 +128,7 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1, // qDebug() << "Connected Object 2 (" << object2 << ")."; connect(obj2, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle2(UAVObject *))); if (nfield2.contains("-")) { - QStringList fieldSubfield = nfield2.split("-", QString::SkipEmptyParts); + QStringList fieldSubfield = nfield2.split("-", Qt::SkipEmptyParts); field2 = fieldSubfield.at(0); subfield2 = fieldSubfield.at(1); haveSubField2 = true; @@ -148,7 +148,7 @@ void DialGadgetWidget::connectNeedles(QString object1, QString nfield1, // qDebug() << "Connected Object 3 (" << object3 << ")."; connect(obj3, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateNeedle3(UAVObject *))); if (nfield3.contains("-")) { - QStringList fieldSubfield = nfield3.split("-", QString::SkipEmptyParts); + QStringList fieldSubfield = nfield3.split("-", Qt::SkipEmptyParts); field3 = fieldSubfield.at(0); subfield3 = fieldSubfield.at(1); haveSubField3 = true; diff --git a/ground/gcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp b/ground/gcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp index 2d5681b4f..a6820a25f 100644 --- a/ground/gcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp +++ b/ground/gcs/src/plugins/gpsdisplay/gpsdisplaygadgetoptionspage.cpp @@ -55,7 +55,7 @@ QWidget *GpsDisplayGadgetOptionsPage::createPage(QWidget *parent) // PORTS QList ports = QSerialPortInfo::availablePorts(); - qSort(ports.begin(), ports.end(), sortPorts); + std::sort(ports.begin(), ports.end(), sortPorts); foreach(QSerialPortInfo port, ports) { qDebug() << "Adding port: " << port.systemLocation() << " (" << port.portName() << ")"; options_page->portComboBox->addItem(port.portName(), port.portName()); diff --git a/ground/gcs/src/plugins/lineardial/lineardialgadgetwidget.cpp b/ground/gcs/src/plugins/lineardial/lineardialgadgetwidget.cpp index 9bfb4a84f..18e510887 100644 --- a/ground/gcs/src/plugins/lineardial/lineardialgadgetwidget.cpp +++ b/ground/gcs/src/plugins/lineardial/lineardialgadgetwidget.cpp @@ -91,7 +91,7 @@ void LineardialGadgetWidget::connectInput(QString object1, QString nfield1) if (obj1 != NULL) { connect(obj1, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateIndex(UAVObject *))); if (nfield1.contains("-")) { - QStringList fieldSubfield = nfield1.split("-", QString::SkipEmptyParts); + QStringList fieldSubfield = nfield1.split("-", Qt::SkipEmptyParts); field1 = fieldSubfield.at(0); subfield1 = fieldSubfield.at(1); haveSubField1 = true; diff --git a/ground/gcs/src/plugins/notify/notifyplugin.cpp b/ground/gcs/src/plugins/notify/notifyplugin.cpp index 5119d83ca..8c5920e04 100644 --- a/ground/gcs/src/plugins/notify/notifyplugin.cpp +++ b/ground/gcs/src/plugins/notify/notifyplugin.cpp @@ -460,7 +460,7 @@ void SoundNotifyPlugin::checkNotificationRule(NotificationItem *notification, UA qNotifyDebug() << "add to pending list - " << notification->toString(); // if audio is busy, start expiration timer // ms = (notification->getExpiredTimeout()[in sec])*1000 - // QxtTimer::singleShot(notification->getExpireTimeout()*1000, this, SLOT(expirationTimerHandler(NotificationItem*)), qVariantFromValue(notification)); + // QxtTimer::singleShot(notification->getExpireTimeout()*1000, this, SLOT(expirationTimerHandler(NotificationItem*)), QVariant::fromValue(notification)); _pendingNotifications.append(notification); notification->startExpireTimer(); connect(notification->getExpireTimer(), SIGNAL(timeout()), diff --git a/ground/gcs/src/plugins/scope/scopegadgetwidget.cpp b/ground/gcs/src/plugins/scope/scopegadgetwidget.cpp index 09974e6a7..6eacaa82c 100644 --- a/ground/gcs/src/plugins/scope/scopegadgetwidget.cpp +++ b/ground/gcs/src/plugins/scope/scopegadgetwidget.cpp @@ -355,7 +355,7 @@ void ScopeGadgetWidget::addCurvePlot(QString objectName, QString fieldPlusSubFie int element = 0; if (fieldPlusSubField.contains("-")) { - QStringList fieldSubfield = fieldName.split("-", QString::SkipEmptyParts); + QStringList fieldSubfield = fieldName.split("-", Qt::SkipEmptyParts); fieldName = fieldSubfield.at(0); elementName = fieldSubfield.at(1); } diff --git a/ground/gcs/src/plugins/serialconnection/serialplugin.cpp b/ground/gcs/src/plugins/serialconnection/serialplugin.cpp index d4155e906..29adff92a 100644 --- a/ground/gcs/src/plugins/serialconnection/serialplugin.cpp +++ b/ground/gcs/src/plugins/serialconnection/serialplugin.cpp @@ -137,7 +137,7 @@ QList SerialConnection::availableDevices() QList ports = availablePorts(); // sort the list by port number (nice idea from PT_Dreamer :)) - qSort(ports.begin(), ports.end(), sortPorts); + std::sort(ports.begin(), ports.end(), sortPorts); foreach(QSerialPortInfo port, ports) { device d; diff --git a/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp b/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp index cb7b6d335..c058c6e10 100644 --- a/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp +++ b/ground/gcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp @@ -606,7 +606,7 @@ QVariant UAVObjectTreeModel::data(const QModelIndex &index, int role) const case Qt::UserRole: // UserRole gives access to TreeItem // cast to void* is necessary - return qVariantFromValue((void *)item); + return QVariant::fromValue((void *)item); default: return QVariant(); diff --git a/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp index bfecfc154..0d1332b4b 100644 --- a/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/gcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -206,7 +206,7 @@ void UploaderGadgetWidget::getSerialPorts() QList ports = QSerialPortInfo::availablePorts(); // sort the list by port number (nice idea from PT_Dreamer :)) - qSort(ports.begin(), ports.end(), sortPorts); + std::sort(ports.begin(), ports.end(), sortPorts); foreach(QSerialPortInfo port, ports) { list.append(port.portName()); } diff --git a/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp b/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp index 4c3dfbf94..f6492b051 100644 --- a/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp +++ b/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp @@ -76,7 +76,7 @@ struct Context { struct FieldContext { FieldContext(FieldInfo *fieldInfo, ObjectInfo *object); - FieldContext(const FieldContext &fieldContext); + FieldContext(const FieldContext &fieldContext) = default; FieldInfo *field; // field @@ -617,11 +617,6 @@ bool UAVObjectGeneratorGCS::generate(UAVObjectParser *parser, QString templatepa return true; } -FieldContext::FieldContext(const FieldContext &fieldContext) -{ - *this = fieldContext; -} - FieldContext::FieldContext(FieldInfo *fieldInfo, ObjectInfo *object) { field = fieldInfo; diff --git a/ground/uavobjgenerator/uavobjectparser.cpp b/ground/uavobjgenerator/uavobjectparser.cpp index ef9b9cd97..1379ff950 100644 --- a/ground/uavobjgenerator/uavobjectparser.cpp +++ b/ground/uavobjgenerator/uavobjectparser.cpp @@ -223,7 +223,7 @@ QString UAVObjectParser::parseXML(QString & xml, QString & filename) } // Sort all fields according to size - qStableSort(info->fields.begin(), info->fields.end(), fieldTypeLessThan); + std::stable_sort(info->fields.begin(), info->fields.end(), fieldTypeLessThan); // Make sure that required elements were found if (!fieldFound) { @@ -528,7 +528,7 @@ QString UAVObjectParser::processObjectFields(QDomNode & childNode, ObjectInfo *i return QString("Object:field:elementnames attribute is not allowed for cloned fields"); } // Get element names - QStringList names = elemAttr.nodeValue().split(",", QString::SkipEmptyParts); + QStringList names = elemAttr.nodeValue().split(",", Qt::SkipEmptyParts); for (int n = 0; n < names.length(); ++n) { names[n] = names[n].trimmed(); } @@ -581,7 +581,7 @@ QString UAVObjectParser::processObjectFields(QDomNode & childNode, ObjectInfo *i QStringList options; elemAttr = elemAttributes.namedItem("options"); if (!elemAttr.isNull()) { - options = elemAttr.nodeValue().split(",", QString::SkipEmptyParts); + options = elemAttr.nodeValue().split(",", Qt::SkipEmptyParts); for (int n = 0; n < options.length(); ++n) { options[n] = options[n].trimmed(); } @@ -623,7 +623,7 @@ QString UAVObjectParser::processObjectFields(QDomNode & childNode, ObjectInfo *i // Get the default value attribute (required for settings objects, optional for the rest) elemAttr = elemAttributes.namedItem("defaultvalue"); if (!elemAttr.isNull()) { - QStringList defaults = elemAttr.nodeValue().split(",", QString::SkipEmptyParts); + QStringList defaults = elemAttr.nodeValue().split(",", Qt::SkipEmptyParts); for (int n = 0; n < defaults.length(); ++n) { defaults[n] = defaults[n].trimmed(); }