QDialog关闭按钮变灰
时间: 2023-08-21 22:07:27 浏览: 93
将按钮置灰
3星 · 编辑精心推荐
要将QDialog关闭按钮变灰,可以使用以下两种方法:
1. 使用setWindowFlag函数:调用setWindowFlag(Qt::WindowCloseButtonHint, false)来禁用关闭按钮,即将其隐藏起来。这样关闭按钮就会变灰并无法点击。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [【Qt一骚操作】Qt QDialog 对话框 右上角关闭按钮屏蔽不显示](https://blog.csdn.net/Monster_H7/article/details/120687180)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [不错的QDialog示例](https://download.csdn.net/download/guoyflotus/12303359)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文