本文整理汇总了Python中pyqtgraph.PlotWidget.setToolTip方法的典型用法代码示例。如果您正苦于以下问题:Python PlotWidget.setToolTip方法的具体用法?Python PlotWidget.setToolTip怎么用?Python PlotWidget.setToolTip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.PlotWidget
的用法示例。
在下文中一共展示了PlotWidget.setToolTip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Ui_MainWindow
# 需要导入模块: from pyqtgraph import PlotWidget [as 别名]
# 或者: from pyqtgraph.PlotWidget import setToolTip [as 别名]
#.........这里部分代码省略.........
self.resample_check_box.setObjectName(_fromUtf8("resample_check_box"))
self.horizontalLayout_6.addWidget(self.resample_check_box)
self.resample_factor = QtGui.QDoubleSpinBox(self.centralwidget)
self.resample_factor.setEnabled(False)
self.resample_factor.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.resample_factor.setMinimum(1.0)
self.resample_factor.setProperty("value", 10.0)
self.resample_factor.setObjectName(_fromUtf8("resample_factor"))
self.horizontalLayout_6.addWidget(self.resample_factor)
self.sr_ref_label = QtGui.QLabel(self.centralwidget)
self.sr_ref_label.setEnabled(False)
font = QtGui.QFont()
font.setPointSize(9)
self.sr_ref_label.setFont(font)
self.sr_ref_label.setObjectName(_fromUtf8("sr_ref_label"))
self.horizontalLayout_6.addWidget(self.sr_ref_label)
self.verticalLayout_5.addLayout(self.horizontalLayout_6)
self.line = QtGui.QFrame(self.centralwidget)
self.line.setFrameShape(QtGui.QFrame.HLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName(_fromUtf8("line"))
self.verticalLayout_5.addWidget(self.line)
self.horizontalLayout_8 = QtGui.QHBoxLayout()
self.horizontalLayout_8.setObjectName(_fromUtf8("horizontalLayout_8"))
self.verticalLayout_2 = QtGui.QVBoxLayout()
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.z_graph = PlotWidget(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.z_graph.sizePolicy().hasHeightForWidth())
self.z_graph.setSizePolicy(sizePolicy)
self.z_graph.setMouseTracking(False)
self.z_graph.setToolTip(_fromUtf8(""))
self.z_graph.setObjectName(_fromUtf8("z_graph"))
self.verticalLayout_2.addWidget(self.z_graph)
self.n_graph = PlotWidget(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.n_graph.sizePolicy().hasHeightForWidth())
self.n_graph.setSizePolicy(sizePolicy)
self.n_graph.setToolTip(_fromUtf8(""))
self.n_graph.setObjectName(_fromUtf8("n_graph"))
self.verticalLayout_2.addWidget(self.n_graph)
self.e_graph = PlotWidget(self.centralwidget)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.e_graph.sizePolicy().hasHeightForWidth())
self.e_graph.setSizePolicy(sizePolicy)
self.e_graph.setObjectName(_fromUtf8("e_graph"))
self.verticalLayout_2.addWidget(self.e_graph)
self.horizontalLayout_8.addLayout(self.verticalLayout_2)
self.line_2 = QtGui.QFrame(self.centralwidget)
self.line_2.setFrameShape(QtGui.QFrame.VLine)
self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
self.line_2.setObjectName(_fromUtf8("line_2"))
self.horizontalLayout_8.addWidget(self.line_2)
self.verticalLayout_3 = QtGui.QVBoxLayout()
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.info_text = QtGui.QTextBrowser(self.centralwidget)
self.info_text.setMinimumSize(QtCore.QSize(470, 100))
self.info_text.setMaximumSize(QtCore.QSize(470, 600))
font = QtGui.QFont()
font.setFamily(_fromUtf8("Monospace"))
示例2: BusMonitorWidget
# 需要导入模块: from pyqtgraph import PlotWidget [as 别名]
# 或者: from pyqtgraph.PlotWidget import setToolTip [as 别名]
class BusMonitorWidget(QGroupBox):
DEFAULT_PLOT_X_RANGE = 120
BUS_LOAD_PLOT_MAX_SAMPLES = 5000
def __init__(self, parent, node, iface_name):
super(BusMonitorWidget, self).__init__(parent)
self.setTitle('CAN bus activity (%s)' % iface_name.split(os.path.sep)[-1])
self._node = node
self._hook_handle = self._node.can_driver.add_io_hook(self._frame_hook)
self._columns = [
BasicTable.Column('Dir',
lambda e: (e[0].upper()),
searchable=False),
BasicTable.Column('Local Time', TimestampRenderer(), searchable=False),
BasicTable.Column('CAN ID',
lambda e: (('%0*X' % (8 if e[1].extended else 3, e[1].id)).rjust(8),
colorize_can_id(e[1]))),
BasicTable.Column('Data Hex',
lambda e: (' '.join(['%02X' % x for x in e[1].data]).ljust(3 * e[1].MAX_DATA_LENGTH),
colorize_transfer_id(e))),
BasicTable.Column('Data ASCII',
lambda e: (''.join([(chr(x) if 32 <= x <= 126 else '.') for x in e[1].data]),
colorize_transfer_id(e))),
BasicTable.Column('Src',
lambda e: render_node_id_with_color(e[1], 'src')),
BasicTable.Column('Dst',
lambda e: render_node_id_with_color(e[1], 'dst')),
BasicTable.Column('Data Type',
lambda e: render_data_type_with_color(e[1]),
resize_mode=QHeaderView.Stretch),
]
self._log_widget = RealtimeLogWidget(self, columns=self._columns, font=get_monospace_font(),
post_redraw_hook=self._redraw_hook)
self._log_widget.on_selection_changed = self._update_measurement_display
def flip_row_mark(row, col):
if col == 0:
item = self._log_widget.table.item(row, col)
if item.icon().isNull():
item.setIcon(get_icon('circle'))
flash(self, 'Row %d was marked, click again to unmark', row, duration=3)
else:
item.setIcon(QIcon())
self._log_widget.table.cellPressed.connect(flip_row_mark)
self._stat_update_timer = QTimer(self)
self._stat_update_timer.setSingleShot(False)
self._stat_update_timer.timeout.connect(self._update_stat)
self._stat_update_timer.start(500)
self._traffic_stat = TrafficStatCounter()
self._stat_frames_tx = QLabel('N/A', self)
self._stat_frames_rx = QLabel('N/A', self)
self._stat_traffic = QLabel('N/A', self)
self._load_plot = PlotWidget(background=(0, 0, 0))
self._load_plot.setRange(xRange=(0, self.DEFAULT_PLOT_X_RANGE), padding=0)
self._load_plot.setMaximumHeight(150)
self._load_plot.setMinimumHeight(100)
self._load_plot.setMinimumWidth(100)
self._load_plot.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
self._load_plot.showGrid(x=True, y=True, alpha=0.4)
self._load_plot.setToolTip('Frames per second')
self._load_plot.getPlotItem().getViewBox().setMouseEnabled(x=True, y=False)
self._load_plot.enableAutoRange()
self._bus_load_plot = self._load_plot.plot(name='Frames per second', pen=mkPen(QColor(Qt.lightGray), width=1))
self._bus_load_samples = [], []
self._started_at_mono = time.monotonic()
layout = QVBoxLayout(self)
layout.addWidget(self._log_widget, 1)
stat_vars_layout = QGridLayout(self)
stat_layout_next_row = 0
def add_stat_row(label, value):
nonlocal stat_layout_next_row
stat_vars_layout.addWidget(QLabel(label, self), stat_layout_next_row, 0)
stat_vars_layout.addWidget(value, stat_layout_next_row, 1)
value.setMinimumWidth(75)
stat_layout_next_row += 1
add_stat_row('Frames transmitted:', self._stat_frames_tx)
add_stat_row('Frames received:', self._stat_frames_rx)
add_stat_row('Frames per second:', self._stat_traffic)
stat_vars_layout.setRowStretch(stat_layout_next_row, 1)
stat_layout = QHBoxLayout(self)
stat_layout.addLayout(stat_vars_layout)
stat_layout.addWidget(self._load_plot, 1)
layout.addLayout(stat_layout, 0)
self.setLayout(layout)
#.........这里部分代码省略.........
示例3: Ui_facewindow
# 需要导入模块: from pyqtgraph import PlotWidget [as 别名]
# 或者: from pyqtgraph.PlotWidget import setToolTip [as 别名]
class Ui_facewindow(object):
def setupUi(self, facewindow):
facewindow.setObjectName(_fromUtf8("facewindow"))
facewindow.resize(1241, 749)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(_fromUtf8("../smfsmanager/D_mica.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
facewindow.setWindowIcon(icon)
self.centralwidget = QtGui.QWidget(facewindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.gridLayout = QtGui.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.grafo = PlotWidget(self.centralwidget)
self.grafo.setToolTip(_fromUtf8(""))
self.grafo.setStatusTip(_fromUtf8(""))
self.grafo.setWhatsThis(_fromUtf8(""))
self.grafo.setObjectName(_fromUtf8("grafo"))
self.gridLayout.addWidget(self.grafo, 0, 0, 1, 2)
self.slide1 = QtGui.QScrollBar(self.centralwidget)
self.slide1.setEnabled(True)
self.slide1.setMinimum(1)
self.slide1.setMaximum(1)
self.slide1.setTracking(False)
self.slide1.setOrientation(QtCore.Qt.Vertical)
self.slide1.setObjectName(_fromUtf8("slide1"))
self.gridLayout.addWidget(self.slide1, 0, 2, 1, 1)
self.griglia = QtGui.QGraphicsView(self.centralwidget)
self.griglia.setEnabled(True)
self.griglia.setObjectName(_fromUtf8("griglia"))
self.gridLayout.addWidget(self.griglia, 0, 3, 1, 1)
self.slide2 = QtGui.QDial(self.centralwidget)
self.slide2.setEnabled(True)
self.slide2.setMinimum(1)
self.slide2.setMaximum(1)
self.slide2.setTracking(True)
self.slide2.setObjectName(_fromUtf8("slide2"))
self.gridLayout.addWidget(self.slide2, 1, 3, 1, 1)
self.logTxt = QtGui.QTextEdit(self.centralwidget)
self.logTxt.setEnabled(True)
self.logTxt.setObjectName(_fromUtf8("logTxt"))
self.gridLayout.addWidget(self.logTxt, 2, 0, 1, 2)
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.chgStatBtn = QtGui.QPushButton(self.centralwidget)
self.chgStatBtn.setEnabled(False)
self.chgStatBtn.setObjectName(_fromUtf8("chgStatBtn"))
self.verticalLayout.addWidget(self.chgStatBtn)
self.removeBtn = QtGui.QPushButton(self.centralwidget)
self.removeBtn.setEnabled(False)
self.removeBtn.setObjectName(_fromUtf8("removeBtn"))
self.verticalLayout.addWidget(self.removeBtn)
self.removeBOBtn = QtGui.QPushButton(self.centralwidget)
self.removeBOBtn.setEnabled(False)
self.removeBOBtn.setObjectName(_fromUtf8("removeBOBtn"))
self.verticalLayout.addWidget(self.removeBOBtn)
self.gridLayout.addLayout(self.verticalLayout, 2, 3, 1, 1)
self.gridLayout_3 = QtGui.QGridLayout()
self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
self.line_6 = QtGui.QFrame(self.centralwidget)
self.line_6.setLineWidth(6)
self.line_6.setFrameShape(QtGui.QFrame.VLine)
self.line_6.setFrameShadow(QtGui.QFrame.Sunken)
self.line_6.setObjectName(_fromUtf8("line_6"))
self.gridLayout_3.addWidget(self.line_6, 0, 15, 3, 1)
self.nmVNumDbl = QtGui.QDoubleSpinBox(self.centralwidget)
self.nmVNumDbl.setEnabled(False)
self.nmVNumDbl.setMaximum(1000.0)
self.nmVNumDbl.setObjectName(_fromUtf8("nmVNumDbl"))
self.gridLayout_3.addWidget(self.nmVNumDbl, 1, 7, 1, 1)
self.line_3 = QtGui.QFrame(self.centralwidget)
self.line_3.setLineWidth(6)
self.line_3.setFrameShape(QtGui.QFrame.VLine)
self.line_3.setFrameShadow(QtGui.QFrame.Sunken)
self.line_3.setObjectName(_fromUtf8("line_3"))
self.gridLayout_3.addWidget(self.line_3, 0, 5, 3, 1)
self.kNumDbl = QtGui.QDoubleSpinBox(self.centralwidget)
self.kNumDbl.setEnabled(False)
self.kNumDbl.setMaximum(1000.0)
self.kNumDbl.setObjectName(_fromUtf8("kNumDbl"))
self.gridLayout_3.addWidget(self.kNumDbl, 0, 7, 1, 1)
self.speedNumDbl = QtGui.QDoubleSpinBox(self.centralwidget)
self.speedNumDbl.setEnabled(False)
self.speedNumDbl.setMaximum(1000.0)
self.speedNumDbl.setObjectName(_fromUtf8("speedNumDbl"))
self.gridLayout_3.addWidget(self.speedNumDbl, 2, 7, 1, 1)
self.bAddDir = QtGui.QPushButton(self.centralwidget)
self.bAddDir.setObjectName(_fromUtf8("bAddDir"))
self.gridLayout_3.addWidget(self.bAddDir, 0, 0, 1, 1)
self.bAddFiles = QtGui.QPushButton(self.centralwidget)
self.bAddFiles.setObjectName(_fromUtf8("bAddFiles"))
self.gridLayout_3.addWidget(self.bAddFiles, 1, 0, 1, 1)
self.convr9Btn = QtGui.QPushButton(self.centralwidget)
self.convr9Btn.setObjectName(_fromUtf8("convr9Btn"))
self.gridLayout_3.addWidget(self.convr9Btn, 2, 0, 1, 1)
self.label_4 = QtGui.QLabel(self.centralwidget)
self.label_4.setObjectName(_fromUtf8("label_4"))
self.gridLayout_3.addWidget(self.label_4, 0, 6, 1, 1)
self.label = QtGui.QLabel(self.centralwidget)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout_3.addWidget(self.label, 0, 1, 1, 2)
self.label_2 = QtGui.QLabel(self.centralwidget)
#.........这里部分代码省略.........