diff --git a/aboutdialog.cpp b/aboutdialog.cpp index 419c3ae..8389126 100644 --- a/aboutdialog.cpp +++ b/aboutdialog.cpp @@ -137,14 +137,12 @@ SOFTWARE. this->close(); }); - QVBoxLayout * mainLayout = new QVBoxLayout; + setLayout(new QVBoxLayout); - mainLayout->addWidget(m_tabWidget); - mainLayout->addWidget(m_buttonBox); + layout()->addWidget(m_tabWidget); + layout()->addWidget(m_buttonBox); - this->setLayout(mainLayout); - this->setMinimumSize(361, 161); // not sure why it complain "Unable to set geometry" - this->resize(520, 350); + setMinimumSize(361, 161); // not sure why it complain "Unable to set geometry" setWindowFlag(Qt::WindowContextHelpButtonHint, false); } @@ -152,3 +150,8 @@ AboutDialog::~AboutDialog() { } + +QSize AboutDialog::sizeHint() const +{ + return QSize(520, 350); +} diff --git a/aboutdialog.h b/aboutdialog.h index d484562..4fc3bca 100644 --- a/aboutdialog.h +++ b/aboutdialog.h @@ -14,7 +14,9 @@ class AboutDialog : public QDialog Q_OBJECT public: explicit AboutDialog(QWidget *parent = nullptr); - ~AboutDialog(); + ~AboutDialog() override; + + QSize sizeHint() const override; private: QTabWidget * m_tabWidget = nullptr;