We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
看了下你的代码,控件布局部分没有用layout,都是用moveto(比如主界面的几个控件)、或者QPainter(对于比如体检得分控件),个人理解本质上依然是绝对布局。 比如void MainTopWidget::updateSizeAndPos()
{ m_userWidget->move(0, m_titleWidget->y() + m_titleWidget->height() + 10); m_scoreWidget->move(0, m_userWidget->y() + m_userWidget->height() + 10); m_bottomWidget->move(0, m_scoreWidget->y() + m_scoreWidget->height() + 10); } 是不是这样写更好写: QVBoxLayout* vLayout = new QVBoxLayout; QHBoxLayout* hLayout = new QHBoxLayout; hLayout->addStretch(); hLayout->addWidget(m_userWidget); QHBoxLayout* hLayout _1= new QHBoxLayout; hLayout_1->addWidget(m_scoreWidget); hLayout_1->addStretch(); vLayout->addLayout(hLayout); vLayout->addLayout(hLayout_1); vLayout->addWidget(m_bottomWidget);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
{
m_userWidget->move(0, m_titleWidget->y() + m_titleWidget->height() + 10);
m_scoreWidget->move(0, m_userWidget->y() + m_userWidget->height() + 10);
m_bottomWidget->move(0, m_scoreWidget->y() + m_scoreWidget->height() + 10);
}
是不是这样写更好写:
QVBoxLayout* vLayout = new QVBoxLayout;
QHBoxLayout* hLayout = new QHBoxLayout;
hLayout->addStretch();
hLayout->addWidget(m_userWidget);
QHBoxLayout* hLayout _1= new QHBoxLayout;
hLayout_1->addWidget(m_scoreWidget);
hLayout_1->addStretch();
vLayout->addLayout(hLayout);
vLayout->addLayout(hLayout_1);
vLayout->addWidget(m_bottomWidget);
The text was updated successfully, but these errors were encountered: