Quantcast
Channel: Active questions tagged qpainter - Stack Overflow
Viewing all articles
Browse latest Browse all 58

paintEvent is not called after an update() in mouseMoveEvent

$
0
0

I am using a QAbstractScrollArea and a custom QWidget derivative widget as "the" widget(having sizeHint() overriden).

The application needs to constantly update the QWidget content during mouseMove (kind ofa drag, but not exactly, it is a drawing tool to draw lines between objects, thus the mousecursor needs to change and the line needs to be drawn on the fly).

The application works fine, e.g., I can render the content properly, scrollbars visible,I can manually update the viewport during scrollContentsBy, etc.

However, regardless that I manually fire an update() (or repaint()) call in mouseMoveEvent, the paintEvent will only be called after the "drag" process is over, e.g., the mouseReleaseEvent is fired.

And I'm clueless why this happens. Obviously, if I do the update directly within themouseMoveEvent, it'll be rejected by QPainter (as I can't instantiate a QPainter withinthe mouseMoveEvent— Qt drops "paintEngine should no longer be called" when trying to do that).


Viewing all articles
Browse latest Browse all 58

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>