ui 0.2 添加loading界面 待美观

This commit is contained in:
Norah
2020-02-01 21:26:08 +08:00
parent c0cb15818b
commit 178c1ac179
5 changed files with 140 additions and 6 deletions

View File

@@ -1,10 +1,11 @@
#include "Reconstruction.h"
#include <QtWidgets/QApplication>
#include "Loading.h"
#include "Reconstruction.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Reconstruction w;
w.show();
Loading l;
l.show();
return a.exec();
}

38
Loading.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include "Loading.h"
#include "Classes/Reconstruction.h"
Loading::Loading(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
ui.label_2->hide();
ui.progressBar->setValue(0);
// todo ¼ÓÔØ
ui.progressBar->setValue(100);
ui.label_2->show();
ready2Enter = true;
}
Loading::~Loading()
{
}
void Loading::updateSlot()
{
ui.progressBar->setValue(currentValue);
}
void Loading::mousePressEvent(QMouseEvent *event)
{
if(ready2Enter)
{
if (event->button() == Qt::LeftButton)
{
this->hide();
Reconstruction *w = new Reconstruction();
w->show();
}
}
}

24
Loading.h Normal file
View File

@@ -0,0 +1,24 @@
#pragma once
#include <QWidget>
#include "ui_Loading.h"
#include <QMouseEvent>
class Loading : public QWidget
{
Q_OBJECT
public:
Loading(QWidget *parent = Q_NULLPTR);
~Loading();
private:
Ui::Loading ui;
bool ready2Enter = false;
int currentValue = 0;
void updateSlot();
protected:
void mousePressEvent(QMouseEvent *);
};

71
Loading.ui Normal file
View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Loading</class>
<widget class="QWidget" name="Loading">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>871</width>
<height>494</height>
</rect>
</property>
<property name="windowTitle">
<string>Loading</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>340</x>
<y>150</y>
<width>151</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<family>Adobe Devanagari</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>LOADING...</string>
</property>
</widget>
<widget class="QProgressBar" name="progressBar">
<property name="geometry">
<rect>
<x>80</x>
<y>330</y>
<width>711</width>
<height>23</height>
</rect>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>320</x>
<y>420</y>
<width>181</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>书体坊雪纯体3500</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>按任意键进入</string>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1111</width>
<height>604</height>
<height>601</height>
</rect>
</property>
<property name="windowTitle">
@@ -33,11 +33,11 @@
<x>249</x>
<y>-1</y>
<width>851</width>
<height>551</height>
<height>531</height>
</rect>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<widget class="QWidget" name="page">
<widget class="QLabel" name="label_2">