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

QCombobox calculates container height wrong when using spacing

    XMLWordPrintable

Details

    • ab556d6b321bb02cec2a0c0705b1212377fde095 (qtbase/5.4, 22.10.2014, 5.4)

    Description

      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();
      }
      

      Attachments

        1. qtbug37685.zip
          2 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes