#include "AboutView.h" #include "AppInfoWidget.h" #include #include #include #include #include #include AboutView::AboutView(QWidget *parent) : QWidget(parent) { setWindowTitle("关于"); } void AboutView::showEvent(QShowEvent *event) { qDebug() << __FUNCTION__; QWidget::showEvent(event); initialize(); } void AboutView::hideEvent(QHideEvent *event) { qDebug() << __FUNCTION__ << __LINE__ << endl; QWidget::hideEvent(event); } void AboutView::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); initialize(); m_bgLabel->resize(event->size()); m_bgLabel->setPixmap(pixmap.scaled(width(), height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); } void AboutView::initialize() { if (m_initilized == true) { return; } m_bgLabel = new QLabel(this); pixmap = QPixmap(":/resource/background/1.jpg"); m_vBoxLayout = new QVBoxLayout(this); m_appInfoWidget = new AppInfoWidget(this); m_vBoxLayout->addWidget(m_appInfoWidget); m_initilized = true; }