配置页面

This commit is contained in:
tangchao0503
2026-04-01 15:55:42 +08:00
parent 7e119fbf91
commit 50989bcd5b
8 changed files with 363 additions and 2 deletions

View File

@ -107,6 +107,7 @@ HPPA::HPPA(QWidget* parent)
initPanelToolbar();
setDockNestingEnabled(true);
connect(this->ui.mSetting, SIGNAL(triggered()), this, SLOT(settingWindow()));
connect(this->ui.action_about, SIGNAL(triggered()), this, SLOT(onAbout()));
connect(this->ui.mActionOneMotorScenario, SIGNAL(triggered()), this, SLOT(createOneMotorScenario()));
connect(this->ui.mActionPlantPhenotypeScenario, SIGNAL(triggered()), this, SLOT(createPlantPhenotypeScenario()));
@ -1954,6 +1955,13 @@ void HPPA::onAbout()
about.exec();
}
void HPPA::settingWindow()
{
setWindow w;
w.show();
w.exec();
}
void HPPA::onDark()
{
QMessageBox msgBox;

View File

@ -73,6 +73,8 @@
#include "recordFrameCounter.h"
#include "setWindow.h"
#define PI 3.1415926
QT_CHARTS_USE_NAMESPACE//QChartView 使用 需要加宏, 否则无法使用
@ -313,6 +315,7 @@ public Q_SLOTS:
void onFocus2(int command);
void onFocusWindowClosed();
void onAbout();
void settingWindow();
void onDark();
void recordDarkFinish();
void onReference();

View File

@ -72,7 +72,7 @@ color:white;
</property>
<addaction name="mActionOpenImg"/>
<addaction name="separator"/>
<addaction name="action_11"/>
<addaction name="mSetting"/>
<addaction name="action_exit"/>
</widget>
<widget class="QMenu" name="menuspectrometer">
@ -797,7 +797,7 @@ QPushButton:pressed
<string>关闭影像</string>
</property>
</action>
<action name="action_11">
<action name="mSetting">
<property name="text">
<string>设置</string>
</property>

View File

@ -145,6 +145,7 @@
<ClCompile Include="ResononNirImager.cpp" />
<ClCompile Include="RgbCameraOperation.cpp" />
<ClCompile Include="RobotArmControl.cpp" />
<ClCompile Include="setWindow.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
@ -178,6 +179,7 @@
<QtUic Include="RadianceConversion.ui" />
<QtUic Include="ReflectanceConversion.ui" />
<QtUic Include="RobotArmControl.ui" />
<QtUic Include="set.ui" />
<QtUic Include="twoMotorControl.ui" />
</ItemGroup>
<ItemGroup>
@ -224,6 +226,7 @@
<ClInclude Include="RasterDataProvider.h" />
<ClInclude Include="RasterRenderer.h" />
<QtMoc Include="recordFrameCounter.h" />
<QtMoc Include="setWindow.h" />
<ClInclude Include="utility_tc.h" />
<QtMoc Include="aboutWindow.h" />
<ClInclude Include="hppaConfigFile.h" />

View File

@ -199,6 +199,9 @@
<ClCompile Include="recordFrameCounter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="setWindow.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<QtMoc Include="fileOperation.h">
@ -324,6 +327,9 @@
<QtMoc Include="recordFrameCounter.h">
<Filter>Header Files</Filter>
</QtMoc>
<QtMoc Include="setWindow.h">
<Filter>Header Files</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<ClInclude Include="imageProcessor.h">
@ -403,6 +409,9 @@
<QtUic Include="hyperImagerControl.ui">
<Filter>Form Files</Filter>
</QtUic>
<QtUic Include="set.ui">
<Filter>Form Files</Filter>
</QtUic>
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />

284
HPPA/set.ui Normal file
View File

@ -0,0 +1,284 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>setDialog</class>
<widget class="QDialog" name="setDialog">
<property name="windowModality">
<enum>Qt::ApplicationModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>486</width>
<height>401</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QWidget" name="contentWidget" native="true">
<property name="styleSheet">
<string notr="true">QWidget #contentWidget
{
background: #040125;
/*border-radius: 8px 8px 8px 8px;*/
border: 1px solid #2f6bff;
}
QLineEdit {
background-color: #142D7F;
color: #e6eeff;
border: 1px solid #2f6bff;
border-radius: 6px;
padding: 4px 8px;
min-width: 70px;
min-height: 20px;
font-size: 13px;
}
QLabel {
color: rgb(255, 255, 255);
}
QPushButton
{
/*width: 172px;
height: 56px;*/
font: 10pt &quot;新宋体&quot;;
background-color: qlineargradient(
spread:pad,
x1:0.5, y1:0, x2:0.5, y2:1,
stop:0 #283D86,
stop:1 #0F1A40
);
color: white;
border: none;
padding: 8px 8px;
border-radius: 4px;
}
QPushButton:hover
{
background-color: qlineargradient(
spread:pad,
x1:0, y1:0, x2:1, y2:0,
stop:0 #3A4875,
stop:1 #5F6B91
);
}
/* 按下时的效果 */
QPushButton:pressed
{
background-color: qlineargradient(
spread:pad,
x1:0, y1:0, x2:1, y2:0,
stop:0 #1A254F,
stop:1 #3A466B
);
/* 可选:添加下压效果 */
padding-top: 9px;
padding-bottom: 7px;
}
</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QWidget" name="titlebarWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>43</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>43</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QWidget #titlebarWidget
{
background: #0E1C4C;
border: 1px solid #2f6bff;
}</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QLabel" name="iconLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="HPPA.qrc">:/png/resources/icons/png/Spectral_Insight_27.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_9">
<property name="styleSheet">
<string notr="true">QLabel
{
color:#E2EDFF;
}</string>
</property>
<property name="text">
<string>设置</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>505</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="closeBtn">
<property name="styleSheet">
<string notr="true">QPushButton
{
/*width: 172px;
height: 56px;*/
font: 10pt &quot;新宋体&quot;;
background-color: qlineargradient(
spread:pad,
x1:0.5, y1:0, x2:0.5, y2:1,
stop:0 #283D86,
stop:1 #0F1A40
);
color: white;
border: none;
padding: 8px 8px;
border-radius: 4px;
}
QPushButton:hover
{
background-color: qlineargradient(
spread:pad,
x1:0, y1:0, x2:1, y2:0,
stop:0 #3A4875,
stop:1 #5F6B91
);
}
/* 按下时的效果 */
QPushButton:pressed
{
background-color: qlineargradient(
spread:pad,
x1:0, y1:0, x2:1, y2:0,
stop:0 #1A254F,
stop:1 #3A466B
);
/* 可选:添加下压效果 */
padding-top: 9px;
padding-bottom: 7px;
}</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="HPPA.qrc">
<normaloff>:/svg/resources/icons/svg/close.svg</normaloff>:/svg/resources/icons/svg/close.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="widget" native="true">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>54</width>
<height>12</height>
</rect>
</property>
<property name="text">
<string>数据路径</string>
</property>
</widget>
<widget class="QLineEdit" name="dataFolderLineEdit">
<property name="geometry">
<rect>
<x>80</x>
<y>50</y>
<width>113</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="dataFolderBtn">
<property name="geometry">
<rect>
<x>210</x>
<y>50</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="HPPA.qrc"/>
</resources>
<connections/>
</ui>

27
HPPA/setWindow.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "setWindow.h"
#include <QSvgRenderer>
#include <QPainter>
setWindow::setWindow(QWidget* parent)
{
ui.setupUi(this);
//Qt::WindowFlags flags = 0;
////flags |= Qt::WindowMinimizeButtonHint;
//flags |= Qt::WindowCloseButtonHint;
//flags |= Qt::MSWindowsFixedSizeDialogHint;
//setWindowFlags(flags);
setWindowFlags(Qt::FramelessWindowHint);
connect(this->ui.closeBtn, SIGNAL(released()), this, SLOT(onExit()));
}
setWindow::~setWindow()
{
}
void setWindow::onExit()
{
this->close();
}

27
HPPA/setWindow.h Normal file
View File

@ -0,0 +1,27 @@
#pragma once
#include <QtWidgets/qdialog.h>
#include <qstring.h>
#include "ui_set.h"
class setWindow :public QDialog
{
Q_OBJECT
public:
setWindow(QWidget* parent = Q_NULLPTR);
~setWindow();
private:
Ui::setDialog ui;
public Q_SLOTS:
void onExit();
signals:
};