template class that inherits from QObject
Solved
General and Desktop
-
Hi,
I wrote this class
template <typename t_figure> class drawing : public QObject, public t_figure { Q_OBJECT ...
And when I try to compile it, I get :
mainwindow.o:-1: error: referência indefinida para `drawing<QGraphicsRectItem>::metaObject() const'
Where "referência indefinida" means "undefined reference".
Can I create such a class in Qt?
Thanks
-
Hi,
I wrote this class
template <typename t_figure> class drawing : public QObject, public t_figure { Q_OBJECT ...
And when I try to compile it, I get :
mainwindow.o:-1: error: referência indefinida para `drawing<QGraphicsRectItem>::metaObject() const'
Where "referência indefinida" means "undefined reference".
Can I create such a class in Qt?
Thanks
@canellas
AFAIK Q_OBJECT macro can't be used in templated classes.