Bug #5889

WTreeView loooks bad after data update

Added by Daniel Lier over 5 years ago. Updated about 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:



attached you'll find your TreeViewExample with some modifications.

-a model class is added where the data update needs to be done (various data might come from the DB with a different number of cols and rows)

-when updating data within the constructor of the model class everything is fine but when updating afterwards the WTreeView looks bad

-note: for testing the data update() is triggered when pressing any key

you'll have to add the files atttached to the according example project

I have almost this ccenario in my application and it looks even worse. The scroll bar on the right hand side moves the data to thte left so they are not aligned to the cloumn anymore (it's ok after scrolling). And the column size changing behaviour is weird too. When changing the width of the column on the right hand side, the left hand side is moving.

It looks to me that data are not removed from the view and/or any update or refresh is needed.

Thanks for your help!



TreeViewApplication.C (1.56 KB) TreeViewApplication.C Daniel Lier, 08/23/2017 12:56 PM
TreeViewExample.C (8.2 KB) TreeViewExample.C Daniel Lier, 08/23/2017 12:56 PM
TreeViewExample.h (1.56 KB) TreeViewExample.h Daniel Lier, 08/23/2017 12:56 PM

Updated by Roel Standaert over 5 years ago

Looks like this particular problem is caused by the column width being reset, because the model goes from 4 columns to 0 columns back to 4 columns. If you change the column width on column 0 after the update, then it looks ok again. I'm not sure yet what the best way would be to deal with this.


Updated by Daniel Lier about 5 years ago

Setting the width on column 0 does not help in my case. I found out that after resizing the WTreeView via ::setHeight the bad behaviour is gone and everything is ok.

I do:



Also available in: Atom PDF