Merge pull request #1250 from PySimpleGUI/Dev-latest

Fix for crashing when Updating a table, got KeyEventsEnabled attribut…
This commit is contained in:
MikeTheWatchGuy 2019-03-19 18:46:18 -04:00 committed by GitHub
commit ba8cfbcb4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -2635,7 +2635,8 @@ class Table(Element):
class QTTableWidget(QTableWidget): class QTTableWidget(QTableWidget):
def __init__(self, window): def __init__(self, enable_key_events, window):
self.KeyEventsEnabled = enable_key_events
self.Window = window self.Window = window
super().__init__() super().__init__()
@ -5401,7 +5402,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win):
qt_row_layout.addStretch(1) qt_row_layout.addStretch(1)
# ------------------------- TABLE element ------------------------- # # ------------------------- TABLE element ------------------------- #
elif element_type == ELEM_TYPE_TABLE: elif element_type == ELEM_TYPE_TABLE:
element.QT_TableWidget = Table.QTTableWidget(toplevel_win) element.QT_TableWidget = Table.QTTableWidget(toplevel_win.ReturnKeyboardEvents, toplevel_win)
if element.NumRows is not None: if element.NumRows is not None:
element.QT_TableWidget.setFixedHeight(element.NumRows*35+25) element.QT_TableWidget.setFixedHeight(element.NumRows*35+25)
# element.QT_TableWidget = QTableWidget() # element.QT_TableWidget = QTableWidget()