Note that there are some explanatory texts on larger screens.

plurals
  1. POQMenu for QTableWidget in PySide/PyQt
    primarykey
    data
    text
    <p>here is my question details: I have these widgets - QMenuBar, QTableWidget and QToolbar. Here is my code sample:</p> <pre><code>import sys from PySide import QtGui class Example(QtGui.QMainWindow): def __init__(self): super(Example, self).__init__() self.header_lbls = ['Name', 'Second Name', 'Surname', 'Birth Date', 'Phone Number', 'Skype', 'E-mail'] self.table = QtGui.QTableWidget(10, 7) self.table.setHorizontalHeaderLabels(self.header_lbls) self.setCentralWidget(self.table) #ACTIONS self.createActions() #MENUBAR self.createMenus() #TOOLBAR self.createToolbar() #STATUSBAR self.creatStatusbar() def contextMenuEvent(self, event): self.menu = QtGui.QMenu(self.table) self.menu.addAction(self.aboutAct) self.menu.exec_(QtGui.QCursor.pos()) def createActions(self): self.exitAct = QtGui.QAction('E&amp;xit', self, shortcut='Ctrl+Q', statusTip='Exit the application', triggered=app.exit) def createMenus(self): self.menubar = self.menuBar() self.fileMenu = self.menuBar().addMenu("&amp;File") self.fileMenu.addAction(self.exitAct) def createToolbar(self): self.toolbar = self.addToolBar('Toolbar') self.toolbar.addAction(self.settingsAct) self.toolbar.addSeparator() self.toolbar.addAction(self.exitAct) def creatStatusbar(self): self.statusBar() if __name__ == '__main__': app = QtGui.QApplication(sys.argv) window = Example() window.setGeometry(80, 80, 800, 600) window.show() sys.exit(app.exec_()) </code></pre> <p>The question is: How make QMenu like in Microsoft Excel for example (I mean only add/delete rows/coloumns). Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload