Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- tensorflow
- port
- GIT
- MySQL
- MS-SQL
- urllib
- 유니티
- python
- 라즈베리파이
- 맛집
- Linux
- javascript
- ASP
- PyQt5
- swift
- pandas
- IOS
- 함수
- node.js
- mssql
- 다이어트
- PER
- PyQt
- sqlite
- Unity
- 날짜
- flutter
- Excel
- 리눅스
- ubuntu
Archives
아미(아름다운미소)
PyQt5 메뉴바(QAction 사용) 본문
PyQt5 , QAction 사용하여 menubar 만들기
#-*- coding: utf-8 -*- ''' Created on 2018. 11. 29. @author: bhm ''' from PyQt5.QtWidgets import QMainWindow, QAction, qApp, QApplication from PyQt5.QtGui import QIcon class Example(QMainWindow): def __init__(self): super().__init__() exit_action = QAction(QIcon('exit.png'), "&Exit", self) # exit_action = QAction('&Exit', self) exit_action.setShortcut('Ctrl+Q') exit_action.setStatusTip('Exit application') exit_action.triggered.connect(qApp.quit) self.statusBar() menubar = self.menuBar() fielmenu = menubar.addMenu('&File') fielmenu.addAction(exit_action) self.setGeometry(300, 300, 300, 200) self.setWindowTitle('Menubar') self.show() if __name__ == '__main__': import sys app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())
'랭귀지 > python' 카테고리의 다른 글
[pyqt5]stylesheet를 사용하지 않고 색상을 변경 (0) | 2018.12.02 |
---|---|
[python] subprocess 모듈을 이용한 명령어 실행 (0) | 2018.12.01 |
python 문자열에서 숫자만 제거 (0) | 2018.11.27 |
Python PyQt5 combobox 예제 (0) | 2018.11.26 |
python 리스트 슬라이싱 (0) | 2018.11.25 |
Comments