Qt 5.5 project build error in Qt 5.8

落爺英雄遲暮 提交于 2019-12-02 07:33:42

the error for QtXLSX has not been solved.

The solution is simple.

On the file xlsxzipreader.cpp, it is necesary to include:

#include <QVector>

After that in the function: void ZipReader::init(){}, we need to update the type:

void ZipReader::init(){
// This was the previous definition
//QList<QZipReader::FileInfo> allFiles = m_reader->fileInfoList();

QVector<QZipReader::FileInfo> allFiles = m_reader->fileInfoList();

foreach (const QZipReader::FileInfo &fi, allFiles) {
    if (fi.isFile)
        m_filePaths.append(fi.filePath);
    }
}

Just save and do again:

make
make install

This has been tested on Qt 5.8.x, 5.9.x

Cheers!

So I fixed my problem; I was using the oldest version of the QXlsx, and according to this post, there were many new revisions on gitHub. Installing the new version solved the issue.

New version
Old version

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!