Qt-- a little idea of drawing Qpainter

Because I have not studied the system Qt, it is now with the current study, learn what needs what, write a blog record your own ideas, there are many deficiencies, welcome to discuss with the message, learn together.

Recently has been to get a map, needs its own painting grid background, real-time display of the track vehicle movement, as well as map rotation ah what

It has been painted directly on the widget

Drawing on the widget need to reload painterEvent function! ! (important)

In this function, then draw graphics inside.

But just see a pixmap something, you can call directly painter! Paint is not in wideget on the drawing on the pixmap, you do not need to reload the painterEvent function!

Then unfinished as long as the display pixmap on the line, many will find that this method is simple.

Of course, first I feel myself drawing easy to understand on the widget, you can choose to feel good things according to their own situation.

Guess you like

Origin www.cnblogs.com/zhouya1/p/11873071.html