How to access a QAction using the QtTest lib?
问题 I have a pop-up menu in a QTableWidget (resultTable). In the constructor of my class I set the context menu policy: resultTable->setContextMenuPolicy(Qt::CustomContextMenu); connect(resultTable, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(popUpMenuResultTable(QPoint))); The popUpMenuResultTable function: void MyClass::popUpMenuResultTable(QPoint pos) { QMenu menu; QAction* actionExport = menu.addAction(QIcon(":/new/prefix1/FileIcon.png"), tr("Export")); connect(actionExport, SIGNAL