How to hide arrow of setMenu ?
-
QMenu *menu=new QMenu;
open=new QAction("打开本地网页",menu);
about=new QAction("关于",menu);
menu->addAction(open);
menu->addAction(about);
ui->pushButtonMenu->setMenu(menu);@sonichy Hi, friend, welcome.
did you use the
QToolButton::setMenu or QPushButton::setMenu
?If you used
QPushButton::setMenu
. you can try below style code snippet. or you can search qt key words Qt Style Sheets Reference to read QToolButton or QPushButton, and Customizing the QPushButton's Menu Indicator Sub-ControlQPushButton::menu-indicator { image: url(myindicator.png); subcontrol-position: right center; subcontrol-origin: padding; left: -2px; }
Try to modify it , maybe help you.
If you used
QToolButton
, They has the same ways. Just to read Qt Help manual.Reference
Qt Style Sheets Reference
Customizing the QPushButton's Menu Indicator Sub-Control
Customizing QToolButton -
@sonichy Hi, friend, welcome.
did you use the
QToolButton::setMenu or QPushButton::setMenu
?If you used
QPushButton::setMenu
. you can try below style code snippet. or you can search qt key words Qt Style Sheets Reference to read QToolButton or QPushButton, and Customizing the QPushButton's Menu Indicator Sub-ControlQPushButton::menu-indicator { image: url(myindicator.png); subcontrol-position: right center; subcontrol-origin: padding; left: -2px; }
Try to modify it , maybe help you.
If you used
QToolButton
, They has the same ways. Just to read Qt Help manual.Reference
Qt Style Sheets Reference
Customizing the QPushButton's Menu Indicator Sub-Control
Customizing QToolButton