diff options
Diffstat (limited to 'desktop-widgets/tableview.cpp')
-rw-r--r-- | desktop-widgets/tableview.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop-widgets/tableview.cpp b/desktop-widgets/tableview.cpp index 20b62ac3c..3e9bb129e 100644 --- a/desktop-widgets/tableview.cpp +++ b/desktop-widgets/tableview.cpp @@ -135,8 +135,13 @@ void TableView::edit(const QModelIndex &index) int TableView::defaultColumnWidth(int col) { + int width; QString text = ui.tableView->model()->headerData(col, Qt::Horizontal).toString(); - return text.isEmpty() ? metrics.rm_col_width : defaultModelFontMetrics().width(text) + 4; // add small margin + width = text.isEmpty() ? metrics.rm_col_width : defaultModelFontMetrics().width(text) + 4; // add small margin +#if defined(Q_OS_MAC) + width += 10; // Mac needs more margin +#endif + return width; } QTableView *TableView::view() |