Franco Amato | 17 Sep 01:28

Q_OBJECT

Hi to all,
I'm writing a little application integrating Qt (for the GUI part) and coin3D for the simulation part.
I wrote a class named SndTestViewer that inherits from SoQtViewer (from coin3d). In this class
I added the macro Q_OBJECT because I would implement in the same class the signal/slot mechanism.
When I compile I got lots these errors:
moc/moc_SndTestViewer.cpp:37: error: 'staticMetaObject' is not a member of 'SoQtViewer'
moc/moc_SndTestViewer.cpp: In member function 'virtual void* SndTestViewer::qt_metacast(const char*)':
moc/moc_SndTestViewer.cpp:51: error: 'qt_metacast' is not a member of 'SoQtViewer'
moc/moc_SndTestViewer.cpp: In member function 'virtual int SndTestViewer::qt_metacall(QMetaObject::Call, int, void**)':
moc/moc_SndTestViewer.cpp:56: error: 'qt_metacall' is not a member of 'SoQtViewer'

Reading some online document I discovered that if a class doesn't inherits from a QObject I don't have to add the Q_OBJECT
macro, but how can implement the signal-slot so?

Regards,
Franco

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qwt-interest mailing list
qwt-interest <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qwt-interest
Uwe Rathmann | 17 Sep 06:57

Re: Q_OBJECT

On Wednesday 17 September 2008 01:28, Franco Amato wrote:

> Reading some online document I discovered that if a class doesn't inherits
> from a QObject I don't have to add the Q_OBJECT
> macro, but how can implement the signal-slot so?

You can't: signal/slot is for classes derived from QObject only.

This is the Qwt mailing list. For Qt related questions please use the Qt 
support channels f.e. http://www.qtcentre.org/forum.

Uwe

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane