Sorry, the worker thread just reads data and emits a signal to main gui thread which then informs the model to update its data. The code below shows the code within the main gui which informs the model of the change with the setCanData function:
if( m_pCanReadThread->isRunning() ) // user may have stopped thread
{
if( nCount < 8000 )
{
m_ptreeModel->setCanData( pData, nAmount, nCount );
ui.tableView->scrollTo( index );
}
else
{
m_pCanReadThread->cancelThread();
}
}
if( m_pCanReadThread->isRunning() ) // user may have stopped thread
{
if( nCount < 8000 )
{
m_ptreeModel->setCanData( pData, nAmount, nCount );
QModelIndex index = m_ptreeModel->index( nCount, 0 );
ui.tableView->scrollTo( index );
}
else
{
m_pCanReadThread->cancelThread();
}
}
To copy to clipboard, switch view to plain text mode
Regards,
Steve
Bookmarks