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
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()))
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()))
To copy to clipboard, switch view to plain text mode
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
Bookmarks