Example #1
0
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())
def main():
    app = QApplication([])
    view = QDeclarativeView()
    manager = MyContactManager()
    context = view.rootContext()
    context.setContextProperty("manager", manager)

    url = QUrl('main.qml')
    view.setSource(url)
    view.showFullScreen()

    app.exec_()
Example #3
0
def main():
    app = QApplication([])
    view = QDeclarativeView()
    manager = ServiceManager()
    context = view.rootContext()
    context.setContextProperty("manager", manager)

    url = QUrl('main.qml')
    view.setSource(url)
    view.showFullScreen()

    app.exec_()
def main():
  app = QApplication(sys.argv)

  server = ElServer()
  server.start()

  view = QDeclarativeView()
  rootContext = view.rootContext()
  rootContext.setContextProperty('server', server)
  view.setSource('main.qml')
  view.showFullScreen()

  app.exec_()

  server.stop()
Example #5
0
def main():
    app = QApplication([])
    view = QDeclarativeView()
    manager = TodoManager()
    context = view.rootContext()
    context.setContextProperty("manager", manager)

    url = QUrl('main.qml')
    view.setSource(url)

    if "-no-fs" not in sys.argv:
        view.showFullScreen()
    else:
        view.show()

    app.exec_()
Example #6
0
def main():
    app = QApplication([])
    view = QDeclarativeView()
    manager = TodoManager()
    context = view.rootContext()
    context.setContextProperty("manager", manager)

    url = QUrl('main.qml')
    view.setSource(url)

    if "-no-fs" not in sys.argv:
        view.showFullScreen()
    else:
        view.show()

    app.exec_()
Example #7
0
class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super().__init__(parent)

        self.process_page = ProcessSelectPage(self)
        self.setCentralWidget(self.process_page)
        self.text = TextPrefDialog(self)
        self.view = QDeclarativeView()
        self.tray = TrayIcon(self)
        self.tray.show()

        self._connect()

    def _connect(self):
        self.text.textSelected.connect(self.text_display)

    def open_filter(self):
        self.text.set_active(True)
        self.text.show()

    @Slot()
    def text_display(self):
        # _register()
        # from qmlregister import register_qml_type
        # register_qml_type()
        # need to test qmlRegisterType once more

        self.view.engine().addImportPath('ui/lib')
        self.view.engine().addImportPath('ui/imports')

        self.view.setSource('ui/main.qml')
        self.view.setAttribute(Qt.WA_TranslucentBackground)
        self.view.setStyleSheet("background-color:transparent")
        self.view.setWindowFlags(Qt.SplashScreen | Qt.FramelessWindowHint
                                 | Qt.WindowStaysOnTopHint)
        self.view.showFullScreen()
app = QtGui.QApplication(sys.argv)

view = QDeclarativeView()
view.setResizeMode(QDeclarativeView.SizeRootObjectToView)

rootObject = view.rootObject()
rootContext = view.rootContext()

rootContext.setContextProperty('elementList', elementList)
rootContext.setContextProperty('eelsEdgeList', eelsEdgeList)
rootContext.setContextProperty('edsLineList', edsLineList)
rootContext.setContextProperty('controller', controller)
rootContext.setContextProperty('elementName', elementName)


#"debugging" mode to run without the N9 specific QML
if options.desktop:
    if options.landscape:
        view.setSource(QtCore.QUrl('qml/Eels_edx_lookup_landscape.qml'))
    else:
        view.setSource(QtCore.QUrl('qml/Eels_edx_lookup.qml'))
    view.setGeometry(100, 100, 900, 540)
    view.show()
else:
    view.setSource(QtCore.QUrl('qml/N9_wrapper.qml'))
    view.showFullScreen()



app.exec_()