Your SignalData::PrivateData class has *two* QPointF arrays: values and values2. You are using one of these for the sample and one of them for the model, right? appendSignal() should put a new point onto the end of values, and appendModel() should put a new point onto the end of values2. What is the problem?if we use two append() methods,there is only only one signaldata class and curvedata class,how should I set the data for p_curve?
Have you made your design so complicated that you don't understand it any more?
When I originally offered you a solution to this, I gave you another class: ModelData. You decided to combine the sample and the model into one class, SignalData, and now you are getting confused because you are using one class to hold two different things, and your design makes that class a Singleton. It is getting you into trouble, because now you can have values and values2 with different lengths, but there is only one size() member function, and that is returning the length of values. Likewise for the other member functions - they are using values, and same property for values2 might be different. If you are depending on size() to set the points into the curves, then one curve will be wrong.
Bookmarks