[Qt-interest] QTableWidget continuous updates and gui freeze
Riccardo Roasio
riccardo.roasio at gmail.com
Fri Jul 15 14:16:35 CEST 2011
This is my code:
--- READING THREAD (rxRoutine)
tmpLogList=GetMessagesFromDevice();
for(i=0;i<tmpLogList.length();i++)
{
tmpComLogConfig=tmpLogList.at(i);
logList->AddElement(tmpComLogConfig);
emit RefreshLogSignal();
}
-- MAIN THREAD
connect(rxRoutine, SIGNAL(RefreshLogSignal()), this,
SLOT(RefreshComunicationLog()));
void MainWindow::RefreshComunicationLog()
{
int i;
logTable->clear();
logTable->setRowCount(0);
logTable->setColumnCount(0);
for(i=0;i<logList->Length();i++)
{
logTable->AddNewItem(logList->GetElementAt(i));
}
logTable->setColumnWidth(0,400);
logTable->scrollToBottom();
}
2011/7/14 Bill Crocker <william.crocker at analog.com>:
> Riccardo Roasio wrote:
>> Hi,
>>
>> i have a QTableWidget derived class that receive update events from a
>> thread reading from a serial line.
>> I noticed that on high traffic there are so many updates request thata
>> the gui seems to freeze showing nothing...
>>
>>
>> How can i solve this problem?
>>
>
> Yield the receiving thread.
>
>> Thanks,
>> Riccardo
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at qt.nokia.com
>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list