Properly show the custom header widget when started with non-QML KCMs
Calling KTitleWidget::setVisible(true), i.e. QWidget::setVisble(true), does not necessarily mean that isVisible() will return true as well. It can still be false if its ancestors are invisible.
When starting System Settings with a QWidgets-based KCM as starting page (e.g. via KRunner or CLI), this resulted in the module name not showing up as header title.
This commit decides whether or not to set the custom header text based on the original boolean condition, as opposed to checking isVisible() after setVisible() with that boolean.
(cherry picked from commit 0645f3fa)