issue #19550: Clean up getValue code
issue #19550: More changes from Qt code review.