tdf#130857 qt weld: Implement QtInstanceTreeView::columns_autosize
QTreeView::resizeColumnToContents [1] looks like the Qt equivalent for GTK's gtk_tree_view_columns_autosize [2]. [1] https://doc.qt.io/qt-6/qtreeview.html#resizeColumnToContents [2] https://docs.gtk.org/gtk3/method.TreeView.columns_autosize.html Change-Id: I4771896fb932834f51fa48ceaa3557181f474fcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178062 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
parent
23ea73587a
commit
36ab4833c9
1 changed files with 9 additions and 1 deletions
|
@ -653,7 +653,15 @@ int QtInstanceTreeView::get_height_rows(int) const
|
|||
return 0;
|
||||
}
|
||||
|
||||
void QtInstanceTreeView::columns_autosize() { assert(false && "Not implemented yet"); }
|
||||
void QtInstanceTreeView::columns_autosize()
|
||||
{
|
||||
SolarMutexGuard g;
|
||||
|
||||
GetQtInstance().RunInMainThread([&] {
|
||||
for (int i = 0; i < m_pModel->columnCount(); i++)
|
||||
m_pTreeView->resizeColumnToContents(i);
|
||||
});
|
||||
}
|
||||
|
||||
void QtInstanceTreeView::set_column_fixed_widths(const std::vector<int>&)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue