qmenu 设置箭头
时间: 2023-11-09 09:06:55 浏览: 205
QT实现带箭头的Step 菜单
3星 · 编辑精心推荐
QMenu的箭头可以通过设置QPushButton的样式表来实现。在样式表中,使用QPushButton::menu-indicator来选择菜单指示器,然后设置其image属性为none,将宽度设置为0px,这样就可以隐藏箭头。例如,可以使用以下代码来设置箭头:
```cpp
ui.tbtn_user->setStyleSheet("QPushButton::menu-indicator{image:none;width:0px;}");
```
这样就可以隐藏QMenu的箭头。\[3\]
#### 引用[.reference_title]
- *1* *2* [自定义QMenu样式](https://blog.csdn.net/weixin_30500473/article/details/101564248)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [QT样式中取消Menu三角箭头并显示图片](https://blog.csdn.net/qq_38491692/article/details/127119103)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文