chore: the way we setup aboutdialog layout

This commit is contained in:
Gary Wang 2020-10-08 22:24:54 +08:00
parent 5ace4e219c
commit 6da9c16c4f
2 changed files with 12 additions and 7 deletions

View File

@ -137,14 +137,12 @@ SOFTWARE.
this->close(); this->close();
}); });
QVBoxLayout * mainLayout = new QVBoxLayout; setLayout(new QVBoxLayout);
mainLayout->addWidget(m_tabWidget); layout()->addWidget(m_tabWidget);
mainLayout->addWidget(m_buttonBox); layout()->addWidget(m_buttonBox);
this->setLayout(mainLayout); setMinimumSize(361, 161); // not sure why it complain "Unable to set geometry"
this->setMinimumSize(361, 161); // not sure why it complain "Unable to set geometry"
this->resize(520, 350);
setWindowFlag(Qt::WindowContextHelpButtonHint, false); setWindowFlag(Qt::WindowContextHelpButtonHint, false);
} }
@ -152,3 +150,8 @@ AboutDialog::~AboutDialog()
{ {
} }
QSize AboutDialog::sizeHint() const
{
return QSize(520, 350);
}

View File

@ -14,7 +14,9 @@ class AboutDialog : public QDialog
Q_OBJECT Q_OBJECT
public: public:
explicit AboutDialog(QWidget *parent = nullptr); explicit AboutDialog(QWidget *parent = nullptr);
~AboutDialog(); ~AboutDialog() override;
QSize sizeHint() const override;
private: private:
QTabWidget * m_tabWidget = nullptr; QTabWidget * m_tabWidget = nullptr;