123456789101112131415161718192021222324252627282930313233343536 |
- #include "AboutView.h"
- #include "AppInfoWidget.h"
- #include <QBoxLayout>
- #include <QApplication>
- #include <QPainter>
- #include <QDebug>
- AboutView::AboutView(QWidget *parent) : QWidget(parent)
- {
- initialize();
- initLayout();
- setWindowTitle("关于");
- }
- void AboutView::paintEvent(QPaintEvent *event)
- {
- QWidget::paintEvent(event);
- QPainter painter(this);
- QPixmap pixmap(":/resource/background/1.jpg");
- painter.drawPixmap(0, 0,
- pixmap.scaled(width(), height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation));
- }
- void AboutView::initialize()
- {
- m_vBoxLayout = new QVBoxLayout(this);
- m_appInfoWidget = new AppInfoWidget(this);
- }
- void AboutView::initLayout()
- {
- m_vBoxLayout->addWidget(m_appInfoWidget);
- }
|