Having MyClass : QPolygonF I would like to create
void bin_write(QDataStream & out ) const
{
out << (BASE CLASS QPOLYGONF)*this ??
}
which calls the overload operator
QDataStream& operator<< ( QDataStream & stream, const QPolygonF & polygon )
I dont know how to tell it to call that method.
Simply do:
There’s no need for an explicit upcast here (as is generally the case) unless your subclass is also defining its own overload of
operator<<(insertion operator) withQDataStream.If your class does provide overloaded
operator<<and you need to use QPolygonF’s insertion operator (for example, in order to help implement operator<< for your subclass), then you can do: