I don't currently have any implementation examples of derived classes because I wanted to try and establish the parent class beforehand. However, I will try to make as much sense as to what I want the derived classes to function/look like. Basically, the derived classes will override the computeBezier method, which will make use of this equation which calculates the x-y coordinates of the bezier curve based on control points P0, P1, P2, P3 (the curve is a cubic in this case, hence the highest degree of 3 in the equation)
[image: 67db0cf3-b363-4a28-b45d-21ccc5d1a95c.png]
The ctrlPts variable will be a list that stores points which represent the positions of each control point in graphics view space (i.e, pixel coordinates).
Ideally, derived classes will have a copy of the DataPort struct (that they inherit from base class) in which they store bezier curve data (control point locations and bezier curve coordinates) via the public setter method, which will look something like:
void setBezier() {
DataPort_Bezier.bezierData = computeBezier();
} // this setter will set the Bezier curve data in the struct using the computeBezier method
My main question was, how do I initialize these struct variables (which are QLists) as empty lists each time a derived class is instantiated?
I apologize that I couldn't provide a coded example, and I understand if this hinders the ability to provide criticism on the code I have provided thus far. If I can figure out the first question, I will make a first-pass attempt at implementing a derived class so I can add it to this topic