From 5fe8d817865aeeca9a6e5c5a6171960c00ffdc8d Mon Sep 17 00:00:00 2001 From: TurBoss Date: Fri, 21 Feb 2020 00:12:13 +0100 Subject: [PATCH] create a staked widget that accepts rules --- qtpyvcp/widgets/containers/designer_plugins.py | 7 +++++++ qtpyvcp/widgets/containers/stack.py | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 qtpyvcp/widgets/containers/stack.py diff --git a/qtpyvcp/widgets/containers/designer_plugins.py b/qtpyvcp/widgets/containers/designer_plugins.py index b260701f8..efdb3c8b7 100644 --- a/qtpyvcp/widgets/containers/designer_plugins.py +++ b/qtpyvcp/widgets/containers/designer_plugins.py @@ -13,3 +13,10 @@ def pluginClass(self): return VCPWidget def isContainer(self): return True + +from stack import VCPStackedWidget +class VCPStackedWidgetPlugin(_DesignerPlugin): + def pluginClass(self): + return VCPStackedWidget + def isContainer(self): + return True diff --git a/qtpyvcp/widgets/containers/stack.py b/qtpyvcp/widgets/containers/stack.py new file mode 100644 index 000000000..584e53fd1 --- /dev/null +++ b/qtpyvcp/widgets/containers/stack.py @@ -0,0 +1,18 @@ + + +from qtpy.QtWidgets import QStackedWidget +from qtpyvcp.widgets.base_widgets import VCPWidget + + +class VCPStackedWidget(QStackedWidget, VCPWidget): + """VCPStackedWidget + + VCP Stacked Widget + + A widget Stack that can be controlled via rules. + """ + DEFAULT_RULE_PROPERTY = 'Enable' + + def __init__(self, parnet): + super(VCPStackedWidget, self).__init__(parent=parnet) +