I'm actually creating an application in QtCreator (open source), and I need to open Excel and communicate by sending to Excel data to show. I try to #include <QAxWidget> , and to modify my .pro file with:

CONFIG+= axcontainer
Qt += activeqt

But it didn't work. I've got the error QAxWidget was not declared in this scope. I read lots of things contradictory on the Internet, like you must paid licence or else.

Can you explain to me, if there's a way to solve my problem? Thanks.

有帮助吗?

解决方案

You need the "Qt5-way" of using the module from your project file:

QT += axcontainer

Also, you need to include the necessary header of course:

#include <QAxWidget>

You can find the more thorough explanation here with examples.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top