PDA

View Full Version : Application crashing on setting Model in QComboBox.



kaushal_gaurav
11th February 2009, 04:42
Hi,

My app is crashing when i set the QSortFilterProxyModel in the combo box.
below is the code snippet that i use to set the model to the comboBox



m_TxPowerProxyModel->setDynamicSortFilter(true);
m_TxPowerProxyModel->setSourceModel(m_Model);
m_Ui.txPowerCombo->setModel(m_TxPowerProxyModel);
m_Ui.txPowerCombo->setModelColumn(DevicesModel::TX_POWER);
m_TxPowerProxyModel->SetModelSearchStr(m_BandProxyModel->data(index).toString());


Please Help......

Regards,
GK

talk2amulya
11th February 2009, 05:37
did u see which line exactly it is crashing?

kaushal_gaurav
11th February 2009, 05:54
The crash is not in these lines.. but is due to these lines.... when i comment these lines the app is fine..
The app is crashing in m_Model's setData() funciton.

aamer4yu
11th February 2009, 07:06
The crash is not in these lines.. but is due to these lines.... when i comment these lines the app is fine..

I cant see any lines in your post !!

faldzip
11th February 2009, 07:33
The crash is not in these lines.. but is due to these lines.... when i comment these lines the app is fine..
The app is crashing in m_Model's setData() funciton.

So maybe it's crashing because setData() is written wrong? Can we see it?

kaushal_gaurav
13th February 2009, 18:14
The app is crashing because of



m_Ui.txPowerCombo->clear();


If i comment the line the app works fine.
I need to clear the contents of the combo box because it is coming out to be junk in index 0.
and rest of the combo is populated with the values from the model.

Help...

GK

spirit
13th February 2009, 18:20
try to trace clear method, maybe somewhere invalid pointer is used.