Esempio n. 1
0
def _create_vertical_line():
    vertical_line = QFrame()
    vertical_line.setFixedWidth(20)
    vertical_line.setFrameShape(QFrame.VLine)
    vertical_line.setFrameShadow(QFrame.Sunken)
    vertical_line.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
    vertical_line.setMinimumHeight(300)
    return vertical_line
Esempio n. 2
0
    def _init_widgets(self):
        layout = QHBoxLayout()
        frame = QFrame()
        frame.setFixedWidth(30)
        frame.setFixedHeight(15)

        def update_color(**kwargs):  # pylint:disable=unused-argument
            r, g, b, a = self.color.getRgb()
            frame.setStyleSheet(f"background-color: rgba({r},{g},{b},{a});")

        update_color()
        self.color.am_subscribe(update_color)

        text = QLabel(self.label)

        layout.addWidget(frame)
        layout.addWidget(text)
        self.setLayout(layout)