本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsView.setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsView.setWindowTitle方法的具体用法?Python QGraphicsView.setWindowTitle怎么用?Python QGraphicsView.setWindowTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QGraphicsView
的用法示例。
在下文中一共展示了QGraphicsView.setWindowTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QApplication
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsView [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsView import setWindowTitle [as 别名]
import sys
app = QApplication(sys.argv)
scene = QGraphicsScene()
scene.setStickyFocus(True)
for y in range(10):
for x in range(10):
proxy = CustomProxy(None, Qt.Window)
proxy.setWidget(EmbeddedDialog())
rect = proxy.boundingRect()
proxy.setPos( x * rect.width()*1.05, y*rect.height()*1.05 )
proxy.setCacheMode(QGraphicsItem.DeviceCoordinateCache)
scene.addItem(proxy)
scene.setSceneRect(scene.itemsBoundingRect())
view = QGraphicsView(scene)
view.scale(0.5, 0.5)
view.setRenderHints(view.renderHints() | QPainter.Antialiasing | QPainter.SmoothPixmapTransform)
view.setBackgroundBrush(QBrush(QPixmap(':/No-Ones-Laughing-3.jpg')))
view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
view.show()
view.setWindowTitle("Embedded Dialogs Demo")
sys.exit(app.exec_())
示例2: QApplication
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsView [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsView import setWindowTitle [as 别名]
if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
scene = QGraphicsScene()
scene.setSceneRect(-500, -500, 1000, 1000)
scene.setItemIndexMethod(QGraphicsScene.NoIndex)
car = Car()
scene.addItem(car)
view = QGraphicsView(scene)
view.setRenderHint(QPainter.Antialiasing)
view.setBackgroundBrush(Qt.darkGray)
view.setWindowTitle("Qt DBus Controlled Car")
view.resize(400, 300)
view.show()
a = CarInterfaceAdaptor(car)
connection = QDBusConnection.sessionBus()
connection.registerObject('/Car', car)
connection.registerService('org.example.CarExample')
rc = app.exec_()
# Make sure things get destroyed in the right order.
del view
sys.exit(rc)
示例3: QApplication
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsView [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsView import setWindowTitle [as 别名]
if __name__== '__main__':
import sys
import math
app = QApplication(sys.argv)
qsrand(QTime(0, 0, 0).secsTo(QTime.currentTime()))
scene = QGraphicsScene(-200, -200, 400, 400)
for i in range(10):
item = ColorItem()
angle = i*6.28 / 10.0
item.setPos(math.sin(angle)*150, math.cos(angle)*150)
scene.addItem(item)
robot = Robot()
robot.setTransform(QTransform.fromScale(1.2, 1.2), True)
robot.setPos(0, -20)
scene.addItem(robot)
view = QGraphicsView(scene)
view.setRenderHint(QPainter.Antialiasing)
view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
view.setBackgroundBrush(QColor(230, 200, 167))
view.setWindowTitle("Drag and Drop Robot")
view.show()
sys.exit(app.exec_())
示例4: QApplication
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsView [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsView import setWindowTitle [as 别名]
if __name__ == '__main__':
import sys
MouseCount = 7
app = QApplication(sys.argv)
qsrand(QTime(0,0,0).secsTo(QTime.currentTime()))
scene = QGraphicsScene()
scene.setSceneRect(-300, -300, 600, 600)
scene.setItemIndexMethod(QGraphicsScene.NoIndex)
for i in range(MouseCount):
mouse = Mouse()
mouse.setPos(math.sin((i * 6.28) / MouseCount) * 200,
math.cos((i * 6.28) / MouseCount) * 200)
scene.addItem(mouse)
view = QGraphicsView(scene)
view.setRenderHint(QPainter.Antialiasing)
view.setBackgroundBrush(QBrush(QPixmap(':/images/cheese.jpg')))
view.setCacheMode(QGraphicsView.CacheBackground)
view.setViewportUpdateMode(QGraphicsView.BoundingRectViewportUpdate)
view.setDragMode(QGraphicsView.ScrollHandDrag)
view.setWindowTitle("Colliding Mice")
view.resize(400, 300)
view.show()
sys.exit(app.exec_())