def __build_main_window(self, engine): """ Builds the QML interface """ parentcontext = engine.rootContext() #Create a context for the family tree list self.centralviewcontext = QtDeclarative.QDeclarativeContext(parentcontext) #Create ListModel to use detviews = DetViewSumModel([DetailView('People')]) #register them in the context self.centralviewcontext.setContextProperty('Const', self.const) self.centralviewcontext.setContextProperty('CentralView', self) self.centralviewcontext.setContextProperty('DetViewSumModel', detviews) #create a Component to show self.centralview = QtDeclarative.QDeclarativeComponent(engine) self.centralview.loadUrl(QtCore.QUrl.fromLocalFile( os.path.join(ROOT_DIR, "guiQML", 'views', 'centralview.qml'))) #and obtain the QObject of it self.Qcentralview = self.centralview.create(self.centralviewcontext)
def __build_main_window(self, engine): """ Builds the QML interface """ parentcontext = engine.rootContext() #Create a context for the family tree list self.famtreecontext = QtDeclarative.QDeclarativeContext(parentcontext) #Create ListModel to use famtreesQT = [FamTreeWrapper(obj, self) for obj in self.current_names] self.famtrees = FamTreeListModel(famtreesQT) #register them in the context self.famtreecontext.setContextProperty('Const', self.const) self.famtreecontext.setContextProperty('DbManager', self) self.famtreecontext.setContextProperty('FamTreeListModel', self.famtrees) #create a Component to show self.famtreeview = QtDeclarative.QDeclarativeComponent(engine) self.famtreeview.loadUrl(QtCore.QUrl.fromLocalFile( os.path.join(ROOT_DIR, "guiQML", 'views', 'dbman.qml'))) #and obtain the QObject of it self.Qfamtreeview = self.famtreeview.create(self.famtreecontext)
def __build_main_window(self, engine): """ Builds the QML interface """ parentcontext = engine.rootContext() #Create a context for the family tree list self.qmlpersonlistcontext = QtDeclarative.QDeclarativeContext( parentcontext) #Create ListModel to use personlistmodel = QMLPersonListModel(self.dbstate.db) #register them in the context self.qmlpersonlistcontext.setContextProperty('Const', self.const) self.qmlpersonlistcontext.setContextProperty('QMLPersonList', self) self.qmlpersonlistcontext.setContextProperty('QMLPersonListModel', personlistmodel) #create a Component to show self.qmlpersonlist = QtDeclarative.QDeclarativeComponent(engine) self.qmlpersonlist.loadUrl( QtCore.QUrl.fromLocalFile( os.path.join(ROOT_DIR, "guiQML", 'views', 'peopleview.qml'))) #and obtain the QObject of it self.Qpersonlist = self.qmlpersonlist.create(self.qmlpersonlistcontext)