mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
implemented hidden widget
This commit is contained in:
parent
6abfa14e01
commit
fe392aa5db
1 changed files with 24 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ from Qt import QtWidgets, QtCore
|
|||
from openpype.lib.attribute_definitions import (
|
||||
AbtractAttrDef,
|
||||
UnknownDef,
|
||||
HiddenDef,
|
||||
NumberDef,
|
||||
TextDef,
|
||||
EnumDef,
|
||||
|
|
@ -459,6 +460,29 @@ class UnknownAttrWidget(_BaseAttrDefWidget):
|
|||
self._input_widget.setText(str_value)
|
||||
|
||||
|
||||
class HiddenAttrWidget(_BaseAttrDefWidget):
|
||||
def _ui_init(self):
|
||||
self.setVisible(False)
|
||||
self._value = None
|
||||
self._multivalue = False
|
||||
|
||||
def setVisible(self, visible):
|
||||
if visible:
|
||||
visible = False
|
||||
super(HiddenAttrWidget, self).setVisible(visible)
|
||||
|
||||
def current_value(self):
|
||||
if self._multivalue:
|
||||
raise ValueError(
|
||||
"{} can't output for multivalue.".format(self.__class__.__name__)
|
||||
)
|
||||
return self._value
|
||||
|
||||
def set_value(self, value, multivalue=False):
|
||||
self._value = copy.deepcopy(value)
|
||||
self._multivalue = multivalue
|
||||
|
||||
|
||||
class FileAttrWidget(_BaseAttrDefWidget):
|
||||
def _ui_init(self):
|
||||
input_widget = FilesWidget(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue