Function Widget.canFocus

returns true if widget is focusable and visible and enabled

bool canFocus() @property;