From 9497ae5e03d2ad293fec0f9725912bc8a83a700e Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Tue, 19 Mar 2019 18:45:56 -0400 Subject: [PATCH] Fix for crashing when Updating a table, got KeyEventsEnabled attribute error --- PySimpleGUIQt/PySimpleGUIQt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index 31365ea0..e69f8474 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -2635,7 +2635,8 @@ class Table(Element): class QTTableWidget(QTableWidget): - def __init__(self, window): + def __init__(self, enable_key_events, window): + self.KeyEventsEnabled = enable_key_events self.Window = window super().__init__() @@ -5401,7 +5402,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win): qt_row_layout.addStretch(1) # ------------------------- TABLE element ------------------------- # 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: element.QT_TableWidget.setFixedHeight(element.NumRows*35+25) # element.QT_TableWidget = QTableWidget()