So... This creates the QPoint on the heap:
Qt Code:
To copy to clipboard, switch view to plain text mode
And this creates it on the stack?
You got it
Yes, this is correct.
I'm a rebel in the S.D.G.
Great, thanks!
Since the QPoint is something that is just needed temporarily, would it be better to create it on the stack?
And should I always create a widget on the heap?
For your case you should better allocate your QPoint on the stack, cause it is small
Generally, it depends on memory management and perfomance features.
N3wb: You should really get a good book on C++ first, or try Python instead with some PyQt tutorials and stuff. Jumping into C++ like this is a recipe for very poor code a LOT of frustration.
N3wb (17th September 2009)
Bookmarks