CAboutDialog: Make use of unique_ptr

This commit is contained in:
Lioncash 2020-06-28 07:08:43 -04:00
parent d7ee7fe22d
commit 464b417d24
2 changed files with 7 additions and 8 deletions

View File

@ -4,7 +4,7 @@
CAboutDialog::CAboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CAboutDialog)
ui(std::make_unique<Ui::CAboutDialog>())
{
ui->setupUi(this);
@ -13,7 +13,4 @@ CAboutDialog::CAboutDialog(QWidget *parent) :
ui->AboutLabel->setText(LabelText);
}
CAboutDialog::~CAboutDialog()
{
delete ui;
}
CAboutDialog::~CAboutDialog() = default;

View File

@ -3,6 +3,8 @@
#include <QDialog>
#include <memory>
namespace Ui {
class CAboutDialog;
}
@ -12,11 +14,11 @@ class CAboutDialog : public QDialog
Q_OBJECT
public:
explicit CAboutDialog(QWidget *parent = 0);
~CAboutDialog();
explicit CAboutDialog(QWidget *parent = nullptr);
~CAboutDialog() override;
private:
Ui::CAboutDialog *ui;
std::unique_ptr<Ui::CAboutDialog> ui;
};
#endif // CABOUTDIALOG_H