Skip to content

Commit

Permalink
优化 CI/CD测试输出及打包名称
Browse files Browse the repository at this point in the history
  • Loading branch information
nekosilverfox committed Apr 8, 2024
1 parent 6965b74 commit 8c42322
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
env:
targetName: PolyChat
# 在 Qt pro 文件中的 TARGET
QtApplicationName: App
QtApplicationName: PolyChat
steps:
# macos 11.0 默认环境变了,要指定
- name: prepare env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
env:
targetName: PolyChat
# 在 Qt pro 文件中的
QtApplicationName: App.exe
QtApplicationName: PolyChat.exe
# 步骤
steps:
# 安装Qt
Expand Down
2 changes: 2 additions & 0 deletions App/App.pro
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

TARGET = PolyChat

RESOURCES += \
resource.qrc

Expand Down
4 changes: 3 additions & 1 deletion App/uil_chatboxwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ ChatBoxWidget::ChatBoxWidget(QWidget* parent, QString name, qint16 port)
ui->setupUi(this);
this->setAttribute(Qt::WA_DeleteOnClose);
this->setWindowIcon(QIcon(":/icon/icons/user-group.png"));
this->setWindowTitle(QString(tr("Chat %1 on port %2")).arg(name).arg(port)); // 注意:这里 .arg() 必须链式调用 不可以 .arg(name, port) 否则无法正常渲染。这是因为 如果想 .arg(name, port) 单次调用的话,必须保证参数类型一样,而这里是一个 QString 一个 qint16 类型,而链式调用就不存在这个问题

//this->setWindowTitle(QString(tr("Chat %1 on port %2")).arg(name).arg(port)); // 注意:这里 .arg() 必须链式调用 不可以 .arg(name, port) 否则无法正常渲染。这是因为 如果想 .arg(name, port) 单次调用的话,必须保证参数类型一样,而这里是一个 QString 一个 qint16 类型,而链式调用就不存在这个问题
this->setWindowTitle(QString(tr("Chat %1 on port %2")).arg(name, QString::number(port)));


/* 对所有窗口的同样地址广播 8888 (告诉 ChatList 本窗口存在) */
Expand Down

0 comments on commit 8c42322

Please sign in to comment.