Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.2, 5.13.0
-
None
Description
Let's say we have an item view as in QComboBox and we insert a few normal strings. If we insert spacer which is not visible on the first page (limited by MaxVisibleItems) the list leaves an empty space at end when we scroll to bottom. Empty space's height is exactly (NormalItemHeight) - (SpacerHeight). But if we also insert a spacer so it is visible on the first page (indexNumber falls under MaxVisibleItems) then there will be no empty space.
As far as I know something doesnt work out between View and ScrollBars. Scroll bar jumps between Items (QAbstractItemView::ScrollPerItem") but it doesnt adjust step correctly based on item height.
Code that displays EMPTY SPACE (image 'empty_space.png'):
// code placeholder QComboBox *combo_box = new QComboBox(); combo_box->setMaxVisibleItems(4); combo_box->addItem("dude1"); combo_box->addItem("dude2"); combo_box->addItem("dude3"); combo_box->addItem("dude4"); combo_box->addItem("dude5"); combo_box->addItem("dude6"); combo_box->insertSeparator(combo_box->count()); combo_box->addItem("dude7");
Code that displays correctly (image 'no_empty_space.png'):
// code placeholder QComboBox *combo_box = new QComboBox(); combo_box->setMaxVisibleItems(4); combo_box->insertSeparator(combo_box->count()); combo_box->addItem("dude1"); combo_box->addItem("dude2"); combo_box->addItem("dude3"); combo_box->addItem("dude4"); combo_box->addItem("dude5"); combo_box->addItem("dude6"); combo_box->insertSeparator(combo_box->count()); combo_box->addItem("dude7");