[英]itemChanged signal works when the application startup without change in item
I am use itemChanged(QTableWidgetItem *item)
signal, in order to when changing in item, performs something. 我正在使用
itemChanged(QTableWidgetItem *item)
信号,以便在更改项目时执行某些操作。
The following code is the slot function: 以下代码是slot函数:
void Widget::on_tableWidget_itemChanged(QTableWidgetItem *item){
qDebug() << item->text();
}
The problem is : supposed to the previous function be implemented when change in item, and this is already happening, but there is another something wrong happening when the application startup as the following. 问题是:应该在项目更改时实现先前的功能,并且这种情况已经发生,但是当应用程序启动时,发生了另外一些错误,如下所示。
"circle"
"Sound"
"57013368"
"17"
"Sound"
"Lion King z"
"Lion King"
itemChanged
signal works when the application startup without change in item. 当应用程序启动时项目没有更改时,
itemChanged
信号起作用。
How to solve this problem ? 如何解决这个问题呢 ?
you can disable signals during startup: 您可以在启动期间禁用信号:
widget->blockSignals( true );
// startup code
widget->blockSignals( false );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.