|
ORE Studio 0.0.4
|
A QListView that caps the combo box popup height and repositions it. More...
#include <WidgetUtils.hpp>
Inherits QListView.

Public Member Functions | |
| BoundedListView (QComboBox *combo) | |
| QSize | sizeHint () const override |
Static Public Attributes | |
| static constexpr int | max_popup_height = 250 |
Protected Member Functions | |
| void | showEvent (QShowEvent *event) override |
A QListView that caps the combo box popup height and repositions it.
On Linux, Qt can compute the popup size from sizeHintForRow() * itemCount, ignoring setMaxVisibleItems(), and position the popup above the combo when it would overflow the screen. A deferred showEvent() resize then corrects both the height and the vertical position relative to the combo box.
sizeHint() is also overridden as a first-pass hint for platforms that do query it before positioning.