本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsView.raise_方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsView.raise_方法的具体用法?Python QGraphicsView.raise_怎么用?Python QGraphicsView.raise_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QGraphicsView
的用法示例。
在下文中一共展示了QGraphicsView.raise_方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsView [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsView import raise_ [as 别名]
def test(self):
raw = numpy.load(os.path.join(volumina._testing.__path__[0], "lena.npy")).astype(numpy.uint32)
ars = _ArraySource2d(raw)
ims = DummyItemSource(ars)
req = ims.request(QRect(0, 0, 256, 256))
item = req.wait()
assert isinstance(item, QGraphicsItem)
DEBUG = False
if DEBUG:
from PyQt5.QtWidgets import QApplication, QGraphicsView, QGraphicsScene
app = QApplication([])
scene = QGraphicsScene()
scene.addItem(item)
view = QGraphicsView(scene)
view.show()
view.raise_()
app.exec_()
示例2: generate_path_items_for_labels
# 需要导入模块: from PyQt5.QtWidgets import QGraphicsView [as 别名]
# 或者: from PyQt5.QtWidgets.QGraphicsView import raise_ [as 别名]
start = time.time()
path_items = generate_path_items_for_labels(pen_table, default_pen, labels_img, None)
print("generate took {}".format(time.time() - start)) # 52 ms
edges_item = SegmentationEdgesItem(path_items, pen_table, default_pen)
def assign_random_color(id_pair, buttons):
print("handling click: {}".format(id_pair))
pen = pen_table[id_pair]
if pen:
pen = QPen(pen)
else:
pen = QPen()
random_color = QColor(*list(np.random.randint(0, 255, (3,))))
pen.setColor(random_color)
pen_table[id_pair] = pen
edges_item.edgeClicked.connect(assign_random_color)
scene = QGraphicsScene()
scene.addItem(edges_item)
transform = QTransform()
transform.scale(2.0, 2.0)
view = QGraphicsView(scene)
view.setTransform(transform)
view.show()
view.raise_()
app.exec_()