Qt5: 'void QTime::start()' / 'int QTime::elapsed() const' / 'int QTime::restart()' are deprecated: Use QElapsedTimer instead [-Wdeprecated-declarations]

This commit is contained in:
wmayer
2020-06-10 23:02:47 +02:00
committed by wwmayer
parent 8dbe26a95f
commit c8dae9eb85
13 changed files with 35 additions and 26 deletions

View File

@@ -130,7 +130,9 @@ AutoSaver::~AutoSaver()
void AutoSaver::changeOccurred()
{
if (m_firstChange.isNull())
if (!m_firstChange.isValid())
printf("changeOccurred\n");
if (!m_firstChange.isValid())
m_firstChange.start();
if (m_firstChange.elapsed() > MAXWAIT) {
@@ -154,7 +156,8 @@ void AutoSaver::saveIfNecessary()
if (!m_timer.isActive())
return;
m_timer.stop();
m_firstChange = QTime();
printf("saveifnecessary\n");
m_firstChange = QElapsedTimer();
if (!QMetaObject::invokeMethod(parent(), "save", Qt::DirectConnection)) {
qWarning() << "AutoSaver: error invoking slot save() on parent";
}