import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QAction, QVBoxLayout, QTextEdit
from PyQt5.QtGui import QIcon
from PyQt5.QtGui import *
class MyApp(QMainWindow):
def __init__(self):
super().__init__()
self.vbox = QVBoxLayout()
self.initUI()
def initUI(self):
N = QAction('새로 만들기(N)', self)
N.setShortcut('Ctrl+N')
W = QAction('새 창(W)', self)
W.setShortcut('Ctrl+Shift+N')
O = QAction('열기(O)', self)
O.setShortcut('Ctrl+O')
S = QAction('저장(S)', self)
S.setShortcut('Ctrl+S')
A = QAction('다른 이름으로 저장(A)', self)
A.setShortcut('Ctrl+Shift+S')
U = QAction('페이지 설정(U)', self)
U.setShortcut('Ctrl+U')
P = QAction('인쇄(P)', self)
P.setShortcut('Ctrl+P')
X = QAction('끝내기(X)', self)
X.setShortcut('Ctrl+X')
U1 = QAction('실행 취소(U)', self)
U1.setShortcut('Ctrl+Z')
T1 = QAction('잘라내기(T)', self)
T1.setShortcut('Ctrl+X')
C1 = QAction('복사(C)', self)
C1.setShortcut('Ctrl+C')
P1 = QAction('붙여넣기(P)', self)
P1.setShortcut('Ctrl+V')
L1 = QAction('삭제(L)', self)
L1.setShortcut('Del')
S1 = QAction('Bing으로 검색(S)', self)
S1.setShortcut('Ctrl+E')
F1 = QAction('찾기(F)', self)
F1.setShortcut('Ctrl+F')
N1 = QAction('다음 찾기(N)', self)
N1.setShortcut('F3')
V1 = QAction('이전 찾기(V)', self)
V1.setShortcut('Shift+F3')
R1= QAction('바꾸기(R)', self)
R1.setShortcut('Ctrl+H')
G1 = QAction('이동(G)', self)
G1.setShortcut('Ctrl+G')
A1 = QAction('모두 선택(A)', self)
A1.setShortcut('Ctrl+A')
D1 = QAction('시간/날짜(D)', self)
D1.setShortcut('F5')
W2 = QAction('자동 줄바꿈(W)', self)
W2.setShortcut('Ctrl+W')
F2 = QAction('글꼴(F)', self)
F2.setShortcut('Ctrl+F')
I3 = QAction('확대(I)', self)
I3.setShortcut('Ctrl++')
O3 = QAction('축소(O)', self)
O3.setShortcut('Ctrl+-')
R3 = QAction('확대하기/축소하기 기본값 복원', self)
R3.setShortcut('Ctrl+R')
S3 = QAction('상태 표시줄', self)
S3.setShortcut('Ctrl+S')
H4 = QAction('도움말 보기(H)', self)
H4.setShortcut('Ctrl+H')
F4 = QAction('피드백 보내기(F)', self)
F4.setShortcut('Ctrl+F')
A4 = QAction('메모장 정보(A)', self)
A4.setShortcut('Ctrl+A')
self.statusBar()
menubar = self.menuBar()
menubar.setNativeMenuBar(False)
filemenuF = menubar.addMenu('파일(&F)')
filemenuF.addAction(N)
filemenuF.addAction(W)
filemenuF.addAction(O)
filemenuF.addAction(S)
filemenuF.addAction(A)
filemenuF.addAction(U)
filemenuF.addAction(P)
filemenuF.addAction(X)
filemenuE = menubar.addMenu('편집(&E)')
filemenuE.addAction(U1)
filemenuE.addAction(T1)
filemenuE.addAction(C1)
filemenuE.addAction(P1)
filemenuE.addAction(L1)
filemenuE.addAction(S1)
filemenuE.addAction(F1)
filemenuE.addAction(N1)
filemenuE.addAction(V1)
filemenuE.addAction(R1)
filemenuE.addAction(G1)
filemenuE.addAction(A1)
filemenuE.addAction(D1)
filemenuO = menubar.addMenu('서식(&O)')
filemenuO.addAction(W2)
filemenuO.addAction(F2)
filemenuV = menubar.addMenu('보기(&V)')
filemenuV.addAction(I3)
filemenuV.addAction(O3)
filemenuV.addAction(R3)
filemenuV.addAction(S3)
filemenuH = menubar.addMenu('도움말(&H)')
filemenuH.addAction(H4)
filemenuH.addAction(F4)
filemenuH.addAction(A4)
self.vbox.addLayout(menubar)
self.x = QTextEdit()
self.vbox.addWidget(self.x)
self.setLayout(self.vbox)
self.setWindowTitle('Icon')
self.setWindowIcon(QIcon('C:\\Users\\spca\\Desktop\\iicon\\iconnote.png'))
pal = QPalette()
pal.setColor(QPalette.Background, QColor(255, 255, 255))
self.setAutoFillBackground(True)
self.setPalette(pal)
self.setGeometry(300, 300, 300, 200)
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = MyApp()
sys.exit(app.exec_())top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
노트 2022.07.16
노트 2022.07.16
댓글 0개
좋아요
댓글(0)
더 이상 게시물에 대한 댓글 기능이 지원되지 않습니다. 자세한 사항은 사이트 소유자에게 문의하세요.
bottom of page


