adding right click to tableview cells
I want to have a right click menu from which i can rename, delete or open the selected image in QTableView from cells.
Here is what I have so f
Code:
def _connections(self):
self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.
connect(self, QtCore.
SIGNAL(self.
customContextMenuRequested(QtCore.
QPoint)), self, QtCore.
SLOT(displayMenu
(QtCore.
QPoint))) if self._slideShowWin:
self._slideShowWin.bar.galrBtn.clicked[bool].connect(self._openSlideShow)
def displayMenu(self, pos):
self.
menu = QtGui.
QMenu() self.menu.addAction(self.close)
self.menu.exec_(self.mapToGlobal(event.pos()))
But keep getting the error saying
self.connect(self, QtCore.SIGNAL(self.customContextMenuRequested(QtCo re.QPoint)), self, QtCore.SLOT(displayMenu(QtCore.QPoint)))
TypeError: native Qt signal is not callable
Re: adding right click to tableview cells
My guess would be the "self." inside the SIGNAL() is wrong.
Cheers,
_
Re: adding right click to tableview cells
Quote:
Originally Posted by
anda_skoa
My guess would be the "self." inside the SIGNAL() is wrong.
Cheers,
_
self is my QTableView
Re: adding right click to tableview cells
Quote:
Originally Posted by
krystosan
self is my QTableView
Yes it is. How is that related to what I wrote?
Cheers,
_