Hi all,
I've recently updated to Qt4.4.0-rc1 from Qt4.3, this has now given me a crash on one of my table views and I've debugged it down to the following bit of code :
modelIndex
= m_pmodel
->index
( m_nAmount,
1,
QModelIndex() );
m_pSpinBox
[m_nAmount
] = new QSpinBox(ui.
tableView);
m_pSpinBox[m_nAmount]->setMinimum( 1 );
m_pSpinBox[m_nAmount]->setMaximum( 100 );
m_pSpinBox[m_nAmount]->setSingleStep( 10 );
m_pSpinBox[m_nAmount]->setSuffix("ms");
m_pSpinBox[m_nAmount]->setValue( this->m_MessObj.m_nAmount + 10 );
ui.tableView->setIndexWidget( modelIndex, m_pSpinBox[m_nAmount] );
modelIndex = m_pmodel->index( m_nAmount, 1, QModelIndex() );
m_pSpinBox[m_nAmount] = new QSpinBox(ui.tableView);
m_pSpinBox[m_nAmount]->setMinimum( 1 );
m_pSpinBox[m_nAmount]->setMaximum( 100 );
m_pSpinBox[m_nAmount]->setSingleStep( 10 );
m_pSpinBox[m_nAmount]->setSuffix("ms");
m_pSpinBox[m_nAmount]->setValue( this->m_MessObj.m_nAmount + 10 );
ui.tableView->setIndexWidget( modelIndex, m_pSpinBox[m_nAmount] );
To copy to clipboard, switch view to plain text mode
The setIndexWidget causes the crash, I've not much idea why as this was fine in Qt4.3, maybe there is a bug in my code that was getting away on Qt4.3, I don't know?
m_nAmount is set to zero initiallty.
Anybody any ideas of what could be wrong?
Thanks,
Steve
Bookmarks