I have a main window and in that main window is a qwidget which I promoted to my class based on qwtplot. In the constructor of that class I have defined two arrays which were then added to my plotcurve. When running in Fedora Core 12 the plot comes up fine but missing the plot curve. When I run the same program in Windows 7 all is well with a plot containing the curve. Qt version is 4.6.2 on both platforms with qwt5.1.2 which I subversioned over and built on both machines. My constructor which does all of the work is below... Thanks very much for any insight into what I might be lacking here.
#include "myplot.h"
#include <qwt_symbol.h>
{
int i ;
setTitle ("junk") ;
curve1->attach(this);
// alloc memory for data arrays
xdata = new double [100] ;
ydata = new double [100] ;
// load arrays for display
for (i = 0; i < 100; i++)
{
xdata[i] = i ;
ydata[i] = i ;
}
curve1->setData(xdata, ydata, 100);
curve1
->setPen
(QPen(Qt
::red,
3));
replot() ;
}
#include "myplot.h"
#include <qwt_symbol.h>
MyPlot::MyPlot(QWidget *gv) : QwtPlot ( gv)
{
int i ;
setTitle ("junk") ;
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
curve1->attach(this);
// alloc memory for data arrays
xdata = new double [100] ;
ydata = new double [100] ;
// load arrays for display
for (i = 0; i < 100; i++)
{
xdata[i] = i ;
ydata[i] = i ;
}
curve1->setData(xdata, ydata, 100);
curve1->setPen(QPen(Qt::red, 3));
curve1->setStyle (QwtPlotCurve::Lines) ;
replot() ;
}
To copy to clipboard, switch view to plain text mode
Bookmarks