航线属性修改,添加地面站ID
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
RESOURCES += \
|
||||
$$PWD/Global.qrc
|
||||
|
||||
FORMS += \
|
||||
$$PWD/GlobalSetting.ui
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/GlobalSetting.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/GlobalSetting.cpp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<RCC>
|
||||
<qresource prefix="/img"/>
|
||||
<qresource prefix="/qss"/>
|
||||
</RCC>
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
.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);
|
||||
}
|
||||
|
||||
QTabWidget {
|
||||
|
||||
font: 20px "Arial";
|
||||
|
||||
}
|
||||
|
||||
QTabWidget::pane {
|
||||
border-top: 1px solid #E5E5E5;
|
||||
border-left:1px solid #E5E5E5;
|
||||
position: absolute;
|
||||
font-size: 20px;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
QTabBar::tab {
|
||||
border-width: 2px;
|
||||
border-bottom-color: #5F4F4F; /* same as the pane color */
|
||||
border-top-left-radius: 5px;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
min-width: 10px;
|
||||
padding: 5px;
|
||||
font-size: 20px;
|
||||
background-color:#FF5F6F;
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:hover {
|
||||
background-color:#EFEFFF;//选中背景色
|
||||
}
|
||||
|
||||
QTabBar::tab:selected {
|
||||
color:#2080F7;//选中颜色
|
||||
border-bottom: 2px solid #2080F7;
|
||||
font-weight:bold;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
QTabWidget::tab-bar {
|
||||
border-top: 2px solid #E5E5E5;
|
||||
border-bottom: 2px solid #E5E5E5;
|
||||
border-left:1px solid #E5E5E5;
|
||||
alignment: center;//居中显示
|
||||
font-size: 30px;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#include "GlobalSetting.h"
|
||||
#include "ui_GlobalSetting.h"
|
||||
|
||||
GlobalSetting::GlobalSetting(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::GlobalSetting)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->comboBox_ID->addItem(tr("250"),250);
|
||||
ui->comboBox_ID->addItem(tr("251"),251);
|
||||
ui->comboBox_ID->addItem(tr("252"),252);
|
||||
ui->comboBox_ID->addItem(tr("253"),253);
|
||||
ui->comboBox_ID->addItem(tr("254"),254);
|
||||
ui->comboBox_ID->addItem(tr("255"),255);
|
||||
|
||||
Config *cfg = new Config();
|
||||
|
||||
QVariant id;
|
||||
|
||||
cfg->get_GCS_ID(&id);
|
||||
|
||||
qDebug() << id;
|
||||
|
||||
ui->comboBox_ID->setCurrentIndex(ui->comboBox_ID->findData(id.toInt()));
|
||||
|
||||
|
||||
emit setGCSID(id.toInt());//设置全局ID
|
||||
|
||||
|
||||
}
|
||||
|
||||
GlobalSetting::~GlobalSetting()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void GlobalSetting::on_pushButton_setGCSID_clicked()
|
||||
{
|
||||
int id = 0;
|
||||
|
||||
id = ui->comboBox_ID->currentData(Qt::DisplayRole).toInt();
|
||||
|
||||
qDebug() << id;
|
||||
|
||||
emit setGCSID(id);
|
||||
|
||||
Config *cfg = new Config();
|
||||
|
||||
cfg->set_GCS_ID(id);
|
||||
|
||||
cfg->deleteLater();
|
||||
delete cfg;
|
||||
}
|
||||
|
||||
void GlobalSetting::getGCSID(void)
|
||||
{
|
||||
Config *cfg = new Config();
|
||||
|
||||
QVariant id;
|
||||
cfg->get_GCS_ID(&id);
|
||||
emit setGCSID(id.toInt());//设置全局ID
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef GLOBALSETTING_H
|
||||
#define GLOBALSETTING_H
|
||||
|
||||
#include <QWidget>
|
||||
#include "QDebug"
|
||||
#include "Config/Config.h"
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class GlobalSetting;
|
||||
}
|
||||
|
||||
class GlobalSetting : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GlobalSetting(QWidget *parent = nullptr);
|
||||
~GlobalSetting();
|
||||
|
||||
|
||||
void getGCSID(void);
|
||||
|
||||
private slots:
|
||||
void on_pushButton_setGCSID_clicked();
|
||||
|
||||
signals:
|
||||
void setGCSID(int id);
|
||||
|
||||
|
||||
private:
|
||||
Ui::GlobalSetting *ui;
|
||||
};
|
||||
|
||||
#endif // GLOBALSETTING_H
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GlobalSetting</class>
|
||||
<widget class="QWidget" name="GlobalSetting">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>533</width>
|
||||
<height>384</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<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>302</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>ID设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBox_ID"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>设置地面站ID号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pushButton_setGCSID">
|
||||
<property name="text">
|
||||
<string>设置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in New Issue
Block a user