Fix compilation with Qt 5.9
ClosedPublic

Authored by wbauer on Jun 2 2020, 8:33 AM.

Details

Summary

QTimer::callOnTimeout() only exists since Qt 5.12.

Connect to the QTimer::timeout signal instead, this works with older versions as well and is equivalent according to the Qt documentation.

BUG: 422354
FIXED-IN: 3.3.2

Test Plan

Compiles fine with Qt 5.9.7 now, and also newer versions (tested with 5.12.7 and 5.14.1).

Diff Detail

Repository
R470 Tellico
Lint
Lint Skipped
Unit
Unit Tests Skipped
wbauer requested review of this revision.Jun 2 2020, 8:33 AM
wbauer created this revision.
wbauer added a comment.Jun 2 2020, 8:43 AM

Actually, callOnTimeout() is just a template that calls connect() anyway:

template <typename ... Args>
QMetaObject::Connection callOnTimeout(Args && ...args)
{
    return QObject::connect(this, &QTimer::timeout, std::forward<Args>(args)... );
}
wbauer edited the summary of this revision. (Show Details)Jun 2 2020, 2:20 PM

I'd be ok not having the Qt version check at all and just simply using the ::connect syntax

wbauer updated this revision to Diff 83200.Jun 2 2020, 3:04 PM
wbauer edited the summary of this revision. (Show Details)

Use connect() unconditionally.

rstephenson accepted this revision.Jun 2 2020, 3:08 PM

Go for it. Thanks for your diligence fixing up my mistakes!

This revision is now accepted and ready to land.Jun 2 2020, 3:08 PM
This revision was automatically updated to reflect the committed changes.
wbauer added a comment.Jun 2 2020, 3:40 PM

There were conflicts when I tried to merge the 3.3 branch into master, I think I better leave that to you... ;-)