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

QCombobox calculates container height wrong when using spacing

XMLWordPrintable

    • ab556d6b321bb02cec2a0c0705b1212377fde095 (qtbase/5.4, 22.10.2014, 5.4)

      QCombobox calculates container listview height wrong in QComboBox::showPopup() when spacing is used. Bug is visible in the end of the dropdown list when there's more than 3 items. Visual effect is empty space after last item.

      main.cpp
      #include <QApplication>
      #include <QComboBox>
      #include <QListView>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QComboBox* cb = new QComboBox();
          (qobject_cast<QListView*>(cb->view()))->setSpacing(4);
          int numOfItems=5;
          for(int i=0;i<numOfItems;i++)
              cb->addItem("item " + QString::number(i+1));
          cb->show();
          return a.exec();
      }
      

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

            kleint Friedemann Kleint
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes