当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QFont方法代码示例

本文整理汇总了Python中pyqtgraph.Qt.QtGui.QFont方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QFont方法的具体用法?Python QtGui.QFont怎么用?Python QtGui.QFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyqtgraph.Qt.QtGui的用法示例。


在下文中一共展示了QtGui.QFont方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QFont [as 别名]
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) 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:21,代码来源:widgets.py

示例2: makePI

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QFont [as 别名]
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 
开发者ID:epolestar,项目名称:equant,代码行数:21,代码来源:fundtab.py

示例3: createLabel

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QFont [as 别名]
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) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:15,代码来源:ScatterPlot.py

示例4: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QFont [as 别名]
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) 
开发者ID:traveller59,项目名称:second.pytorch,代码行数:11,代码来源:bbox_plot.py

示例5: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QFont [as 别名]
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)

    # 更新坐标映射表
    # ---------------------------------------------------------------------- 
开发者ID:epolestar,项目名称:equant,代码行数:14,代码来源:fundtab.py

示例6: update_buffer

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QFont [as 别名]
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]) 
开发者ID:P2PSP,项目名称:simulator,代码行数:50,代码来源:play.py


注:本文中的pyqtgraph.Qt.QtGui.QFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。