Basically, the code is:

Qt Code:
  1. for( int idx = 0; idx < count; idx ++ ) {
  2. log_entry entry = lgit_->log().entry( idx );
  3. QTableWidgetItem *item1 = new QTableWidgetItem( QString::fromStdString( entry.sha ) );
  4. QTableWidgetItem *item2 = new QTableWidgetItem( QString::fromStdString( entry.author ) );
  5. QTableWidgetItem *item3 = new QTableWidgetItem( QString::fromStdString( entry.message ) );
  6.  
  7. item1->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
  8. item2->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
  9. item3->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
  10.  
  11. QString summary = QString::fromStdString( entry.diff_data_summary_html() );
  12. item1->setToolTip( summary );
  13. item2->setToolTip( summary );
  14. item3->setToolTip( summary );
  15.  
  16. int row = ui->tableWidget->rowCount();
  17. ui->tableWidget->insertRow(row);
  18.  
  19. ui->tableWidget->setItem( row, 0, item1 );
  20. ui->tableWidget->setItem( row, 1, item2 );
  21. ui->tableWidget->setItem( row, 2, item3 );
  22. }
To copy to clipboard, switch view to plain text mode 

Nothing special, I guess. I've verified that `summary` isn't empty. The code in wider context.

I call this code when log data is already available: thus, the table is filled with items right after creation. Then the tooltips work. However, when I start the dialog when log data isn't available, and wait for user to press "Fetch*" button to download the log data, then the tooltips doesn't appear. I really verified that the `summary` variable isn't empty. I even did `qDebug() << item1->toolTip();`, and it showed text. Has anyone any ideas what can be wrong? Apparently something slight is changed in the second execution path. What could I invoke as a workaround? Or to debug this?