Skip to content

Commit

Permalink
Removal Of Dead QT_VERSION checks
Browse files Browse the repository at this point in the history
We require Qt6, so no need for these any more.
  • Loading branch information
SimonCSmith committed Mar 7, 2023
1 parent 3c67cd0 commit fb4d5c7
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 47 deletions.
4 changes: 0 additions & 4 deletions DeepSkyStacker/About.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,7 @@ void About::storeSettings()
//
QString translatorFileName = QLatin1String("qt_");
translatorFileName += language;
#if QT_VERSION >= 0x060000
if (theQtTranslator.load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
#else
if (theQtTranslator.load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
#endif
qApp->installTranslator(&theQtTranslator);

settings.setValue("InternetCheck", m_InternetCheck);
Expand Down
4 changes: 0 additions & 4 deletions DeepSkyStacker/DarkFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#include "CFABitmapInfo.h"
#include "StackingTasks.h"

#if QT_VERSION < 0x060000
#define _USE_MATH_DEFINES
#endif

using namespace DSS;

/* ------------------------------------------------------------------- */
Expand Down
4 changes: 0 additions & 4 deletions DeepSkyStacker/DeBloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#include "BackgroundCalibration.h"
#include "Ztrace.h"

#if QT_VERSION < 0x060000
#define _USE_MATH_DEFINES
#endif

using namespace DSS;

#ifdef DSSBETA
Expand Down
11 changes: 0 additions & 11 deletions DeepSkyStacker/DeepSkyStacker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,12 +873,6 @@ int main(int argc, char* argv[])
// std::signal(SIGTERM, signalHandler);
//#endif

// High DPI support
#if QT_VERSION < 0x060000
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif

//QMfcApp app(&theApp, argc, argv);
QApplication app(argc, argv);

Expand Down Expand Up @@ -936,13 +930,8 @@ int main(int argc, char* argv[])
translatorFileName += language;
qDebug() << "qt translator filename: " << translatorFileName;

#if QT_VERSION >= 0x060000
qDebug() << "translationPath " << QLibraryInfo::path(QLibraryInfo::TranslationsPath);
if (theQtTranslator.load(translatorFileName, QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
#else
qDebug() << "translationPath " << QLibraryInfo::location(QLibraryInfo::TranslationsPath);
if (theQtTranslator.load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
#endif
{
app.installTranslator(&theQtTranslator);
}
Expand Down
3 changes: 0 additions & 3 deletions DeepSkyStacker/ImageListModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@

namespace DSS
{
#if QT_VERSION < 0x060000
constexpr auto M_PI = 3.14159265358979323846;
#endif
//
// Initial code based on https://meetingcpp.com/blog/items/an-introduction-into-qt-part-3.html
//
Expand Down
4 changes: 0 additions & 4 deletions DeepSkyStacker/RecommendedSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ bool RecommendationItem::differsFromWorkspace()
currentValue = workspace.value(keyName);
value = setting.value();

#if QT_VERSION >= 0x060000
switch (static_cast<QMetaType::Type>(value.typeId()))
#else
switch (value.type())
#endif
{
case QMetaType::Bool:
bResult = value.toBool() != currentValue.toBool();
Expand Down
4 changes: 0 additions & 4 deletions DeepSkyStacker/RegisterEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#include "TIFFUtil.h"
#include "MasterFrames.h"

#if QT_VERSION < 0x060000
#define _USE_MATH_DEFINES
#endif

/* ------------------------------------------------------------------- */

class CStarAxisInfo
Expand Down
4 changes: 0 additions & 4 deletions DeepSkyStacker/Workspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,7 @@ bool WorkspaceSettings::ReadFromString(const QString& theString)
// We need to convert it to the same type as is currently stored
//
QVariant variant(value);
#if QT_VERSION < 0x060000
QVariant::Type type = it->value().type();
#else
QMetaType type = it->value().metaType();
#endif
ZASSERT(variant.canConvert(type));
variant.convert(type);
it->setValue(variant);
Expand Down
5 changes: 0 additions & 5 deletions DeepSkyStacker/editstars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,7 @@ namespace DSS
//
// Get the mouse location and convert to image coordinates
//
#if QT_VERSION >= 0x060000
QPointF pt{ e->position() };
#else
QPointF pt{ static_cast<qreal>(e->x()),
static_cast<qreal>(e->y()) };
#endif
pt = imageView->screenToImage(pt);

if (pt.x() >= 0 && pt.x() < imageView->imageWidth() &&
Expand Down
4 changes: 0 additions & 4 deletions DeepSkyStacker/toolbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ namespace DSS
}

protected:
#if QT_VERSION < 0x060000
inline void enterEvent([[maybe_unused]] QEvent* e) override
#else
inline void enterEvent([[maybe_unused]] QEnterEvent* e) override
#endif
{
Inherited::enterEvent(e);
setOpacity(1.0, true);
Expand Down

0 comments on commit fb4d5c7

Please sign in to comment.