frmdstryr / enamlx

Additional Qt Widgets for Enaml
MIT License
28 stars 9 forks source link

TableView - fixed a crash happening when closing window with a scrolled TBV #11

Closed JeffMv closed 6 years ago

JeffMv commented 6 years ago

When having a TableView on a window that was not the main window, if the TableView was scrolled down so that the first rows would not be visible anymore, and the user happened to close the window with the TableView, the program would crash.

The crash is because in QtTableView, the method _refresh_visible_row(self) gets called at least once after the user has closed the window, and at that time self.declaration is None, which implies a crash when accessing attributes visible_rows and visible_row.

JeffMv commented 6 years ago

The same crash happens on master, so a commit could be pushed there too, so that people get the fix as soon as possible. Best regards PS: enamlx rocks! 👍

frmdstryr commented 6 years ago

Very good, thank you!