Esempio n. 1
0
    def __init__(self):
        super(SystemInfoUI, self).__init__()
        self.view = QtDeclarative.QDeclarativeView()
        self.rc = self.view.rootContext()

        self.model = SystemInfoModel()
        self.rc.setContextProperty('sysinfo', self.model)

        self.view.setSource('main.qml')

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

        self.systemInfo = QSystemInfo(self)
Esempio n. 2
0
if __name__ == '__main__':
    import sys
    QtGui.QApplication.setGraphicsSystem("raster")
    app = QtGui.QApplication(sys.argv)

    username, ok = QtGui.QInputDialog.getText(None, "Username", "Username:"******"Must provide a username")
        sys.exit(1)

    password, ok = QtGui.QInputDialog.getText(None, "Password", "Password:"******"Must provide a password")
        sys.exit(1)

    data = Picasa(username, password)

    view = QtDeclarative.QDeclarativeView()
    engine = view.engine()
    engine.quit.connect(app.quit)
    albums = data.getAlbumListModel()
    view.rootContext().setContextProperty("albumModel", albums)
    context = view.rootContext()
    view.setSource(QUrl('photoviewer.qml'))
    view.show()

    sys.exit(app.exec_())