本文整理匯總了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()