美化窗口:关于+图像控制

This commit is contained in:
tangchao0503
2026-03-18 00:03:56 +08:00
parent ca10848750
commit 06dffddfd0
9 changed files with 446 additions and 107 deletions

View File

@ -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
}</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="sizePolicy">

View File

@ -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*>("MapLayer*");
@ -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()

View File

@ -241,6 +241,7 @@ private:
QActionGroup* mImagerGroup = nullptr;
void createActionGroups();
void selectingImager(QAction* selectedAction);
void updateImagerPicture(const QString& actionName);
QActionGroup* moveplatformActionGroup = nullptr;
void createMoveplatformActionGroup();

View File

@ -322,7 +322,7 @@ QTabWidget::pane {
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
@ -412,7 +412,7 @@ QSlider::handle:horizontal:pressed {
<number>10</number>
</property>
<property name="topMargin">
<number>0</number>
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
@ -421,15 +421,21 @@ QSlider::handle:horizontal:pressed {
<number>10</number>
</property>
<property name="spacing">
<number>0</number>
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="imagerPictureLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="HPPA.qrc">:/HPPA/HPPA.ico</pixmap>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -457,11 +463,8 @@ QSlider::handle:horizontal:pressed {
<property name="bottomMargin">
<number>0</number>
</property>
<property name="horizontalSpacing">
<number>2</number>
</property>
<property name="verticalSpacing">
<number>6</number>
<property name="spacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">

View File

@ -9,8 +9,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>629</width>
<height>463</height>
<width>486</width>
<height>401</height>
</rect>
</property>
<property name="windowTitle">
@ -20,91 +20,291 @@
<iconset>
<normaloff>HPPA.ico</normaloff>HPPA.ico</iconset>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>90</x>
<y>250</y>
<width>434</width>
<height>134</height>
</rect>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="companylname_label">
<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;
}</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>公司:北京依锐思遥感技术有限公司</string>
<string> </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<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>地址北京市海淀区清河安宁庄东路18号5号楼二层205</string>
<string>关于</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>电话010-51292601</string>
<item row="0" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>505</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_5">
<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>邮箱hanshanlong@iris-rs.cn</string>
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>icon/all/close.svg</normaloff>icon/all/close.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>270</x>
<y>150</y>
<width>141</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>版本2.0</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>270</x>
<y>70</y>
<width>391</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Hyper Plant Phenotypic Analysis</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="widget" native="true">
<widget class="QLabel" name="label_7">
<property name="geometry">
<rect>
<x>90</x>
<y>50</y>
<width>141</width>
<height>141</height>
<x>70</x>
<y>20</y>
<width>171</width>
<height>171</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>HPPA.ico</pixmap>
<pixmap>icon/all/png/Group 356_slices/Group 356.png</pixmap>
</property>
</widget>
<widget class="QWidget" name="widget_2" native="true">
<property name="geometry">
<rect>
<x>70</x>
<y>210</y>
<width>306</width>
<height>111</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">QLabel
{
color: #E2EDFF;
font: 10pt &quot;Adobe Devanagari&quot;;
}</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="spacing">
<number>10</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>地址北京市海淀区清河安宁庄东路18号5号楼二层205</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>电话010-51292601</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>邮箱hanshanlong@iris-rs.cn</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="companylname_label">
<property name="text">
<string>公司:北京依锐思遥感技术有限公司</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_3" native="true">
<property name="geometry">
<rect>
<x>260</x>
<y>50</y>
<width>171</width>
<height>101</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<property name="verticalSpacing">
<number>30</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="styleSheet">
<string notr="true">QLabel
{
color:#E2EDFF;
font: italic 18pt &quot;Adobe Devanagari&quot;;
}</string>
</property>
<property name="text">
<string>Spectral Insight</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="versionLabel">
<property name="styleSheet">
<string notr="true">QLabel
{
color:#E2EDFF;
font: 10pt &quot;Adobe Devanagari&quot;;
}</string>
</property>
<property name="text">
<string>版本3.0</string>
</property>
</widget>
</item>
</layout>
</widget>
<zorder>label_7</zorder>
<zorder>widget_2</zorder>
<zorder>widget_3</zorder>
<zorder>companylname_label</zorder>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>

View File

@ -1,22 +1,38 @@
#include "aboutWindow.h"
#include <QSvgRenderer>
#include <QPainter>
aboutWindow::aboutWindow(QWidget* parent)
{
ui.setupUi(this);
QSvgRenderer svgRenderer(QString(".//icon//all//software_icon.svg"));
QPixmap pixmap(24, 24);
pixmap.fill(Qt::transparent); // <20><><EFBFBD><EFBFBD>͸<EFBFBD><CDB8>
QPainter painter(&pixmap);
svgRenderer.render(&painter);
ui.iconLabel->setPixmap(pixmap);
ui.companylname_label->setOpenExternalLinks(true);//<2F><><EFBFBD><EFBFBD>Ϊtrue<75><65><EFBFBD>ܴ<EFBFBD><DCB4><EFBFBD><EFBFBD><EFBFBD>ҳ
QString text = ui.companylname_label->text();
ui.companylname_label->setText("<a style='color: green; text-decoration: none' href = http://www.iris-rs.cn/pr.jsp?_jcp=3_10>" + 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();
}

View File

@ -2,6 +2,7 @@
#include <QtWidgets/qdialog.h>
#include <qstring.h>
#include "ui_about.h"
class aboutWindow :public QDialog
@ -19,6 +20,7 @@ private:
Ui::aboutDialog ui;
public Q_SLOTS:
void onExit();
signals:

View File

@ -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; /* <20>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>ť */
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()

View File

@ -28,7 +28,7 @@ QPushButton
{
/*width: 172px;
height: 56px;*/
font: 19pt &quot;新宋体&quot;;
font: 10pt &quot;新宋体&quot;;
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 {
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupAdjustments">
<property name="styleSheet">
<string notr="true">QLabel
{
color: #ACCDFF;
font-size: 14px;
font: 9pt &quot;Adobe Devanagari&quot;;
}</string>
</property>
<property name="title">
<string>调整</string>
</property>
@ -237,6 +245,24 @@ QSlider::handle:horizontal:pressed {
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QPushButton" name="btnTrueColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<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="text">
<string>真彩色</string>
</property>
@ -244,6 +270,12 @@ QSlider::handle:horizontal:pressed {
</item>
<item row="0" column="1">
<widget class="QPushButton" name="btnColorInfrared">
<property name="minimumSize">
<size>
<width>0</width>
<height>43</height>
</size>
</property>
<property name="text">
<string>假彩色</string>
</property>