From ac5ec626f9c4d2795ecd70259ec52e97e6dfd4a9 Mon Sep 17 00:00:00 2001 From: j2doll Date: Thu, 17 Aug 2017 20:29:40 +0900 Subject: [PATCH] set different routine for each qt version --- QtXlsxWriter-Static/source/xlsxzipreader.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/QtXlsxWriter-Static/source/xlsxzipreader.cpp b/QtXlsxWriter-Static/source/xlsxzipreader.cpp index 93d840f..7a44859 100644 --- a/QtXlsxWriter-Static/source/xlsxzipreader.cpp +++ b/QtXlsxWriter-Static/source/xlsxzipreader.cpp @@ -11,7 +11,10 @@ #include -#include // https://github.com/dbzhang800/QtXlsxWriter/issues/108 +#include + +#include +#include namespace QXlsx { @@ -34,10 +37,17 @@ ZipReader::~ZipReader() void ZipReader::init() { + // issue + // https://github.com/dbzhang800/QtXlsxWriter/issues/108 + // https://github.com/dbzhang800/QtXlsxWriter/issues/117 - // https://github.com/dbzhang800/QtXlsxWriter/issues/117 - // QList allFiles = m_reader->fileInfoList(); // before - QVector allFiles = m_reader->fileInfoList(); // after +#if (QT_VERSION <= QT_VERSION_CHECK(5, 5, 0)) + QList allFiles = m_reader->fileInfoList(); +#endif + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) + QVector allFiles = m_reader->fileInfoList(); +#endif foreach (const QZipReader::FileInfo &fi, allFiles) { if (fi.isFile)