Allow compile with Qt 5.5 again

This commit is contained in:
Jonas Kvinge 2019-01-07 19:04:53 +01:00
parent 89e0524f90
commit aeb7e3914e
2 changed files with 9 additions and 1 deletions

View File

@ -120,7 +120,7 @@ if(WIN32)
endif(WIN32)
# QT
set(QT_MIN_VERSION 5.6)
set(QT_MIN_VERSION 5.5)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Concurrent Widgets Network Sql)
if(X11_FOUND)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)

View File

@ -247,7 +247,11 @@ 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;
@ -311,7 +315,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;