Commit 6acf35e4 authored by Committed by Vlad ZahorodniiBrowse files
Avoid QPointer in return types of Input methods
QPointer is a really useful way to store a pointer over time. It doesn't make have any value as a return value used by a short-lived method. There isn't a good copy constructor, it's effectively the same as creating a new QWeakPointer reference that has to be cleaned up. Testing if something is null is still the same. A new QPointer can be made by the caller if it actually is needed. Input handling is a very hot path called many times a frame, so it's important to keep this light. focus() and at() are called a lot which added up to slightly over 1% of CPU time when moving the mouse about.
Showing with 47 additions and 36 deletions