First Create Actions in you application UI. Then for your TreeView Widget, use setContextMenuPolicy(Qt::ActionsContextMenu); In your constructor, assign those actions to your Widget with ui->tableWidget->addAction(ui->actionNew);
↧