qtqtablewidget

QTableCellWidget is not hiding


I have placed a widget in QTableWidget using setCellWidget method.

But when I am calling cellWidget(row,col)->hide() or cellWidget(row,col)->setEnable(false) widget is not hiding.

Can anyone suggest a solution? I am using Qt 5.5.0


Solution

  • You may be able to by-pass the mentioned bug by overwriting the paintEvent in a derived QTableWidget class and hide the widgets after the QTableWidget finished painting.

    DerivedQTableWidget::paintEvent(QPaintEvent * e)
    {
       QTableWidget::paintEvent(e);
    
       // do the hiding here
    }