[Qt-interest] QTableWidget cellChanged signal called while populating table

Malyushytsky, Alex alex at wai.com
Tue Feb 9 05:38:14 CET 2010


You can disconnect cellChanged signal before you populate the table and connect it again after.
I do such things all the time.

You could probably us QObject::blockSignals (block before populating, unblock after), but this would block all the signals and this might be not you want in specific situation.

Regards,
    Alex

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Robert Wood
Sent: Monday, February 08, 2010 10:27 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QTableWidget cellChanged signal called while populating table

I am populating a QTableWidget with a load of data from a sql table and
I want to be able to call a routine when a *user* changes a cell in the
table.

void QTableWidget::cellChanged ( int row, int column ) does indeed,
work, but the problem is that when I'm populating the table with the
data I've extracted from the sql table, this routine is also called
which I don't want!

Is the only way round this to have the "connect" line this signal uses
*after* I have populated the table? I don't really like that as there
could conceivably be other methods of changing a cell's data that would
also call the routine.

Many thanks,

Rob
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list