class DiffView(QObject): def __init__(self, app, difftext, leftfile, rightfile): QObject.__init__(self) self.app = app self.difftext = difftext self.window = QMainWindow() self.window.setWindowTitle("Log Diffs") self.leftfile = leftfile self.rightfile = rightfile self.view = QDeclarativeView() self.glw = QtOpenGL.QGLWidget() self.view.setViewport(self.glw) self.view.setResizeMode( QtDeclarative.QDeclarativeView.SizeRootObjectToView) self.window.setCentralWidget(self.view) self.rc = self.view.rootContext() self.rc.setContextProperty('controller', self) self.rc.setContextProperty('difftext', self.difftext) self.view.setSource('diffview.qml') self.window.show() @Slot() def diff_viewer(self): p = subprocess.Popen("gvim -d {0} {1}".format(self.leftfile, self.rightfile), shell=True) sts = os.waitpid(p.pid, 0)[1] def checked(self): for build in self.build_list.checked(): yield build
class LogView(QObject): def __init__(self, app, logpath, id, sdk_model, row_number): QObject.__init__(self) self.app = app self.logpath = logpath self.window = QMainWindow() self.window.setWindowTitle("Raptor build viewer") self.build_list = BuildListModel(self.logpath) self.controller = BuildController(app, self.build_list, id, sdk_model, row_number) self.view = QDeclarativeView() self.glw = QtOpenGL.QGLWidget() self.view.setViewport(self.glw) self.view.setResizeMode( QtDeclarative.QDeclarativeView.SizeRootObjectToView) self.window.setCentralWidget(self.view) self.rc = self.view.rootContext() self.rc.setContextProperty('controller', self.controller) self.rc.setContextProperty('pyBuildListModel', self.build_list) self.rc.setContextProperty('logpath', self.logpath) self.rc.setContextProperty('info', sdk_model.sdk_info(id)) self.rc.setContextProperty('window', self.window) self.rc.setContextProperty('row', row_number) self.view.setSource('logchooser.qml') self.window.show() def checked(self): for build in self.build_list.checked(): yield build
class QmlGui(Gui): USES = ['geonames', 'qmllocationprovider'] def __init__(self, core, dataroot, parent=None): self.app = QApplication(sys.argv) self.core = core self.view = QDeclarativeView() self.view.statusChanged.connect(self._status_changed) glw = QGLWidget() self.view.setViewport(glw) self.controller = Controller(self.view, self.core) self.settings = SettingsWrapper(self.core) rc = self.view.rootContext() rc.setContextProperty('controller', self.controller) rc.setContextProperty('settings', self.settings) rc.setContextProperty('gps', GPSDataWrapper(self.core)) self.view.setSource(os.path.join('qml','main.qml')) def get_gps(self, callback): self.controller.callback_gps = callback def show(self): self.view.showFullScreen() self.app.exec_() self.core.on_destroy() def _status_changed(self, error): logger.error(self.view.errors())
class LogView(QObject): def __init__(self, app, logpath, id, sdk_model, row_number): QObject.__init__(self) self.app = app self.logpath = logpath self.window = QMainWindow() self.window.setWindowTitle("Raptor build viewer") self.build_list = BuildListModel(self.logpath) self.controller = BuildController(app, self.build_list, id, sdk_model, row_number) self.view = QDeclarativeView() self.glw = QtOpenGL.QGLWidget() self.view.setViewport(self.glw) self.view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView) self.window.setCentralWidget(self.view) self.rc = self.view.rootContext() self.rc.setContextProperty('controller', self.controller) self.rc.setContextProperty('pyBuildListModel', self.build_list) self.rc.setContextProperty('logpath', self.logpath) self.rc.setContextProperty('info', sdk_model.sdk_info(id)) self.rc.setContextProperty('window', self.window) self.rc.setContextProperty('row', row_number) self.view.setSource('logchooser.qml') self.window.show() def checked(self): for build in self.build_list.checked(): yield build
class DiffView(QObject): def __init__(self, app, difftext, leftfile, rightfile): QObject.__init__(self) self.app = app self.difftext = difftext self.window = QMainWindow() self.window.setWindowTitle("Log Diffs") self.leftfile = leftfile self.rightfile = rightfile self.view = QDeclarativeView() self.glw = QtOpenGL.QGLWidget() self.view.setViewport(self.glw) self.view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView) self.window.setCentralWidget(self.view) self.rc = self.view.rootContext() self.rc.setContextProperty('controller', self) self.rc.setContextProperty('difftext', self.difftext) self.view.setSource('diffview.qml') self.window.show() @Slot() def diff_viewer(self): p = subprocess.Popen("gvim -d {0} {1}".format(self.leftfile, self.rightfile), shell=True) sts = os.waitpid(p.pid, 0)[1] def checked(self): for build in self.build_list.checked(): yield build
def main(argv): app = QApplication(argv) display_widget = QDeclarativeView() display_widget.setViewport(QGLWidget()) display_widget.setResizeMode(QDeclarativeView.SizeRootObjectToView) display_widget.setSource(QUrl('drawer_demo.qml')) display_widget.show() display_widget.resize(640,480) sys.exit(app.exec_())
def main(argv): app = QApplication(argv) display_widget = QDeclarativeView() display_widget.setViewport(QGLWidget()) display_widget.setResizeMode(QDeclarativeView.SizeRootObjectToView) display_widget.setSource(QUrl('drawer_demo.qml')) display_widget.show() display_widget.resize(640, 480) sys.exit(app.exec_())
class SDKView(QObject): def __init__(self, app, window, logpath=None): QObject.__init__(self) self.app = app self.sdk_list_model = SDKListModel() self.controller = SDKController(app, self.sdk_list_model) self.view = QDeclarativeView() self.glw = QtOpenGL.QGLWidget() self.view.setViewport(self.glw) self.view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView) window.setCentralWidget(self.view) self.rc = self.view.rootContext() self.rc.setContextProperty('sdk_controller', self.controller) self.rc.setContextProperty('pySDKListModel', self.sdk_list_model) self.view.setSource('sdkchooser.qml') @Slot() def quit(self): self.controller.quit()
class SDKView(QObject): def __init__(self, app, window, logpath=None): QObject.__init__(self) self.app = app self.sdk_list_model = SDKListModel() self.controller = SDKController(app, self.sdk_list_model) self.view = QDeclarativeView() self.glw = QtOpenGL.QGLWidget() self.view.setViewport(self.glw) self.view.setResizeMode( QtDeclarative.QDeclarativeView.SizeRootObjectToView) window.setCentralWidget(self.view) self.rc = self.view.rootContext() self.rc.setContextProperty('sdk_controller', self.controller) self.rc.setContextProperty('pySDKListModel', self.sdk_list_model) self.view.setSource('sdkchooser.qml') @Slot() def quit(self): self.controller.quit()