From 91697164e2691adb15aa4f3dc287f861659776d8 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 25 Apr 2020 23:13:01 -0400 Subject: [PATCH 1/3] Changed theme to Dark Red for testing --- DemoPrograms/Demo_Date_Chooser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/DemoPrograms/Demo_Date_Chooser.py b/DemoPrograms/Demo_Date_Chooser.py index 07bdc192..fb5ecd90 100644 --- a/DemoPrograms/Demo_Date_Chooser.py +++ b/DemoPrograms/Demo_Date_Chooser.py @@ -13,6 +13,7 @@ import itertools Copyright 2020 PySimpleGUI """ +sg.theme('Dark Red') def popup_get_date(start_mon=None, start_day=None, start_year=None, begin_at_sunday_plus=0, no_titlebar=True, title='Choose Date', keep_on_top=True, location=(None, None), close_when_chosen=False, icon=None, locale=None, month_names=None, day_abbreviations=None): """ From 106d8b83d97e4de13e8e493c65a5931defa49fb4 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Wed, 29 Apr 2020 11:35:10 -0400 Subject: [PATCH 2/3] Save the ParentRowFrame like in the tkinter port --- PySimpleGUIQt/PySimpleGUIQt.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index ce7cc1d8..4546d378 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -3427,6 +3427,7 @@ class Window: # print("quitting window") self.QTApplication.exit() # kick the users out of the mainloop + def Read(self, timeout=None, timeout_key=TIMEOUT_KEY, close=False): """ THE biggest deal method in the Window class! This is how you get all of your data from your Window. @@ -4798,6 +4799,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win): qt_row_layout = QHBoxLayout() for col_num, element in enumerate(flex_row): element.ParentForm = toplevel_win # save the button's parent form object + element.ParentRowFrame = qt_row_layout if toplevel_win.Font and (element.Font == DEFAULT_FONT or not element.Font): font = toplevel_win.Font element.Font = font From a58b95ab51fe3f9085dc69e84d4a7221b8b0533d Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Wed, 29 Apr 2020 11:55:11 -0400 Subject: [PATCH 3/3] Addition of member variables to access row_frame and column's vbox --- PySimpleGUIQt/PySimpleGUIQt.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/PySimpleGUIQt/PySimpleGUIQt.py b/PySimpleGUIQt/PySimpleGUIQt.py index 4546d378..826e18c7 100644 --- a/PySimpleGUIQt/PySimpleGUIQt.py +++ b/PySimpleGUIQt/PySimpleGUIQt.py @@ -1,5 +1,5 @@ #!/usr/bin/python3 -version = __version__ = "0.32.0. Released 04-Apr-2020" +version = __version__ = "0.32.0.1 Unreleased - Experimental ability for user to add widgets to layout" port = 'PySimpleGUIQt' @@ -3250,6 +3250,7 @@ class Window: self._Hidden = False self.QTApplication = None self.QT_QMainWindow = None + self.QTWindow = None # type Window.QTMainWindow self._Size=size self.ElementPadding = element_padding or DEFAULT_ELEMENT_PADDING self.FocusElement = None @@ -4799,7 +4800,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win): qt_row_layout = QHBoxLayout() for col_num, element in enumerate(flex_row): element.ParentForm = toplevel_win # save the button's parent form object - element.ParentRowFrame = qt_row_layout + element.parent_row_frame = element.ParentRowFrame = qt_row_layout if toplevel_win.Font and (element.Font == DEFAULT_FONT or not element.Font): font = toplevel_win.Font element.Font = font @@ -4860,7 +4861,7 @@ def PackFormIntoFrame(window, containing_frame, toplevel_win): column_widget.setStyleSheet(style) column_layout = QFormLayout() - column_vbox = QVBoxLayout() + element.vbox_layout = column_vbox = QVBoxLayout() PackFormIntoFrame(element, column_layout, toplevel_win) scroll = None @@ -5931,6 +5932,13 @@ def stop_timer(timer): # ----====----====----====----====----==== STARTUP TK ====----====----====----====----====----# def StartupTK(window): + """ + Does the building of the window with all the widgets + :param window: + :type window: Window + :return: + """ + global using_pyqt5 ow = Window.NumOpenWindows @@ -5942,7 +5950,6 @@ def StartupTK(window): Window.IncrementOpenCount() - # window.QTWindow = QWidget() window.QT_QMainWindow = Window.QT_QMainWindowClass(window.ReturnKeyboardEvents, window)