Skip to content

Conversation

@adamerose
Copy link

Added some more test cases and fixed the bug, here's what it looks like before and after.

Something else I noticed is I think headerData() does nothing, because everything still works if I make it return None. I think the header values come only from data() using the HeaderDataRole roles.

image

image

@cp27643
Copy link

cp27643 commented Aug 8, 2019

Yep.. Had this same issue and using xe worked for me

@cp27643
Copy link

cp27643 commented Aug 8, 2019

Do you know how to resize the header columns if text is too long??? I've got this right now...
image
And i would like for the left most column in the header data to be aligned right and the width of the header data columns to be the width of the largest cell in the column

@adamerose
Copy link
Author

Do you know how to resize the header columns if text is too long??? I've got this right now...
image
And i would like for the left most column in the header data to be aligned right and the width of the header data columns to be the width of the largest cell in the column

Honestly I spent many hours trying to get this code working well for myself and ended up deciding that QHeaderViews were just too complicated and limited to make it work. Over the past year I worked on a new project that uses QTableViews for each individual MultiIndex header, you can see it here:
https://github.com/adamerose/pandasgui

Doing what you want might be easier if you start with my pandasgui/pandasgui/widgets/dataframe_viewer.py because then you can just align and resize all cells in the body and headers as simply as you would any normal QTableView.

@cp27643
Copy link

cp27643 commented Aug 9, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants