From 518153c56b7f56e19f2d0fdbdf41483032dabfcb Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 5 Jun 2024 10:16:14 +0800 Subject: [PATCH] update --- src/mainwindow.cpp | 15 +++++++++++++++ src/mainwindow.ui | 6 +++--- src/version.h | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e6f1e74..7f56c1d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -26,6 +26,7 @@ #include "tab/mini_servo_tab.hpp" #include "tab/module_opera_tab.hpp" #include "tab/step_motor_ctrl_tab.hpp" +#include "version.h" using namespace std; using namespace iflytop; @@ -202,11 +203,23 @@ void MainWindow::constructBaseUI() { void MainWindow::displayInfo(bool suc, QString info) {} +static const char *fmt(const char *fmt, ...) { + va_list args; + va_start(args, fmt); + static char buf[1024] = {0}; + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + return buf; +} + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { /** * @brief QT初始化 */ + // VERSION + + main_ui = ui; ui->setupUi(this); @@ -223,6 +236,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi ZQUI::ins()->setrawshow([this](QString text) { rawshow(text); }); ZQUI::ins()->setInstructionPreviewClear([this]() { instructionPreviewClear(); }); + ui->menu_version->setTitle(QApplication::translate("MainWindow", VERSION, nullptr)); + /** * @brief 页面逻辑初始化 */ diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 0ba948d..dae0778 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1168,12 +1168,12 @@ p, li { white-space: pre-wrap; } 20 - + - V1 + V3 - + diff --git a/src/version.h b/src/version.h index edd57ad..e21e922 100644 --- a/src/version.h +++ b/src/version.h @@ -1,4 +1,4 @@ #pragma once -#define VERSION 4 +#define VERSION "VERSION_4" #define MAUFACTURER "iflytop" \ No newline at end of file