简体   繁体   English

QTableWidget cellClicked信号不起作用

[英]QTableWidget cellClicked signal not working

I have a QTableWidget in my application and I have connected the cellClicked(int,int) signal to a slot. 我的应用程序中有一个QTableWidget,并且已经将cellClicked(int,int)信号连接到插槽。 But this code in the slot doesn't get called at all when a cell is clicked. 但是,单击单元格时根本不会调用该插槽中的代码。 Please let me know how this can be resolved. 请让我知道如何解决。 This is my code: 这是我的代码:

connect(ui.tableWidget, SIGNAL(cellClicked(x,y)), this, SLOT(myCellClicked(x,y)));

Thanks, Rakesh. 谢谢,拉克什。

SIGNALSLOT宏仅处理类型名称,而不处理变量名称,因此应为:

connect(ui.tableWidget, SIGNAL(cellClicked(int,int)), this, SLOT(myCellClicked(int,int)));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM