CSelectResourcePanel: Make use of in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-28 05:52:15 -04:00
parent 5a041dd474
commit c96ed14062
2 changed files with 6 additions and 7 deletions

View File

@ -7,7 +7,7 @@
CSelectResourcePanel::CSelectResourcePanel(CResourceSelector *pSelector)
: QFrame(pSelector)
, mpUI(new Ui::CSelectResourcePanel)
, mpUI(std::make_unique<Ui::CSelectResourcePanel>())
, mpSelector(pSelector)
, mModel(pSelector)
{
@ -69,10 +69,7 @@ CSelectResourcePanel::CSelectResourcePanel(CResourceSelector *pSelector)
mpUI->SearchBar->setFocus();
}
CSelectResourcePanel::~CSelectResourcePanel()
{
delete mpUI;
}
CSelectResourcePanel::~CSelectResourcePanel() = default;
// Slots
void CSelectResourcePanel::FocusChanged(QWidget*, QWidget *pNew)

View File

@ -5,6 +5,8 @@
#include "CFilteredResourceModel.h"
#include "CResourceSelector.h"
#include <memory>
namespace Ui {
class CSelectResourcePanel;
}
@ -12,7 +14,7 @@ class CSelectResourcePanel;
class CSelectResourcePanel : public QFrame
{
Q_OBJECT
Ui::CSelectResourcePanel *mpUI;
std::unique_ptr<Ui::CSelectResourcePanel> mpUI;
CResourceSelector *mpSelector;
CFilteredResourceModel mModel;
@ -20,7 +22,7 @@ class CSelectResourcePanel : public QFrame
public:
explicit CSelectResourcePanel(CResourceSelector *pSelector);
~CSelectResourcePanel();
~CSelectResourcePanel() override;
public slots:
void FocusChanged(QWidget *pOld, QWidget *pNew);