From 06dffddfd0a9effaa518d2bdcb80e66705cb02a8 Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Wed, 18 Mar 2026 00:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E5=8C=96=E7=AA=97=E5=8F=A3=EF=BC=9A?= =?UTF-8?q?=E5=85=B3=E4=BA=8E+=E5=9B=BE=E5=83=8F=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HPPA/FocusDialog.ui | 14 +- HPPA/HPPA.cpp | 35 +++- HPPA/HPPA.h | 1 + HPPA/HPPA.ui | 25 +-- HPPA/about.ui | 364 ++++++++++++++++++++++++++++++++---------- HPPA/aboutWindow.cpp | 28 +++- HPPA/aboutWindow.h | 2 + HPPA/imageControl.cpp | 48 ++++++ HPPA/imgControl.ui | 36 ++++- 9 files changed, 446 insertions(+), 107 deletions(-) diff --git a/HPPA/FocusDialog.ui b/HPPA/FocusDialog.ui index 668a0e7..eb0f76d 100644 --- a/HPPA/FocusDialog.ui +++ b/HPPA/FocusDialog.ui @@ -52,7 +52,7 @@ QPushButton ); color: white; border: none; - padding: 8px 16px; + padding: 8px 8px; border-radius: 4px; } QPushButton:hover @@ -277,6 +277,18 @@ QRadioButton } + + 9 + + + 9 + + + 9 + + + 9 + diff --git a/HPPA/HPPA.cpp b/HPPA/HPPA.cpp index 9942f84..d9e03fb 100644 --- a/HPPA/HPPA.cpp +++ b/HPPA/HPPA.cpp @@ -31,7 +31,7 @@ HPPA::HPPA(QWidget* parent) s_instance = this; ui.setupUi(this); - setWindowFlags(Qt::FramelessWindowHint); + //setWindowFlags(Qt::FramelessWindowHint); // register MapLayer* metatype for queued signal/slot across threads qRegisterMetaType("MapLayer*"); @@ -750,7 +750,7 @@ void HPPA::initMenubarToolbar() if (checked) ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral_done.svg")); else - ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral.svg")); + ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral.svg")); }); // 使用样式表设置透明背景 @@ -900,6 +900,7 @@ void HPPA::createActionGroups() ui.mActionCorning_410->setChecked(true); } + updateImagerPicture(lastSelectedAction); } void HPPA::selectingImager(QAction* selectedAction) @@ -907,6 +908,30 @@ void HPPA::selectingImager(QAction* selectedAction) QSettings settings; settings.setValue("LastSelectedImagerAction", selectedAction->objectName()); settings.sync(); + + updateImagerPicture(selectedAction->objectName()); +} + +void HPPA::updateImagerPicture(const QString& actionName) +{ + QString picPath; + if (actionName == "mActionPica_L") + picPath = ".//icon//imagerPicture//L.png"; + else if (actionName == "mActionPica_NIR") + picPath = ".//icon//imagerPicture//IR.png"; + else if (actionName == "mActionPika_XC2") + picPath = ".//icon//imagerPicture//XC2.png"; + else if (actionName == "mActionCorning_410") + picPath = ".//icon//imagerPicture//corning410.png"; + + if (!picPath.isEmpty()) + { + QPixmap pixmap(picPath); + if (!pixmap.isNull()) + { + ui.imagerPictureLabel->setPixmap(pixmap); + } + } } void HPPA::createMoveplatformActionGroup() @@ -1315,7 +1340,7 @@ void HPPA::onStartRecordStep1() removeAllLayersInRasterGroup(); ui.action_start_recording->setText(QString::fromLocal8Bit("停止采集")); - ui.action_start_recording->setIcon(QIcon(".//icon//all//record_ing.svg")); + ui.action_start_recording->setIcon(QIcon(".//icon//all//record_ing.svg")); //ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}"); //应该先控制马达运动,当马达运动后,再开始光谱仪采集(发射开始采集信号) @@ -1747,9 +1772,9 @@ void HPPA::onconnect() { QMessageBox msgBox; msgBox.setText(QString::fromLocal8Bit("请选择相机!")); - msgBox.exec(); + msgBox.exec(); - return; + return; } ui.action_connect_imager->setIcon(QIcon(".//icon//all//connect_imager_ing.svg")); diff --git a/HPPA/HPPA.h b/HPPA/HPPA.h index 28ffa42..16c2574 100644 --- a/HPPA/HPPA.h +++ b/HPPA/HPPA.h @@ -241,6 +241,7 @@ private: QActionGroup* mImagerGroup = nullptr; void createActionGroups(); void selectingImager(QAction* selectedAction); + void updateImagerPicture(const QString& actionName); QActionGroup* moveplatformActionGroup = nullptr; void createMoveplatformActionGroup(); diff --git a/HPPA/HPPA.ui b/HPPA/HPPA.ui index 441f59e..cec621b 100644 --- a/HPPA/HPPA.ui +++ b/HPPA/HPPA.ui @@ -322,7 +322,7 @@ QTabWidget::pane { QTabWidget::Rounded - 1 + 0 Qt::ElideNone @@ -412,7 +412,7 @@ QSlider::handle:horizontal:pressed { 10 - 0 + 10 10 @@ -421,15 +421,21 @@ QSlider::handle:horizontal:pressed { 10 - 0 + 10 - + + + + 0 + 0 + + - - :/HPPA/HPPA.ico + + true Qt::AlignCenter @@ -457,11 +463,8 @@ QSlider::handle:horizontal:pressed { 0 - - 2 - - - 6 + + 10 diff --git a/HPPA/about.ui b/HPPA/about.ui index 7c2799a..04910a3 100644 --- a/HPPA/about.ui +++ b/HPPA/about.ui @@ -9,8 +9,8 @@ 0 0 - 629 - 463 + 486 + 401 @@ -20,91 +20,291 @@ HPPA.icoHPPA.ico - - - - 90 - 250 - 434 - 134 - + + + 0 - - - - - 公司:北京依锐思遥感技术有限公司 + + 0 + + + 0 + + + 0 + + + 0 + + + + + QWidget #contentWidget +{ + background: #040125; + /*border-radius: 8px 8px 8px 8px;*/ + border: 1px solid #2f6bff; +} + + + + 0 - - - - - - 地址:北京市海淀区清河安宁庄东路18号5号楼二层205 + + 0 - - - - - - 电话:010-51292601 + + 0 - - - - - - 邮箱:hanshanlong@iris-rs.cn + + 0 - - - - - - - - 270 - 150 - 141 - 24 - - - - 版本:2.0 - - - - - - 270 - 70 - 391 - 31 - - - - Hyper Plant Phenotypic Analysis - - - Qt::PlainText - - - - - - 90 - 50 - 141 - 141 - - - - - - - HPPA.ico - - + + 10 + + + + + + 0 + 0 + + + + + 0 + 43 + + + + + 16777215 + 43 + + + + QWidget #titlebarWidget +{ + background: #0E1C4C; + border: 1px solid #2f6bff; +} + + + + + + + + + + + + + QLabel +{ + color:#E2EDFF; +} + + + 关于 + + + + + + + Qt::Horizontal + + + + 505 + 20 + + + + + + + + QPushButton +{ + /*width: 172px; + height: 56px;*/ + font: 10pt "新宋体"; + 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; +} + + + + + + + icon/all/close.svgicon/all/close.svg + + + + + + + + + + + + 70 + 20 + 171 + 171 + + + + + + + icon/all/png/Group 356_slices/Group 356.png + + + + + + 70 + 210 + 306 + 111 + + + + QLabel +{ + color: #E2EDFF; + font: 10pt "Adobe Devanagari"; +} + + + + 10 + + + + + 地址:北京市海淀区清河安宁庄东路18号5号楼二层205 + + + + + + + 电话:010-51292601 + + + + + + + 邮箱:hanshanlong@iris-rs.cn + + + + + + + 公司:北京依锐思遥感技术有限公司 + + + + + + + + + 260 + 50 + 171 + 101 + + + + + + + + 30 + + + + + QLabel +{ + color:#E2EDFF; + font: italic 18pt "Adobe Devanagari"; +} + + + Spectral Insight + + + Qt::PlainText + + + + + + + QLabel +{ + color:#E2EDFF; + font: 10pt "Adobe Devanagari"; +} + + + 版本:3.0 + + + + + + label_7 + widget_2 + widget_3 + companylname_label + + + + + + diff --git a/HPPA/aboutWindow.cpp b/HPPA/aboutWindow.cpp index 4a84310..c50be7f 100644 --- a/HPPA/aboutWindow.cpp +++ b/HPPA/aboutWindow.cpp @@ -1,22 +1,38 @@ #include "aboutWindow.h" - +#include +#include aboutWindow::aboutWindow(QWidget* parent) { ui.setupUi(this); + QSvgRenderer svgRenderer(QString(".//icon//all//software_icon.svg")); + QPixmap pixmap(24, 24); + pixmap.fill(Qt::transparent); // ͸ + QPainter painter(&pixmap); + svgRenderer.render(&painter); + ui.iconLabel->setPixmap(pixmap); + ui.companylname_label->setOpenExternalLinks(true);//Ϊtrueܴҳ QString text = ui.companylname_label->text(); ui.companylname_label->setText("" + text); - Qt::WindowFlags flags = 0; - //flags |= Qt::WindowMinimizeButtonHint; - flags |= Qt::WindowCloseButtonHint; - flags |= Qt::MSWindowsFixedSizeDialogHint; - setWindowFlags(flags); + //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())); } aboutWindow::~aboutWindow() { +} + +void aboutWindow::onExit() +{ + this->close(); } \ No newline at end of file diff --git a/HPPA/aboutWindow.h b/HPPA/aboutWindow.h index 9489e19..6ad442a 100644 --- a/HPPA/aboutWindow.h +++ b/HPPA/aboutWindow.h @@ -2,6 +2,7 @@ #include #include + #include "ui_about.h" class aboutWindow :public QDialog @@ -19,6 +20,7 @@ private: Ui::aboutDialog ui; public Q_SLOTS: + void onExit(); signals: diff --git a/HPPA/imageControl.cpp b/HPPA/imageControl.cpp index 5bc5803..1bc492e 100644 --- a/HPPA/imageControl.cpp +++ b/HPPA/imageControl.cpp @@ -37,6 +37,54 @@ ImageControl::ImageControl(QWidget* parent) ui.spinRed->setKeyboardTracking(false); ui.spinGreen->setKeyboardTracking(false); ui.spinBlue->setKeyboardTracking(false); + + ui.groupAdjustments->setStyleSheet(R"( + QDoubleSpinBox { + border: 1px solid #999; + border-radius: 4px; + padding: 2px 20px 2px 6px; /* Ҳռť */ + background: #0e1c4c; + selection-background-color: #0078d7; + font-size: 12px; + color:#ACCDFF ; + } + + QDoubleSpinBox::up-button { + subcontrol-origin: border; + subcontrol-position: top right; + width: 16px; + border-left: 1px solid #ccc; + } + + QDoubleSpinBox::down-button { + subcontrol-origin: border; + subcontrol-position: bottom right; + width: 16px; + border-left: 1px solid #ccc; + } + + QDoubleSpinBox::up-arrow { + image: url(:/icons/up.svg); + width: 10px; + height: 10px; + } + + QDoubleSpinBox::down-arrow { + image: url(:/icons/down.svg); + width: 10px; + height: 10px; + } + + QDoubleSpinBox::up-button:hover, + QDoubleSpinBox::down-button:hover { + background: #e6f2ff; + } + + QDoubleSpinBox::up-button:pressed, + QDoubleSpinBox::down-button:pressed { + background: #cce4ff; + } + )"); } ImageControl::~ImageControl() diff --git a/HPPA/imgControl.ui b/HPPA/imgControl.ui index fc90f40..a9091c0 100644 --- a/HPPA/imgControl.ui +++ b/HPPA/imgControl.ui @@ -28,7 +28,7 @@ QPushButton { /*width: 172px; height: 56px;*/ - font: 19pt "新宋体"; + font: 10pt "新宋体"; background-color: qlineargradient( spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, @@ -37,7 +37,7 @@ QPushButton ); color: white; border: none; - padding: 8px 16px; + padding: 8px 8px; border-radius: 4px; } QPushButton:hover @@ -120,6 +120,14 @@ QSlider::handle:horizontal:pressed { + + QLabel +{ + color: #ACCDFF; + font-size: 14px; + font: 9pt "Adobe Devanagari"; +} + 调整 @@ -237,6 +245,24 @@ QSlider::handle:horizontal:pressed { + + + 0 + 0 + + + + + 0 + 43 + + + + + 16777215 + 43 + + 真彩色 @@ -244,6 +270,12 @@ QSlider::handle:horizontal:pressed { + + + 0 + 43 + + 假彩色