本文整理汇总了Python中PyQt4.QtDeclarative.QDeclarativeView.setFixedSize方法的典型用法代码示例。如果您正苦于以下问题:Python QDeclarativeView.setFixedSize方法的具体用法?Python QDeclarativeView.setFixedSize怎么用?Python QDeclarativeView.setFixedSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtDeclarative.QDeclarativeView
的用法示例。
在下文中一共展示了QDeclarativeView.setFixedSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setFixedSize [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_())
示例2: MyQProcess
# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setFixedSize [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_()
示例3: open
# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setFixedSize [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")
示例4: len
# 需要导入模块: from PyQt4.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PyQt4.QtDeclarative.QDeclarativeView import setFixedSize [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_()