mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-16 07:55:41 +00:00
14f369b47f
This commit replaces qSort with std::sort to fix warnings from compiling with
Qt 5.14.1. Below is one of the warnings:
error: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QList<lyx::ColorCode>::iterator; LessT$
an = bool (*)(lyx::ColorCode, lyx::ColorCode)]’ is deprecated: Use std::sort [-Werror=deprecated-declarations]
qSort() has been deprecated since Qt 5.2. Quoting from the ChangeLog [1]:
With STL no longer being optional for building and using Qt, a number of
parts of QtAlgorithms no longer make sense, and have therefore been
deprecated. Replacements are available in the STL, and generally have
much better performance
There are some cases that require more than just a trivial substitution, but
our code does not appear to use any of those cases.
For some discussion on the differences in speed of std::sort() and
qSort(), see the following:
https://phabricator.kde.org/D10857
These are just warnings now, but will likely be errors with Qt 6:
https://bugreports.qt.io/browse/QTBUG-73048
I tested that LyX can still be built against Qt 4.8.7 with this commit.
This commit follows
|
||
---|---|---|
.. | ||
qt | ||
tests | ||
.gitignore | ||
alert.h | ||
Application.h | ||
Clipboard.h | ||
CMakeLists.txt | ||
Delegates.h | ||
FontLoader.h | ||
FontMetrics.h | ||
KeyModifier.h | ||
KeySymbol.h | ||
Makefile.am | ||
mouse_state.h | ||
NullPainter.h | ||
Painter.h | ||
Selection.h | ||
WorkArea.h | ||
WorkAreaManager.cpp | ||
WorkAreaManager.h |