AnthonyL
25th August 2016, 21:33
Basically, the code is:
for( int idx = 0; idx < count; idx ++ ) {
log_entry entry = lgit_->log().entry( idx );
QTableWidgetItem *item1 = new QTableWidgetItem( QString::fromStdString( entry.sha ) );
QTableWidgetItem *item2 = new QTableWidgetItem( QString::fromStdString( entry.author ) );
QTableWidgetItem *item3 = new QTableWidgetItem( QString::fromStdString( entry.message ) );
item1->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
item2->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
item3->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
QString summary = QString::fromStdString( entry.diff_data_summary_html() );
item1->setToolTip( summary );
item2->setToolTip( summary );
item3->setToolTip( summary );
int row = ui->tableWidget->rowCount();
ui->tableWidget->insertRow(row);
ui->tableWidget->setItem( row, 0, item1 );
ui->tableWidget->setItem( row, 1, item2 );
ui->tableWidget->setItem( row, 2, item3 );
}
Nothing special, I guess. I've verified that `summary` isn't empty. The code in wider context (https://github.com/psprint/QtZekyllManager/blob/06a3a37d9bada3b32cd5bee4f0e01b3cc8b0c092/manager/pulldialog.cpp#L331-L334).
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?
for( int idx = 0; idx < count; idx ++ ) {
log_entry entry = lgit_->log().entry( idx );
QTableWidgetItem *item1 = new QTableWidgetItem( QString::fromStdString( entry.sha ) );
QTableWidgetItem *item2 = new QTableWidgetItem( QString::fromStdString( entry.author ) );
QTableWidgetItem *item3 = new QTableWidgetItem( QString::fromStdString( entry.message ) );
item1->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
item2->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
item3->setTextAlignment( Qt::AlignLeft | Qt::AlignVCenter );
QString summary = QString::fromStdString( entry.diff_data_summary_html() );
item1->setToolTip( summary );
item2->setToolTip( summary );
item3->setToolTip( summary );
int row = ui->tableWidget->rowCount();
ui->tableWidget->insertRow(row);
ui->tableWidget->setItem( row, 0, item1 );
ui->tableWidget->setItem( row, 1, item2 );
ui->tableWidget->setItem( row, 2, item3 );
}
Nothing special, I guess. I've verified that `summary` isn't empty. The code in wider context (https://github.com/psprint/QtZekyllManager/blob/06a3a37d9bada3b32cd5bee4f0e01b3cc8b0c092/manager/pulldialog.cpp#L331-L334).
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?