| 9 | #include "UpdateSystem.h" |
| 10 | |
| 11 | UpdateView::UpdateView() { |
| 12 | setWindowTitle(tr("检查更新")); |
| 13 | setWindowFlags(windowFlags() & |
| 14 | ~Qt::WindowMaximizeButtonHint & |
| 15 | ~Qt::WindowMinimizeButtonHint); |
| 16 | setWindowModality(Qt::ApplicationModal); |
| 17 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
| 18 | setFixedSize(333,380); |
| 19 | |
| 20 | UpdateWidget *_native = new UpdateWidget(&_updater, this); |
| 21 | _native->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
| 22 | _nativeLabel = new QLabel(tr("努力检查中,请稍后...")); |
| 23 | _nativeLabel->setWordWrap(true); |
| 24 | _nativeLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
| 25 | _nativeLabel->setAlignment(Qt::AlignHCenter); |
| 26 | |
| 27 | QGridLayout *layout = new QGridLayout; |
| 28 | layout->addWidget(_native, 0, 0); |
| 29 | layout->addWidget(_nativeLabel, 1, 0); |
| 30 | setLayout(layout); |
| 31 | |
| 32 | _timer = new QTimer(this); |
| 33 | connect(_timer, &QTimer::timeout, _native, &UpdateWidget::animate); |
| 34 | _timer->start(50); |
| 35 | |
| 36 | QTimer *timer2 = new QTimer(this); |
| 37 | connect(timer2, &QTimer::timeout, this, &UpdateView::noupdate); |
| 38 | timer2->start(5000); |
| 39 | } |
| 40 | |
| 41 | // 没有服务端,此处不实现 |
| 42 | void UpdateView::noupdate() { |
nothing calls this directly
no outgoing calls
no test coverage detected