c++qtinheritanceqlistqpolygon

Qt/C++ Inheritance from QPolygonF as QList item


I have a problem with using QList.

T should be an inheritance from QPolygonF.

It looks like:

class Polygon : public QPolygonF
{
public:
    Polygon(){}
    Polygon &operator=(const Polygon &other);
};

When I try to define QList< Polygon>, I get the following compile error:

type/value mismatch [...] for 'template<class T> class QList'
error: expected a type, got 'Polygon'

So I think, something is used to be defined at compile time, but I don't get it :(

QPolygonF is inherited by QVector< QPointF>, maybe this is a Problem?

Thanks a lot!


Solution

  • I figured it out. I used some CAD-Library where Polygon was already defined. Compiler message was not helpful =(

    Can be closed.