diff --git a/src/qt/governancelist.cpp b/src/qt/governancelist.cpp index 263508dd63..11e36ec3f4 100644 --- a/src/qt/governancelist.cpp +++ b/src/qt/governancelist.cpp @@ -275,8 +275,7 @@ const Proposal* ProposalModel::getProposalAt(const QModelIndex& index) const GovernanceList::GovernanceList(QWidget* parent) : QWidget(parent), - ui(new Ui::GovernanceList), - clientModel(nullptr), + ui(std::make_unique()), proposalModel(new ProposalModel(this)), proposalModelProxy(new QSortFilterProxyModel(this)), proposalContextMenu(new QMenu(this)), @@ -321,10 +320,7 @@ GovernanceList::GovernanceList(QWidget* parent) : GUIUtil::updateFonts(); } -GovernanceList::~GovernanceList() -{ - delete ui; -} +GovernanceList::~GovernanceList() = default; void GovernanceList::setClientModel(ClientModel* model) { diff --git a/src/qt/governancelist.h b/src/qt/governancelist.h index d352508adb..4f72946a60 100644 --- a/src/qt/governancelist.h +++ b/src/qt/governancelist.h @@ -43,7 +43,7 @@ public: float paymentAmount() const; QString url() const; bool isActive() const; - QString votingStatus(const int nAbsVoteReq) const; + QString votingStatus(int nAbsVoteReq) const; int GetAbsoluteYesCount() const; void openUrl() const; @@ -96,9 +96,9 @@ public: void setClientModel(ClientModel* clientModel); private: - ClientModel* clientModel; + ClientModel* clientModel{nullptr}; - Ui::GovernanceList* ui; + std::unique_ptr ui; ProposalModel* proposalModel; QSortFilterProxyModel* proposalModelProxy;