Skip to content

Commit

Permalink
chore: the way we setup aboutdialog layout
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed Oct 8, 2020
1 parent 5ace4e2 commit 6da9c16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,21 @@ 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);
}

AboutDialog::~AboutDialog()
{

}

QSize AboutDialog::sizeHint() const
{
return QSize(520, 350);
}
4 changes: 3 additions & 1 deletion aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6da9c16

Please sign in to comment.