Disabled item in QComboBox is still interactive
-
Hello
I used an item model to make one of the entries in my drop-down list disabled (grayed out).
So now the entry can not be selected, but it can still be clicked, and there is still a highlight when hovering over the item with the mouse. The only difference is an adjacent item will be selected when clicked.
How could I make sure the disabled item is not interactive and does not respond to clicks or to mouse move events ?
Should I have my own QListView, with overriden mouse events, and set it as the view to the combo box ? Will the combo box still look and behave properly if I pass it a QListView instance ? How do i allocate it so the QComboBox can delete it properly ?
Thank you,
Adrian Vasile Constantin -
Hello
I used an item model to make one of the entries in my drop-down list disabled (grayed out).
So now the entry can not be selected, but it can still be clicked, and there is still a highlight when hovering over the item with the mouse. The only difference is an adjacent item will be selected when clicked.
How could I make sure the disabled item is not interactive and does not respond to clicks or to mouse move events ?
Should I have my own QListView, with overriden mouse events, and set it as the view to the combo box ? Will the combo box still look and behave properly if I pass it a QListView instance ? How do i allocate it so the QComboBox can delete it properly ?
Thank you,
Adrian Vasile ConstantinCan you please at least tell what exact Qt version you're using and how you disabled it? Best would be a small codepiece so we can see what you're really doing and can reproduce it.