Python Forum
[PyQt] Why widget is resized
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Why widget is resized
#3
Well, I worked around the issue, but I never did find out why the middle column shrinks. The tableview does not have a default true WidthForHeight policy (I just thought to look at the label, but don't think it will make a difference), so that's all I got.

But, what I did was set a fixed size policy for the tableview initially, and then set it back to it default (Expanding) after the image label loads. I had to use a QTimer, but no biggie. So, that's that for anyone interested.

EDIT:
Lightning struck my brain. I have solved the sizing issue in a non-hacky way. I reimplemented size() as well. So with sizeHint() and size() reimplemented, the tableview stays at the right size. I still don't know why a large widget size shrinks another widget to either it's size or size hint. If size() is reimplemented (and not sizeHint()), when the large image loads, the tableview shrinks to it's sizeHint(). If sizeHint() is reimplemented (and not size()), the tableview shrinks to its size(). There's probably another non-hackway to solve this by understanding layouts, but I can't figure it.
Reply


Messages In This Thread
Why widget is resized - by malonn - Oct-08-2022, 09:06 PM
RE: Why widget is resized - by malonn - Oct-08-2022, 09:47 PM
RE: Why widget is resized - by malonn - Oct-09-2022, 11:56 AM
RE: Why widget is resized - by Axel_Erfurt - Oct-09-2022, 12:20 PM
RE: Why widget is resized - by malonn - Oct-09-2022, 12:31 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020