Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.9.1
-
None
-
b2a282d7c7b8f49819bbc86ed705980438ecb04b , 021906f6c (dev), 2376f6a2c (6.5), 1d01af306 (tqtc/lts-5.15), 017ebb2ed (tqtc/lts-6.2), 8be65ba91 (6.4)
Description
QToolButton will cut off text (details might depend on style) when maximum width will prevent it from allocating enough space, which looks ugly.
At least some other widgets (like `QTabBar`) will elide text in such cases.
Example code:
#include <QtWidgets/QApplication> #include <QtWidgets/QBoxLayout> #include <QtWidgets/QToolButton> int main(int argc, char *argv[]) { QApplication application(argc, argv); QWidget widget; QToolButton normalToolButton(&widget); normalToolButton.setIcon(QIcon::fromTheme("text-html")); normalToolButton.setIconSize({64, 64}); normalToolButton.setText("Some Text"); normalToolButton.setToolButtonStyle(Qt::ToolButtonTextUnderIcon); QToolButton constrainedToolButton(&widget); constrainedToolButton.setIcon(QIcon::fromTheme("text-html")); constrainedToolButton.setIconSize({64, 64}); constrainedToolButton.setText("Some Text"); constrainedToolButton.setToolButtonStyle(Qt::ToolButtonTextUnderIcon); constrainedToolButton.setFixedWidth(64); QBoxLayout layout(QBoxLayout::TopToBottom, &widget); layout.addWidget(&normalToolButton); layout.addWidget(&constrainedToolButton); widget.show(); return application.exec(); }
Related URL:
https://bugs.kde.org/show_bug.cgi?id=386076
Attachments
Issue Links
- relates to
-
QTBUG-73333 QToolButton eliding option editing
-
- Closed
-