| 760 | } |
| 761 | |
| 762 | void ConfigWindow::resizeExtraFlagsTable() |
| 763 | { |
| 764 | auto* hScroll = ui->extraParams_tableWidget->horizontalScrollBar(); |
| 765 | // To avoid creating a vertical scrollbar if there's a horizontal one |
| 766 | int padding = hScroll ? hScroll->height() : 0; |
| 767 | int total_height = ui->extraParams_tableWidget->horizontalHeader()->height() + padding; |
| 768 | if (!ui->extraParams_tableWidget->horizontalScrollBar()->isHidden()) { |
| 769 | total_height += ui->extraParams_tableWidget->horizontalScrollBar()->height(); |
| 770 | } |
| 771 | for (int row = 0; row < ui->extraParams_tableWidget->rowCount(); row++) { |
| 772 | total_height += ui->extraParams_tableWidget->rowHeight(row); |
| 773 | } |
| 774 | ui->extraParams_tableWidget->setMinimumHeight(total_height); |
| 775 | } |
| 776 | |
| 777 | QWidget* ExtraOptionDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const |
| 778 | { |