From 9760ed0fca36990ea69e68e6057266e27cba62a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Thu, 13 Apr 2023 10:49:18 +0800 Subject: Children inherit mode --- Bootstrap.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Bootstrap.cxx') diff --git a/Bootstrap.cxx b/Bootstrap.cxx index d123dca..38bbba5 100644 --- a/Bootstrap.cxx +++ b/Bootstrap.cxx @@ -136,6 +136,13 @@ void Bootstrap::setMode(Mode mode) emit bodyBgChanged(); emit borderColorChanged(); emit headingColorChanged(); + for (auto sibling : parent()->findChildren()) + if (strstr(sibling->metaObject()->className(), "_QMLTYPE_")) + for (auto child : sibling->children()) + if (!strcmp(child->metaObject()->className(), + "Bootstrap")) + qobject_cast(child) + ->setMode(mode); } Bootstrap::Theme Bootstrap::theme() const -- cgit v1.2.3