Fix build with Qt 5.6
ClosedPublic

Authored by wbauer on Mar 21 2018, 10:10 AM.

Details

Summary

QOverload<>::of() is new in Qt 5.7, so "emulate" it with static_cast<>() when building against lower Qt versions.

Test Plan

Kexi 3.1.0 builds fine now on openSUSE Leap 42.3 with Qt 5.6.2.
Before I got these compiler errors:

/home/abuild/rpmbuild/BUILD/kexi-3.1.0/src/widget/KexiFileRequester.cpp: In member function 'void KexiFileRequester::init()':
/home/abuild/rpmbuild/BUILD/kexi-3.1.0/src/widget/KexiFileRequester.cpp:479:30: error: 'QOverload' was not declared in this scope
     connect(d->locationEdit, QOverload<>::of(&KUrlComboBox::returnPressed),
                              ^
/home/abuild/rpmbuild/BUILD/kexi-3.1.0/src/widget/KexiFileRequester.cpp:479:40: error: expected primary-expression before '>' token
     connect(d->locationEdit, QOverload<>::of(&KUrlComboBox::returnPressed),
                                        ^
/home/abuild/rpmbuild/BUILD/kexi-3.1.0/src/widget/KexiFileRequester.cpp:479:41: error: '::of' has not been declared
    connect(d->locationEdit, QOverload<>::of(&KUrlComboBox::returnPressed),
                                         ^

Still builds fine with Qt 5.9.4 and 5.10.0 too...

Diff Detail

Repository
R71 Kexi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wbauer requested review of this revision.Mar 21 2018, 10:10 AM
wbauer created this revision.
staniek accepted this revision.Mar 21 2018, 11:44 AM
staniek added reviewers: staniek, piggz.

Good job, thanks Wolfgang!

This revision is now accepted and ready to land.Mar 21 2018, 11:45 AM
This revision was automatically updated to reflect the committed changes.