내 의도는 셀 내용을 클립 보드에 복사하는 컨텍스트 메뉴를 만드는 것입니다. 보낸 사람()의 도움으로 두 개의 다른 QTableWidget에 동일한 기능을 연결할 수 있습니다.QMenu에서 기능을 읽을 수 없습니다. Slot
이: 모든이 오류 메시지를 제외하고 작동 "QObject를이 : 연결 : 호환되지 않는 송신자/수신자 인수 QAction :: 트리거 (부울) -> MainWindow를 :: copyToClipboard (QTableWidget *, INT, INT)"
이것은 내가 시간에 대한 공식 문서에서 찾아 봤는데 오류
void MainWindow::ProvideContextMenu(const QPoint& pos) // this is a slot
{
QTableWidget *tw = (QTableWidget *)sender();
int row = tw->currentRow();
int col = tw->currentColumn();
QMenu menu;
menu.addAction(QString("Test Item"), this,
SLOT(copyToClipboard(QTableWidget *, int,int)));
menu.exec(tw->mapToGlobal(pos));
}
void MainWindow::copyToClipboard(QTableWidget *tw, int row, int col) {
clipboard = QApplication::clipboard();
clipboard->setText(tw->item(row, col)->text());
}
을 생성하지만 이것에 대해 아무것도 발견 코드의 일부이다. 해결책이 있습니까? documentation 가입일