In QtableWidget, you need to make all cells square and not change. How to do this?
Closed due to the fact that the essence of the issue is incomprehensible by the participants αλεχολυτ , Cheg , MihailPw , Sergey Gornostaev , br3t 6 Oct '17 at 21:22 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
|
1 answer
Such a construction makes cells 30 * 30 with the prohibition of resizing.
ui->tableWidget->horizontalHeader()->setCascadingSectionResizes(false); ui->tableWidget->verticalHeader()->setCascadingSectionResizes(false); ui->tableWidget->verticalHeader()->setMinimumSectionSize(30); ui->tableWidget->verticalHeader()->setMaximumSectionSize(30); ui->tableWidget->verticalHeader()->setDefaultSectionSize(30); ui->tableWidget->horizontalHeader()->setMinimumSectionSize(30); ui->tableWidget->horizontalHeader()->setMaximumSectionSize(30); ui->tableWidget->horizontalHeader()->setDefaultSectionSize(30); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); ui->tableWidget->verticalHeader()->setSizePolicy(sizePolicy); ui->tableWidget->horizontalHeader()->setSizePolicy(sizePolicy); |