From a2ca57f4fbbce6758ba663a1516d7f60a46f9c31 Mon Sep 17 00:00:00 2001 From: huaijin <3165620677@qq.com> Date: Sun, 13 Jul 2025 08:34:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Client/src/ui/main/MainWindow.cpp | 37 +++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/Client/src/ui/main/MainWindow.cpp b/src/Client/src/ui/main/MainWindow.cpp index 4c306f0b..302b32a4 100644 --- a/src/Client/src/ui/main/MainWindow.cpp +++ b/src/Client/src/ui/main/MainWindow.cpp @@ -56,8 +56,7 @@ MainWindow::MainWindow(QWidget *parent) , m_leftPanelSplitter(nullptr) , m_intelligenceUI(nullptr) , m_faceLightControl(nullptr) - // , m_droneControlDialog(nullptr) - // , m_robotDogControlDialog(nullptr) + , m_robotDogControlDialog(nullptr) { m_ui->setupUi(this); @@ -83,14 +82,10 @@ MainWindow::~MainWindow() delete m_faceLightControl; m_faceLightControl = nullptr; } - // if (m_droneControlDialog) { - // delete m_droneControlDialog; - // m_droneControlDialog = nullptr; - // } - // if (m_robotDogControlDialog) { - // delete m_robotDogControlDialog; - // m_robotDogControlDialog = nullptr; - // } + if (m_robotDogControlDialog) { + delete m_robotDogControlDialog; + m_robotDogControlDialog = nullptr; + } delete m_ui; } @@ -1371,14 +1366,18 @@ void MainWindow::onRobotDogControlRequested() { SystemLogger::getInstance()->logInfo("机器狗控制请求"); - // 暂时使用简单的消息框来测试功能 - QMessageBox::information(this, "机器狗控制", - "机器狗控制界面功能正在开发中...\n" - "将包含以下功能:\n" - "• 运动控制(前进、后退、转向)\n" - "• 姿态控制(站立、趴下、跳跃)\n" - "• 地图建构和导航\n" - "• 视觉识别和跟踪\n" - "• 设备状态监控"); + // 创建机器狗控制对话框(如果还没有创建) + if (!m_robotDogControlDialog) { + m_robotDogControlDialog = new RobotDogControlDialog(this); + + // 连接信号(如果需要的话) + // connect(m_robotDogControlDialog, &RobotDogControlDialog::someSignal, + // this, &MainWindow::someSlot); + } + + // 显示对话框 + m_robotDogControlDialog->show(); + m_robotDogControlDialog->raise(); + m_robotDogControlDialog->activateWindow(); }