Merge pull request #1727 from PySimpleGUI/Dev-latest
Fix for Table.Update losing the table's headers. Fix for problem whe…
This commit is contained in:
commit
4b0cfccbcc
|
@ -2616,7 +2616,7 @@ class Table(Element):
|
||||||
self.SelectedRows = []
|
self.SelectedRows = []
|
||||||
self.ChangeSubmits = change_submits or enable_events
|
self.ChangeSubmits = change_submits or enable_events
|
||||||
self.BindReturnKey = bind_return_key
|
self.BindReturnKey = bind_return_key
|
||||||
self.Widget = self.QT_TableWidget = None # type: QTabWidget
|
self.Widget = self.QT_TableWidget = None # type: QTableWidget
|
||||||
|
|
||||||
super().__init__(ELEM_TYPE_TABLE, text_color=text_color, background_color=background_color, font=font,
|
super().__init__(ELEM_TYPE_TABLE, text_color=text_color, background_color=background_color, font=font,
|
||||||
size=size, pad=pad, key=key, tooltip=tooltip, visible=visible, size_px=size_px)
|
size=size, pad=pad, key=key, tooltip=tooltip, visible=visible, size_px=size_px)
|
||||||
|
@ -2640,7 +2640,7 @@ class Table(Element):
|
||||||
if values is not None:
|
if values is not None:
|
||||||
self.Values = values
|
self.Values = values
|
||||||
self.SelectedRows = []
|
self.SelectedRows = []
|
||||||
self.QT_TableWidget.clear()
|
self.QT_TableWidget.clearContents()
|
||||||
if len(values) != 0:
|
if len(values) != 0:
|
||||||
self.QT_TableWidget.setRowCount(len(self.Values))
|
self.QT_TableWidget.setRowCount(len(self.Values))
|
||||||
self.QT_TableWidget.setColumnCount(len(self.Values[0]))
|
self.QT_TableWidget.setColumnCount(len(self.Values[0]))
|
||||||
|
@ -3120,7 +3120,6 @@ class Window:
|
||||||
QTApplication = None
|
QTApplication = None
|
||||||
active_popups = {}
|
active_popups = {}
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, title, layout=None, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size=(None, None),
|
def __init__(self, title, layout=None, default_element_size=DEFAULT_ELEMENT_SIZE, default_button_element_size=(None, None),
|
||||||
auto_size_text=None, auto_size_buttons=None, location=(None, None), size=(None, None), element_padding=None, button_color=None, font=None,
|
auto_size_text=None, auto_size_buttons=None, location=(None, None), size=(None, None), element_padding=None, button_color=None, font=None,
|
||||||
progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False,
|
progress_bar_color=(None, None), background_color=None, border_depth=None, auto_close=False,
|
||||||
|
@ -3515,7 +3514,7 @@ class Window:
|
||||||
if element.Key is not None:
|
if element.Key is not None:
|
||||||
if element.Key in key_dict.keys():
|
if element.Key in key_dict.keys():
|
||||||
print('*** Duplicate key found in your layout {} ***'.format(element.Key)) if element.Type != ELEM_TYPE_BUTTON else None
|
print('*** Duplicate key found in your layout {} ***'.format(element.Key)) if element.Type != ELEM_TYPE_BUTTON else None
|
||||||
element.Key = element.Key + str(self.UniqueKeyCounter)
|
element.Key = str(element.Key) + str(self.UniqueKeyCounter)
|
||||||
self.UniqueKeyCounter += 1
|
self.UniqueKeyCounter += 1
|
||||||
print('*** Replaced new key with {} ***'.format(element.Key)) if element.Type != ELEM_TYPE_BUTTON else None
|
print('*** Replaced new key with {} ***'.format(element.Key)) if element.Type != ELEM_TYPE_BUTTON else None
|
||||||
key_dict[element.Key] = element
|
key_dict[element.Key] = element
|
||||||
|
|
Loading…
Reference in New Issue