当前位置: 首页>>代码示例>>Python>>正文


Python QDeclarativeView.setWindowIcon方法代码示例

本文整理汇总了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_()
开发者ID:hsdrose,项目名称:feup-sdis-budibox,代码行数:35,代码来源:login_box.py

示例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:
开发者ID:Alberto-Beralix,项目名称:Beralix,代码行数:33,代码来源:app.py

示例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_())
开发者ID:bash-a,项目名称:vindoga,代码行数:31,代码来源:app.py


注:本文中的PySide.QtDeclarative.QDeclarativeView.setWindowIcon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。