BATS.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:BATS-Bayesian-Adaptive-Trial-Simulator 作者: ContaTP 项目源码 文件源码
def __init__(self, parent = None, root_name = "", currentfile = ""):

        QtWidgets.QFrame.__init__(self, parent)
        self.parent = parent
        self.setMinimumHeight(400)
        self.setMaximumHeight(400)
        self.plot_font = QtGui.QFont('Bitter', 11)
        self.setStyleSheet("QFrame{border: 2px solid #e9f0f5; border-radius:5px; border-left:4px solid #baddef;} QFrame:hover{border: 2px solid #faaba4; border-left:4px solid #fa7064; color: #55b1f2; }")
        self.plot_layout = QtWidgets.QVBoxLayout()
        self.plot_title_layout = QtWidgets.QHBoxLayout()
        self.plot_title = QtWidgets.QLabel()
        # Read only the name
        self.plot_title.setText(root_name)
        self.plot_title.setFont(self.plot_font)
        self.plot_title.setStyleSheet("QLabel {border: none;}")
        self.plot_title.setWordWrap(True)
        self.plot_title_layout.insertStretch(0, 2)
        self.plot_title_layout.addWidget(self.plot_title, 6)
        self.plot_title_layout.insertStretch(2, 2)
        self.plot_graph = GraphLabel()
        self.plot_graph.setMargin(0)
        self.plot_graph.setStyleSheet("QLabel{border: none;}")
        self.currentdir = currentfile.rsplit("/", 1)[0]
        self.currentpixmap = QtGui.QPixmap(currentfile).scaled(QtCore.QSize(300, 300))
        self.plot_graph.setPixmap(self.currentpixmap)
        self.plot_graph.setAlignment(QtCore.Qt.AlignCenter)
        self.plot_layout.addWidget(self.plot_graph)
        self.plot_layout.addLayout(self.plot_title_layout)
        self.plot_layout.setContentsMargins(5, 5, 5, 10)
        self.plot_layout.setSpacing(0)
        self.setLayout(self.plot_layout)

        self.root_name = root_name
        # Click event
        self.plot_graph.clicked.connect(self.openAllGraph)
        # Display
        # self.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号