QT - Spreadsheet like tabular widget
Hi,
I am writing an app in QT and I need to accept user input in the form of a table. The number of columns will be fixed (determined at runtime) however the number of rows (whilst initially can be set to a fixed number) will vary. So the user might want to enter 100 rows or 1000 rows of data, either by pasting in, or typing.
Now I know I can (when pasting) work out how many extra lines there are and add that many rows, however it would be a more flexible solution to have a solution similar to excel where the scrollbar knows whether there is data in later cells and sizes accordingly (i.e. if you have only a few rows populated it gets the look and feel of having just one page however if you have thousands then the scrollbar sizes accordingly).
So I am looking for some form of spreadsheet like widget which would achieve this. Ideally I would like to avoid having to pre-create a large number of blank rows (because it might be the user needs to use several hundred thousand).
I can add a "add rows" button but again this is a bit messy - I want the user not to have to worry about adding additional rows etc.
Does anyone have any suggestions?
|