Пример #1
0
    def __init__(self, parent=None):
        super(MyLangEditor, self).__init__(parent=parent)
        # 默认字体
        self.font = QtGui.QFont("Courier", 16)

        # 词法解析器
        self.lexer = Lexer(parent=self)
        self.lexer.setFont(self.font)
        self.setLexer(self.lexer)

        # 标志内容是否发生改变
        self.text_change = False

        self.init_ui()
Пример #2
0
from vnpy.trader.ui import QtGui


WHITE_COLOR = (255, 255, 255)
BLACK_COLOR = (0, 0, 0)
GREY_COLOR = (100, 100, 100)

UP_COLOR = (255, 75, 75)
DOWN_COLOR = (0, 255, 255)
CURSOR_COLOR = (255, 245, 162)

PEN_WIDTH = 1
BAR_WIDTH = 0.3

AXIS_WIDTH = 0.8
NORMAL_FONT = QtGui.QFont("Arial", 9)


def to_int(value: float) -> int:
    """"""
    return int(round(value, 0))