[Base] Remove deprecated Qt < 5.9 code

This commit is contained in:
Chris Hennes
2021-03-31 10:18:58 -05:00
committed by wwmayer
parent f9a54c3385
commit 5592548e2e
3 changed files with 0 additions and 50 deletions

View File

@@ -79,18 +79,8 @@ void TimeInfo::setTime_t (uint64_t seconds)
std::string TimeInfo::currentDateTimeString()
{
#if (QT_VERSION >= 0x050300)
return QDateTime::currentDateTime().toTimeSpec(Qt::OffsetFromUTC)
.toString(Qt::ISODate).toStdString();
#else
QDateTime local = QDateTime::currentDateTime();
QDateTime utc = local.toUTC();
utc.setTimeSpec(Qt::LocalTime);
int utcOffset = utc.secsTo(local);
local.setUtcOffset(utcOffset);
QString dm = local.toString(Qt::ISODate);
return dm.toStdString();
#endif
}
std::string TimeInfo::diffTime(const TimeInfo &timeStart,const TimeInfo &timeEnd )

View File

@@ -34,41 +34,6 @@
#include <QString>
#include <QObject>
#if (QT_VERSION < 0x050300)
class QSignalBlocker
{
public:
QSignalBlocker(QObject *object)
: object(object)
, blocked(object && object->blockSignals(true))
, inhibited(false)
{
}
~QSignalBlocker()
{
if (object && !inhibited)
object->blockSignals(blocked);
}
void reblock()
{
if (object)
object->blockSignals(true);
inhibited = false;
}
void unblock()
{
if (object)
object->blockSignals(blocked);
inhibited = true;
}
private:
QObject *object;
bool blocked;
bool inhibited;
};
#endif
// ----------------------------------------------------------------------------
namespace Base

View File

@@ -79,12 +79,7 @@ Py::Object Translate::translate(const Py::Tuple& args)
if (!PyArg_ParseTuple(args.ptr(), "ss|si", &context, &source, &disambiguation, &n))
throw Py::Exception();
#if (QT_VERSION >= 0x050000)
QString str = QCoreApplication::translate(context, source, disambiguation, n);
#else
QString str = QCoreApplication::translate(context, source, disambiguation,
QCoreApplication::UnicodeUTF8, n);
#endif
return Py::asObject(PyUnicode_FromString(str.toUtf8()));
}