Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zzz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lr
zzz
Commits
b25211ae
Commit
b25211ae
authored
Dec 03, 2025
by
ym0408
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
914ec9fd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
270 deletions
+83
-270
MultiFunctionDialog.cpp
MultiFunctionDialog.cpp
+45
-238
MultiFunctionDialog.h
MultiFunctionDialog.h
+5
-0
carMachineDetect.pro.user
carMachineDetect.pro.user
+1
-1
carMachineDetectionWidget.cpp
carMachineDetectionWidget.cpp
+17
-2
carMachineDetectionWidget.h
carMachineDetectionWidget.h
+2
-0
carMachineDetectionWidget.ui
carMachineDetectionWidget.ui
+13
-29
No files found.
MultiFunctionDialog.cpp
View file @
b25211ae
//#include "MultiFunctionDialog.h"
//#include "ui_MultiFunctionDialog.h"
//MultiFunctionDialog::MultiFunctionDialog(DialogType type,QWidget *parent) :
// QDialog(parent),m_dialogType(type),
// ui(new Ui::MultiFunctionDialog)
//{
// //ui->setupUi(this);
// setWindowFlags(Qt::FramelessWindowHint);
// // 弹窗基础样式
// setWindowTitle("选择设置");
// setFixedSize(1800, 800); // 统一弹窗大小(可根据类型微调)
// // 根据类型初始化对应的UI
// switch (m_dialogType) {
// case WorkStationType:
// setWindowTitle("请选择要设置的工位");
// initWorkStationUI();
// break;
// case DeviceType:
// setWindowTitle("请选择设备名称");
// initDeviceUI();
// break;
// case InspectionType:
// setWindowTitle("请选择抽检项类型");
// initInspectionUI();
// break;
// case TimeRangeType:
// setWindowTitle("请选择时间范围");
// setFixedSize(400, 320); // 时间弹窗稍大
// initTimeRangeUI();
// break;
// }
//}
//MultiFunctionDialog::~MultiFunctionDialog()
//{
// delete ui;
//}
//// -------------------------- 1. 初始化工位选择UI --------------------------
//void MultiFunctionDialog::initWorkStationUI() {
// // 标题
// QLabel *titleLabel = new QLabel("请选择要设置的工位", this);
// titleLabel->setAlignment(Qt::AlignCenter);
// // 工位列表
// m_listWidget = new QListWidget(this);
// QStringList stations = {"KOER", "KOEO", "PEPS", "KOGH", "KMOK"};
// m_listWidget->addItems(stations);
// m_listWidget->setSelectionMode(QListWidget::SingleSelection);
// m_listWidget->setCurrentRow(2); // 默认选中PEPS
// // 列表样式
// m_listWidget->setStyleSheet(R"(
// QListWidget::item { padding: 8px; text-align: center; }
// QListWidget::item:selected { background-color: #f0f0f0; color: #00bcd4; }
// )");
// // 按钮
// QPushButton *confirmBtn = new QPushButton("确认修改", this);
// QPushButton *cancelBtn = new QPushButton("取消修改", this);
// confirmBtn->setStyleSheet("background-color: #00bcd4; color: white; padding: 8px; border: none; border-radius: 4px;");
// cancelBtn->setStyleSheet("background-color: #e0e0e0; color: #333; padding: 8px; border: none; border-radius: 4px;");
// // 布局
// QVBoxLayout *mainLayout = new QVBoxLayout(this);
// QHBoxLayout *btnLayout = new QHBoxLayout;
// btnLayout->addWidget(confirmBtn);
// btnLayout->addWidget(cancelBtn);
// mainLayout->addWidget(titleLabel);
// mainLayout->addWidget(m_listWidget);
// mainLayout->addLayout(btnLayout);
// // 绑定按钮事件
// connect(confirmBtn, &QPushButton::clicked, this, &QDialog::accept);
// connect(cancelBtn, &QPushButton::clicked, this, &QDialog::reject);
//}
//// -------------------------- 2. 初始化设备选择UI --------------------------
//void MultiFunctionDialog::initDeviceUI() {
// QLabel *titleLabel = new QLabel("请选择设备名称", this);
// titleLabel->setAlignment(Qt::AlignCenter);
// m_listWidget = new QListWidget(this);
// QStringList devices = {"设备A", "设备B", "设备C", "设备D", "设备E"};
// m_listWidget->addItems(devices);
// m_listWidget->setSelectionMode(QListWidget::SingleSelection);
// m_listWidget->setCurrentRow(0);
// m_listWidget->setStyleSheet(R"(
// QListWidget::item { padding: 8px; text-align: center; }
// QListWidget::item:selected { background-color: #f0f0f0; color: #00bcd4; }
// )");
// QPushButton *confirmBtn = new QPushButton("确认", this);
// QPushButton *cancelBtn = new QPushButton("取消", this);
// confirmBtn->setStyleSheet("background-color: #00bcd4; color: white; padding: 8px; border: none; border-radius: 4px;");
// cancelBtn->setStyleSheet("background-color: #e0e0e0; color: #333; padding: 8px; border: none; border-radius: 4px;");
// QVBoxLayout *mainLayout = new QVBoxLayout(this);
// QHBoxLayout *btnLayout = new QHBoxLayout;
// btnLayout->addWidget(confirmBtn);
// btnLayout->addWidget(cancelBtn);
// mainLayout->addWidget(titleLabel);
// mainLayout->addWidget(m_listWidget);
// mainLayout->addLayout(btnLayout);
// connect(confirmBtn, &QPushButton::clicked, this, &QDialog::accept);
// connect(cancelBtn, &QPushButton::clicked, this, &QDialog::reject);
//}
//// -------------------------- 3. 初始化抽检项选择UI --------------------------
//void MultiFunctionDialog::initInspectionUI() {
// QLabel *titleLabel = new QLabel("请选择抽检项类型", this);
// titleLabel->setAlignment(Qt::AlignCenter);
// // 单选按钮组
// m_radioGroup = new QButtonGroup(this);
// QRadioButton *rbMust = new QRadioButton("必检", this);
// QRadioButton *rbSample = new QRadioButton("抽检", this);
// QRadioButton *rbBoth = new QRadioButton("必检&抽检", this);
// m_radioGroup->addButton(rbMust);
// m_radioGroup->addButton(rbSample);
// m_radioGroup->addButton(rbBoth);
// rbBoth->setChecked(true); // 默认选中
// // 单选按钮样式
// rbMust->setStyleSheet("margin: 8px; font-size: 14px;");
// rbSample->setStyleSheet("margin: 8px; font-size: 14px;");
// rbBoth->setStyleSheet("margin: 8px; font-size: 14px;");
// QPushButton *confirmBtn = new QPushButton("确认", this);
// QPushButton *cancelBtn = new QPushButton("取消", this);
// confirmBtn->setStyleSheet("background-color: #00bcd4; color: white; padding: 8px; border: none; border-radius: 4px;");
// cancelBtn->setStyleSheet("background-color: #e0e0e0; color: #333; padding: 8px; border: none; border-radius: 4px;");
// QVBoxLayout *mainLayout = new QVBoxLayout(this);
// QHBoxLayout *btnLayout = new QHBoxLayout;
// btnLayout->addWidget(confirmBtn);
// btnLayout->addWidget(cancelBtn);
// mainLayout->addWidget(titleLabel);
// mainLayout->addWidget(rbMust);
// mainLayout->addWidget(rbSample);
// mainLayout->addWidget(rbBoth);
// mainLayout->addLayout(btnLayout);
// connect(confirmBtn, &QPushButton::clicked, this, &QDialog::accept);
// connect(cancelBtn, &QPushButton::clicked, this, &QDialog::reject);
//}
//// -------------------------- 4. 初始化时间范围选择UI --------------------------
//void MultiFunctionDialog::initTimeRangeUI() {
// QLabel *titleLabel = new QLabel("请选择时间范围", this);
// titleLabel->setAlignment(Qt::AlignCenter);
// // 日历控件(辅助选择)
// QCalendarWidget *calendar = new QCalendarWidget(this);
// calendar->setSelectedDate(QDate::currentDate());
// calendar->setGridVisible(true);
// calendar->setMaximumHeight(180);
// // 日期编辑框
// QLabel *startLabel = new QLabel("开始日期:", this);
// QLabel *endLabel = new QLabel("结束日期:", this);
// m_startDateEdit = new QDateEdit(QDate::currentDate(), this);
// m_endDateEdit = new QDateEdit(QDate::currentDate().addDays(2), this);
// m_startDateEdit->setCalendarPopup(true);
// m_endDateEdit->setCalendarPopup(true);
// m_startDateEdit->setFixedWidth(120);
// m_endDateEdit->setFixedWidth(120);
// // 日期布局
// QHBoxLayout *dateLayout = new QHBoxLayout;
// dateLayout->addWidget(startLabel);
// dateLayout->addWidget(m_startDateEdit);
// dateLayout->addSpacing(20);
// dateLayout->addWidget(endLabel);
// dateLayout->addWidget(m_endDateEdit);
// QPushButton *confirmBtn = new QPushButton("确认", this);
// QPushButton *cancelBtn = new QPushButton("取消", this);
// confirmBtn->setStyleSheet("background-color: #00bcd4; color: white; padding: 8px; border: none; border-radius: 4px;");
// cancelBtn->setStyleSheet("background-color: #e0e0e0; color: #333; padding: 8px; border: none; border-radius: 4px;");
// QVBoxLayout *mainLayout = new QVBoxLayout(this);
// QHBoxLayout *btnLayout = new QHBoxLayout;
// btnLayout->addWidget(confirmBtn);
// btnLayout->addWidget(cancelBtn);
// mainLayout->addWidget(titleLabel);
// mainLayout->addWidget(calendar);
// mainLayout->addLayout(dateLayout);
// mainLayout->addLayout(btnLayout);
// connect(confirmBtn, &QPushButton::clicked, this, &QDialog::accept);
// connect(cancelBtn, &QPushButton::clicked, this, &QDialog::reject);
//}
//// -------------------------- 获取选择结果 --------------------------
//QString MultiFunctionDialog::getStringResult() const {
// switch (m_dialogType) {
// case WorkStationType:
// // 返回选中的工位
// if (m_listWidget->currentItem()) {
// return m_listWidget->currentItem()->text();
// }
// break;
// case DeviceType:
// // 返回选中的设备
// if (m_listWidget->currentItem()) {
// return m_listWidget->currentItem()->text();
// }
// break;
// case InspectionType:
// // 返回选中的抽检项
// if (m_radioGroup->checkedButton()) {
// return m_radioGroup->checkedButton()->text();
// }
// break;
// default:
// break;
// }
// return "";
//}
//QPair<QDate, QDate> MultiFunctionDialog::getTimeRangeResult() const {
// // 仅时间范围弹窗返回日期对
// if (m_dialogType == TimeRangeType) {
// return {m_startDateEdit->date(), m_endDateEdit->date()};
// }
// return {QDate(), QDate()};
//}
#include "MultiFunctionDialog.h"
#include "MultiFunctionDialog.h"
#include "ui_MultiFunctionDialog.h"
#include "ui_MultiFunctionDialog.h"
#include <QStyleOption>
#include <QStyleOption>
...
@@ -249,20 +20,26 @@ MultiFunctionDialog::MultiFunctionDialog(DialogType type,QWidget *parent) :
...
@@ -249,20 +20,26 @@ MultiFunctionDialog::MultiFunctionDialog(DialogType type,QWidget *parent) :
// 弹窗基础设置
// 弹窗基础设置
setWindowTitle
(
"选择设置"
);
setWindowTitle
(
"选择设置"
);
setFixedSize
(
1900
,
700
);
// 修正:原1800x800太大,改为适配弹窗的尺寸(可按需调整)
//
setFixedSize(1900, 700); // 修正:原1800x800太大,改为适配弹窗的尺寸(可按需调整)
move
(
40
,
440
);
//
move(40,440);
// 根据类型初始化对应的UI
// 根据类型初始化对应的UI
switch
(
m_dialogType
)
{
switch
(
m_dialogType
)
{
case
WorkStationType
:
case
WorkStationType
:
setWindowTitle
(
"请选择要设置的工位"
);
setWindowTitle
(
"请选择要设置的工位"
);
setFixedSize
(
1900
,
700
);
// 修正:原1800x800太大,改为适配弹窗的尺寸(可按需调整)
move
(
40
,
440
);
initWorkStationUI
();
initWorkStationUI
();
break
;
break
;
case
DeviceType
:
case
DeviceType
:
setWindowTitle
(
"请选择设备名称"
);
setWindowTitle
(
"请选择设备名称"
);
setFixedSize
(
1900
,
700
);
// 修正:原1800x800太大,改为适配弹窗的尺寸(可按需调整)
move
(
40
,
440
);
initDeviceUI
();
initDeviceUI
();
break
;
break
;
case
InspectionType
:
case
InspectionType
:
setWindowTitle
(
"请选择抽检项类型"
);
setWindowTitle
(
"请选择抽检项类型"
);
setFixedSize
(
1900
,
700
);
// 修正:原1800x800太大,改为适配弹窗的尺寸(可按需调整)
move
(
40
,
440
);
initInspectionUI
();
initInspectionUI
();
break
;
break
;
case
TimeRangeType
:
case
TimeRangeType
:
...
@@ -275,7 +52,7 @@ MultiFunctionDialog::MultiFunctionDialog(DialogType type,QWidget *parent) :
...
@@ -275,7 +52,7 @@ MultiFunctionDialog::MultiFunctionDialog(DialogType type,QWidget *parent) :
MultiFunctionDialog
::~
MultiFunctionDialog
()
MultiFunctionDialog
::~
MultiFunctionDialog
()
{
{
delete
ui
;
//
delete ui;
}
}
// -------------------------- 关键补充:重写paintEvent实现圆角(必须,否则弹窗圆角不生效) --------------------------
// -------------------------- 关键补充:重写paintEvent实现圆角(必须,否则弹窗圆角不生效) --------------------------
...
@@ -305,15 +82,19 @@ void MultiFunctionDialog::initWorkStationUI() {
...
@@ -305,15 +82,19 @@ void MultiFunctionDialog::initWorkStationUI() {
QListWidgetItem
*
item
=
m_listWidget
->
item
(
i
);
QListWidgetItem
*
item
=
m_listWidget
->
item
(
i
);
item
->
setTextAlignment
(
Qt
::
AlignCenter
);
// 等同于 Qt::AlignHCenter | Qt::AlignVCenter
item
->
setTextAlignment
(
Qt
::
AlignCenter
);
// 等同于 Qt::AlignHCenter | Qt::AlignVCenter
}
}
// // 开启循环滚动
// m_enableCycleScroll = true;
// // 给列表安装事件过滤器
// m_listWidget->installEventFilter(this);
// 列表样式
// 列表样式
m_listWidget
->
setStyleSheet
(
R"(
m_listWidget
->
setStyleSheet
(
R"(
QListWidget { border: none;
QListWidget { border: none;
outline: none;
outline: none;
font-size: 40px;
font-size: 25px;
border-radius: 25px;
} /* 去掉列表边框 */
} /* 去掉列表边框 */
QListWidget::item {
QListWidget::item {
padding:
12
px; /* 选项内边距加大,更宽松 */
padding:
25
px; /* 选项内边距加大,更宽松 */
text-align: center;
text-align: center;
outline: none;
outline: none;
...
@@ -364,9 +145,9 @@ void MultiFunctionDialog::initWorkStationUI() {
...
@@ -364,9 +145,9 @@ void MultiFunctionDialog::initWorkStationUI() {
// 布局
// 布局
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
(
this
);
// 布局内边距(避免内容贴弹窗边缘)
// 布局内边距(避免内容贴弹窗边缘)
mainLayout
->
setContentsMargins
(
20
,
2
0
,
20
,
20
);
mainLayout
->
setContentsMargins
(
20
,
3
0
,
20
,
20
);
// 布局间距(控件之间的距离)
// 布局间距(控件之间的距离)
mainLayout
->
setSpacing
(
1
5
);
mainLayout
->
setSpacing
(
2
5
);
QHBoxLayout
*
btnLayout
=
new
QHBoxLayout
;
QHBoxLayout
*
btnLayout
=
new
QHBoxLayout
;
btnLayout
->
setSpacing
(
12
);
// 两个按钮之间的间距
btnLayout
->
setSpacing
(
12
);
// 两个按钮之间的间距
...
@@ -381,6 +162,32 @@ void MultiFunctionDialog::initWorkStationUI() {
...
@@ -381,6 +162,32 @@ void MultiFunctionDialog::initWorkStationUI() {
connect
(
confirmBtn
,
&
QPushButton
::
clicked
,
this
,
&
QDialog
::
accept
);
connect
(
confirmBtn
,
&
QPushButton
::
clicked
,
this
,
&
QDialog
::
accept
);
connect
(
cancelBtn
,
&
QPushButton
::
clicked
,
this
,
&
QDialog
::
reject
);
connect
(
cancelBtn
,
&
QPushButton
::
clicked
,
this
,
&
QDialog
::
reject
);
}
}
//// 事件过滤器实现:处理上下键循环滚动
//bool MultiFunctionDialog::eventFilter(QObject *watched, QEvent *event) {
// // 仅处理QListWidget的按键事件,且开启了循环滚动
// if (watched == m_listWidget && m_enableCycleScroll && event->type() == QEvent::KeyPress) {
// QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
// int currentRow = m_listWidget->currentRow();
// int itemCount = m_listWidget->count();
// // 按下下键:最后一项 -> 第一项
// if (keyEvent->key() == Qt::Key_Down) {
// if (currentRow == itemCount - 1) {
// m_listWidget->setCurrentRow(0);
// return true; // 拦截默认事件,避免继续向下滚动
// }
// }
// // 按上键:第一项 -> 最后一项
// else if (keyEvent->key() == Qt::Key_Up) {
// if (currentRow == 0) {
// m_listWidget->setCurrentRow(itemCount - 1);
// return true; // 拦截默认事件
// }
// }
// }
// // 其他事件交给父类处理
// return QDialog::eventFilter(watched, event);
//}
// -------------------------- 2. 初始化设备选择UI(按钮样式同步修改) --------------------------
// -------------------------- 2. 初始化设备选择UI(按钮样式同步修改) --------------------------
void
MultiFunctionDialog
::
initDeviceUI
()
{
void
MultiFunctionDialog
::
initDeviceUI
()
{
...
@@ -556,7 +363,7 @@ QString MultiFunctionDialog::getStringResult() const {
...
@@ -556,7 +363,7 @@ QString MultiFunctionDialog::getStringResult() const {
switch
(
m_dialogType
)
{
switch
(
m_dialogType
)
{
case
WorkStationType
:
case
WorkStationType
:
// 返回选中的工位
// 返回选中的工位
if
(
m_listWidget
->
currentItem
())
{
if
(
m_listWidget
&&
m_listWidget
->
currentItem
())
{
return
m_listWidget
->
currentItem
()
->
text
();
return
m_listWidget
->
currentItem
()
->
text
();
}
}
break
;
break
;
...
...
MultiFunctionDialog.h
View file @
b25211ae
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <QCalendarWidget> // 用到了 QCalendarWidget
#include <QCalendarWidget> // 用到了 QCalendarWidget
#include <QVBoxLayout> // 用到了布局
#include <QVBoxLayout> // 用到了布局
#include <QHBoxLayout>
#include <QHBoxLayout>
#include <QKeyEvent> // 新增:包含QKeyEvent头文件
// 枚举:4种弹窗类型
// 枚举:4种弹窗类型
enum
DialogType
{
enum
DialogType
{
WorkStationType
,
// 工位选择
WorkStationType
,
// 工位选择
...
@@ -33,6 +34,9 @@ public:
...
@@ -33,6 +34,9 @@ public:
// 统一接口:获取选择结果(根据类型返回对应数据)
// 统一接口:获取选择结果(根据类型返回对应数据)
QString
getStringResult
()
const
;
// 用于:工位/设备/抽检项(返回字符串)
QString
getStringResult
()
const
;
// 用于:工位/设备/抽检项(返回字符串)
QPair
<
QDate
,
QDate
>
getTimeRangeResult
()
const
;
// 用于:时间范围(返回日期对)
QPair
<
QDate
,
QDate
>
getTimeRangeResult
()
const
;
// 用于:时间范围(返回日期对)
private
slots
:
// 事件过滤器:处理QListWidget的按键事件(实现循环滚动)
// bool eventFilter(QObject *watched, QEvent *event);
private:
private:
// 根据类型创建对应的UI
// 根据类型创建对应的UI
void
initWorkStationUI
();
// 初始化工位选择UI
void
initWorkStationUI
();
// 初始化工位选择UI
...
@@ -46,6 +50,7 @@ private:
...
@@ -46,6 +50,7 @@ private:
QButtonGroup
*
m_radioGroup
;
// 单选按钮组(抽检项用)
QButtonGroup
*
m_radioGroup
;
// 单选按钮组(抽检项用)
QDateEdit
*
m_startDateEdit
;
// 开始日期编辑框(时间用)
QDateEdit
*
m_startDateEdit
;
// 开始日期编辑框(时间用)
QDateEdit
*
m_endDateEdit
;
// 结束日期编辑框(时间用)
QDateEdit
*
m_endDateEdit
;
// 结束日期编辑框(时间用)
// bool m_enableCycleScroll = false;
Ui
::
MultiFunctionDialog
*
ui
;
Ui
::
MultiFunctionDialog
*
ui
;
};
};
...
...
carMachineDetect.pro.user
View file @
b25211ae
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2025-12-03T1
0:14:14
. -->
<!-- Written by QtCreator 4.11.1, 2025-12-03T1
5:06:26
. -->
<qtcreator>
<qtcreator>
<data>
<data>
<variable>
EnvironmentId
</variable>
<variable>
EnvironmentId
</variable>
...
...
carMachineDetectionWidget.cpp
View file @
b25211ae
...
@@ -7,8 +7,8 @@ carMachineDetectionWidget::carMachineDetectionWidget(QWidget *parent)
...
@@ -7,8 +7,8 @@ carMachineDetectionWidget::carMachineDetectionWidget(QWidget *parent)
:
QMainWindow
(
parent
)
:
QMainWindow
(
parent
)
,
ui
(
new
Ui
::
carMachineDetectionWidget
)
,
ui
(
new
Ui
::
carMachineDetectionWidget
)
{
{
setWindowFlags
(
windowFlags
()
&
~
Qt
::
WindowFullscreenButtonHint
);
//
setWindowFlags(windowFlags() & ~Qt::WindowFullscreenButtonHint);
setMaximumSize
(
2000
,
1200
);
//
setMaximumSize(2000, 1200);
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
//初始状态
//初始状态
// ui->widget_search->hide();
// ui->widget_search->hide();
...
@@ -72,3 +72,18 @@ void carMachineDetectionWidget::on_pushButton_inspectionItemt_clicked()
...
@@ -72,3 +72,18 @@ void carMachineDetectionWidget::on_pushButton_inspectionItemt_clicked()
}
}
}
}
}
}
void
carMachineDetectionWidget
::
on_pushButton_chooseTime_clicked
()
{
MultiFunctionDialog
dialog
(
TimeRangeType
,
this
);
if
(
dialog
.
exec
()
==
QDialog
::
Accepted
)
{
QPair
<
QDate
,
QDate
>
timeRange
=
dialog
.
getTimeRangeResult
();
QDate
startDate
=
timeRange
.
first
;
QDate
endDate
=
timeRange
.
second
;
if
(
startDate
.
isValid
()
&&
endDate
.
isValid
())
{
QMessageBox
::
information
(
this
,
"选择结果"
,
QString
(
"时间范围:%1 至 %2"
).
arg
(
startDate
.
toString
(
"yyyy-MM-dd"
)).
arg
(
endDate
.
toString
(
"yyyy-MM-dd"
)));
// 业务逻辑:更新时间范围设置
}
}
}
carMachineDetectionWidget.h
View file @
b25211ae
...
@@ -28,6 +28,8 @@ private slots:
...
@@ -28,6 +28,8 @@ private slots:
void
on_pushButton_inspectionItemt_clicked
();
void
on_pushButton_inspectionItemt_clicked
();
void
on_pushButton_chooseTime_clicked
();
private:
private:
Ui
::
carMachineDetectionWidget
*
ui
;
Ui
::
carMachineDetectionWidget
*
ui
;
};
};
...
...
carMachineDetectionWidget.ui
View file @
b25211ae
...
@@ -473,6 +473,12 @@
...
@@ -473,6 +473,12 @@
<height>
191
</height>
<height>
191
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"layoutDirection"
>
<property
name=
"layoutDirection"
>
<enum>
Qt::RightToLeft
</enum>
<enum>
Qt::RightToLeft
</enum>
</property>
</property>
...
@@ -1432,7 +1438,7 @@ QWidget#widget_SearchCriteria {
...
@@ -1432,7 +1438,7 @@ QWidget#widget_SearchCriteria {
<widget
class=
"QLabel"
name=
"label_choosetime"
>
<widget
class=
"QLabel"
name=
"label_choosetime"
>
<property
name=
"geometry"
>
<property
name=
"geometry"
>
<rect>
<rect>
<x>
1
0
0
</x>
<x>
1
7
0
</x>
<y>
10
</y>
<y>
10
</y>
<width>
141
</width>
<width>
141
</width>
<height>
51
</height>
<height>
51
</height>
...
@@ -1673,37 +1679,9 @@ QLineEdit#lineEdit_Model {
...
@@ -1673,37 +1679,9 @@ QLineEdit#lineEdit_Model {
</rect>
</rect>
</property>
</property>
</widget>
</widget>
<widget
class=
"QPushButton"
name=
"pushButton"
>
<property
name=
"geometry"
>
<rect>
<x>
140
</x>
<y>
699
</y>
<width>
800
</width>
<height>
71
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
PushButton
</string>
</property>
</widget>
<widget
class=
"QPushButton"
name=
"pushButton_2"
>
<property
name=
"geometry"
>
<rect>
<x>
1010
</x>
<y>
700
</y>
<width>
800
</width>
<height>
71
</height>
</rect>
</property>
<property
name=
"text"
>
<string>
PushButton
</string>
</property>
</widget>
<zorder>
listWidget
</zorder>
<zorder>
listWidget
</zorder>
<zorder>
tabWidget
</zorder>
<zorder>
tabWidget
</zorder>
<zorder>
pushButton_btnSoftwareControl
</zorder>
<zorder>
pushButton_btnSoftwareControl
</zorder>
<zorder>
pushButton
</zorder>
<zorder>
pushButton_2
</zorder>
</widget>
</widget>
<widget
class=
"QWidget"
name=
"SoftControlwidget"
native=
"true"
>
<widget
class=
"QWidget"
name=
"SoftControlwidget"
native=
"true"
>
<property
name=
"geometry"
>
<property
name=
"geometry"
>
...
@@ -1811,6 +1789,12 @@ QLabel#label_softwnamet {
...
@@ -1811,6 +1789,12 @@ QLabel#label_softwnamet {
</item>
</item>
<item>
<item>
<widget
class=
"QWidget"
name=
"widget_ReleaseTime"
native=
"true"
>
<widget
class=
"QWidget"
name=
"widget_ReleaseTime"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
/* widget_SearchCriteria 样式:背景色+圆角 */
<string
notr=
"true"
>
/* widget_SearchCriteria 样式:背景色+圆角 */
QWidget#widget_ReleaseTime {
QWidget#widget_ReleaseTime {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment