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

Timothy Reaves treaves at silverfieldstech.com
Sat Jan 9 00:59:04 CET 2010


	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?



More information about the Qt-interest-old mailing list