本文整理汇总了Python中PySide.QtDeclarative.QDeclarativeView.setWindowIcon方法的典型用法代码示例。如果您正苦于以下问题:Python QDeclarativeView.setWindowIcon方法的具体用法?Python QDeclarativeView.setWindowIcon怎么用?Python QDeclarativeView.setWindowIcon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtDeclarative.QDeclarativeView
的用法示例。
在下文中一共展示了QDeclarativeView.setWindowIcon方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import setWindowIcon [as 别名]
def start(self):
global client
if (len(self.email) > 0 and len(self.password) > 0):
self.email = str(self.email[0])
self.password = str(base64.b64decode(self.password[0]))
client = Client(self.email, self.password)
response = client.login()
if (response['result'] == 'ok'):
startup = client.notify_startup()
if (not startup):
print_message("Could not startup!")
else:
print_message("Notified!")
else:
Mbox("Budibox", "Credentials undefined or incorrect. Please login again.")
# Create the QML user interface.
view = QDeclarativeView()
view.setSource(QUrl('qml/main.qml'))
view.setWindowTitle("Budibox")
view.setWindowIcon(QIcon("qml/budibox.jpg"))
context = view.rootContext()
context.setContextProperty("send_data",Receive_data())
# Display the user interface and allow the user to interact with it.
view.setGeometry(360, 360, 360, 360)
view.setMaximumSize(360, 360)
view.show()
app.exec_()
示例2: QApplication
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import setWindowIcon [as 别名]
from softwarecenter.db.pkginfo import get_pkg_info
from pkglist import PkgListModel
from reviewslist import ReviewsListModel
from categoriesmodel import CategoriesModel
if __name__ == '__main__':
app = QApplication(sys.argv)
# TODO do this async
app.cache = get_pkg_info()
app.cache.open()
view = QDeclarativeView()
view.setWindowTitle(view.tr("Ubuntu Software Center"))
view.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__), "../../../data/icons/scalable/apps/softwarecenter.svg")))
view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView)
# ideally this should be part of the qml by using a qmlRegisterType()
# but that does not seem to be supported in pyside yet(?) so we need
# to cowboy it in here
pkglistmodel = PkgListModel()
reviewslistmodel = ReviewsListModel()
categoriesmodel = CategoriesModel()
rc = view.rootContext()
rc.setContextProperty('pkglistmodel', pkglistmodel)
rc.setContextProperty('reviewslistmodel', reviewslistmodel)
rc.setContextProperty('categoriesmodel', categoriesmodel)
# debug
if len(sys.argv) > 1:
示例3: QApplication
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import setWindowIcon [as 别名]
if options.debug:
log.root.setLevel(level=logging.DEBUG)
else:
log.root.setLevel(level=logging.INFO)
dirpath = os.path.dirname(__file__)
icopath = os.path.join(dirpath, "../data/ico/128/vindoga-flower.png")
qmlpath = os.path.join(dirpath, "../data/qml/vindoga.qml")
qapp = QApplication(sys.argv)
view = QDeclarativeView()
launchermodel = model.LauncherModel()
pkglistmodel = model.PackagesModel()
reviewslistmodel = model.ReviewsModel()
categoriesmodel = model.CategoriesModel()
rc = view.rootContext()
rc.setContextProperty('launchermodel', launchermodel)
rc.setContextProperty('pkglistmodel', pkglistmodel)
rc.setContextProperty('reviewslistmodel', reviewslistmodel)
rc.setContextProperty('categoriesmodel', categoriesmodel)
view.setSource(QUrl.fromLocalFile(qmlpath))
view.setResizeMode(QtDeclarative.QDeclarativeView.SizeRootObjectToView)
view.setWindowTitle(view.tr("Algorete Market"))
view.setWindowIcon(QIcon(icopath))
view.show()
sys.exit(qapp.exec_())