Python pyqtgraph.Qt.QtGui.QFont() Examples

The following are 7 code examples of pyqtgraph.Qt.QtGui.QFont(). 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 also want to check out all available functions/classes of the module pyqtgraph.Qt.QtGui , or try the search function .
Example #1
Source File: widgets.py    From pyFlightAnalysis with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setFixedSize(QtCore.QSize(600, 400))
        w = QtGui.QWidget()
        self.setCentralWidget(w)
        vlayout = QtGui.QVBoxLayout()
        w.setLayout(vlayout)
        self.htmlView = QtWidgets.QTextBrowser(self)
        font = QtGui.QFont()
        font.setFamily('Arial')
        self.htmlView.setReadOnly(True)
        self.htmlView.setFont(font)
        self.htmlView.setOpenExternalLinks(True)
        self.htmlView.setObjectName('Help information')
        html_help_path = get_source_name('docs/help.html')
        ret = self.htmlView.setSource(QtCore.QUrl(html_help_path))
        print('load result:', ret)
#         self.htmlView.append(ret)
        vlayout.addWidget(self.htmlView) 
Example #2
Source File: fundtab.py    From equant with GNU General Public License v2.0 6 votes vote down vote up
def makePI(self, name):
        """生成PlotItem对象"""
        vb = CustomViewBox(self)
        plotItem = pg.PlotItem(viewBox=vb, name=name, axisItems={'bottom': self.axisTime})
        plotItem.setMenuEnabled(False)
        # 仅绘制ViewBox可见范围内的点
        plotItem.setClipToView(True)
        plotItem.hideAxis('left')
        plotItem.showAxis('right')
        # 设置采样模式
        plotItem.setDownsampling(mode='peak')
        plotItem.setRange(xRange=(0, 1), yRange=(0, 1))
        plotItem.getAxis('right').setWidth(70)
        plotItem.getAxis('right').setStyle(tickFont=QtGui.QFont('Roman times', 10, QtGui.QFont.Bold))
        plotItem.getAxis('right').setPen(color=(255, 255, 255, 255), width=0.8)
        plotItem.showGrid(True, True)
        plotItem.hideButtons()

        return plotItem 
Example #3
Source File: ScatterPlot.py    From tf-pose with Apache License 2.0 5 votes vote down vote up
def createLabel(label, angle):
    symbol = QtGui.QPainterPath()
    #symbol.addText(0, 0, QFont("San Serif", 10), label)
    f = QtGui.QFont()
    f.setPointSize(10)
    symbol.addText(0, 0, f, label)
    br = symbol.boundingRect()
    scale = min(1. / br.width(), 1. / br.height())
    tr = QtGui.QTransform()
    tr.scale(scale, scale)
    tr.rotate(angle)
    tr.translate(-br.x() - br.width()/2., -br.y() - br.height()/2.)
    return TextSymbol(label, tr.map(symbol), 0.1 / scale) 
Example #4
Source File: bbox_plot.py    From second.pytorch with MIT License 5 votes vote down vote up
def __init__(self, pos=None, text=None, color=None, font=QtGui.QFont()):
        GLGraphicsItem.__init__(self)
        self.color = color
        if color is None:
            self.color = QtCore.Qt.white
        self.text = text
        self.pos = pos
        self.font = font
        self.font.setPointSizeF(20) 
Example #5
Source File: fundtab.py    From equant with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, xdict, *args, **kwargs):
        pg.AxisItem.__init__(self, *args, **kwargs)
        self.minVal = 0
        self.maxVal = 0
        self.xdict = xdict
        self.x_values = np.asarray(xdict.keys())
        self.x_strings = xdict.values()
        self.setPen(color=(255, 255, 255, 255), width=0.8)
        self.setStyle(tickFont=QtGui.QFont("Roman times", 10, QtGui.QFont.Bold), autoExpandTextSpace=True)

    # 更新坐标映射表
    # ---------------------------------------------------------------------- 
Example #6
Source File: bbox_plot.py    From nutonomy_pointpillars with MIT License 5 votes vote down vote up
def __init__(self, pos=None, text=None, color=None, font=QtGui.QFont()):
        GLGraphicsItem.__init__(self)
        self.color = color
        if color is None:
            self.color = QtCore.Qt.white
        self.text = text
        self.pos = pos
        self.font = font
        self.font.setPointSizeF(20) 
Example #7
Source File: play.py    From simulator with GNU General Public License v3.0 4 votes vote down vote up
def update_buffer(self, node, senders_shot):

        if self.buffer_order.get(node) is None:
            self.buffer_order[node] = self.buffer_index
            self.buffer_labels.append(node)
            text = pg.TextItem()
            text.setText("P"+str(self.buffer_index))
            text.setColor(self.QColors[self.buffer_index])
            text.setFont(QtGui.QFont("arial", 16))
            text.setPos(self.buffer_index, 1)
            self.p4.addItem(text)   # Add label for newly added peer
            self.buffer_index += 1

        senders_list = senders_shot.split(":")
        buffer_order_node = self.buffer_order[node]
        self.OutData[buffer_order_node].clear()

        for pos, sender in enumerate(senders_list):
            self.clear_all((buffer_order_node, pos))  # Clear previous color point, to avoid overapping
            if sender != "":
                ix = self.buffer_order[sender]
                self.Data[ix].add((buffer_order_node, pos))
            else:
                self.OutData[buffer_order_node].add((buffer_order_node, pos))

        ######
        xIn = []
        yIn = []
        for i in range(self.total_peers):
            tempData = list(self.Data[i])
            xIn.append([])
            yIn.append([])
            for pt in tempData:
                xIn[i].append(pt[0])
                yIn[i].append(pt[1])

        xOut = []
        yOut = []
        for i in range(self.total_peers):
            tempData = list(self.OutData[i])
            for pt in tempData:
                xOut.append(pt[0])
                yOut.append(pt[1])
        ######

        self.lineOUT.setData(x=xOut, y=yOut)
        for ix in range(self.total_peers):
            self.lineIN[ix].setData(x=xIn[ix], y=yIn[ix])