Hi,

I was making a simple subclass of QwtPlot but Iḿ ot able to compile it. Every time I try, I get this error:

In file included from vectplot.h:2,
from principal.h:10,
from principal.cpp:1:
/usr/include/qt4/QtGui/qframe.h: In copy constructor ‘QwtPlot::QwtPlot(const QwtPlot&)’:
/usr/include/qt4/QtGui/qframe.h:140: error: ‘QFrame::QFrame(const QFrame&)’ is private
/usr/local/qwt-5.2.0/include/qwt_plot.h:73: error: within this context
Here's the code from my vectplot.h file:

Qt Code:
  1. #include <qwt_plot.h>
  2.  
  3.  
  4. class Vectplot: public QwtPlot
  5. {
  6. Q_OBJECT
  7.  
  8. public:
  9. Vectplot(QWidget *parent = NULL);
  10.  
  11. private:
  12. void alignScales();
  13. void getDataPlot();
  14. double equis[2000];
  15. double ye1[2000];
  16. double ye2[2000];
  17. };
To copy to clipboard, switch view to plain text mode 

And here's the code from the vectplot.cpp file:

Qt Code:
  1. #include "vectplot.h"
  2. #include <math.h>
  3. #include <qpainter.h>
  4. #include <qwt_plot_curve.h>
  5. #include <qwt_symbol.h>
  6. #include <qwt_scale_widget.h>
  7. #include <stdlib.h>
  8.  
  9.  
  10. Vectplot::Vectplot(QWidget *parent):
  11. QwtPlot(parent)
  12. {
  13.  
  14. // We don't need the cache here
  15. canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
  16. canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
  17.  
  18. QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
  19. QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
  20. curve1->attach(this);
  21. curve2->attach(this);
  22. getDataPlot();
  23.  
  24. curve1->setData(equis, ye1, 2000);
  25. curve2->setData(equis,ye2, 2000);
  26. curve1->setPen(QPen(Qt::red, 2));
  27. curve2->setPen(QPen(Qt::blue,2));
  28. curve1->setStyle (QwtPlotCurve::Lines) ;
  29. curve2->setStyle(QwtPlotCurve::Dots);
  30.  
  31. replot();
  32. }
  33.  
  34. void Vectplot::alignScales()
  35. {
  36.  
  37. canvas()->setFrameStyle(QFrame::Box | QFrame::Plain );
  38. canvas()->setLineWidth(1);
  39.  
  40. for ( int i = 0; i < QwtPlot::axisCnt; i++ )
  41. {
  42. QwtScaleWidget *scaleWidget = (QwtScaleWidget *)axisWidget(i);
  43. if ( scaleWidget )
  44. scaleWidget->setMargin(0);
  45.  
  46. QwtScaleDraw *scaleDraw = (QwtScaleDraw *)axisScaleDraw(i);
  47. if ( scaleDraw )
  48. scaleDraw->enableComponent(QwtAbstractScaleDraw::Backbone, false);
  49. }
  50. }
  51.  
  52. void Vectplot::getDataPlot()
  53. {
  54. for (int i = 0; i < 2000; i++)
  55. {
  56. ye1[i] = i / sqrt(i) ;
  57. equis[i] = i ;
  58. ye2[i] = sin(i);
  59. }
  60. }
To copy to clipboard, switch view to plain text mode 

I'm sure the error is something stupid, but haven't been able to find it. If someone could, please, check this and tell me what's going on, I'd appreciate it .

Thanks in advance,

Claudia