Jūs esate

menu

Qt. How to create a contex menu for QTableWidget?

Add a method definition into your .h file:
private slots: void cool_slot();
Add a line in the constructor of the class:
m_ui->tableWidgetRemoteSite->setContextMenuPolicy(Qt::CustomContextMenu);
Then click on your QTableWidget component and add a method for your customContextMenuRequested(QPoint pos) event (right click and select Go to slot...):
void MDIChildWindow::on_tableWidgetRemoteSite_customContextMenuRequested(QPoint pos)

{

Subscribe to menu