How to increase refresh rate on mouseMoveEvent?
-
@Yippiyak
Hi
Do you by any way store points/lines while drawing ?
if yes Can you try the
http://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html
which uses dirty rect for updating and see if that is faster?override just means, "tell me if i dont actually override the virtual function"
so if u flag something for override and u have wrong signature, compiler will tell you.Anyway, if you testing with a usb mouse, it might also just be the actually polling from Os side.
in win 7 days, i used
http://www.softpedia.com/get/Tweak/System-Tweak/USB-Mouserate-switcher.shtml
but i have not tried in window 8+ if it still have any effect.wrote on 10 Jul 2018, 20:38 last edited by@mrjj It is not the USB, but I am running about 1.4 million data points in the background so the the project is slow as a whole haha. Im just trying to see if there is a way to reduce the time necessary to call and update mouseMoveEvent.
-
@mrjj It is not the USB, but I am running about 1.4 million data points in the background so the the project is slow as a whole haha. Im just trying to see if there is a way to reduce the time necessary to call and update mouseMoveEvent.
@Yippiyak
ah, so the mouse drawing cross paint event is shared with
painting of the the points? -
@mrjj
No, its threaded and theoretically happens independently. Its just not tracking fast enough.@Yippiyak
Ok. Normally in games they use hardware cursors to avoid this kind of trailing.
https://stackoverflow.com/questions/6957039/what-is-hardware-cursor-and-how-does-it-workIm not sure there is a way, to make it go faster. Unless its due to something lagging/stressing the event queue
or anything like that. -
@Yippiyak
Ok. Normally in games they use hardware cursors to avoid this kind of trailing.
https://stackoverflow.com/questions/6957039/what-is-hardware-cursor-and-how-does-it-workIm not sure there is a way, to make it go faster. Unless its due to something lagging/stressing the event queue
or anything like that. -
@mrjj
Thanks for the tip on the hardware cursor, that may be the approach I need to take anyway in order to boost my programs performance. I am rendering a spectrogram and it is too slow!@Yippiyak
Is the spectrogram using openGL or just QPainter? -
wrote on 10 Jul 2018, 21:48 last edited by
@mrjj
Just qpainter and qcharts atm, which I suspect is my issue, but I also have no real clue how to even begin with OpenGL. Also would you mind upvoting my reputation? I can only post once every 10 min and its getting annoying haha. -
@mrjj
Just qpainter and qcharts atm, which I suspect is my issue, but I also have no real clue how to even begin with OpenGL. Also would you mind upvoting my reputation? I can only post once every 10 min and its getting annoying haha.@Yippiyak said in How to increase refresh rate on mouseMoveEvent?:
qcharts
well for QLineSeries and QScatterSeries, it seems easy
https://doc.qt.io/Qt-5/qtcharts-openglseries-example.html
for other im not sure. -
@Yippiyak said in How to increase refresh rate on mouseMoveEvent?:
qcharts
well for QLineSeries and QScatterSeries, it seems easy
https://doc.qt.io/Qt-5/qtcharts-openglseries-example.html
for other im not sure. -
@mrjj
Yeah im running the acceleration but its still not fast enough. Dumb part is the code works flawlessly in my c# implementation but C++ is brutalizing it. Should be the other way around.@Yippiyak
Thats odd. what graph did you use with c# ? -
@mrjj
A pretty basic line plot using direct3d hardware acceleration and like 60 other files lolLifetime Qt Championwrote on 10 Jul 2018, 22:37 last edited by mrjj 7 Oct 2018, 22:38@Yippiyak
Ok so most likely your plotter is just more specialized than QtChart and hence the speed difference.
You could try some test with direct openGL to see if it is faster -
@Yippiyak
Ok so most likely your plotter is just more specialized than QtChart and hence the speed difference.
You could try some test with direct openGL to see if it is faster -
@mrjj
Yeah, I think that is the issue, but I am not entirely sure how to get started with converting what I have to OpenGL and what not.@Yippiyak
well it really depends on how your layered your plotter
most of the work would to replace the Direct3D calls.
this is a very basic get started example
http://doc.qt.io/qt-5/qtgui-openglwindow-example.html -
wrote on 11 Jul 2018, 04:19 last edited by
Well in my opinion maybe you can try not refreshing immediately. Just record the position in a fifo and return. You can get yourself another thread which looks through the fifo and draws, so the handler may return faster, and missing fewer. Well...in fact I am not very sure of this....
16/21