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
Expand all
Show 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
This diff is collapsed.
Click to expand it.
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