本文整理汇总了Python中PyQt5.QtWidgets.QGraphicsTextItem方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QGraphicsTextItem方法的具体用法?Python QtWidgets.QGraphicsTextItem怎么用?Python QtWidgets.QGraphicsTextItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QGraphicsTextItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_simulation_started
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsTextItem [as 别名]
def on_simulation_started(self):
for i in range(3):
self.ui.tabWidgetSimulatorSettings.setTabEnabled(i, False)
self.ui.checkBoxCaptureFullRX.setDisabled(True)
self.reset()
self.timer.start(self.update_interval)
self.ui.btnStartStop.setIcon(QIcon.fromTheme("media-playback-stop"))
self.ui.btnStartStop.setText("Stop")
if not self.rx_needed:
return
rx_device = self.simulator.sniffer.rcv_device
for item in self.scene_manager.scene.items():
if isinstance(item, QGraphicsTextItem):
self.scene_manager.scene.removeItem(item)
if hasattr(rx_device.data, "real"):
self.ui.graphicsViewPreview.setEnabled(True)
if self.ui.checkBoxCaptureFullRX.isChecked():
self.scene_manager.plot_data = rx_device.data.real
else:
self.scene_manager.data_array = rx_device.data.real
else:
self.ui.graphicsViewPreview.setEnabled(False)
if self.ui.checkBoxCaptureFullRX.isChecked():
self.scene_manager.plot_data = np.array([], dtype=rx_device.data_type)
else:
self.scene_manager.data_array = np.array([], dtype=rx_device.data_type)
self.scene_manager.scene.addText("Could not generate RX preview.")
示例2: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsTextItem [as 别名]
def __init__(self, model_item: SimulatorMessage, parent=None):
assert isinstance(model_item, SimulatorMessage)
super().__init__(model_item=model_item, parent=parent)
self.setFlag(QGraphicsItem.ItemIsPanel, True)
self.arrow = MessageArrowItem(self)
self.repeat_text = QGraphicsTextItem(self)
self.repeat_text.setFont(self.font)
示例3: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsTextItem [as 别名]
def __init__(self, model_item: SimulatorProtocolLabel, parent=None):
assert isinstance(model_item, SimulatorProtocolLabel)
super().__init__(model_item=model_item, parent=parent)
self.name = QGraphicsTextItem(self)
self.name.setFont(self.font)
示例4: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsTextItem [as 别名]
def __init__(self, model_item: SimulatorRuleCondition, parent=None):
assert isinstance(model_item, SimulatorRuleCondition)
super().__init__(model_item=model_item, parent=parent)
self.number.setFont(self.font_bold)
self.text = QGraphicsTextItem(self)
self.text.setPlainText(self.model_item.type.value)
self.text.setFont(self.font_bold)
self.desc = QGraphicsTextItem(self)
self.desc.setFont(self.font)
示例5: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QGraphicsTextItem [as 别名]
def __init__(self, model_item: Participant, parent=None):
super().__init__(parent)
self.model_item = model_item
self.text = QGraphicsTextItem(self)
self.line = QGraphicsLineItem(self)
self.line.setPen(QPen(Qt.darkGray, 1, Qt.DashLine, Qt.RoundCap, Qt.RoundJoin))
self.refresh()