PDA

View Full Version : Problem connecting selectionChanged



jano_alex_es
1st June 2009, 14:29
Hi, I want to connect QAbstractItemView::selectionChanged, but I don't know why it's not working :S




m_itemSelectedModel = ui.m_myTableView->selectionModel();
bool test = QObject::connect(m_itemSelectedModel , SIGNAL(selectionChanged()), this, SLOT(my_private_slot()));


thanks!

lyuts
1st June 2009, 15:44
You are specifying a wrong signal signature. It looks like this:



selectionChanged ( const QItemSelection &, const QItemSelection & )

Lykurg
1st June 2009, 15:57
What is not working? is my_private_slot declared as a slot? Q_OBJECT makro in the header file? or maybe

QObject::connect(m_itemSelectedModel , SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(my_private_slot()));

EDIT: maybe I should try refresh before answering a thread I have opened in a tab...