component item can coverup component widget changes

This commit is contained in:
Jakub Trllo 2019-04-17 09:54:08 +02:00
parent fe3d94c203
commit b2b4c031c1

View file

@ -5,11 +5,25 @@ from . import ComponentWidget
class ComponentItem(QtWidgets.QTreeWidgetItem):
def __init__(self, parent, data):
super().__init__(parent)
self.parent_widget = parent
self.in_data = data
self._widget = ComponentWidget(self)
self._widget.set_context(data)
def set_context(self):
self._widget = ComponentWidget(self)
self._widget.set_context(self.in_data)
self.treeWidget().setItemWidget(self, 0, self._widget)
def is_thumbnail(self):
return self._widget.thumbnail.checked
def change_thumbnail(self, hover=True):
self._widget.thumbnail.change_checked(hover)
def is_preview(self):
return self._widget.preview.checked
def change_preview(self, hover=True):
self._widget.preview.change_checked(hover)
def double_clicked(*args):
pass