Bug 372339 - Okular fails to compile with QT < 5.6 due to usage of new QT method QList::constFirst
Summary: Okular fails to compile with QT < 5.6 due to usage of new QT method QList::co...
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-11 12:24 UTC by Tobias Deiminger
Modified: 2016-11-14 23:24 UTC (History)
0 users

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 Tobias Deiminger 2016-11-11 12:24:38 UTC
Okular configures, but fails to compile if built with QT < 5.6. This is because core/document.cpp:L3687 uses QList<int>::constFirst, which was introduced only with Qt 5.6.

CMakeLists.txt says set(QT_REQUIRED_VERSION "5.2.0"), so it looks like it was intended to support lower versions than QT 5.6.

Compiler error is:
~/okular/core/document.cpp: In member function ‘void Okular::Document::editFormCombo(int, Okular::FormFieldChoice*, const QString&, int, int, int)’:
~/okular/core/document.cpp:3687:59: error: ‘class QList<int>’ has no member named ‘constFirst’
         prevText = form->choices()[form->currentChoices().constFirst()];

Found with okular master (ae6adf2390e36d15754133fdf9f9a16c7bce7680), QT 5.5.1 and a fresh KF5 from kdesrc-build.
Comment 1 Tobias Deiminger 2016-11-11 14:03:24 UTC
Just found one more dependency on QT 5.6 here:
okular/core/document.cpp:L4219, QSet<QMimeType> uniqueMimetypes;

This requires uint qHash(const QMimeType &key, uint seed = 0), which was only introduced with QT 5.6. See http://doc.qt.io/qt-5/qmimetype.html#qHash.
Comment 2 Albert Astals Cid 2016-11-14 23:24:58 UTC
Git commit fa680b6c047b05a458bf9516fe7bc18f0d723ce6 by Albert Astals Cid.
Committed on 14/11/2016 at 23:24.
Pushed by aacid into branch 'master'.

Require Qt 5.6

This is not a dependency freeze break, it's just bringing cmake up to date with what the code already required

M  +1    -1    CMakeLists.txt

http://commits.kde.org/okular/fa680b6c047b05a458bf9516fe7bc18f0d723ce6