建立自检框架

This commit is contained in:
2020-06-17 18:01:56 +08:00
parent e60eeaa720
commit bb7b013210
13 changed files with 703 additions and 278 deletions
+53
View File
@@ -0,0 +1,53 @@
{
"comment": "Custom",
"version": 1,
"spacing" : 10,
"Width": 200,
"Height": 60,
"Button": [
{
"Text" : "Init",
"row": 0,
"column": 0,
"command": 400,
"confirm": 0,
"param1": 1,
"param2": 2,
"param3": 3,
"param4": 4,
"param5": 5,
"param6": 6,
"param7": 7
},
{
"Text" : "Pass",
"row": 1,
"column": 0,
"command": 1,
"confirm": 0,
"param1": 7,
"param2": 6,
"param3": 5,
"param4": 4,
"param5": 3,
"param6": 2,
"param7": 1
},
{
"Text" : "Fail",
"row": 2,
"column": 0,
"command": 900,
"confirm": 0,
"param1": 7,
"param2": 6,
"param3": 5,
"param4": 4,
"param5": 3,
"param6": 2,
"param7": 1
}
]
}
+191
View File
@@ -1,12 +1,45 @@
#include "CheckUI.h"
#include "ui_CheckUI.h"
const char* CheckUI::_versionJsonKey = "version";
const char* CheckUI::_commentJsonKey = "comment";
const char* CheckUI::_ButtonJsonKey = "Button";
const char* CheckUI::_WidthJsonKey = "Width";
const char* CheckUI::_HeightJsonKey = "Height";
const char* CheckUI::_TextJsonKey = "Text";
const char* CheckUI::_rowJsonKey = "row";
const char* CheckUI::_columnJsonKey = "column";
const char* CheckUI::_param1JsonKey = "param1";
const char* CheckUI::_param2JsonKey = "param2";
const char* CheckUI::_param3JsonKey = "param3";
const char* CheckUI::_param4JsonKey = "param4";
const char* CheckUI::_param5JsonKey = "param5";
const char* CheckUI::_param6JsonKey = "param6";
const char* CheckUI::_param7JsonKey = "param7";
const char* CheckUI::_commandJsonKey = "command";
const char* CheckUI::_confirmJsonKey = "confirm";
CheckUI::CheckUI(QWidget *parent) :
QWidget(parent),
ui(new Ui::CheckUI)
{
ui->setupUi(this);
//检测文件夹,如果不存在,那么就新建一个
QDir *Dir = new QDir;
if(!Dir->exists("./checks"))
Dir->mkdir("./checks");//如果文件夹不存在就新建
//load qss
QFile file(":/qss/CheckUI.qss");
file.open(QFile::ReadOnly);
@@ -15,6 +48,35 @@ CheckUI::CheckUI(QWidget *parent) :
this->setStyleSheet(stylesheet);
file.close();
//载入json
loadCommandJson(":/json/Check.json");
//loadCommandJson("./json/Check.json");
//ui->groupBox_Command->setTitle(tr("Command Version:") + QString::number(CMD_version));
for(QJsonValue info: infoArray) {
if (!info.isObject()) {
return;
}
QPushButton *btn = new QPushButton(this);
btn->setText(info.toObject().find(_TextJsonKey).value().toString());
btn->setFixedSize(width,height);
ui->gridLayout_Check->addWidget(btn,
info.toObject().find(_rowJsonKey).value().toInt(),
info.toObject().find(_columnJsonKey).value().toInt());
btn->setProperty("CheckState",CheckState::Init);
btn->style()->unpolish(btn);
btn->style()->polish(btn);
connect(btn,SIGNAL(clicked(bool)),
this,SLOT(on_commandClicked()));
}
}
@@ -23,3 +85,132 @@ CheckUI::~CheckUI()
{
delete ui;
}
void CheckUI::loadCommandJson(const QString& jsonFilename)
{
if (jsonFilename.isEmpty()) {
return;
}
qDebug() << "Loading " << jsonFilename;
QFile jsonFile(jsonFilename);
if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Unable to open file" << jsonFilename << jsonFile.errorString();
return;
}
QByteArray bytes = jsonFile.readAll();
jsonFile.close();
QJsonParseError jsonParseError;
QJsonDocument doc = QJsonDocument::fromJson(bytes, &jsonParseError);
if (jsonParseError.error != QJsonParseError::NoError) {
qWarning() << jsonFilename << "Unable to open json document" << jsonParseError.errorString();
return;
}
QJsonObject json = doc.object();
version = json.value(_versionJsonKey).toInt();
qDebug() << "command version :" << version;
width = json.value(_WidthJsonKey).toInt();
height = json.value(_HeightJsonKey).toInt();
QJsonValue jsonValue = json.value(_ButtonJsonKey);
if (!jsonValue.isArray()) {
qWarning() << jsonFilename << "Button not array";
return;
}
infoArray = jsonValue.toArray();
for(QJsonValue info: infoArray) {
if (!info.isObject()) {
qWarning() << jsonFilename << "Array should contain objects";
return;
}
}
}
void CheckUI::on_commandClicked()
{
//找到消息的发送者
QPushButton *btn = qobject_cast<QPushButton *>(sender());
for(QJsonValue info: infoArray) {
if (!info.isObject()) {
return;
}
//找到id或者名字一样的按键,找到参数,发出去
QString _name = info.toObject().find(_TextJsonKey).value().toString();
QString _text = btn->text();
if(_name == _text)
{
float param1 = info.toObject().find(_param1JsonKey).value().toDouble();
float param2 = info.toObject().find(_param2JsonKey).value().toDouble();
float param3 = info.toObject().find(_param3JsonKey).value().toDouble();
float param4 = info.toObject().find(_param4JsonKey).value().toDouble();
float param5 = info.toObject().find(_param5JsonKey).value().toDouble();
float param6 = info.toObject().find(_param6JsonKey).value().toDouble();
float param7 = info.toObject().find(_param7JsonKey).value().toDouble();
uint16_t command = info.toObject().find(_commandJsonKey).value().toInt();
uint8_t confirm = info.toObject().find(_confirmJsonKey).value().toInt();
emit cmd_long(param1,param2, param3,param4,param5,param6,param7,command,confirm);
}
}
if(btn->text() == tr("Init"))
{
QObjectList Olist = this->children();
foreach (QObject *obj, Olist) {
QPushButton *btnn = qobject_cast<QPushButton *>(obj);
if(btnn)//如果存在
{
btnn->setProperty("CheckState",CheckState::Init);
btnn->style()->unpolish(btnn);
btnn->style()->polish(btnn);
}
}
}
else if(btn->text() == tr("Pass"))
{
btn->setProperty("CheckState",CheckState::Pass);
btn->style()->unpolish(btn);
btn->style()->polish(btn);
}
else if(btn->text() == tr("Fail"))
{
btn->setProperty("CheckState",CheckState::Fail);
btn->style()->unpolish(btn);
btn->style()->polish(btn);
}
}
void CheckUI::feedback(bool flag)
{
}
+79
View File
@@ -5,6 +5,23 @@
#include "QFile"
#include "QDebug"
#include "QPushButton"
#include "QJsonArray"
#include "QJsonDocument"
#include "QJsonObject"
#include "QJsonParseError"
#include "QDir"
#include <QCommonStyle>
#include "QStyle"
namespace Ui {
class CheckUI;
}
@@ -13,11 +30,73 @@ class CheckUI : public QWidget
{
Q_OBJECT
public:
explicit CheckUI(QWidget *parent = nullptr);
~CheckUI();
enum CheckState{
Init = 0,
Pass,
Fail,
};
Q_ENUM(CheckState)
signals:
void cmd_int(float param1, float param2, float param3, float param4, int x, int y, float z);
void cmd_long( float param1,float param2,float param3,float param4,float param5,float param6,float param7,uint16_t command,uint8_t confirmation);
public slots:
void feedback(bool flag);
private slots:
void on_commandClicked();
protected:
void loadCommandJson(const QString& jsonFilename);
private:
static const char* _versionJsonKey;
static const char* _commentJsonKey;
static const char* _ButtonJsonKey;
static const char* _WidthJsonKey;
static const char* _HeightJsonKey;
static const char* _TextJsonKey;
static const char* _rowJsonKey;
static const char* _columnJsonKey;
static const char* _param1JsonKey;
static const char* _param2JsonKey;
static const char* _param3JsonKey;
static const char* _param4JsonKey;
static const char* _param5JsonKey;
static const char* _param6JsonKey;
static const char* _param7JsonKey;
static const char* _commandJsonKey;
static const char* _confirmJsonKey;
QJsonArray infoArray;
int width = 60;
int height = 60;
int version;
Ui::CheckUI *ui;
};
+34 -12
View File
@@ -1,12 +1,18 @@
/* ================================================ *
* ================================================ */
QFrame {
background-color: #FFFFFF;
}
QPushButton {
background-color: #FFFFFF /*palegoldenrod*/;
background-color: #FFFFFF;
border-width: 2px;
border-color: darkkhaki;
border-style: solid;
@@ -15,25 +21,41 @@ QPushButton {
font: 30px "Arial";
}
QPushButton:pressed {
QPushButton:pressed[CheckState="0"] {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
stop: 0 #dadbde, stop: 0.5 #FFAA00, stop: 1 #dadbde);
}
QPushButton:pressed[CheckState="1"] {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 0.5 #00FF00, stop: 1 #dadbde);
}
QPushButton:pressed[CheckState="2"] {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 0.5 #FF5500, stop: 1 #dadbde);
}
QPushButton:flat {
border: none; /* no border for a flat push button */
border: none;
}
QPushButton:default {
border-color: navy; /* make the default button prominent */
border-color: navy;
}
QLineEdit {
background-color: #FFFFFF
QPushButton[CheckState="0"] {
background-color: #FFAA00;
}
QPushButton[CheckState="1"] {
background-color: #00FF00;
}
QPushButton[CheckState="2"] {
background-color: #FF5500;
}
+27 -8
View File
@@ -6,23 +6,42 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>500</height>
<width>566</width>
<height>530</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<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="QLabel" name="label">
<property name="text">
<string>Seft Test</string>
<layout class="QGridLayout" name="gridLayout_Check"/>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</widget>
+3
View File
@@ -2,4 +2,7 @@
<qresource prefix="/qss">
<file>CheckUI.qss</file>
</qresource>
<qresource prefix="/json">
<file>Check.json</file>
</qresource>
</RCC>
-2
View File
@@ -188,8 +188,6 @@ void CommandUI::loadCommandJson(const QString& jsonFilename)
}
}
}
+256 -243
View File
@@ -487,8 +487,8 @@
</item>
<item row="3" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_1">
<item row="0" column="10">
<widget class="QPushButton" name="pushButton_0">
<property name="minimumSize">
<size>
<width>80</width>
@@ -496,46 +496,7 @@
</size>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="3">
<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="0" column="4">
<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="0" column="9">
<widget class="QPushButton" name="pushButton_9">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>9</string>
<string>0</string>
</property>
</widget>
</item>
@@ -552,32 +513,6 @@
</property>
</widget>
</item>
<item row="0" column="8">
<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="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_2">
<property name="minimumSize">
@@ -591,8 +526,8 @@
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="QPushButton" name="pushButton_0">
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_1">
<property name="minimumSize">
<size>
<width>80</width>
@@ -600,7 +535,33 @@
</size>
</property>
<property name="text">
<string>0</string>
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="8">
<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="0" column="4">
<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>
@@ -617,6 +578,32 @@
</property>
</widget>
</item>
<item row="0" column="3">
<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="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="11">
<spacer name="horizontalSpacer_8">
<property name="orientation">
@@ -630,6 +617,19 @@
</property>
</spacer>
</item>
<item row="0" column="9">
<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="0" column="7">
<widget class="QPushButton" name="pushButton_7">
<property name="minimumSize">
@@ -647,65 +647,8 @@
</item>
<item row="6" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_C">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>C</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="pushButton_B">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>B</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_Z">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Z</string>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer_6">
<item row="1" column="15">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -717,7 +660,7 @@
</property>
</spacer>
</item>
<item row="0" column="8">
<item row="0" column="9">
<widget class="QPushButton" name="pushButton_M">
<property name="minimumSize">
<size>
@@ -736,116 +679,7 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_X">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>X</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="pushButton_V">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>V</string>
</property>
</widget>
</item>
<item row="0" column="6" colspan="2">
<widget class="QPushButton" name="pushButton_N">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>N</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="14">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="14">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" colspan="8">
<widget class="QPushButton" name="pushButton_Space">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Space</string>
</property>
</widget>
</item>
<item row="0" column="9">
<item row="0" column="10">
<widget class="QPushButton" name="pushButton_Line">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@@ -870,7 +704,90 @@
</property>
</widget>
</item>
<item row="0" column="10" colspan="4">
<item row="0" column="0">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_X">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>X</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QPushButton" name="pushButton_V">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>V</string>
</property>
</widget>
</item>
<item row="1" column="2" colspan="8">
<widget class="QPushButton" name="pushButton_Space">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Space</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="pushButton_Z">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Z</string>
</property>
</widget>
</item>
<item row="0" column="11" colspan="4">
<widget class="QPushButton" name="pushButton_Delete">
<property name="minimumSize">
<size>
@@ -883,7 +800,90 @@
</property>
</widget>
</item>
<item row="1" column="9" colspan="5">
<item row="0" column="6">
<widget class="QPushButton" name="pushButton_B">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>B</string>
</property>
</widget>
</item>
<item row="0" column="15">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="pushButton_C">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>C</string>
</property>
</widget>
</item>
<item row="0" column="7" colspan="2">
<widget class="QPushButton" name="pushButton_N">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>N</string>
</property>
</widget>
</item>
<item row="1" column="10" colspan="5">
<widget class="QPushButton" name="pushButton_Enter">
<property name="minimumSize">
<size>
@@ -902,6 +902,19 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_Type">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>EN</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
+20 -1
View File
@@ -21,9 +21,9 @@ Index0::Index0(QWidget *parent) :
//mapsetting
mapsetting = new MapSettingUI(this);
connect(this,SIGNAL(IndexChanged(int)),
this,SLOT(onTabIndexChanged(int)));
emit IndexChanged(0);
}
@@ -53,6 +53,15 @@ void Index0::onTabIndexChanged(const int &index)//界面选择管理
//地图设置
if(index == 1) mapsetting->show();
else mapsetting->hide();
//地图设置
if(index == 2) mapsetting->show();
else mapsetting->hide();
//地图设置
if(index == 3) mapsetting->show();
else mapsetting->hide();
}
void Index0::on_pushButton_Link_clicked()
@@ -65,3 +74,13 @@ void Index0::on_pushButton_Map_clicked()
emit IndexChanged(1);
}
void Index0::on_pushButton_command_clicked()
{
emit IndexChanged(2);
}
void Index0::on_pushButton_check_clicked()
{
emit IndexChanged(3);
}
+4
View File
@@ -36,6 +36,10 @@ private slots:
void on_pushButton_Map_clicked();
void on_pushButton_command_clicked();
void on_pushButton_check_clicked();
signals:
void IndexChanged(const int &index);
+30 -4
View File
@@ -32,13 +32,13 @@
<widget class="QPushButton" name="pushButton_Link">
<property name="minimumSize">
<size>
<width>150</width>
<width>120</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<width>120</width>
<height>80</height>
</size>
</property>
@@ -51,13 +51,13 @@
<widget class="QPushButton" name="pushButton_Map">
<property name="minimumSize">
<size>
<width>150</width>
<width>120</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<width>120</width>
<height>80</height>
</size>
</property>
@@ -67,6 +67,19 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="pushButton_command">
<property name="minimumSize">
<size>
<width>120</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Command</string>
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -79,6 +92,19 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButton_check">
<property name="minimumSize">
<size>
<width>120</width>
<height>80</height>
</size>
</property>
<property name="text">
<string>Check</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
@@ -216,14 +216,10 @@ void ConnectDialog::onUsrNameClicked(void)//英文输入
QStringList list;
//list.append(ui->pushButton_usrName->text());//将当前的这个加入
for(QJsonValue info: Connect_info) {
if (info.isObject()) {
//如果这个名称已经连接,那么将不会出现在列表里面
list.append(info.toObject().value("Name").toString());
}
}
@@ -232,8 +228,10 @@ void ConnectDialog::onUsrNameClicked(void)//英文输入
list.prepend(ui->pushButton_usrName->text());
}
list.append(tr("New"));
if(!list.contains(tr("New")))
{
list.append(tr("New"));
}
selector->setList(list,ui->pushButton_usrName->text());
+2 -2
View File
@@ -45,13 +45,13 @@
<widget class="QPushButton" name="pushButton_Parameters">
<property name="minimumSize">
<size>
<width>150</width>
<width>120</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<width>120</width>
<height>80</height>
</size>
</property>