QComboBox popup as TableView
-
Hello,
I have a QComboBox for which I supplied QTableView and QAbstractTableModel in order to have combobox's popup contain some columns which indexes when clicked will behave just like buttons.
The problem is that I need to prevent currently selected item from being changed based on which tableView index is being clicked so that I can have these indexes for extra functionality only.
Also, I need to disable popup being closed on these indexes being pressed.
Any ideas on how this can be done?

ComboBox::ComboBox(QWidget* parent) : QComboBox(parent) { auto table = new LightsTableView{ this , this}; setView(table); setModel(new ModelLights{}); setModelColumn(2); } -
You need to install an event filter to manage
QEvent::MouseButtonReleaseto override the default behaviour -
Hi,
This kind of interaction is a bit unusual. Can you explain the workflow you want to implement with that ?
-
You need to install an event filter to manage
QEvent::MouseButtonReleaseto override the default behaviour