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

QComboBoxListView display misalignment after sliding

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11
    • Commits:
      f7a4a79c62daeba9ab5545c5e0a1f36d5e1fce6b (qt/qtbase/dev) 22d74333732ba0d5a5b8fd94f2b539bba989298a (qt/qtbase/6.2) a2797c7ddbcf7b0942b871c145967e92df31bfad (qt/tqtc-qtbase/5.15)

      Description

      [Code]

      #include <QComboBox>
      #include <QScroller>
      #include <QAbstractItemView>
      
      MainWindow::MainWindow(QWidget *parent)
          : QMainWindow(parent)
      {
          QComboBox *comboBox = new QComboBox(this);
          for (int i = 0; i < 60; i++) {
              comboBox->addItem(" item " + QString::number(i + 1));
          }
          QScroller::grabGesture(comboBox->view(), QScroller::LeftMouseButtonGesture);
      }
      

       

      [Steps]

      1.Click the QComboBox component and scroll the mouse to hide a part of the item above;

      2.At this moment, press the left mouse button and drag the QComboBoxListView down;

      3.Release the left mouse button, QComboBoxListView will automatically return to position;

      4.But the position has been misplaced, and there is a blank underneath;

      5.On the contrary, if you drag upwards, there will be a blank space above.

       

      [Hope]

      I hope that there will be no blank space on the top or bottom after the scrolling is over

        Attachments

        1. Video presentation.mp4
          1.41 MB
        2. Extra blank space(top).png
          Extra blank space(top).png
          739 kB
        3. Extra blank space(bottom).png
          Extra blank space(bottom).png
          495 kB
        4. Demo project.zip
          2 kB
        5. aaaaaaaaa.zip
          2 kB
        6. aaaaaaaaa.mp4
          944 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            vhilshei Volker Hilsheimer
            Reporter:
            tangxing tang xing
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: