https://codereview.qt-project.org/227511/ allows text in a QToolButton to elide. However, in some cases it causes a "premature" eliding. That means that even with preferred width, the QToolButton elides its text.
QTBUG-72226.zip contains a minimal application to reproduce the issue.
Key ingredients are:
- QToolButton in a QHorizontalLayout
- button has an icon
- button has text
- text contains a & (mnemonic)
- toolButtonStyle is Qt::ToolButtonTextBesideIcon
The issue was originally fount in Qt Creator's amend/commit editor (
QTCREATORBUG-21551). This is how it looks like: