I'm trying to copy QwtPlot.
copy constructor doesn't work:
> QFrame::QFrame(const QFrame&) is private. in qframe.h
...Q_DISABLE_COPY(QFrame)
Could you help me?
thank YOU!
I'm trying to copy QwtPlot.
copy constructor doesn't work:
> QFrame::QFrame(const QFrame&) is private. in qframe.h
...Q_DISABLE_COPY(QFrame)
Could you help me?
thank YOU!
i have 5 QWidgets, such as 5 oscilloscopes. Each Widget has 10 sec interval. so over 50 sec i would update Widget #1 but i don't want remove all dates. so i can print, export, etc with all Widgets. e.g. over 100 sec i can print 10 oscilloscopes
I don't understand your explanation. You want to clone a plot to end up with 50 widgets in the end? Or do you just need an image of a plot so that you can save it somewhere?
I need an image and all points from thess widgets (X,Y, and timestamp). I want to print all dates and images.
I have points for 5 min but just 5 plots to draw these points. I draw the first 10 sec in Plot 1 (0 to 10 sec), then Plot 2 (10 to 20 sec) and so on. The dates from 50 sec can I draw in Plot 1. A Circular buffer but with Plots. Use can see the last 5 Plots, but others images and tables of points (X,Y, Timestamp) are in memory located
Last edited by TomiBomi; 19th January 2012 at 13:43.
Use QwtPlotRenderer to render a plot to an image, store the image somewhere and reuse the plot object.
It doesn't work
constructor(){
printer = new QPrinter(QPrinter::HighResolution);
renderer = new QwtPlotRenderer();
}
FunctionNextPlot(){
// e.g. when Plot 1 is full, stop(Plot1); start(Plot2)
renderer->renderTo(plotVec[PlotNumberCounter], *printer); // HERE: each time i see a dialog, so each plot will be saved separate but i want just one file with all plots ???
}
Added after 31 minutes:
or do you mean
void renderDocument (QwtPlot *, const QString &format, const QSizeF &sizeMM, int resolution=85)
void renderDocument (QwtPlot *, const QString &title, const QString &format, const QSizeF &sizeMM, int resolution=85)
but i save also separatly all Plots... if program runs 10 min with 10 sec interval, i have 60 files
Last edited by TomiBomi; 19th January 2012 at 18:21.
Qt Code:
px.fill(); QwtPlotRenderer renderer; renderrer.renderTo(plot, &p); px.save("file.png");To copy to clipboard, switch view to plain text mode
This saves a single plot to a single image. Then you can compose images by creating yet another image and drawing all those on it or printing all of them to a single QPrinter object.
Alternatively (however this is more complicated) create one large pixmap and use QPainter::setViewport() to limit the area drawn so that you can paint all plots on a single pixmap.
TomiBomi (19th January 2012)
almost. just
renderrer.renderTo(plot, px);
but this works too:
renderer.renderDocument( plot, fileName, QSizeF(300, 100), 85);
Bookmarks