From dd32d292225ddde81fb5dc90ca239a977ce8bc7a Mon Sep 17 00:00:00 2001 From: Exeldro Date: Thu, 14 Nov 2024 15:18:32 +0100 Subject: [PATCH] Remove Qt warnings --- multistream.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/multistream.cpp b/multistream.cpp index dd17b87..5bd3e30 100644 --- a/multistream.cpp +++ b/multistream.cpp @@ -99,10 +99,12 @@ void RemoveWidget(QWidget *widget) if (!widget) return; if (widget->layout()) { - while (QLayoutItem *item = widget->layout()->takeAt(0)) { + auto l = widget->layout(); + QLayoutItem *item; + while (l->count() > 0 && (item = l->takeAt(0))) { RemoveLayoutItem(item); } - delete widget->layout(); + delete l; } delete widget; }