mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
dbconection is passed from window
This commit is contained in:
parent
8ebf7f9fb3
commit
f13d8c7cd9
2 changed files with 7 additions and 5 deletions
|
|
@ -7,9 +7,7 @@ from .constants import (
|
|||
DUPLICATED_ROLE
|
||||
)
|
||||
|
||||
from avalon.api import AvalonMongoDB
|
||||
from avalon.vendor import qtawesome
|
||||
|
||||
from Qt import QtCore, QtGui
|
||||
|
||||
|
||||
|
|
@ -73,12 +71,12 @@ class HierarchyModel(QtCore.QAbstractItemModel):
|
|||
]
|
||||
index_moved = QtCore.Signal(QtCore.QModelIndex)
|
||||
|
||||
def __init__(self, parent=None):
|
||||
def __init__(self, dbcon, parent=None):
|
||||
super(HierarchyModel, self).__init__(parent)
|
||||
self._root_item = None
|
||||
self._items_by_id = {}
|
||||
self._asset_items_by_name = collections.defaultdict(list)
|
||||
self.dbcon = AvalonMongoDB()
|
||||
self.dbcon = dbcon
|
||||
|
||||
self._hierarchy_mode = True
|
||||
self._reset_root_item()
|
||||
|
|
|
|||
|
|
@ -6,12 +6,16 @@ from . import (
|
|||
HierarchyView
|
||||
)
|
||||
|
||||
from avalon.api import AvalonMongoDB
|
||||
|
||||
|
||||
class Window(QtWidgets.QWidget):
|
||||
def __init__(self, parent=None):
|
||||
super(Window, self).__init__(parent)
|
||||
|
||||
model = HierarchyModel()
|
||||
dbcon = AvalonMongoDB()
|
||||
|
||||
model = HierarchyModel(dbcon)
|
||||
view = HierarchyView(model, self)
|
||||
view.setModel(model)
|
||||
_selection_model = HierarchySelectionModel()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue