Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33359

QToolButton text under icon shrinking

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • None
    • 5.1.1
    • None
    • Windows 8

    Description

      If a tool button with an icon and text under it is added to a toolbar, Qt 5.1.1 doesn't display the text correctly: letters like "q", "g" or "p" are shrunk.

      The following code demontrates the issue:

      tool button text shrinking in Qt 5.1.1
      #include <QtWidgets/QToolButton>
      #include <QtWidgets/QHBoxLayout>
      
      #include "testtoolbara.h"
      
      testtoolbara::testtoolbara(QWidget *parent)
      	: QMainWindow(parent)
      {
      	ui.setupUi(this);
      
      	QToolButton *toolButton1 = new QToolButton;
      	toolButton1->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
      	toolButton1->setIcon(QIcon("z:/page-settings.png"));
      	toolButton1->setText("Qt 5.1.1");
      	toolButton1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
      
      	QToolButton *toolButton2 = new QToolButton;
      	toolButton2->setText("Buggy");
      	toolButton2->setIcon(QIcon("z:/page-settings.png"));
      	toolButton2->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
      	toolButton2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
      
      	ui.mainToolBar->addWidget(toolButton1);
      	ui.mainToolBar->addWidget(toolButton2);
      }
      
      testtoolbara::~testtoolbara()
      {
      
      }
      

      There is a picture attached where text shrinking is shown.

      Attachments

        1. qtbug_33359.tgz
          8 kB
        2. shrinking.png
          shrinking.png
          8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            mentalmushroom Pugach Yaroslav
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes