Added check to only grab visible child widgets

Trying to grab a non-visible widget may lead to an application hang, because glGetError may never clear the error if a GL context is not created.
See details at http://www.na-mic.org/Bug/view.php?id=3438
Merge pull request #374 from lassoan/373-grabVTKWidget-hangs

373 - Added check to only grab visible child widgets
Fix indent style for braces in if statement