Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
Python PyQt5 submenu 본문
Python PyQt5 submenu
# -*- coding: utf-8 -*- import sys from PyQt5.QtWidgets import QMainWindow, QAction, QMenu, QApplication class Example(QMainWindow): def __init__(self): super().__init__() self.initUI() def initUI(self): menubar = self.menuBar() fileMenu = menubar.addMenu('파일') impMenu = QMenu('열기', self) impAct = QAction('서브메뉴열기', self) impMenu.addAction(impAct) newAct = QAction('새파일', self) fileMenu.addAction(newAct) fileMenu.addMenu(impMenu) self.setGeometry(300, 300, 300, 200) self.setWindowTitle('서브메뉴') self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())
'랭귀지 > python' 카테고리의 다른 글
Python PyQt5 click action on Qwidget (0) | 2018.12.13 |
---|---|
Python PyQt5 QInputDialog 다이얼로그 팝업창 띄우기 (0) | 2018.12.12 |
python CSV 파일 쓰기 (0) | 2018.12.09 |
PyQt5 : QHeaderView의 헤더를 클릭하면 QTableView를 정렬하는 방법 (0) | 2018.12.08 |
python 서버 시간 확인 (0) | 2018.12.05 |
Comments