[Kmymoney-devel] Re: Review Request: Allow the resizing of the table in the csv importer plugin

allan agander93 at gmail.com
Thu Jan 13 01:20:59 CET 2011


On 12/01/11 05:51, Cristian Oneț wrote:
> On Tuesday 11 January 2011 20:22:36 allan wrote:
>> Just a query about this patch of yours.  Is it the intent that when a
>> file is loaded into the UI, it should all be viewable by scrolling, but
>> without resizing?
> The main objective was to have the columns show all the content and the user
> could scroll or make the dialog larger to see all the content. If the columns
> are not sized to content correctly then that should be fixed.

Hi Cristian

This is a rambling one, I'm afraid. Skip to the last paragraph or two if 
you don't want the full gory details.

I've spent several hours on this, without being able to achieve what you 
wanted.

The problem, so far as I have seen it, is that in one particular file, 
just one line does not initially display fully. The last column should 
display '(20,000.00)', but the '00)'is replaced by ellipsis.

 From the UI, clicking anywhere on the column headers causes a redraw, 
which results in the column showing correctly. Or, alternatively, a 
slight resize of the form width achieves the same result.

I have tried making the form larger, numerous variations of 
resizecolumns to contents and other settings. I was even thinking I 
might have to revert to calculating the screen width, but you wouldn't 
have been happy with that!

There were only two ways in which I could get that column to display 
fully. The first way, whilst showing the last column fully, initially 
showed the whole table as filled with the first column, but a scroll-bar 
scroll followed by a single '>' scroll (or vice-versa) showed the final 
column correctly.

The last way, I removed your 
'tableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);' 
from csvimporterdlg.cpp. This correctly showed the last column fully, 
but all other columns were at default width, but individually resizeable 
to show their full contents.

I'm happy with this arrangement. I don't need to see each and every 
character in every column, but I know I can resize any column I may need 
to see in full.

Unless you can think of an alternative, then that's the way it seems for 
now. If you want to explore I'll send you a file to use....(Breaking off).

Erm.... It's turned out to be a bit less straight forward than that. 
I've tried to produce a simple test file. (The data is not mine, and 
private.) Just that single line worked correctly, nothing missing and 
column data fully visible. I tried adding back the lines above and 
below. Still OK. Tried adding back the line with column headings. Still 
OK. Then, it dawned on me that the suspect line doesn't initially appear 
- it's off the bottom of the table and an upward scroll is necessary to 
see it. So, I removed four header lines from the full file, so the 
suspect line is initially shown. Problem gone! Those dropped lines would 
have been dropped anyway as part of the import. Increasing the form 
height to 1000 allows the full file to be displayed with no vertical 
scroll needed and the whole original file displays with no problem.

Verdict - leave as is, with 
'tableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);' 
removed.

Allan





More information about the KMyMoney-devel mailing list