Qt Update Gui From Thread Chart

14.10.2019
Qt Update Gui From Thread Chart Rating: 3,5/5 6929 votes

Forcing the Qt GUI to update before entering a separate function. Ask Question Asked 6 years. (which are thread-safe by default) to signal to your main GUI thread when your processing is complete. Share improve this answer. Answered Sep 13 '12 at 16:23. Forcing the Qt GUI to update. I have found that while my tools are running the GUI becomes non-responsive. The general wisdom is that the work. How do I maintain a resposive GUI using QThread with PyQGIS. Ask Question Asked 6 years, 7 months ago. The result is that any code in doWork will run in a seperate thread, leaving the GUI free to respond to user input. Communicating with the Main Thread. When a Qt application starts, only one thread is running—the main thread. This is the only thread that is allowed to create the QApplication or QCoreApplication object and call exec() on it. After the call to exec(), this thread is either waiting for an event or processing an.

  1. Qt Gui Application
  2. Qt Gui Design
  3. C++ Qt Gui
Qt Update Gui From Thread Chart

Hi everyone, I've got a poser here. I use the QCustomPlot in a good old desktop application to my full satisfaction. But now I need to extend the user interface to the web, I'd like to take the qualities of the QCP with me. Maybe I'm not the first one to try this, maybe some of you out there (or you, derManu) have already thought about this or even better have it done. So the thing is: Is it possible to run QCustomPlot outside the GUI thread to paint the plot on, say, a QImage?

The first task is clear - to get rid of the QWidget and substitute the geometry, events etc. This one is clear and I'm already half way through. But before I'll dig deep into the 'Paint It Black' stuff, I just wanted to ask advice. I myself am not an expert on painting in threads in Qt and will much appreciate any sort of advice / help / ready-made QCP-in-Threads source as well as a possible no-go warning. Thanks in advance!

I have the same need: I'm using QCustomPlot in a scientific application and think is does a really great job - many thanks! I now need to process a large amount of data on a remote machine and want to generate plots (in png or pdf format) to monitore the progress.

Added.6 hours ago. Sponsored Links. Opera mini browser free download for samsung gt e2652.

It would be great to have a way of using the main functionality without having to run a GUI. I'm afraid I won't be of great help because I'm not to much into the Qt internals.

But if I make progress I'll post here and of course I'd appreciate any kind of help. Cheers, Robert. My colleague has solved this temporarily by putting the image painting logic outside the main project into a standalone executable, which is called with a set of parameters when ever there is the need to repaint one of the pictures.

The executable takes the parameters and outputs a picture file without user interaction, that is loads the GUI libraries but doesn't create any sort of GUI. Depending on your needs and configuration, this may or may not bring too much of an overhead (to my understanding the main problem is on the OS handling the shared library of QtGui4.dll in our case), but at least as a quick patch it has worked for us.

Qt Gui Application

I'll keep you and others posted via this forum thread if we find the way (and the time, off course) to push this thing forward - maybe we can come up with a solution together. I'm in the same boat.

I'm happy to put some time into this if I can get some technical guidance. The only thing I have to contribute so far is that I read that QWidgets must be in the main GUI event loop thread and because they aren't 'reentrant' It sounds like it would require large modifications of the QCustomPlot library to remove it's dependence on QWidgets. That probably won't work. What if we have a separate GUI loop running within the main window.

Can we have it share the same screenspace as the main GUI window but be running on another thread? This might have the same effect as starting another QApplication like Robert said. The GUIs don't have to interact, at least in my case, which might prevent multithreadding errors and make it simpler to implement. At a minimum, signal and slot communication would be nice. This thread has over 500 views! Let's put our heads together and figure this out! Yes please let me know if i am doing something wrong, i find this behavor strange.

Im plotting 4096 histograms, 4096x4096 sized heatmap and two line items. Not very heavy. I have to call four replots for four channels using a for loop inside a slot which is called every 500ms by a QTimer. The histogram data is generated in a device that is connected to the PC via ethernet and sends the whole distribution in one go. Hence i have no option but to use setData. The heatmap is edited ( data) to append the map. I donot have antialiasing or alpha.

The first call to replot, before i made the changes, takes about 600ms, the next one about 80ms. Do not know why. This is just the replot, not the data processing, i.e. The total process takes up quite a bit of time. I activated opengl today, i use OGLWidget in QT5. And #define QTGRAPHICSSYSTEM opengl and #define QCUSTOMPLOTUSEOPENGL. With this, the first replot takes 400ms, and the subsequent ones take 50ms.

This is a better. But if you could tell me why the first replot takes 400ms, that would be awesome, than i could trim down the use of threads. With the modified code and ogl, it takes 150ms on the first replot and 1-2ms on the subsequent ones.

Interest Dealing with large data sets with QtCharts Interest Dealing with large data sets with QtCharts Benjamin TERRIER Mon Nov 6 10:42:16 CET 2017. Previous message (by thread):. Next message (by thread):. Messages sorted by: 2017-11-05 14:37 GMT+01:00 iman ahmadvand: Hi everyone. I was wonder if it's possible to manage large data sets with qchart? What do you mean by 'large data sets'?

How many points? The consuming operation is a loop for adding points to QLineSeries + adding each series to QChart. Since QChart is a view on it's own and unfortunately data sets are integrated inside the view so it can't be used in another background worker at all, so what is the possible solution to keep GUI responsive while feeding the chart? Note that QCoreApplication::processEvents doesn't help this situation This is not the same issue as 'large data sets', you are talking about updating the chart while the GUI run. The critical parameter is how many points per second do you want to add to the?

Qt Gui Design

Thread

Anyway, I have played a bit with QtCharts. For large data sets (100k+ points), the drawing performance degrades and you have to enable OpenGL acceleration. This gives a huge boost in performances but reduce the customization options. Also it seems there is a limit to how many point you can have. For updating you chart while keeping the ui responsive, you can have a 'feeder' in another thread that will send the data using signals. The chart will receive the data asynchronously in a slot. The signal/slot being connected with Qt::QueuedConnection.

C++ Qt Gui

You can even have your worker waits for the UI with Qt::BlockingQueuedConnection, so that you do not fill the event queue. Br, Benjamin. Previous message (by thread):.

Next message (by thread):. Messages sorted.

Comments are closed.