In QMenu there's a addSeparator() function available, what's the equivalent in QTableView?
I only see the function to add an action (which is addAction()), how am I supposed to add a separator when I set context menu mode to ActionContextMenu?
QAction *separator = new QAction(this);
separator->setSeparator(true);
addAction(separator);
I think you can set ContextMenuPolicy to Qt::CustomContextMenu and then construct your custom menu using QWidget::actions() and your separators.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With