Vertical scroll bar in QComboBox
-
Hi all,
I have a huge QComboBox (more than 2000 items) and Qt display it with tiny arrows on top and bottom like this:
But the scrolling is too slow, I need the classic vertical scrollbar like this (picked from this post:
How is it possible ?
Thanks in advanceArnaud
-
Hi all,
I have a huge QComboBox (more than 2000 items) and Qt display it with tiny arrows on top and bottom like this:
But the scrolling is too slow, I need the classic vertical scrollbar like this (picked from this post:
How is it possible ?
Thanks in advanceArnaud
@duarna
You're not going to like this, but you simply should not populate a combobox for the user with 2000 items, it is not manageable! If you really have this many you should choose a different UI interface, e.g. use aQCompleter
. Then you won't have this issue..... -
Hi
As @JonB says, 2000 items in combobox is not a good experience for the end user.
Its hard to navigate.Anyway, you can try
ui->comboBox->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);which gives me a scrollbar also on linux that normally only has the up/down arrows using XFCE WM.
-
I had same problem on Windows when filling a combobox with almost 4000 lines (ICD10 diagnoses for a healthcare app), it works but you have to use the "classic" vertical scrollbar.
On Windows this means you cannot use Fusion style, instead use the VistaStyle for the combobox.