PDA

View Full Version : Error to use QAxWidget



HelloDan
15th May 2009, 18:45
I just test the an example of the C++ GUI programming with Qt4, the one to implement the media player. But fail, the following is some part the error information.

playerwindow.cpp:2:21: QAxWidget: No such file or directory
playerwindow.cpp: In constructor `PlayerWindow::PlayerWindow()':
playerwindow.cpp:8: error: invalid use of undefined type `struct QAxWidget'
playerwindow.h:6: error: forward declaration of `struct QAxWidget'
playerwindow.cpp:9: error: invalid use of undefined type `struct QAxWidget'
playerwindow.h:6: error: forward declaration of `struct QAxWidget'
playerwindow.cpp:10: error: invalid use of undefined type `struct QAxWidget'
playerwindow.h:6: error: forward declaration of `struct QAxWidget'
playerwindow.cpp:11: error: invalid use of undefined type `struct QAxWidget'
playerwindow.h:6: error: forward declaration of `struct QAxWidget'
playerwindow.cpp:13: error: no matching function for call to `PlayerWindow::conn
ect(QAxWidget*&, const char[27], PlayerWindow* const, const char[29])'
../4.4.3/include/QtCore/../../src/corelib/kernel/qobject.h:197: note: candidates
are: static bool QObject::connect(const QObject*, const char*, const QObject*,
const char*, Qt::ConnectionType)
../4.4.3/include/QtCore/../../src/corelib/kernel/qobject.h:303: note:
bool QObject::connect(const QObject*, const char*, const char*, Qt::Connec
tionType) const
playerwindow.cpp:15: error: no matching function for call to `PlayerWindow::conn
ect(QAxWidget*&, const char[39], PlayerWindow* const, const char[41])'
../4.4.3/include/QtCore/../../src/corelib/kernel/qobject.h:197: note: candidates
are: static bool QObject::connect(const QObject*, const char*, const QObject*,
const char*, Qt::ConnectionType)
../4.4.3/include/QtCore/../../src/corelib/kernel/qobject.h:303: note:
bool QObject::connect(const QObject*, const char*, const char*, Qt::Connec
tionType) const
playerwindow.cpp:17: error: no matching function for call to `PlayerWindow::conn
ect(QAxWidget*&, const char[32], PlayerWindow* const, const char[34])'



The pro file as follow:

TEMPLATE = app
CONFIG += qaxcontainer
HEADERS = playerwindow.h
SOURCES = main.cpp \
playerwindow.cpp

I don't know where comes the error. Can you help me to correct it? Thanks!!!!

aamer4yu
15th May 2009, 19:11
Did you include the header files properly ?
Also is your Qt Commerical edition ? ActiveX is not available on Opensource I guess

HelloDan
15th May 2009, 19:17
//playerwindow.cpp
#include <QtGui>
#include <QAxWidget>

#include "playerwindow.h"

I do include the header file properly.

auba
15th May 2009, 20:42
I don't know if this still is important in the latest SDK... but is the license file located in your home directory?

HelloDan
16th May 2009, 03:17
Mine is opensource, Can I use the Commercial function with the opensource and a licensen ?

Reinstall one is a troublesome bussiness.

auba
16th May 2009, 09:47
I don't think so. Probably mingw is missing needed include files...

aamer4yu
16th May 2009, 09:57
I dont think you can use ActiveX widget with open source.
You need commercial license for that.