Because if you do that 10 times per second for two consecutive hours it's still hell slower than just returning a stored pointer which costs at most three machine instructions.
That's not so certain. What if you have two or more objects with the same name (which can easily happen if your widget contains other widgets composed from some more widgets)? What if the object you are looking for is not a QObject subclass?It will do the job,
That's true if your application doesn't do much besides looking for items. However such applications are very boring.and performance is not an issue either.
Why assume anything if you have a perfectly good solution that doesn't need any assumptions?There's assumption there that names are unique though.
Bookmarks