geometry()
returns a const reference to a QRect
object inside QTableWidget
.
It's meant to be a read-only getter. You should take a copy, modify it and set it back with setGeometry
setter function:
QRect rect = this->geometry();
int h = rect.height();
rect.setHeight(h - 80);
ui->datumTable->setGeometry(rect);