True when `widget` lives inside one of the host composite widgets that manage their own internal child controls (CredentialsEditor's allow-insecure box, DateRangePicker's sub-widgets). Those internals are opaque — adapting a checkbox buried in them would corrupt the composite, so they are left alone.
| 374 | // DateRangePicker's sub-widgets). Those internals are opaque — adapting a |
| 375 | // checkbox buried in them would corrupt the composite, so they are left alone. |
| 376 | static bool isInsideHostComposite(const QWidget* widget) { |
| 377 | for (QWidget* p = widget->parentWidget(); p != nullptr; p = p->parentWidget()) { |
| 378 | if (qobject_cast<CredentialsEditor*>(p) != nullptr || qobject_cast<DateRangePicker*>(p) != nullptr) { |
| 379 | return true; |
| 380 | } |
| 381 | } |
| 382 | return false; |
| 383 | } |
| 384 | |
| 385 | // Push the checkbox's current state onto its ToggleSwitch (keeping it hidden). |
| 386 | static void syncToggleFromCheckBox(QCheckBox* checkbox) { |
no test coverage detected