Python PyQt5.QtWidgets.QGraphicsTextItem() Examples

The following are 5 code examples for showing how to use PyQt5.QtWidgets.QGraphicsTextItem(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: urh   Author: jopohl   File: SimulatorDialog.py    License: GNU General Public License v3.0 5 votes vote down vote up
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.") 
Example 2
Project: urh   Author: jopohl   File: MessageItem.py    License: GNU General Public License v3.0 5 votes vote down vote up
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) 
Example 3
Project: urh   Author: jopohl   File: LabelItem.py    License: GNU General Public License v3.0 5 votes vote down vote up
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) 
Example 4
Project: urh   Author: jopohl   File: RuleItem.py    License: GNU General Public License v3.0 5 votes vote down vote up
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) 
Example 5
Project: urh   Author: jopohl   File: ParticipantItem.py    License: GNU General Public License v3.0 5 votes vote down vote up
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()