Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.3
-
None
-
-
b002c21087e8bfafbcf967d43253bf861e94e6c8 (qt/qtbase/dev)
Description
Just as the title says, when a push-button has both icon and menu the end of it's text is clipped (not visible). and the auto-hide of menu indicator is not working.
Following code:
#include <QtWidgets> int main(int argc, char *argv[]) { QApplication a(argc, argv); auto popupButton = new QPushButton(); popupButton->setText("Popup Button With Menu and Icon"); popupButton->setIcon(QPixmap(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png"))); auto menu = new QMenu(); menu->addAction("&First Item"); menu->addAction("&Second Item"); popupButton->setMenu(menu); auto popupButton2 = new QPushButton(); popupButton2->setText("Popup Button With Menu and Icon"); popupButton2->setIcon(QPixmap(QLatin1String(":/qt-project.org/qmessagebox/images/qtlogo-64.png"))); auto dlg = new QDialog; auto *layout = new QHBoxLayout(dlg); layout->addWidget(popupButton); layout->addWidget(popupButton2); layout->addSpacerItem(new QSpacerItem(20,20,QSizePolicy::Expanding, QSizePolicy::Preferred)) ; dlg->show() ; return a.exec(); }