IordanouGiannis
IordanouGiannis

Reputation: 4357

How do I resize a dialog according to the size of a table in pyqt?

I have a pop-up dialog and I want to resize it according to the size of a table. Specifically, I want the table to display all its rows which are created dynamically without any scroll bars needed.

Upvotes: 0

Views: 109

Answers (1)

AlexVhr
AlexVhr

Reputation: 2064

Maybe something like this?

size = my_dlg.my_table_view.size()
my_dlg.setFixedSize(size.width() + 6, size.heigth() + 6)

Upvotes: 1

Related Questions