Commit b25211ae authored by ym0408's avatar ym0408

2

parent 914ec9fd
This diff is collapsed.
...@@ -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;
}; };
......
<?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-03T10:14:14. --> <!-- Written by QtCreator 4.11.1, 2025-12-03T15:06:26. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
......
...@@ -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")));
// 业务逻辑:更新时间范围设置
}
}
}
...@@ -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;
}; };
......
...@@ -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>100</x> <x>170</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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment