View Full Version : QTable context menu
grabnerj
24th June 2008, 05:08
I have a context menu associated with a widget. The widget has a QTableView as a child. The context menu displays outside of the Table. In the contextMenuEvent I want to calculate if the mouse is over a row of data before I pop up the menu. I also need to set the current row of the table before I do the pop up.
aamer4yu
24th June 2008, 05:20
You can override the mousePressEvent for the QTableView and check childAt(event->pos()) is valid or not.
If its valid, you can get the row from the index of the child.
Hope this helps
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.