Skip to content

Commit

Permalink
Fix bug on ControlEmpty widget
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Sep 27, 2018
1 parent d482261 commit 49f4ef7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions pyforms_gui/controls/control_emptywidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,27 @@ def value(self, value):
if isinstance(value, list):
for w in value:
self.form.layout().addWidget(w.form)

# The init_form should be called only for the BaseWidget
if isinstance(w, BaseWidget) and not w._formLoaded:
w.init_form()
if not hasattr(w, 'about_to_be_shown'):
w.about_to_be_shown = True
w.show()
del w.about_to_be_shown
else:
self.form.layout().addWidget(value.form)

# The init_form should be called only for the BaseWidget
if isinstance(value, BaseWidget) and not value._formLoaded:
value.init_form()

if not hasattr(value, 'about_to_be_shown'):
value.about_to_be_shown = True
value.show()
del value.about_to_be_shown
# The init_form should be called only for the BaseWidget

if isinstance(value, BaseWidget) and not value._formLoaded:
value.init_form()



@property
def form(self):
return self
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
setup(
name='PyForms GUI',
version=version,
description="""Pyforms is a Python 2.7 and 3.4 framework to develop GUI applications based on pyqt""",
description="""Pyforms is a Python framework to develop GUI applications based on pyqt""",
author='Ricardo Ribeiro',
author_email='ricardojvr@gmail.com',
license=license,
Expand Down

0 comments on commit 49f4ef7

Please sign in to comment.