fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
@@ -22,6 +22,7 @@
|
||||
#include <QtWidgets/QCheckBox>
|
||||
#include <QtWidgets/QCompleter>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QTimeZone>
|
||||
#include <QtWidgets/QGridLayout>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtGui/QKeyEvent>
|
||||
@@ -248,7 +249,7 @@ int getItemValue(QSpinBox *spinBox)
|
||||
LtsDateTimeEdit::LtsDateTimeEdit(QWidget *parent, bool withNowButton, bool checkable)
|
||||
: QWidget(parent)
|
||||
// , m_uiLe(new Ui::LtsDateTimeEditLe)
|
||||
, m_scFixed(new QShortcut(QKeySequence(Qt::ShiftModifier + Qt::Key_F2), this, SLOT(setFixedDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
|
||||
, m_scFixed(new QShortcut(QKeySequence(Qt::ShiftModifier | Qt::Key_F2), this, SLOT(setFixedDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
|
||||
, m_scOffset(new QShortcut(QKeySequence(Qt::Key_F2), this, SLOT(setOffsetDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
|
||||
, m_checkable(checkable) // see below
|
||||
, m_withNowButton(withNowButton) // see below
|
||||
@@ -551,7 +552,7 @@ bool LtsDateTimeEdit::setMsecsSinceEpoch(qint64 msec, bool setToNearestPossible)
|
||||
m_curTimeMSec = msec;
|
||||
|
||||
const qint64 offsetTimeZoneMsec = getTimezoneAsSecs() * 1000;
|
||||
const QDateTime datetime(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec + offsetTimeZoneMsec, Qt::UTC));
|
||||
const QDateTime datetime(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec + offsetTimeZoneMsec, QTimeZone(0)));
|
||||
const QDate date(datetime.date());
|
||||
const QTime time(datetime.time());
|
||||
|
||||
@@ -940,7 +941,7 @@ bool LtsDateTimeEdit::isDataAcceptable()
|
||||
return false;
|
||||
}
|
||||
|
||||
qint64 msec = QDateTime(QDate(getYear(), getMonth(), getDay()), QTime(getHour(), getMinute(), getSecond()), Qt::UTC).toMSecsSinceEpoch();
|
||||
qint64 msec = QDateTime(QDate(getYear(), getMonth(), getDay()), QTime(getHour(), getMinute(), getSecond()), QTimeZone(0)).toMSecsSinceEpoch();
|
||||
msec -= DTG::timezone2Secs(getTimezone()) * 1000LL;
|
||||
if (m_minTimeMSec > 0 && m_maxTimeMSec > 0 && m_minTimeMSec < m_maxTimeMSec)
|
||||
{
|
||||
@@ -1539,7 +1540,7 @@ void LtsDateTimeEdit::onFocusOutDay()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setDay(dt.date().day());
|
||||
}
|
||||
}
|
||||
@@ -1571,7 +1572,7 @@ void LtsDateTimeEdit::onFocusOutHHMMSS()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setHHMMSS(dt.time().hour(), dt.time().minute(), dt.time().second());
|
||||
}
|
||||
}
|
||||
@@ -1632,7 +1633,7 @@ void LtsDateTimeEdit::onFocusOutMonth()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setMonth(dt.date().month());
|
||||
}
|
||||
}
|
||||
@@ -1671,7 +1672,7 @@ void LtsDateTimeEdit::onFocusOutYear()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setYear(dt.date().year());
|
||||
}
|
||||
}
|
||||
@@ -1768,7 +1769,7 @@ void LtsDateTimeEdit::onMonthWheelEvent(bool bForward, int cursorPos)
|
||||
if (!isMonthAcceptable())
|
||||
return;
|
||||
const int ofs = bForward ? 1 : -1;
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, Qt::UTC).addMonths(ofs));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, QTimeZone(0)).addMonths(ofs));
|
||||
setMsecsSinceEpoch(dt.toMSecsSinceEpoch(), true);
|
||||
m_uiLe->leLongMonth->setCursorPosition(cursorPos);
|
||||
m_uiLe->leLongMonth->setSelection(0, 3);
|
||||
@@ -1782,7 +1783,7 @@ void LtsDateTimeEdit::onYearWheelEvent(bool bForward, int cursorPos)
|
||||
if (!isYearAcceptable())
|
||||
return;
|
||||
const int ofs = bForward ? 1 : -1;
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, Qt::UTC).addYears(ofs));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, QTimeZone(0)).addYears(ofs));
|
||||
setMsecsSinceEpoch(dt.toMSecsSinceEpoch(), true);
|
||||
m_uiLe->leLongYear->setCursorPosition(cursorPos);
|
||||
m_uiLe->leLongYear->setSelection(0, 2);
|
||||
|
||||
Reference in new issue
Block a user