From 3e1d2e46ceea202120b4ff814fbd872bc6fc60f3 Mon Sep 17 00:00:00 2001 From: Louie S Date: Thu, 14 Mar 2024 18:46:37 -0400 Subject: RulesDialog menu working (functionality WIP) --- src/assignmentList.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/assignmentList.cpp') diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp index 953d443..673e0b5 100644 --- a/src/assignmentList.cpp +++ b/src/assignmentList.cpp @@ -18,6 +18,7 @@ #include "backend/db_sqlite.h" #include "entryLayout.h" #include "groupLayout.h" +#include "lib.h" #include "preferencesDialog.h" AssignmentList::AssignmentList() { @@ -76,7 +77,7 @@ void AssignmentList::displayWidgets() { int i; // clear out old layouts if they exist - this->recursiveClear(ui.groups_layout); + recursiveClear(ui.groups_layout); for(i = 0; i < groups.size(); ++i) { if(groups[i]->hidden) continue; @@ -138,12 +139,3 @@ void AssignmentList::aboutDialog() { QMessageBox about; about.about(this, "About Assignment List", "Created by Louie S. - 2023"); } - -void AssignmentList::recursiveClear(QLayout *layout) { - QLayoutItem *child; - while((child = layout->takeAt(0)) != nullptr) { - if(child->layout()) this->recursiveClear(child->layout()); - delete child->widget(); - delete child; - } -} -- cgit