Frage

I have a problem when the resize function, I do this in the click signal:

if(ShowingDetails){
    ui->BtShowingData->setText("<< Hide details");
    //this->setMaximumWidth(1050);
    //this->setMinimumWidth(1050);
    this->resize(1050, height());
}else {
    ui->BtShowingData->setText("Show details >>");
    //this->setMaximumWidth(750);
    //this->setMinimumWidth(750);
    this->resize(750, height());
}

The resize method does its work, but I have two QTableView (with filtering) and when the windows grows up, the Tables are painted black, if I click on them, return to normal. I used ui->TbViewDatosNewAlum->repaint(); but nothing happend. If I update the QSqlTableModel, it's not painted black, but I can't do this. Thanks for your time.

War es hilfreich?

Lösung

I had the same problem and I found a temporary solution. Hope this helps

Before doing resizing job hide the QTableWidget or QTableView:

tableWidget->hide();

After finishing resizing, show the QTableWidget or QTableView:

tableWidget->show();

It may cause flickering in old systems........but I don't think any system is that old. :)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top