How to set QToolButton right arrow center
Unsolved
General and Desktop
-
Hi all, I want to set the right arrow of position in center.How can i adjust the position of the arrow?Below is my code.
QMenu* menu = new QMenu(); QAction* identifiedAction = new QAction(); identifiedAction->setText(tr("Identified")); QAction* supportedAction = new QAction(); supportedAction->setText(tr("Supported")); menu->addAction(identifiedAction); menu->addAction(supportedAction); QAction* displayModeDefaultAction = new QAction(); displayModeDefaultAction->setText(tr("Display mode")); QToolButton* displayModeBtn = new QToolButton(); displayModeBtn->setText(tr("Display mode")); displayModeBtn->setToolButtonStyle(Qt::ToolButtonIconOnly); displayModeBtn->setDefaultAction(displayModeDefaultAction); displayModeBtn->setPopupMode(QToolButton::InstantPopup); displayModeBtn->setMenu(menu); toolBar->addWidget(displayModeBtn);
-
There is no straight forward, easy way to implement that.
You can write your own style for that purpose: https://doc.qt.io/qt-6/style-reference.html