From 6e9626fa9bd236071d859b8406af5d9fff12a768 Mon Sep 17 00:00:00 2001 From: Raul Radu <raul.radu@mail.polimi.it> Date: Wed, 7 Feb 2024 22:38:16 +0100 Subject: [PATCH] [Core] Using smart pointers in SubscriptionPanel --- .../Components/SubscriptionsPanel/SubscriptionsPanel.cpp | 4 ++-- src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.cpp b/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.cpp index f5479bbf..93456672 100644 --- a/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.cpp +++ b/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.cpp @@ -58,10 +58,10 @@ void SubscriptionsPanel::setupUi() { QVBoxLayout* layout = new QVBoxLayout; - filtersList = new QListWidget; + filtersList = std::make_unique<QListWidget>(); filtersList->setSelectionBehavior(QAbstractItemView::SelectItems); filtersList->setSelectionMode(QAbstractItemView::SingleSelection); - layout->addWidget(filtersList); + layout->addWidget(filtersList.get()); QHBoxLayout* buttonsLayout = new QHBoxLayout; diff --git a/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.h b/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.h index 16851377..745b9a15 100644 --- a/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.h +++ b/src/shared/Components/SubscriptionsPanel/SubscriptionsPanel.h @@ -42,5 +42,5 @@ private: void setupUi(); void removeSubscription(QListWidgetItem* item); - QListWidget* filtersList; + std::unique_ptr<QListWidget> filtersList; }; -- GitLab