Thank you very much for your feedback ...
yes, keeping QGV is required for other features of the complete code.
I try the following without success ...
//Same as before
view->setScene(scene);
setCentralWidget(view);
// Create a QWTPLOT
testhidden->setHidden(TRUE); //Hide the plot
testhidden->setTitle("QwtPlotWidget");
testhidden
->setAxisTitle
(QwtPlot::yLeft,
"Y");
testhidden
->setAxisTitle
(QwtPlot::xBottom,
"X");
// Calculate some fake curve
double xxval[10000];
double yyval[10000];
for(int i=0; i<10000;i++)
{
xxval[i] = i;
yyval[i] = qSin(xxval[i]) * qCos(2.0 * xxval[i]) * 100 +101;
}
//
// attach
m_curve->setRawSamples(xxval, yyval,250);
m_curve->attach(testhidden);
testhidden->show(); // Not sure if needed
//QT pixmap and rendering
scene->addItem(pixmapItem);
QwtPlotRenderer* plotrend = new QwtPlotRenderer;
plotrend->renderTo(testhidden,tmp);
//show the pixmap
pixmapItem->setPixmap(tmp);
// It compiles but fails to show the plot 8blank window) ...
//Same as before
scene = new QGraphicsScene(this);
view = new QGraphicsView();
view->setScene(scene);
setCentralWidget(view);
// Create a QWTPLOT
QwtPlotCurve* m_curve= new QwtPlotCurve;
QwtPlot* testhidden = new QwtPlot;
testhidden->setHidden(TRUE); //Hide the plot
testhidden->setTitle("QwtPlotWidget");
testhidden->setAxisTitle(QwtPlot::yLeft,"Y");
testhidden->setAxisTitle(QwtPlot::xBottom,"X");
// Calculate some fake curve
double xxval[10000];
double yyval[10000];
for(int i=0; i<10000;i++)
{
xxval[i] = i;
yyval[i] = qSin(xxval[i]) * qCos(2.0 * xxval[i]) * 100 +101;
}
//
// attach
m_curve->setRawSamples(xxval, yyval,250);
m_curve->attach(testhidden);
testhidden->show(); // Not sure if needed
//QT pixmap and rendering
pixmapItem = new QGraphicsPixmapItem();
scene->addItem(pixmapItem);
QPixmap tmp;
QwtPlotRenderer* plotrend = new QwtPlotRenderer;
plotrend->renderTo(testhidden,tmp);
//show the pixmap
pixmapItem->setPixmap(tmp);
// It compiles but fails to show the plot 8blank window) ...
To copy to clipboard, switch view to plain text mode
Is it what you meant ? or did I miss something ?
Val
Bookmarks