728x90 pyqt9 PyQt - 테이블 헤더 배경 색 변경 self.table_invest = QtWidgets.QTableWidget(self.tab) self.table_invest.setStyleSheet('QTableWidget{\ncolor:black;}\nQHeaderView::section{background-color: rgb(23,33,43); };') 참고: https://forum.qt.io/topic/87371/how-to-change-qtablewidget-header-color-and-selection-color 2022. 11. 8. PyQt - 리소스 적용하기 [경로] images/ ├─ icon.png main.py resources.qrc [resources.qrc] images/icon.png [리소스 파일 변환하기] pyrcc5 resources.qrc -o icon.py [main.py] import icon ... label=QLabel(Form) label.setPixmap( QPixmap(":/images/icon.png") ) # qrc에서 적은 경로명 label.resize(label.pixmap().width(), label.pixmap().height()) ... 출처: https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=browniz1004&logNo=221373310.. 2022. 5. 31. PyQt - 디렉토리 및 파일 경로 불러오기(QFileDialog) from PyQt5.QtWidgets import * path = QFileDialog.getExistingDirectory() print(path) file = QFileDialog.getOpenFileName() print(file) 출처: https://wikidocs.net/5247 1) QFileDialog 이번 절에서는 PyQt가 제공하는 QFileDigalog 클래스에 대해 알아보겠습니다. QFileDigalog는 그림 16.43과 같이 사용자가 파일이나 디렉터리를 선택할 ... wikidocs.net 2022. 5. 19. PyQt - 스타일시트 레퍼런스 https://doc.qt.io/archives/qt-4.8/stylesheet-reference.html#list-of-properties Qt Style Sheets Reference | Qt 4.8 Qt Style Sheets Reference Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets. The following table lists the Qt widgets that can be customized using style sheets: WidgetHow to St doc.qt.io 출처: https://forum.. 2022. 5. 9. PyQt - 간단하게 토글 스위치 디자인하기 QCheckBox::indicator:unchecked { image: url("switch_off.png"); } QCheckBox::indicator:checked { image: url("switch_on.png"); } 이미지를 이용해서 토글 디자인 출처: https://stackoverflow.com/questions/62363953/how-to-create-toggle-switch-button-in-qt-designer How to create toggle switch button in qt designer? I am trying to create toggle button in qt designer. I refer on internet also but i couldn't find how to .. 2022. 5. 7. PyQt - designer .ui를 .py로 변환하기 pyuic5 -x sub.ui -o sub.py 2022. 5. 7. PyQt - 윈도우창 투명하게 만들기 [완전 투명하게 만들기] Form.setWindowFlags(QtCore.Qt.FramelessWindowHint) Form.setAttribute(QtCore.Qt.WA_TranslucentBackground) Form.setStyleSheet("background:transparent;") [불투명도 설정] Form.setWindowOpacity(0.5) 출처: https://stackoverflow.com/questions/7667552/qt-widget-with-transparent-background Qt Widget with Transparent Background (I'm using PySide, but I think the answer would be the same/similar for .. 2022. 5. 7. PyQt - 트레이(Tray) 만들기 및 메뉴 추가 from PyQt5.QtGui import QIcon trayIcon = QSystemTrayIcon(Form) icon = QIcon("icon.png") trayIcon.setIcon(icon) trayIcon.setToolTip('트레이 아이콘 설명') trayIcon.setVisible(True) trayIcon.show() menu = QMenu() exitAction = menu.addAction('Exit') exitAction.triggered.connect(app.quit) trayIcon.setContextMenu(menu) 참고: https://www.pythonguis.com/tutorials/system-tray-mac-menu-bar-applications-pyqt/ System.. 2022. 5. 7. PyQt - designer 스타일시트 추가하기 원하는 위젯 우클릭하고 styleSheet 바꾸기 클릭 이런식으로 border, :hover 등 다양한 스타일시트를 설정할 수 있음 문법은 CSS와 동일하며 다만 기능은 더 적다. 참고: https://blog.naver.com/PostView.naver?blogId=dhksrl0508&logNo=222344023916&parentCategoryNo=&categoryNo=232&viewDate=&isShowPopularPosts=false&from=postView PyQt StyleSheet로 Visual Studio UI를 만들어보자 마이크로소프트는 UI를 정말 잘 만드는 것 같습니다. 학교 공부로 Visual C++ 실습을 진행하는데, 우연... blog.naver.com 2022. 5. 7. 이전 1 다음 728x90