Bug 405212 - Compilation error because of QOverload usage
Summary: Compilation error because of QOverload usage
Status: RESOLVED FIXED
Alias: None
Product: krusader
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other All
: NOR major
Target Milestone: ---
Assignee: Krusader Bugs Distribution List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-08 12:09 UTC by Miro
Modified: 2019-07-01 07:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Miro 2019-03-08 12:09:34 UTC
SUMMARY
There are few usages of QOverload in current code base.
QOverload was introduced in QT 5.7. Krusader compilation check QT version > 5.5. So if I have QT vesion < 5.7 compilation fails:
/krslots.h:48:23: error: ‘QOverload’ was not declared in this scope

STEPS TO REPRODUCE
1. Have QT version 5.6.1
2. Run cmake
3. Run make

OBSERVED RESULT
Compilation crashes with: /krslots.h:48:23: error: ‘QOverload’ was not declared in this scope

EXPECTED RESULT
Successful compilation 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 16
(available in About System)
Qt Version: 5.6.1

ADDITIONAL INFORMATION
I can fix it, but there are more possibilities:
1. Replace QOverload with static_cast
2. Raise minimal QT version to 5.7
3. Selective compilation #if QT_VERSION <= QT_VERSION_CHECK(5, 7, 0) 
More ideal?
Comment 1 Alex Bikadorov 2019-03-08 19:15:40 UTC
Oh, not good. I didn't know QOverload is so "new".
Qt 5.7 was released in Summer 2016 and that is "brand new" e.g. in the Ubuntu universe.

Replacing it by static_cast is imo by far the best option.

Thanks for reporting!
Comment 2 Alex Bikadorov 2019-03-08 19:21:55 UTC
Made the replacements. See https://phabricator.kde.org/D19623
Comment 3 Alex Bikadorov 2019-04-13 16:44:08 UTC
Update: We decided to make 5.9 the minimal required Qt version.
Support for 5.6 (LTS) is already discarded and 5.9 is the next LTS version with support until next year.

See https://phabricator.kde.org/D20373
Comment 4 Nikita Melnichenko 2019-04-15 06:49:18 UTC
Git commit 0a80cc3ef6c4b610bb7fd677166bf7c19a1621dc by Nikita Melnichenko.
Committed on 15/04/2019 at 06:46.
Pushed by melnichenko into branch 'master'.

Updated minimal Qt version to the earliest supported version (5.9)

FIXED: [ 405212 ] Compilation error because of QOverload usage

Differential Revision: https://phabricator.kde.org/D20373

M  +1    -1    CMakeLists.txt

https://commits.kde.org/krusader/0a80cc3ef6c4b610bb7fd677166bf7c19a1621dc
Comment 5 Nikita Melnichenko 2019-07-01 07:19:53 UTC
Git commit 279c88da25aeee3bffa05250190f0f5168ceac34 by Nikita Melnichenko.
Committed on 01/07/2019 at 07:13.
Pushed by melnichenko into branch 'stable'.

Updated minimal Qt version to the earliest supported version (5.9)

FIXED: [ 405212 ] Compilation error because of QOverload usage

Differential Revision: https://phabricator.kde.org/D20373

(cherry picked from commit 0a80cc3ef6c4b610bb7fd677166bf7c19a1621dc)

M  +1    -1    CMakeLists.txt

https://commits.kde.org/krusader/279c88da25aeee3bffa05250190f0f5168ceac34