pyside

    pyqt pyside scrollArea QScrollArea 맨 위로 스크롤 하기

    self.ui.scrollArea.ensureVisible(0, 0) self.scrollArea.ensureVisible(0, 0) scrollArea.ensureVisible(0, 0) # 사용 x=0, y=0

    파이썬 pyqt QComboBox style

    # enabled = False 일 경우 QComboBox:disabled{ background-color: #e0e0e0; border: 2px solid #e0e0e0; } # 기본 style QComboBox{ border: 2px solid #e0e0e0; } # 드롭다운 화살표 style QComboBox::down-arrow{ image: url(:/icon/icon/down-arrow.png); } # 드롭다운 화살표 버튼 style QComboBox::drop-down:button{ background-color: transparent; }

    파이썬 pyqt pyside qcheckbox 테두리 style

    # 일반 체크박스 QCheckBox{ margin-bottom: 5px; } # 체크박스 자체 QCheckBox:indicator { border: 2px solid #e0e0e0; background: none;padding-bottom: 50px; } # 체크박스 체크 후 QCheckBox:indicator:checked { background-color: black; }

    pyqt QLabel pen, brush로 테두리 그리기

    label = OutlinedLabel(self.test.format("0"), alignment=Qt.AlignCenter, textFormat=Qt.RichText) label.setPen(QColor(255, 249, 177)) label.setBrush(QColor(171, 171, 173)) label.setStyleSheet("QLabel{background-color: #dbdbdb; border: solid; font-family: 나눔스퀘어; font-size: 32pt; font-weight: bold;}" "QLabel:hover{background-color: #2d2801;}") self.ui.horizontalLayout_2.addWidget(label) class Outline..

    pyside, pyqt QGraphicsDropShadowEffect 로 그림자 효과줄 때

    구글링을 통해 삽질 30~40분 label text에 하이라이트 같은 효과 처럼 주고 싶었는데, css는 않먹힘. 구글링을 해보니 GraphicsDropShadowEffect()로 그림자 효과를 줄 수 있다고 함. shadow = QGraphicsDropShadowEffect() shadow.setBlurRadius(0) shadow.setColor(QColor(255, 249, 177)) shadow.setOffset(1, 1) self.ui.label.setGraphicsEffect(shadow) 근데 아무리해도 적용x shadow = QGraphicsDropShadowEffect(self) shadow.setBlurRadius(0) shadow.setColor(QColor(255, 249, 177)..

    Pyqt Pyside 에서 show, hide 인지 확인하는법

    label.show() print(label.isVisible()) # True label.hide() print(label.isVisible()) # False isVisible()로 확인하면 된다.

    pyside6 에서 QUiLoader 로 ui 불러와서 사용할 때 이벤트 동작 안될 때

    from PySide6.QtUiTools import QUiLoader class Dialog(Dialog): def __init__(self): super(Dialog, self).__init__() loader = QUiLoader() ui = loader.load('ui/dialog.ui') # 로더로 ui 를 불러온다. ui.installEventFilter(self) # 이벤트 필터를 self 를 사용하여 해당 클래스에 있는 이벤트 필터로 재정의 def eventFilter(self, o, e): if e.type() == QEvent.Type.MouseButtonPress: # 해당이벤트에 대해 동작 print("click") return True return False # 다른 이벤트의 대해..