diff --git a/src/AnalyzeView/ULogParser.cc b/src/AnalyzeView/ULogParser.cc index d6b7f365eefee50535fe47c5b8938ee920c77cc4..f3a384c285ca8e0a5cd3e4bd1db6d4ff110d900f 100644 --- a/src/AnalyzeView/ULogParser.cc +++ b/src/AnalyzeView/ULogParser.cc @@ -57,7 +57,7 @@ QString ULogParser::extractArraySize(QString &typeNameFull, int &arraySize) return typeNameFull; } - arraySize = typeNameFull.mid(startPos + 1, endPos - startPos - 1).toInt(); + arraySize = typeNameFull.midRef(startPos + 1, endPos - startPos - 1).toInt(); return typeNameFull.mid(0, startPos); } diff --git a/src/FollowMe/FollowMe.cc b/src/FollowMe/FollowMe.cc index e7f4593c127f747b7363520fd6b98a132ee82794..750598980b3eaf325c86bd1ae58f6bd3045b6b33 100644 --- a/src/FollowMe/FollowMe.cc +++ b/src/FollowMe/FollowMe.cc @@ -84,9 +84,9 @@ void FollowMe::_settingsChanged() void FollowMe::_enable() { connect(_toolbox->qgcPositionManager(), - SIGNAL(positionInfoUpdated(QGeoPositionInfo)), + &QGCPositionManager::positionInfoUpdated, this, - SLOT(_setGPSLocation(QGeoPositionInfo))); + &FollowMe::_setGPSLocation); _gcsMotionReportTimer.setInterval(_toolbox->qgcPositionManager()->updateInterval()); _gcsMotionReportTimer.start(); } @@ -94,9 +94,9 @@ void FollowMe::_enable() void FollowMe::_disable() { disconnect(_toolbox->qgcPositionManager(), - SIGNAL(positionInfoUpdated(QGeoPositionInfo)), + &QGCPositionManager::positionInfoUpdated, this, - SLOT(_setGPSLocation(QGeoPositionInfo))); + &FollowMe::_setGPSLocation); _gcsMotionReportTimer.stop(); } diff --git a/src/QtLocationPlugin/QGCMapEngine.cpp b/src/QtLocationPlugin/QGCMapEngine.cpp index fcd219fbd32954e31f46bd14b29aa9f1a7e92f4d..fe64539d25fc0b8cdb3091d5c9fe7b1a439eae43 100644 --- a/src/QtLocationPlugin/QGCMapEngine.cpp +++ b/src/QtLocationPlugin/QGCMapEngine.cpp @@ -187,13 +187,13 @@ QGCMapEngine::_wipeOldCaches() #ifdef __mobile__ oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache55"); #else - oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/QGCMapCache55"); + oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/QGCMapCache55"); #endif _checkWipeDirectory(oldCacheDir); #ifdef __mobile__ oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache100"); #else - oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/QGCMapCache100"); + oldCacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/QGCMapCache100"); #endif _checkWipeDirectory(oldCacheDir); } @@ -208,11 +208,11 @@ QGCMapEngine::init() #ifdef __mobile__ QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QLatin1String("/QGCMapCache" CACHE_PATH_VERSION); #else - QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("/QGCMapCache" CACHE_PATH_VERSION); + QString cacheDir = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QStringLiteral("/QGCMapCache" CACHE_PATH_VERSION); #endif if(!QDir::root().mkpath(cacheDir)) { qWarning() << "Could not create mapping disk cache directory: " << cacheDir; - cacheDir = QDir::homePath() + QLatin1String("/.qgcmapscache/"); + cacheDir = QDir::homePath() + QStringLiteral("/.qgcmapscache/"); if(!QDir::root().mkpath(cacheDir)) { qWarning() << "Could not create mapping disk cache directory: " << cacheDir; cacheDir.clear(); diff --git a/src/QtLocationPlugin/QGCTileCacheWorker.cpp b/src/QtLocationPlugin/QGCTileCacheWorker.cpp index 0f847311dacce3841cb7e0bc1d45e9cd25978b87..0fdf19f956a566c539a74484bc2b1fec02293020 100644 --- a/src/QtLocationPlugin/QGCTileCacheWorker.cpp +++ b/src/QtLocationPlugin/QGCTileCacheWorker.cpp @@ -30,8 +30,8 @@ #include "time.h" const char* kDefaultSet = "Default Tile Set"; -const QString kSession = QLatin1String("QGeoTileWorkerSession"); -const QString kExportSession = QLatin1String("QGeoTileExportSession"); +const QString kSession = QStringLiteral("QGeoTileWorkerSession"); +const QString kExportSession = QStringLiteral("QGeoTileExportSession"); QGC_LOGGING_CATEGORY(QGCTileCacheLog, "QGCTileCacheLog") diff --git a/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp b/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp index ff54955c77f10d4a6279824afba688f5447ccebd..546538f6e03c3e662a719afd745511ad07385a98 100644 --- a/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp +++ b/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp @@ -158,7 +158,7 @@ JasonMonger kMonger; QGeoCodeReplyQGC::QGeoCodeReplyQGC(QNetworkReply *reply, QObject *parent) : QGeoCodeReply(parent), m_reply(reply) { - connect(m_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); + connect(m_reply, &QNetworkReply::finished, this, &QGeoCodeReplyQGC::networkReplyFinished); connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(networkReplyError(QNetworkReply::NetworkError))); diff --git a/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp b/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp index 2e3b6409f2126690aaf2a0a0947debfe3c3f0e40..f020c88b75ee99bace986ecb1f6c8f4db2af6466 100644 --- a/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp +++ b/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp @@ -125,7 +125,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::geocode(const QString &address, int l QGeoCodeReplyQGC *geocodeReply = new QGeoCodeReplyQGC(reply); - connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(geocodeReply, &QGeoCodeReply::finished, this, &QGeoCodingManagerEngineQGC::replyFinished); connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)), this, SLOT(replyError(QGeoCodeReply::Error,QString))); @@ -156,7 +156,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::reverseGeocode(const QGeoCoordinate & QGeoCodeReplyQGC *geocodeReply = new QGeoCodeReplyQGC(reply); - connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(geocodeReply, &QGeoCodeReply::finished, this, &QGeoCodingManagerEngineQGC::replyFinished); connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)), this, SLOT(replyError(QGeoCodeReply::Error,QString))); diff --git a/src/QtLocationPlugin/QGeoMapReplyQGC.cpp b/src/QtLocationPlugin/QGeoMapReplyQGC.cpp index eaee21fc02da06db6a80ccc0cab858ffc2b27257..31d9b14761217e25c16bdbb649da866dd4f086c6 100644 --- a/src/QtLocationPlugin/QGeoMapReplyQGC.cpp +++ b/src/QtLocationPlugin/QGeoMapReplyQGC.cpp @@ -189,7 +189,7 @@ QGeoTiledMapReplyQGC::cacheError(QGCMapTask::TaskType type, QString /*errorStrin #endif _reply = _networkManager->get(_request); _reply->setParent(0); - connect(_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); + connect(_reply, &QNetworkReply::finished, this, &QGeoTiledMapReplyQGC::networkReplyFinished); connect(_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(networkReplyError(QNetworkReply::NetworkError))); #if !defined(__mobile__) _networkManager->setProxy(proxy); diff --git a/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp b/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp index 5a41dfeb56c6af590c72d836e567809262d58ded..a3456b9ea4a9726ae95292b1d083af2e08951feb 100644 --- a/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp +++ b/src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp @@ -216,7 +216,7 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap ¶meters) if(!QFileInfo(cacheDir).exists()) { if(!QDir::root().mkpath(cacheDir)) { qWarning() << "Could not create mapping disk cache directory: " << cacheDir; - cacheDir = QDir::homePath() + QLatin1String("/.qgcmapscache/"); + cacheDir = QDir::homePath() + QStringLiteral("/.qgcmapscache/"); } } } diff --git a/src/VideoStreaming/VideoStreaming.cc b/src/VideoStreaming/VideoStreaming.cc index d7ec9a912bdc005d34f3e4e7cc7ed7efad88be98..9fe2e0d96eb4e63992d4d7f5974d2446df5abccc 100644 --- a/src/VideoStreaming/VideoStreaming.cc +++ b/src/VideoStreaming/VideoStreaming.cc @@ -159,7 +159,7 @@ void initializeVideoStreaming(int &argc, char* argv[], char* logpath, char* debu Q_UNUSED(debuglevel); #endif qmlRegisterType ("QGroundControl.QgcQtGStreamer", 1, 0, "VideoItem"); - qmlRegisterUncreatableType("QGroundControl.QgcQtGStreamer", 1, 0, "VideoSurface", QLatin1String("VideoSurface from QML is not supported")); + qmlRegisterUncreatableType("QGroundControl.QgcQtGStreamer", 1, 0, "VideoSurface", QStringLiteral("VideoSurface from QML is not supported")); } void shutdownVideoStreaming() diff --git a/src/VideoStreaming/gstqtvideosink/painters/openglsurfacepainter.cpp b/src/VideoStreaming/gstqtvideosink/painters/openglsurfacepainter.cpp index dbdad9ba3db5512a37c2d7f57997a515c393c84b..91921e9ca8475c1b41ed6dbd49f3b846fc5d3207 100644 --- a/src/VideoStreaming/gstqtvideosink/painters/openglsurfacepainter.cpp +++ b/src/VideoStreaming/gstqtvideosink/painters/openglsurfacepainter.cpp @@ -60,7 +60,7 @@ OpenGLSurfacePainter::OpenGLSurfacePainter() , m_videoColorMatrix(GST_VIDEO_COLOR_MATRIX_UNKNOWN) { #ifndef QT_OPENGL_ES - glActiveTexture = (_glActiveTexture) QGLContext::currentContext()->getProcAddress(QLatin1String("glActiveTexture")); + glActiveTexture = (_glActiveTexture) QGLContext::currentContext()->getProcAddress(QStringLiteral("glActiveTexture")); #endif } @@ -397,11 +397,11 @@ ArbFpSurfacePainter::ArbFpSurfacePainter() , m_programId(0) { const QGLContext *context = QGLContext::currentContext(); - glProgramStringARB = (_glProgramStringARB) context->getProcAddress(QLatin1String("glProgramStringARB")); - glBindProgramARB = (_glBindProgramARB) context->getProcAddress(QLatin1String("glBindProgramARB")); - glDeleteProgramsARB = (_glDeleteProgramsARB) context->getProcAddress(QLatin1String("glDeleteProgramsARB")); - glGenProgramsARB = (_glGenProgramsARB) context->getProcAddress(QLatin1String("glGenProgramsARB")); - glProgramLocalParameter4fARB = (_glProgramLocalParameter4fARB) context->getProcAddress(QLatin1String("glProgramLocalParameter4fARB")); + glProgramStringARB = (_glProgramStringARB) context->getProcAddress(QStringLiteral("glProgramStringARB")); + glBindProgramARB = (_glBindProgramARB) context->getProcAddress(QStringLiteral("glBindProgramARB")); + glDeleteProgramsARB = (_glDeleteProgramsARB) context->getProcAddress(QStringLiteral("glDeleteProgramsARB")); + glGenProgramsARB = (_glGenProgramsARB) context->getProcAddress(QStringLiteral("glGenProgramsARB")); + glProgramLocalParameter4fARB = (_glProgramLocalParameter4fARB) context->getProcAddress(QStringLiteral("glProgramLocalParameter4fARB")); } void ArbFpSurfacePainter::init(const BufferFormat &format) diff --git a/src/qgcunittest/TCPLinkTest.cc b/src/qgcunittest/TCPLinkTest.cc index 996951eaf4896760f0839d562227c6e3ecaf7c19..92b5303c470c8f50cbd67ab1f09401a27e04be85 100644 --- a/src/qgcunittest/TCPLinkTest.cc +++ b/src/qgcunittest/TCPLinkTest.cc @@ -130,7 +130,7 @@ void TCPLinkTest::_connectSucceed_test(void) // We emit this signal such that it will be queued and run on the TCPLink thread. This in turn // allows the TCPLink object to pump the bytes through. - connect(this, SIGNAL(waitForBytesWritten(int)), _link, SLOT(waitForBytesWritten(int))); + connect(this, &TCPLinkTest::waitForBytesWritten, _link, &TCPLink::waitForBytesWritten); emit waitForBytesWritten(1000); // Check for loopback, both from signal received and actual bytes returned diff --git a/src/qgcunittest/TCPLoopBackServer.cc b/src/qgcunittest/TCPLoopBackServer.cc index f9183627d34bb4bd268064f05977ea0dbf0be1e9..b7e64e9bc84587d9cd0fd560ce4b0444e4415516 100644 --- a/src/qgcunittest/TCPLoopBackServer.cc +++ b/src/qgcunittest/TCPLoopBackServer.cc @@ -30,7 +30,7 @@ void TCPLoopBackServer::run(void) _tcpServer = new QTcpServer(this); Q_CHECK_PTR(_tcpServer); - bool connected = QObject::connect(_tcpServer, SIGNAL(newConnection()), this, SLOT(_newConnection())); + bool connected = QObject::connect(_tcpServer, &QTcpServer::newConnection, this, &TCPLoopBackServer::_newConnection); Q_ASSERT(connected); Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds @@ -45,7 +45,7 @@ void TCPLoopBackServer::_newConnection(void) Q_ASSERT(_tcpServer); _tcpSocket = _tcpServer->nextPendingConnection(); Q_ASSERT(_tcpSocket); - bool connected = QObject::connect(_tcpSocket, SIGNAL(readyRead()), this, SLOT(_readBytes())); + bool connected = QObject::connect(_tcpSocket, &QIODevice::readyRead, this, &TCPLoopBackServer::_readBytes); Q_ASSERT(connected); Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds } diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 9fa3240ba948b203d0e328f31a28a93134b9f5ed..d04a82a377c8a9ef6af500a9f0ed514dae50c97f 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -152,7 +152,7 @@ MainWindow::MainWindow() // Image provider QQuickImageProvider* pImgProvider = dynamic_cast(qgcApp()->toolbox()->imageProvider()); - _mainQmlWidgetHolder->getEngine()->addImageProvider(QLatin1String("QGCImages"), pImgProvider); + _mainQmlWidgetHolder->getEngine()->addImageProvider(QStringLiteral("QGCImages"), pImgProvider); // Set dock options setDockOptions(0);