[Qt-interest] Order of connect() changes what is called?

Malyushytsky, Alex alex at wai.com
Sat Jan 9 01:11:14 CET 2010


Only you can debug it.

Check if slot is called first.
- Change your populateFormWithIndex(QModelIndex) To do nothing but let you know that it was called with qDebug for example.

- to the same to targetSelected

They should be called.

Find what code in populateFormWithIndex makes targetSelected not to be called.

(ui->targetsListView->selectionModel() was changed? )


Regards,
   Alex Malyushytsky






-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Timothy Reaves
Sent: Friday, January 08, 2010 3:59 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Order of connect() changes what is called?

        I have found something I simply do not understand.  I set up two connections like this:

connect(ui->targetsListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
                this, SLOT(populateFormWithIndex(QModelIndex)));
connect(ui->targetsListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
                this, SLOT(targetSelected(QModelIndex)));

the second slot is never fired.  If I set them up like this:


connect(ui->targetsListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
                this, SLOT(targetSelected(QModelIndex)));
connect(ui->targetsListView->selectionModel() , SIGNAL(currentRowChanged(QModelIndex, QModelIndex)),
                this, SLOT(populateFormWithIndex(QModelIndex)));

then they both fire.  Why is the order relevant?  Is this just a defect?
_______________________________________________
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