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


Python QDeclarativeView.setWindowTitle方法代码示例

本文整理汇总了Python中PyQt4.QtDeclarative.QDeclarativeView.setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Python QDeclarativeView.setWindowTitle方法的具体用法?Python QDeclarativeView.setWindowTitle怎么用?Python QDeclarativeView.setWindowTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtDeclarative.QDeclarativeView的用法示例。


在下文中一共展示了QDeclarativeView.setWindowTitle方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
def main():

    app = QApplication(sys.argv)

    now = Now()

    # Create the QML user interface.
    view = QDeclarativeView()
    view.setSource(QUrl('meet.qml'))
    view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
    view.setWindowTitle(u'属于你我的时间')
    # Get the root object of the user interface.  It defines a
    # 'messageRequired' signal and JavaScript 'updateMessage' function.  Both
    # can be accessed transparently from Python.
    rootObject = view.rootObject()

    # Provide the current date and time when requested by the user interface.
    rootObject.messageRequired.connect(now.emit_now)

    # Update the user interface with the current date and time.
    now.now.connect(rootObject.updateMessage)
    timer = QTimer()
    timer.timeout.connect(now.emit_now)
    timer.start(500)
    # Provide an initial message as a prompt.
    rootObject.updateMessage(u"转眼间,你我已相遇...")

    # Display the user interface and allow the user to interact with it.
    view.setGeometry(80, 80, 960, 580)
    view.show()

    app.exec_()
开发者ID:duoduo3369,项目名称:exercise,代码行数:34,代码来源:meet.py

示例2: main

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
def main():

    app = QApplication(sys.argv)
    stack = Stack()
    # Create the QML user interface.
    view = QDeclarativeView()
    view.setSource(QUrl('stack.qml'))
    view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
    view.setWindowTitle(u'栈')
    # Get the root object of the user interface.  It defines a
    # 'messageRequired' signal and JavaScript 'updateMessage' function.  Both
    # can be accessed transparently from Python.
    rootObject = view.rootObject()

    # Provide the current date and time when requested by the user interface.
    rootObject.button_clicked.connect(stack.push)

    # Update the user interface with the current date and time.
    stack.push_element.connect(rootObject.first_clicked)
    # Provide an initial message as a prompt.
    #rootObject.updateMessage(u"转眼间,你我已相遇...")
    
    stack.push(2)
    # Display the user interface and allow the user to interact with it.
    view.setGeometry(80, 80, 960, 580)
    view.show()

    app.exec_()
开发者ID:duoduo3369,项目名称:exercise,代码行数:30,代码来源:run.py

示例3: main

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
def main():
	os.chdir(sys.path[0])
	app = QApplication(sys.argv)
	canvas = QDeclarativeView()
	canvas.setFixedSize(360, 500)
	canvas.setWindowTitle('Ubezee - Lock Your System')
	icon = QIcon()
	icon.addPixmap(QPixmap('qml/images/UbezeeIcon.png'), QIcon.Normal, QIcon.Off)
	canvas.setWindowIcon(QIcon(icon)) 
	qr = canvas.frameGeometry()
	cp = QDesktopWidget().availableGeometry().center()
	qr.moveCenter(cp)
	canvas.move(qr.topLeft())
	engine = canvas.engine()

	element = MyElement()
	
	engine.rootContext().setContextObject(element)
	canvas.setSource(QUrl.fromLocalFile('qml/Ubezee.qml'))
	engine.quit.connect(app.quit)
	canvas.setResizeMode(QDeclarativeView.SizeRootObjectToView)
	canvas.show()
	sys.exit(app.exec_())
开发者ID:kurokid,项目名称:Ubezee,代码行数:25,代码来源:ubezee.py

示例4: main

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
def main():

    app = QApplication(sys.argv)
    test = SignalTest()
    # Create the QML user interface.
    view = QDeclarativeView()
    view.setSource(QUrl('Button.qml'))
    view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
    view.setWindowTitle(u'栈')
    rootObject = view.rootObject()

    rootObject.updateTextRequired.connect(test.change_text)

    # Update the user interface with the current date and time.
    test.signal_test.connect(rootObject.updateText)
    # Provide an initial message as a prompt.
    rootObject.updateText(u"转眼间,你我已相遇...")
    
    #stack.push(2)
    # Display the user interface and allow the user to interact with it.
    view.setGeometry(80, 80, 960, 580)
    view.show()

    app.exec_()
开发者ID:duoduo3369,项目名称:exercise,代码行数:26,代码来源:signal.py

示例5: MyQProcess

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
rootObject.saveFile.connect(saveFile)
rootObject.encodeCmd.connect(encodeCmd)
rootObject.abortEncode.connect(abortEncode)
rootObject.openLogClicked.connect(openLog)

# Set home dir in qml
rootObject.setHomeDir(home)

# Create encode process
cmdProcess = MyQProcess()
QObject.connect(cmdProcess,SIGNAL("finished(int)"),cmdProcess,SLOT("finishEncode()"))
QObject.connect(cmdProcess,SIGNAL("readyReadStandardOutput()"),cmdProcess,SLOT("readStdOutput()"))
QObject.connect(cmdProcess,SIGNAL("readyReadStandardError()"),cmdProcess,SLOT("readStdError()"))
QObject.connect(cmdProcess,SIGNAL("error()"),cmdProcess,SLOT("errorEncode()"))

# Outputfile
outputfile = QString("empty")

# Display the user interface and allow the user to interact with it.
view.setGeometry(0, 0, 480, 575)
view.setFixedSize(480, 575) 
view.setWindowTitle(QCoreApplication.translate(None, 'Encode'))
screen = QDesktopWidget().screenGeometry()
size =  view.geometry()
view.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
view.show()
#view.showFullScreen()

app.exec_()

开发者ID:,项目名称:,代码行数:31,代码来源:

示例6: open

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
            print "Downloading " + f['filename']
            r = requests.get(SERVER + "/" + f['filename'])
            directory = os.path.dirname(f['filename'])
            if directory != '' and not os.path.exists(directory):
                os.makedirs(directory)
            with open(f['filename'], 'wb') as localFile:
                for chunk in r.iter_content(chunk_size=1024):
                    if chunk:
                        localFile.write(chunk)
                        localFile.flush()

if True:#os.path.isfile("gamelobby.exe"):
    app = QApplication(sys.argv)

    view = QDeclarativeView()
    view.setSource(QUrl('patcher.qml'))
    view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
    view.setFixedSize(640, 480)
    view.setWindowTitle("PTG Patcher")

    view.show()

    thread = DownloaderThread()
    thread.finished.connect(app.exit)
    thread.start()

    app.exec_()

print "Opening PTG..."
subprocess.Popen("gamelobby.exe")
开发者ID:mplamann,项目名称:PTG,代码行数:32,代码来源:patcher.py

示例7: QApplication

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
import sys
import os
import string

from PyQt4.QtCore import Qt, QObject, QUrl, pyqtSignal
from PyQt4.QtGui import QApplication, QCursor
from PyQt4.QtDeclarative import QDeclarativeView

app = QApplication(sys.argv)

# Create the QML user interface.
view = QDeclarativeView()

view.setSource(QUrl('main.qml'))
view.setResizeMode(QDeclarativeView.SizeRootObjectToView)

rootObject = view.rootObject()

view.setGeometry(20, 20, rootObject.property("width"), rootObject.property("height"))
view.setWindowTitle("iSFX")
view.show()
view.raise_()

app.exec_()
开发者ID:iSFX-Team,项目名称:iSFX,代码行数:26,代码来源:main.py

示例8: QApplication

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
from pkglist import PkgListModel
from reviewslist import ReviewsListModel
from categoriesmodel import CategoriesModel

from softwarecenter.utils import mangle_paths_if_running_in_local_checkout

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)

    # if running locally, fixup softwarecenter.paths
    mangle_paths_if_running_in_local_checkout()

    # ideally this should be part of the qml by using a qmlRegisterType()
    # but that does not seem to be supported in pyqt yet(?) so we need
    # to cowboy it in here
    pkglistmodel = PkgListModel()
    reviewslistmodel = ReviewsListModel()
    categoriesmodel = CategoriesModel()
    rc = view.rootContext()
    rc.setContextProperty('pkglistmodel', pkglistmodel)
开发者ID:feiying,项目名称:AppStream,代码行数:32,代码来源:app.py

示例9: len

# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setWindowTitle [as 别名]
  gcard = "ati"
else:
  rootObject.updateGraphicsdriverimg("img/hardware.png")
  #global gcard
  gcard = "empty"
  
# Set available drivers
if gcard == "nvidia":
  rootObject.stable_driver(driver_version_stable.strip())
  #if len(nvidia_driver_version_experimental) > 0:
      #rootObject.experimental_driver(nvidia_driver_version_experimental.strip())
  #else:
  rootObject.hide_experimental_driver()
elif gcard == "ati":
  rootObject.stable_driver(driver_version_stable.strip())
  #if len(fglrx_driver_version_experimental) > 0:
      #rootObject.experimental_driver(fglrx_driver_version_experimental.strip())
  #else:
  rootObject.hide_experimental_driver() 

# Display the user interface and allow the user to interact with it.
view.setGeometry(100, 100, 500, 300)
view.setFixedSize(500, 300) 
view.setWindowTitle(QCoreApplication.translate(None, 'ZevenOS Hardware Manager'))
screen = QDesktopWidget().screenGeometry()
size =  view.geometry()
view.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
view.show()

app.exec_()
开发者ID:NeptuneOS,项目名称:zevenoshardwaremanager,代码行数:32,代码来源:zevenoshardwaremanager.py


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