diff --git a/kstars/ekos/align/align.cpp b/kstars/ekos/align/align.cpp --- a/kstars/ekos/align/align.cpp +++ b/kstars/ekos/align/align.cpp @@ -1039,7 +1039,7 @@ boxNames.sort(Qt::CaseInsensitive); boxNames.removeDuplicates(); greekBoxNames.removeDuplicates(); - qSort(greekBoxNames.begin(), greekBoxNames.end(), [](const QString & a, const QString & b) + std::sort(greekBoxNames.begin(), greekBoxNames.end(), [](const QString & a, const QString & b) { QStringList aParts = a.split(' '); QStringList bParts = b.split(' '); diff --git a/kstars/ekos/guide/internalguide/internalguider.cpp b/kstars/ekos/guide/internalguide/internalguider.cpp --- a/kstars/ekos/guide/internalguide/internalguider.cpp +++ b/kstars/ekos/guide/internalguide/internalguider.cpp @@ -1190,9 +1190,9 @@ useNativeDetection = true; // For SEP, prefer flux total if (Options::guideAlgorithm() == SEP_THRESHOLD) - qSort(starCenters.begin(), starCenters.end(), [](const Edge *a, const Edge *b) { return a->val > b->val; }); + std::sort(starCenters.begin(), starCenters.end(), [](const Edge *a, const Edge *b) { return a->val > b->val; }); else - qSort(starCenters.begin(), starCenters.end(), [](const Edge *a, const Edge *b) { return a->width > b->width; }); + std::sort(starCenters.begin(), starCenters.end(), [](const Edge *a, const Edge *b) { return a->width > b->width; }); guideFrame->setStarsEnabled(true); guideFrame->updateFrame(); diff --git a/kstars/ekos/scheduler/scheduler.cpp b/kstars/ekos/scheduler/scheduler.cpp --- a/kstars/ekos/scheduler/scheduler.cpp +++ b/kstars/ekos/scheduler/scheduler.cpp @@ -1123,7 +1123,11 @@ return; /* Swap jobs in the list */ + #if QT_VERSION >= QT_VERSION_CHECK(5,13,0) + jobs.swapItemsAt(currentRow, destinationRow); + #else jobs.swap(currentRow, destinationRow); + #endif /* Reassign status cells */ setJobStatusCells(currentRow); @@ -1158,7 +1162,11 @@ return; /* Swap jobs in the list */ + #if QT_VERSION >= QT_VERSION_CHECK(5,13,0) + jobs.swapItemsAt(currentRow, destinationRow); + #else jobs.swap(currentRow, destinationRow); + #endif /* Reassign status cells */ setJobStatusCells(currentRow); diff --git a/kstars/hips/hipsmanager.cpp b/kstars/hips/hipsmanager.cpp --- a/kstars/hips/hipsmanager.cpp +++ b/kstars/hips/hipsmanager.cpp @@ -387,7 +387,12 @@ Q_ASSERT(item); Q_ASSERT(item->image); + #if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + int cost = item->image->sizeInBytes(); + #else int cost = item->image->byteCount(); + #endif + m_cache.add(key, item, cost); } diff --git a/kstars/hips/hipsrenderer.cpp b/kstars/hips/hipsrenderer.cpp --- a/kstars/hips/hipsrenderer.cpp +++ b/kstars/hips/hipsrenderer.cpp @@ -164,7 +164,12 @@ if (image) { m_rendered++; + + #if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + m_size += image->sizeInBytes(); + #else m_size += image->byteCount(); + #endif // UV Mapping to apply image unto the destination image // 4x4 = 16 points are mapped from the source image unto the destination image. diff --git a/kstars/skyqpainter.cpp b/kstars/skyqpainter.cpp --- a/kstars/skyqpainter.cpp +++ b/kstars/skyqpainter.cpp @@ -910,7 +910,13 @@ save(); QFont f = font(); const QString qMark = " ? "; + + #if QT_VERSION >= QT_VERSION_CHECK(5,11,0) + double scaleFactor = 0.8 * size / fontMetrics().horizontalAdvance(qMark); + #else double scaleFactor = 0.8 * size / fontMetrics().width(qMark); + #endif + f.setPointSizeF(f.pointSizeF() * scaleFactor); setFont(f); translate(x, y); diff --git a/kstars/tools/scriptbuilder.cpp b/kstars/tools/scriptbuilder.cpp --- a/kstars/tools/scriptbuilder.cpp +++ b/kstars/tools/scriptbuilder.cpp @@ -89,7 +89,12 @@ { child->setExpanded(true); + #if QT_VERSION >= QT_VERSION_CHECK(5,11,0) + int w = qfm.horizontalAdvance(child->text(icol)) + 4; + #else int w = qfm.width(child->text(icol)) + 4; + #endif + if (icol == 0) { w += 2 * optionsList()->indentation(); diff --git a/kstars/widgets/infoboxwidget.cpp b/kstars/widgets/infoboxwidget.cpp --- a/kstars/widgets/infoboxwidget.cpp +++ b/kstars/widgets/infoboxwidget.cpp @@ -61,8 +61,14 @@ { QFontMetrics fm(font()); int w = 0; - foreach (const QString &str, m_strings) + foreach (const QString &str, m_strings) { + #if QT_VERSION >= QT_VERSION_CHECK(5,11,0) + w = qMax(w, fm.horizontalAdvance(str)); + #else w = qMax(w, fm.width(str)); + #endif + } + int h = fm.height() * (m_shaded ? 1 : m_strings.size()); // Add padding resize(w + 2 * padX, h + 2 * padY + 2); diff --git a/kstars/widgets/timespinbox.cpp b/kstars/widgets/timespinbox.cpp --- a/kstars/widgets/timespinbox.cpp +++ b/kstars/widgets/timespinbox.cpp @@ -56,7 +56,12 @@ uint wmax = 0; for (int i = 0; i < maximum(); ++i) { + #if QT_VERSION >= QT_VERSION_CHECK(5,11,0) + uint w = fm.horizontalAdvance('-' + TimeString[i]); + #else uint w = fm.width('-' + TimeString[i]); + #endif + if (w > wmax) wmax = w; }