PDA

View Full Version : Reusing a QPainterPath



Micawber
19th March 2009, 19:27
Hello, Mic here...

Looking through the documentation I don't find any way to clear a painter path so that I can put another path in it. My code now has to delete the previous one and allocate a new one when I want to change the path. The text for the moveTo() method mentions closing out a sub-path but I don't think this is what I want.

Any help/ideas would be appreciated.

-Mic

wysota
19th March 2009, 19:35
Simply assign an empty object to it.


QPainterPath path;
doSomethingWith(path);
path = QPainterPath();

Micawber
19th March 2009, 19:49
Thanks Wysota! I'm still learning my way with this C++ stuff.

-Mic