[qt] Don't use deprecated Qt features

pull/681/head
Hleb Valoshka 2020-03-29 09:34:35 +03:00
parent a325973907
commit 04c187d776
3 changed files with 7 additions and 3 deletions

View File

@ -14,7 +14,7 @@
#define _QTEVENTFINDER_H_
#include <QDockWidget>
#include <QTime>
#include <QElapsedTimer>
#include <celestia/eclipsefinder.h>
class QTreeView;
@ -66,7 +66,7 @@ class EventFinder : public QDockWidget, EclipseFinderWatcher
double searchSpan{ 0.0 };
double lastProgressUpdate{ 0.0 };
QTime searchTimer;
QElapsedTimer searchTimer;
const Eclipse* activeEclipse{ nullptr };
};

View File

@ -317,7 +317,11 @@ static QSet<QString> listTextures(QDir& dir)
filters << "*.png" << "*.jpg" << "*.dds" << "*.dxt5nm";
QStringList textureFileNames = dir.entryList(filters, QDir::Files);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
return QSet<QString>(textureFileNames.begin(), textureFileNames.end());
#else
return QSet<QString>::fromList(textureFileNames);
#endif
}
void

View File

@ -361,7 +361,7 @@ MainWindow::buildTxf(const QFont& font, QDataStream& out, int texWidth, int texH
out << (quint16) info.ch.unicode();
out << (quint8) (bounds.width() + 2) << (quint8) (bounds.height() + 2);
out << (qint8) bounds.left() << (qint8) (-bounds.bottom());
#if QT_VERSION >= 0x051100
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
out << (qint8) fm.horizontalAdvance(info.ch);
#else
out << (qint8) fm.width(info.ch);