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

Only "..." is displayed for some elements in a QComboBox

    XMLWordPrintable

Details

    • 8577353b2a5155600e672955e7c6a61e9e9519ca

    Description

      When having a list of elements in a QComboBox then the combobox dropdown list may be too narrow and only display "..." for some elements instead of the actual element text.

      This is reproducible using the example below. Set the fonts to "Extra large" and then run the example on Windows. Open the combo box and see a list of percentages. Note that all items below 9% are only shown as ellipsis.

      int main(int argc, char *argv[])
      {
      	QApplication a(argc, argv);
      	QMainWindow mw;
      	QToolBar *toolBar = new QToolBar;
      	mw.addToolBar(toolBar);
      	QComboBox *cb = new QComboBox;
      	for (int i = 1; i <= 32; i++)
      		cb->addItem(QString("%1%").arg(i));
      	toolBar->addWidget(cb);
      	mw.show();
      	a.exec();
      	return 0;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bachewii Jens
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes