Unsolved How to set the min and max width of a tableview column while resizing in qml
-
Hi
I am working on Table view in qml but facing issue in setting the min and max width of a table view column while resizing as there is no such property available for Tableviewcolumn.
The columns are resized freely but i want it to be resized with an explicitly provided max and minimum width.
Can anyone support me on this? -
Hello! You can utilize the
columnWidthProvider
function by passing a calculation function to determine the maximum and minimum widths of columns. Here's an illustration:columnWidthProvider: function(column) { let width = explicitColumnWidth(column); if (width >= 0) return width; return explicitColumnWidth(column); }
In this example,
calculateColumnWidth()
is a function that calculates the explicit width of the column, whilecalculateImplicitWidth()
calculates the implicit width. Adjust these functions according to your specific requirements.