It's better to change it to `if (!c->isVisible())`