def createWindow(self, owner, filename): engine = self.root.qmlEngine controller = self.getController(filename) context = QDeclarativeContext(engine.rootContext(), controller) context.setContextProperty("myController", controller) controller.registerProperties(context) controller.view = createQmlComponent( filename, engine, context, controller ) controller.view.setVisible(True)
def _create_qml_gui(self, filename): self.qmlEngine = QDeclarativeEngine() self.qmlEngine.addImageProvider('cover', self.cover_provider) context = self.qmlEngine.rootContext() context.setContextProperty('controller', self.controller) context.setContextProperty('configProxy', self.config_proxy) context.setContextProperty('mediaButtonsHandler', self.media_buttons_handler) context.setContextProperty('trackerMinerConfig', self.tracker_miner_config) # Load the QML UI (this could take a while...) self.mainWindow = createQmlComponent( filename, self.qmlEngine, context, self )