添加自检界面

This commit is contained in:
2020-05-15 18:47:47 +08:00
parent 5eb985c8af
commit ccc7e25aec
21 changed files with 745 additions and 233 deletions
+2
View File
@@ -30,6 +30,7 @@ include (./Help/Help.pri)
include (./MissionUI/MissionUI.pri)
include (./MenuBarUI/MenuBarUI.pri)
include (./CommandUI/CommandUI.pri)
include (./CheckUI/CheckUI.pri)
win32:
@@ -152,3 +153,4 @@ TRANSLATIONS = GCS_zh_CN.ts
RESOURCES += \
res.qrc
+25
View File
@@ -0,0 +1,25 @@
#include "CheckUI.h"
#include "ui_CheckUI.h"
CheckUI::CheckUI(QWidget *parent) :
QWidget(parent),
ui(new Ui::CheckUI)
{
ui->setupUi(this);
//load qss
QFile file(":/qss/CheckUI.qss");
file.open(QFile::ReadOnly);
QTextStream filetext(&file);
QString stylesheet = filetext.readAll();
this->setStyleSheet(stylesheet);
file.close();
}
CheckUI::~CheckUI()
{
delete ui;
}
+24
View File
@@ -0,0 +1,24 @@
#ifndef CHECKUI_H
#define CHECKUI_H
#include <QWidget>
#include "QFile"
#include "QDebug"
namespace Ui {
class CheckUI;
}
class CheckUI : public QWidget
{
Q_OBJECT
public:
explicit CheckUI(QWidget *parent = nullptr);
~CheckUI();
private:
Ui::CheckUI *ui;
};
#endif // CHECKUI_H
+35
View File
@@ -0,0 +1,35 @@
QT += opengl
QT += network
QT += sql
QT += svg
QT += quickwidgets
QT += quick
QT += qml
FORMS += \
$$PWD/CheckUI.ui
HEADERS += \
$$PWD/CheckUI.h
SOURCES += \
$$PWD/CheckUI.cpp
RESOURCES += \
$$PWD/CheckUIres.qrc
+39
View File
@@ -0,0 +1,39 @@
QFrame {
background-color: #FFFFFF;
}
QPushButton {
background-color: #FFFFFF /*palegoldenrod*/;
border-width: 2px;
border-color: darkkhaki;
border-style: solid;
border-radius: 5;
padding: 3px;
font: 30px "Arial";
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
QPushButton:flat {
border: none; /* no border for a flat push button */
}
QPushButton:default {
border-color: navy; /* make the default button prominent */
}
QLineEdit {
background-color: #FFFFFF
}
+84
View File
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CheckUI</class>
<widget class="QWidget" name="CheckUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QPushButton" name="pushButton">
<property name="geometry">
<rect>
<x>200</x>
<y>30</y>
<width>121</width>
<height>71</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>131</width>
<height>81</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_3">
<property name="geometry">
<rect>
<x>190</x>
<y>140</y>
<width>171</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>161</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_5">
<property name="geometry">
<rect>
<x>30</x>
<y>200</y>
<width>111</width>
<height>81</height>
</rect>
</property>
<property name="text">
<string>PushButton</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>
+5
View File
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/qss">
<file>CheckUI.qss</file>
</qresource>
</RCC>
+6
View File
@@ -16,6 +16,12 @@ CommandUI::CommandUI(QWidget *parent) :
file.close();
//load json
}
CommandUI::~CommandUI()
+2 -2
View File
@@ -48,9 +48,9 @@ MenuBarUI::MenuBarUI(QWidget *parent) :
file.close();
ui->textBrowser->setText( tr("Starting...\n"));
log_te = ui->textBrowser;
//log_te = ui->textBrowser;
qInstallMessageHandler(myMessageOutput);
//qInstallMessageHandler(myMessageOutput);
}
+309 -212
View File
@@ -41,218 +41,6 @@
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_1">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_3">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>3</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pushButton_8">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>8</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_6">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>6</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_0">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_point">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_4">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButton_del">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>del</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_5">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>5</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_2">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>2</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_9">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>9</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_7">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>7</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="pushButton_ok">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>ok</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pushButton_cancel">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>cancel</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pushButton_nan">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>nan</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="lineEdit">
<property name="minimumSize">
@@ -274,6 +62,315 @@
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pushButton_1">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_3">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>3</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="pushButton_8">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>8</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="pushButton_6">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>6</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="pushButton_0">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_point">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButton_4">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="pushButton_del">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>del</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_5">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>5</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_2">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>2</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_9">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>9</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_7">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>7</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QPushButton" name="pushButton_ok">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>ok</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pushButton_cancel">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>cancel</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="pushButton_nan">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string>nan</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_decription">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
-5
View File
@@ -7,8 +7,6 @@ Selector::Selector(QWidget *parent) :
{
ui->setupUi(this);
//load qss
QFile file(":/qss/Selector.qss");
file.open(QFile::ReadOnly);
@@ -30,9 +28,6 @@ Selector::Selector(QWidget *parent) :
ui->listWidget->setFocus();
ui->listWidget->setFocusPolicy(Qt::StrongFocus);
}
+35
View File
@@ -8,6 +8,28 @@ Setting::Setting(QWidget *parent) :
ui->setupUi(this);
setWindowTitle(tr("Setting"));
//load qss
QFile file(":/qss/Setting.qss");
file.open(QFile::ReadOnly);
QTextStream filetext(&file);
QString stylesheet = filetext.readAll();
this->setStyleSheet(stylesheet);
file.close();
linkui = new LinkUI(this);
/*
nav = new QNavigationWidget(this);
nav->setGeometry(0,0,150,this->height());
nav->setRowHeight(100);
QIcon icon;
nav->addItem(tr("software"),icon);
nav->addItem(tr("vehicle"),icon);
*/
}
@@ -15,3 +37,16 @@ Setting::~Setting()
{
delete ui;
}
void Setting::resizeEvent(QResizeEvent *event)
{
Q_UNUSED(event)
linkui->setGeometry(ui->frame->geometry());
//nav->setGeometry(0,0,200,this->height());
update();
}
+15
View File
@@ -2,6 +2,13 @@
#define SETTING_H
#include <QWidget>
#include "QIcon"
#include "qnavigationwidget.h"
#include "connectdialog.h"
#include "disconnectdialog.h"
#include "clientlinkdialog.h"
#include "QFile"
#include "LinkUI/LinkUI.h"
namespace Ui {
class Setting;
@@ -15,8 +22,16 @@ public:
explicit Setting(QWidget *parent = nullptr);
~Setting();
void resizeEvent(QResizeEvent *event);
private:
Ui::Setting *ui;
LinkUI *linkui = nullptr;
//QNavigationWidget *nav = nullptr;
};
#endif // SETTING_H
+3
View File
@@ -7,6 +7,9 @@ HEADERS += \
SOURCES += \
$$PWD/Setting.cpp
RESOURCES += \
$$PWD/Settingres.qrc
+39
View File
@@ -0,0 +1,39 @@
QFrame {
background-color: #FFFFFF;
}
QPushButton {
background-color: #FFFFFF /*palegoldenrod*/;
border-width: 2px;
border-color: darkkhaki;
border-style: solid;
border-radius: 5;
padding: 3px;
font: 30px "Arial";
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
QPushButton:flat {
border: none; /* no border for a flat push button */
}
QPushButton:default {
border-color: navy; /* make the default button prominent */
}
QLineEdit {
background-color: #FFFFFF
}
+84 -7
View File
@@ -1,21 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author/>
<comment/>
<exportmacro/>
<class>Setting</class>
<widget name="Setting" class="QWidget">
<widget class="QWidget" name="Setting">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>876</width>
<height>493</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="pushButton_software">
<property name="minimumSize">
<size>
<width>150</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>software</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_plane">
<property name="minimumSize">
<size>
<width>150</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>plane</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="1">
<widget class="QFrame" name="frame">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</item>
</layout>
</widget>
<pixmapfunction/>
<resources/>
<connections/>
</ui>
+5
View File
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/qss">
<file>Setting.qss</file>
</qresource>
</RCC>
+28 -6
View File
@@ -33,6 +33,14 @@ MainWindow::MainWindow(QWidget *parent)
//---------------
//设置
setting = new Setting(this);
setting->hide();
//自检
checkUI = new CheckUI(this);
checkUI->hide();
linkui = new LinkUI(this);
linkui->hide();
@@ -50,8 +58,6 @@ MainWindow::MainWindow(QWidget *parent)
help = new Help();
help->hide();
setting = new Setting();
setting->hide();
@@ -179,8 +185,16 @@ void MainWindow::resizeEvent(QResizeEvent *event)
menuBarUI->setGeometry(0,0,this->width(),100);
setting->setGeometry(0,menuBarUI->height(),
this->width(),this->height() - menuBarUI->height());
checkUI->setGeometry(0,menuBarUI->height(),
this->width(),this->height() - menuBarUI->height());
map->setGeometry(0,menuBarUI->height(),
this->width()- copk->width(),this->height());
this->width()- copk->width(),this->height() - menuBarUI->height());
/*
nav->setGeometry(0,menuBarUI->height(),
@@ -408,11 +422,15 @@ void MainWindow::subui(QString arg)//子界面管理
void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
{
if(index == 0) linkui->show();
else linkui->hide();
//设置
if(index == 0) setting->show();
else setting->hide();
//自检
if(index == 1) checkUI->show();
else checkUI->hide();
//任务
if(index == 2)
{
map->setWPLock(false);
@@ -433,6 +451,8 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
if((index == 2)||(index == 3)) map->show();
else map->hide();
//飞行
if(index == 3)
{
copk->show();
@@ -444,6 +464,8 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
commandUI->hide();
}
//信息
if(index == 4) toolsui->show();
else toolsui->hide();
+5 -1
View File
@@ -50,6 +50,10 @@
//selfcheck
#include "CheckUI/CheckUI.h"
QT_BEGIN_MOC_NAMESPACE
#pragma execution_character_set("utf-8")
@@ -99,7 +103,7 @@ protected:
MenuBarUI *menuBarUI = nullptr;
CommandUI *commandUI = nullptr;
Cockpit *copk = nullptr;
CheckUI *checkUI = nullptr;
propertyui *missionUI = nullptr;
Binary file not shown.