Two ways of QT to operate excel QT basics introduction [Excel operation]

There are two ways for QT to operate excel: QAxObject and QtXlsx

QAxObject realizes the operation on the excel chart by calling the office or wps component. It can be realized only by installing office software or wps software, but

  • If only office software is installed, sometimes it can be used and sometimes it cannot be used;
  • If only wps software is installed, it cannot be used at all;
  • If both are installed, the result is basically uncontrollable;
  • If Foxit Reader is installed, it will definitely not work.

To sum up, the result is that the user experience is extremely poor. Fortunately, there is a QtXIsx, which is an open source third-party library, uses Qt to operate the XIsx table, and does not depend on ofic and wps components. As long as it is a platform that can be used by QT5, it can be used, and there will be no strong dependence on the environment.

QtXlsx official documentation: http://qtxlsx.debao.me

For Linux users, if Qt was installed via a package manager tool like "apt-get", make sure that the Qt5 development package qtbase5-private-dev is installed

QtXlsx is a library that can read and write Excel files. It does not require Microsoft Excel and can be used on any platform supported by Qt5. This library can be used to generate a new .xlsx file from scratch Extract data from an existing .xlsx file Edit an existing .xlsx file. Here are three ways to use the QtXlsx library: Three ways to use the Excel library in QT Getting Started with QT Basics [Excel]_Kiss Plasma Blog-CSDN Blog

Guess you like

Origin blog.csdn.net/qq_43445867/article/details/132392843