12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #include "AboutView.h"
- #include "AppInfoWidget.h"
- #include <QBoxLayout>
- #include <QApplication>
- #include <QPainter>
- #include <QLabel>
- #include <QResizeEvent>
- #include <QDebug>
- AboutView::AboutView(QWidget *parent) : QWidget(parent)
- {
- setWindowTitle("关于");
- }
- void AboutView::showEvent(QShowEvent *event)
- {
- QWidget::showEvent(event);
- initialize();
- }
- 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;
- }
|