1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-27 00:34:16 +01:00

Allow compile on Qt 5.5.1 or above

This commit is contained in:
Jonas Kvinge 2018-10-23 20:17:29 +02:00
parent 89a08d1d5e
commit 51021131d7
2 changed files with 9 additions and 1 deletions

View File

@ -122,7 +122,7 @@ if(WIN32)
endif(WIN32)
# QT
set(QT_MIN_VERSION 5.6.0)
set(QT_MIN_VERSION 5.5.1)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Concurrent Widgets Network Sql OpenGL Xml)
if(X11_FOUND)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)

View File

@ -246,7 +246,11 @@ void StretchHeaderView::SetColumnWidth(int logical, ColumnWidthType width) {
bool StretchHeaderView::RestoreState(const QByteArray& data) {
QDataStream s(data);
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
s.setVersion(QDataStream::Qt_5_5);
#else
s.setVersion(QDataStream::Qt_5_6);
#endif
int magic_number = 0;
s >> magic_number;
@ -310,7 +314,11 @@ QByteArray StretchHeaderView::SaveState() const {
visual_indices << logicalIndex(i);
}
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
s.setVersion(QDataStream::Qt_5_5);
#else
s.setVersion(QDataStream::Qt_5_6);
#endif
s << kMagicNumber;
s << stretch_enabled_;