-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.15.3, 6.0.1, 6.0.3
-
None
I have a QTableWidget where I have cells that contain a QPushButton and at some point I won't need those buttons anymore so instead of removing (removeCellWidget) I decided to just make them invisible. However, after I do it, if that cell size ever changes, during a window resize for example, the buttons recently setVisible(false) become visible again.
Here is a compilable code tested with a QPushButton but I believe the problem is true to any widget. On clicking the button it will be become invisible, afterresizing it it will beome visible again
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->table->setRowCount(1);
QPushButton *p = new QPushButton("Test");
ui->table->setCellWidget(0, 0, p);
connect(p, &QPushButton::clicked, [p]()
{
p->setVisible(false);
});
}
- duplicates
-
QTBUG-13522 setvisible() of QWidget has no effect at QTreeWidgetItem
-
- Open
-