1. 按指定格式设置窗口名称 // QWidget::setWindowModified: The window title does not contain a '[*]' placeholder setWindowTitle(tr("%1[*]").arg("Untitled")); 2. 在设置改变时,设置窗口已修改 setWindowModified(true); setWindowModified(false);