1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-16 04:42:53 +08:00

set different routine for each qt version

This commit is contained in:
j2doll 2017-08-17 20:29:40 +09:00
parent 9d513ced38
commit ac5ec626f9

View File

@ -11,7 +11,10 @@
#include <private/qzipreader_p.h>
#include <QVector> // https://github.com/dbzhang800/QtXlsxWriter/issues/108
#include <QtGlobal>
#include <QVector>
#include <QList>
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<QZipReader::FileInfo> allFiles = m_reader->fileInfoList(); // before
QVector<QZipReader::FileInfo> allFiles = m_reader->fileInfoList(); // after
#if (QT_VERSION <= QT_VERSION_CHECK(5, 5, 0))
QList<QZipReader::FileInfo> allFiles = m_reader->fileInfoList();
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
QVector<QZipReader::FileInfo> allFiles = m_reader->fileInfoList();
#endif
foreach (const QZipReader::FileInfo &fi, allFiles) {
if (fi.isFile)