hello

i have searched the forums already on this topic but can't seem to find a solution to the problem im having.

I have a thread which emits a signal like this:

Qt Code:
  1. void PcapThread::startCaptureOnInterface()
  2. {
  3. int r;
  4.  
  5. while(captureOn){
  6. struct pcap_pkthdr *header;
  7. const u_char *pkt_data;
  8.  
  9. r = pcap_next_ex(descr,&header,&pkt_data);
  10.  
  11. emit addToWidget(header,pkt_data);
  12.  
  13. }
To copy to clipboard, switch view to plain text mode 

as soon as pcap gets packets it is sent to the slot in the other class object and the table widget is filled with all packet details. This runs in a loop and outputs data into the table using tableWidget->setItem().

The capturing process is really fast when using high bandwidth and this causes the gui to freeze.

In the main gui thread i have implemented the connection like so:

Qt Code:
  1. void MainWindow::startThread()
  2. {
  3. thread1 = new PcapThread();
  4.  
  5. thread1->setDevice(name);
  6. thread1->start();
  7.  
  8. connect(thread1, SIGNAL(addToWidget(struct pcap_pkthdr*,const u_char*)),
  9. packetTable, SLOT(addToWidget(struct pcap_pkthdr*,const u_char*)));
  10.  
  11. }
To copy to clipboard, switch view to plain text mode 

I assume this is a direct connection and not Queued? How do i set it to queued? I tried Qt::QueuedConnection and moveToThread() function here in startThread() but that only helps slightly improve the performance but the gui still freezes.

Any help would be appreciated