mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cleanup: replace deprecated methods
Sadly the replacements are new in Qt6. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
300248f446
commit
2ede1a4563
2 changed files with 8 additions and 0 deletions
|
@ -83,8 +83,12 @@ void init_qt_late()
|
||||||
QString translationLocation;
|
QString translationLocation;
|
||||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
|
||||||
translationLocation = QLatin1String(":/");
|
translationLocation = QLatin1String(":/");
|
||||||
|
#else
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
translationLocation = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
|
||||||
#else
|
#else
|
||||||
translationLocation = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
translationLocation = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if (uiLang != "en_US" && uiLang != "en-US") {
|
if (uiLang != "en_US" && uiLang != "en-US") {
|
||||||
if (qtTranslator.load(loc, "qtbase", "_", translationLocation) ||
|
if (qtTranslator.load(loc, "qtbase", "_", translationLocation) ||
|
||||||
|
|
|
@ -20,7 +20,11 @@ void qPrefPrivate::propSetValue(const QString &key, const QVariant &value, const
|
||||||
{
|
{
|
||||||
QSettings s;
|
QSettings s;
|
||||||
bool isDefault = false;
|
bool isDefault = false;
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
if (value.isValid() && value.typeId() == QMetaType::Double)
|
||||||
|
#else
|
||||||
if (value.isValid() && value.type() == QVariant::Double)
|
if (value.isValid() && value.type() == QVariant::Double)
|
||||||
|
#endif
|
||||||
isDefault = IS_FP_SAME(value.toDouble(), defaultValue.toDouble());
|
isDefault = IS_FP_SAME(value.toDouble(), defaultValue.toDouble());
|
||||||
else
|
else
|
||||||
isDefault = (value == defaultValue);
|
isDefault = (value == defaultValue);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue