Does it mean you have an application with a GUI thread, that has an invisible plot widget. The only purpose of this widget is, that you want to render an offscreen image that is sent to a different aplication, that is able to display this image - probably not in a QwtPlot widget ?
Yes.
But the plotting is not incremental. One takes a snap of spectrum from the spectrometer, makes 3 different curves based on previous data. and plots it. Each time whole new set of data is computed.
Assuming your plot has a size of 500x500 pixels your image will have a size of 250000 * 4 bytes = 1MB.
Well after paying attention to this, I found indeed sending data through image was larger. With image I found the message to be 940KB while without image it was 153KB. Seems its a matter of how the data was parsed. All messages are sent in xml. So in case of image, image data was stored in CDATA section. One CDATA for 3 curves, while in other case, values were sent as attribute, double array converted in base64. So it seems things were faster with image even with larger data because of xml parsing.
But IMO the overhead of rendering the image in a different thread is the last thing you have to worry.
I admit you are right.
But QwtPlot:

rint to a QImage should be possible from another thread. If it doesn't work in your application you need to report what the problems are in detail.
The Qwt:
rint crash is still a problem. Lets say I function device::sendData, which calls qwtPlot:
rint() function. device class is a member of another class deviceManager which is a thread. owner of deviceManager is say mainManager. Now say if i call device::sendData from another function device::readSpectrum then program crashes in device::sendData.
But if I emit a signal from device::readSpectrum to a slot(slotSendData) in mainManager, and call device::sendData from the mainManager::slotSendData, then it works fine.
The call stack in case of crash is -
> QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x097e4260) Line 2019 C++
QtCored4.dll!qFatal(const char * msg=0x67238224, ...) Line 2216 + 0x29 bytes C++
QtCored4.dll!qt_assert(const char * assertion=0x65914cac, const char * file=0x65914c90, int line=902) Line 1786 + 0x16 bytes C++
QtGuid4.dll!qt_win_display_dc() Line 902 + 0x47 bytes C++
QtGuid4.
dll!QWidget::metric(QPaintDevice::PaintDeviceMetric m
=PdmDpiY
) Line
1658 + 0x5 bytes C
++ QtGuid4.
dll!QPaintDevice::logicalDpiY() Line
96 + 0x16 bytes C
++ qwtd5.dll!03550fc8()
[Frames below may be incorrect and/or missing, no symbols loaded for qwtd5.dll]
qwtd5.dll!03550697()
qwtd5.dll!03552032()
qwtd5.dll!0351ad2c()
qwtd5.dll!0354a55d()
ntdll.dll!7c9623e0()
ntdll.dll!7c91005d()
msvcr80d.dll!_free_base(void * pBlock=0x095ee988) Line 109 + 0x13 bytes C
qwtd5.dll!03549373()
msvcr80d.dll!_free_dbg(void * pUserData=0x00000005, int nBlockUse=25) Line 1225 + 0x7 bytes C++
msvcr80d.dll!free(void * pUserData=0x012fa350) Line 1178 + 0xb bytes C++
qwtd5.dll!03590016()
qwtd5.dll!0358f699()
qwtd5.dll!0351c80f()
qwtd5.dll!0351ecdb()
qwtd5.dll!03590132()
qwtd5.dll!0356addd()
qwtd5.dll!03566606()
> QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x097e4260) Line 2019 C++
QtCored4.dll!qFatal(const char * msg=0x67238224, ...) Line 2216 + 0x29 bytes C++
QtCored4.dll!qt_assert(const char * assertion=0x65914cac, const char * file=0x65914c90, int line=902) Line 1786 + 0x16 bytes C++
QtGuid4.dll!qt_win_display_dc() Line 902 + 0x47 bytes C++
QtGuid4.dll!QWidget::metric(QPaintDevice::PaintDeviceMetric m=PdmDpiY) Line 1658 + 0x5 bytes C++
QtGuid4.dll!QPaintDevice::logicalDpiY() Line 96 + 0x16 bytes C++
QtGuid4.dll!QFont::QFont(const QFont & font={...}, QPaintDevice * pd=0x09781648) Line 709 + 0x8 bytes C++
qwtd5.dll!03550fc8()
[Frames below may be incorrect and/or missing, no symbols loaded for qwtd5.dll]
qwtd5.dll!03550697()
QtCored4.dll!QString::~QString() Line 866 + 0x11 bytes C++
qwtd5.dll!03552032()
qwtd5.dll!0351ad2c()
qwtd5.dll!0354a55d()
ntdll.dll!7c9623e0()
ntdll.dll!7c91005d()
msvcr80d.dll!_free_base(void * pBlock=0x095ee988) Line 109 + 0x13 bytes C
qwtd5.dll!03549373()
msvcr80d.dll!_free_dbg(void * pUserData=0x00000005, int nBlockUse=25) Line 1225 + 0x7 bytes C++
msvcr80d.dll!free(void * pUserData=0x012fa350) Line 1178 + 0xb bytes C++
qwtd5.dll!03590016()
qwtd5.dll!0358f699()
qwtd5.dll!0351c80f()
qwtd5.dll!0351ecdb()
qwtd5.dll!03590132()
qwtd5.dll!0356addd()
qwtd5.dll!03566606()
To copy to clipboard, switch view to plain text mode
In short, you are right about image overhead. And I have given some detail about the print crash. Can you help ,,, may be I am missing something or may be doing some mistake.
Bookmarks