diff --git a/crash/crash - 00d832c5 [ 1 ] [test.txt].dump b/crash/crash - 00d832c5 [ 1 ] [test.txt].dump deleted file mode 100644 index 1da7023..0000000 --- a/crash/crash - 00d832c5 [ 1 ] [test.txt].dump +++ /dev/null @@ -1,8 +0,0 @@ -(dp0 -I112 -S'41414141' -p1 -sI67 -S'414141' -p2 -s. \ No newline at end of file diff --git a/crash/crash - 00d832c5 [ 1 ] [test.txt].txt b/crash/crash - 00d832c5 [ 1 ] [test.txt].txt deleted file mode 100644 index df1c604..0000000 --- a/crash/crash - 00d832c5 [ 1 ] [test.txt].txt +++ /dev/null @@ -1 +0,0 @@ -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAͺͺͺAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA \ No newline at end of file diff --git a/hashDB.txt b/hashDB.txt deleted file mode 100644 index e5f28c9..0000000 --- a/hashDB.txt +++ /dev/null @@ -1 +0,0 @@ -AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEIP = 00d832c5 & hash = 84260117870d0ce63849b995a0992a9e & exe_path = C:\Program Files (x86)\3DP Chip Lite\3DP_Chip.exe & ext = .txt diff --git a/examples/test.txt b/seed/test.txt similarity index 100% rename from examples/test.txt rename to seed/test.txt diff --git a/examples/test2.txt b/seed/test2.txt similarity index 100% rename from examples/test2.txt rename to seed/test2.txt diff --git a/examples/test3.txt b/seed/test3.txt similarity index 100% rename from examples/test3.txt rename to seed/test3.txt diff --git a/src/.esp.log b/src/.esp.log deleted file mode 100644 index 79b00ac..0000000 --- a/src/.esp.log +++ /dev/null @@ -1,2 +0,0 @@ -ESP: 0019ff28 ( 1703720) -> 2@@P ;@r7@8@@t ;@r7l)Cu ;CuuCw ;h` ;@aDwC N/A - EBX: 003b2000 ( 3874816) -> @]Owx(@[Owpv0]OwP(pm @HOw3OwaJ? (heap) - ECX: 3772be1e ( 930266654) -> N/A - EDX: 00401000 ( 4198400) -> N/A - EDI: 00401000 ( 4198400) -> N/A - ESI: 00401000 ( 4198400) -> N/A - EBP: 00d80ef4 ( 14159604) -> N/A - ESP: 0019ff28 ( 1703720) -> 2@@P ;@r7@8@@t ;@r7l)Cu ;CuuCw ;h` ;@aDwC DwC N/A - +08: 00401000 ( 4198400) -> N/A - +0c: 00401000 ( 4198400) -> N/A - +10: 00d80ef4 ( 14159604) -> N/A - +14: 0019ff50 ( 1703760) -> 8@@t ;@r7l)Cu ;CuuCw ;h` ;@aDwC 00d832d3: push ebp - 0019ffe4 -> 77449990: mov edi,edi - ffffffff -> 77457330: nop - diff --git a/src/event_h.py b/src/event_h.py deleted file mode 100644 index 8dc39ec..0000000 --- a/src/event_h.py +++ /dev/null @@ -1,47 +0,0 @@ -from PyQt4.QtGui import * -import sys -import sub_ -import main_ - -class mainDialog(QDialog, main_.Ui_Dialog): - def __init__(self): - QDialog.__init__(self) - self.setupUi(self) - - self.programPath = '' - self.samplePath = '' - - self.btn_main_1.clicked.connect(self.openProgramPath) - self.btn_main_2.clicked.connect(self.openSamplePath) - self.btn_main_3.clicked.connect(self.enterData) - - # program path button - def openProgramPath(self): - fname = QFileDialog.getOpenFileName(self, 'Open file', '*') - self.programPath = fname - self.edit_main_1.setText(fname) - - # sample path button - def openSamplePath(self): - # sample path - fname = QFileDialog.getExistingDirectory(self, 'Open file') - self.samplePath = fname - self.edit_main_2.setText(fname) - - # next stacked - def enterData(self): - # translation sub layout - print("Loading") - # fuzzing class (file_fuzzer) - self.stacked.setCurrentIndex(1) - # self.fuzzer = fuzz_hash.file_fuzzer(str(self.programPath), str(self.samplePath)) - # self.fuzzer.fuzz() - -''' -if __name__ == "__main__": - app = QApplication(sys.argv) - dlg = mainDialog() - dlg.show() - app.exec_() -''' - diff --git a/src/img/fuzz-ico.ico b/src/img/fuzz-ico.ico new file mode 100644 index 0000000..7056359 Binary files /dev/null and b/src/img/fuzz-ico.ico differ diff --git a/src/img/fuzz-ico.png b/src/img/fuzz-ico.png new file mode 100644 index 0000000..2301bc0 Binary files /dev/null and b/src/img/fuzz-ico.png differ diff --git a/src/fuzz_hash.py b/src/main.py similarity index 100% rename from src/fuzz_hash.py rename to src/main.py diff --git a/src/mutate.txt b/src/mutate.txt deleted file mode 100644 index 591d38e..0000000 --- a/src/mutate.txt +++ /dev/null @@ -1 +0,0 @@ -{18432: '8591', 14851: 'e2', 11269: '91e285b8', 1542: 'abe288aa', 3079: 'e288b3', 3592: 'e2', 25609: '8281', 17151: '85b8e285', 8206: 'e285b0e2', 23055: 'e2', 14355: 'bde28594', 19476: '88aa', 20033: '90e282', 25111: 'ade2', 11288: 'e288b6', 27311: 'e2', 10269: '88b6', 8222: '88', 9761: '90e2', 10274: 'c2', 26659: 'bde285', 23077: '90e2', 4647: 'e288aae2', 17448: 'ade288', 28203: 'ba', 25644: '8590e2', 19503: '87e28281', 20528: 'e288ab', 4146: 'e285b8e2', 22025: 'e28287e2', 6200: '88ba', 571: 'c2', 12042: '90e2', 6206: '94e285', 23616: 'b0e2', 24129: '88', 26180: '85b8', 6680: '88aa', 14937: '8594e285', 10826: 'b3e2', 6731: 'b6e288', 1100: '88b3e288', 2641: '91e285b8', 3666: 'e288', 24894: '91e285b8', 19540: '8590', 28245: 'e2', 25686: '94e28590', 8101: 'c2bd', 19549: '8281', 22622: 'abe288aa', 17061: '87e282', 7265: 'e288', 17734: 'e2', 293: '85b8', 5223: '88ade288', 26215: '8281e285', 12396: '88aae288', 13851: '88ade2', 19568: 'b3e288b6', 6258: '8287e282', 9331: 'abe288ad', 23230: 'e2', 15478: '81e285', 23088: '8591e285', 12926: 'e288', 8699: 'e28591e2', 17740: 'e288ab', 13248: 'e2', 18563: 'e2', 1161: '90e282', 17034: '88abe2', 5259: 'b0e288ab', 7308: 'ade288b3', 2701: 'e288b3e2', 25254: '94', 3216: 'e2', 24600: '8591', 16018: 'e2', 11411: 'e288', 148: '81', 18581: '8594e285', 3734: '82', 19607: 'e288', 2112: '85', 10393: 'e2', 25756: 'b8e285', 20637: '88b6e2', 18078: '94e28590', 27808: 'ade2', 18544: '90e282', 26786: 'b6e2', 3747: 'b0e288ab', 2213: '88', 27814: 'b6e288', 23720: '8590', 25257: '90', 7343: '88ade2', 13493: '89e2', 19128: '88bac2bd', 23839: 'e2', 9916: 'e288', 11454: 'abe288aa', 26816: 'e288abe2', 20162: '8287', 14533: '8287e282', 24774: 'b8e285', 28193: '88ade2', 2248: '88aa', 14539: '8591', 27170: 'e285', 24274: 'e2', 24114: '85b0', 2260: '88', 2773: '91e285', 22744: 'e2', 3293: 'c2bd', 13605: 'bac2', 25312: 'e288abe2', 21729: 'aa', 2790: '88b3e288', 20739: '8289e282', 27370: '8289e282', 15083: 'b0', 8429: 'c2bd', 792: '81', 18672: '82', 17960: 'e288abe2', 18864: 'ade288', 23968: 'e285', 10537: 'e288', 8445: '81e2', 24277: 'e28287e2', 14594: 'e288b3e2', 4867: 'b3e288b6', 7940: '85', 9249: 'aae288', 17162: 'e288', 7948: 'e282', 270: '88', 24336: 'e2', 725: 'ad', 2323: 'e285', 14612: '82', 14102: 'e285', 7448: '85', 23428: 'bde2', 282: '89e2', 26415: '89e2', 13596: 'ade2', 2333: '88ab', 2847: 'e285', 4144: '8591e285', 26674: '81e2', 24357: '8594e285', 21801: '8281e285', 13100: '88', 2098: '94e2', 25903: 'b3', 10405: 'e288b3', 4914: 'b6e2', 2870: 'abe288ad', 27960: '85', 14815: '90e2', 17213: 'bde285', 5950: '94', 23360: '8591e2', 10561: '82', 25411: 'b3e288b6', 19268: '85', 14149: '8281', 26950: 'abe2', 4935: 'e2', 27977: 'e2', 25930: 'e285b8e2', 3404: 'e288abe2', 10062: 'e2', 19791: 'e2', 12626: '94e2', 10068: 'e2', 10581: 'e2', 8023: '94', 13656: '8590e2', 4503: 'e282', 24922: '8590e2', 347: 'aae288ad', 11622: '8287e282', 25745: 'e2', 5482: 'ad', 13675: 'b0e288ab', 17260: '90e2', 24432: 'e288abe2', 8049: '88ade2', 370: '89e28287', 11582: '81e28591', 26089: '8287', 4986: '85b0e2', 4987: 'b0', 10010: 'c2bd', 3562: '81', 17045: 'e288bac2', 8064: '94e285', 7553: 'e2', 23938: '81', 19977: '88', 24454: '94', 13377: 'e28591e2', 9608: '8591', 18023: 'b3e2', 19338: '85', 19851: '88ad', 19176: 'e28594', 1424: '88', 8593: 'e288', 5011: 'e2', 8597: '88b6e288', 21145: 'ba', 16280: '8591e285', 2970: 'e28590', 10138: 'b6', 19871: '8289e2', 24480: '88aae288', 815: '88bac2', 13220: '85', 13221: 'b0e288', 19878: '81e28591', 7324: 'e28281', 10154: '82', 2077: '88abe288', 20200: '85', 14254: 'e288', 22429: 'ba', 8624: '88aae288', 3505: '8594e285', 5206: '81', 6067: 'e288ba', 6582: 'e285', 12191: '88b3', 4540: '94e285', 4029: 'e288b3e2', 18367: 'e288', 16320: 'b8', 12737: '88abe288', 19906: '85', 21955: 'e2', 9668: 'b6e288', 24787: 'e288', 6305: '8281e2', 13768: 'e288b6e2', 4684: 'b8e285', 13774: 'c2bd', 27088: 'e288abe2', 25041: 'e285', 8608: 'e282', 10708: '88', 1584: 'e288abe2', 25048: '8289', 7641: 'e285b0', 15322: 'c2bd', 4943: 'b0e288', 6108: 'e288', 6111: 'e288ba', 18593: '82', 2018: '8289e2', 15394: 'abe288aa', 17574: 'abe288aa', 13799: 'b0e2', 1000: '81e285', 10217: 'aae288ad', 490: 'bde28594', 3055: 'e28289e2', 5104: '89e2', 16605: 'bac2bd', 25587: 'b3', 27134: 'abe288', 18310: '91e2', 23543: 'b3e288', 25593: 'bac2bd', 22522: '89e28287', 21503: 'b0', 27645: 'e288', 510: '85b8e285', 20991: '82'} diff --git a/src/test.png b/src/test.png deleted file mode 100644 index b4decf7..0000000 Binary files a/src/test.png and /dev/null differ diff --git a/src/test.txt b/src/test.txt deleted file mode 100644 index 8dd134b..0000000 Binary files a/src/test.txt and /dev/null differ diff --git a/src/tmpMutateDic.txt b/src/tmpMutateDic.txt deleted file mode 100644 index 168d334..0000000 --- a/src/tmpMutateDic.txt +++ /dev/null @@ -1 +0,0 @@ -e288 \ No newline at end of file diff --git a/tmp/Multiple.py b/tmp/Multiple.py deleted file mode 100644 index d204c1a..0000000 --- a/tmp/Multiple.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -''' -GUI ν”„λ‘œκ·Έλž¨μ—λŠ” μ—¬λŸ¬ 개의창이 μžˆλ‹€. -νƒ­ 및 μŠ€νƒ μœ„μ ―μ„ μ‚¬μš©ν•˜λ©΄ ν•œ λ²ˆμ— ν•˜λ‚˜μ˜ 창을 ν™œμ„±ν™” ν•  μˆ˜μžˆλ‹€. -κ·ΈλŸ¬λ‚˜ λ‹€λ₯Έ 창보기가 숨겨져 μžˆμœΌλ―€λ‘œ 이 방법은 μœ μš©ν•˜μ§€ μ•Šλ‹€. -μ—¬λŸ¬ 창을 λ™μ‹œμ— ν‘œμ‹œν•˜λŠ” ν•œ 가지 방법은 λ…λ¦½λœ 창을 λ§Œλ“œλŠ” 것이닀 -이λ₯Ό SDI (단일 λ¬Έμ„œ μΈν„°νŽ˜μ΄μŠ€)라고 ν•œλ‹€. -각 μ°½μ—λŠ” 자체 메뉴 μ‹œμŠ€ν…œ, 도ꡬ λͺ¨μŒ 등이 μžˆμ„ 수 μžˆμœΌλ―€λ‘œλ” λ§Žμ€ λ©”λͺ¨λ¦¬ λ¦¬μ†ŒμŠ€κ°€ ν•„μš”ν•˜λ‹€. - -πŸ˜‰MDI (Multiple Document Interface) μœΌμš©γ…‡ ν”„λ‘œκ·Έλž¨μ€ 더 적은 λ©”λͺ¨λ¦¬ λ¦¬μ†Œλ₯Ό μ‚¬μš©ν•œλ‹€! -ν•˜μœ„ 창은 μ„œλ‘œ κ΄€λ ¨ν•˜μ—¬ μ£Ό μ»¨ν…Œμ΄λ„ˆ 내뢀에 λ°°μΉ˜λœλ‹€. -μ»¨ν…Œμ΄λ„ˆ μœ„μ ―μ€ QMdiArea 라고 λΆ€λ₯Έλ‹€. - -QMdiArea μœ„μ ―μ€ 일반적으둜 QMainWindow 개체의 쀑앙 μœ„μ ―μ„ μ°¨μ§€ν•œλ‹€. -이 μ˜μ—­μ˜ μžμ‹ 창은 QMdiSubWindow 클래슀의 μΈμŠ€ν„΄μŠ€μ΄λ‹€. - -λͺ¨λ“  QWidget을 subWindow 객체의 λ‚΄λΆ€ μœ„μ ―μœΌλ‘œ μ„€μ •ν•  μˆ˜μžˆλ‹€. -MDI μ˜μ—­μ˜ ν•˜μœ„ 창은 계단 식 λ˜λŠ” 타일 λ°©μ‹μœΌλ‘œ λ°°μ—΄ν•  수 μžˆλ‹€. - - -''' -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - - -class MainWindow(QMainWindow): - count = 0 - - def __init__(self, parent=None): - # QMainWindow 둜 κ΅¬μ„±λœ μ΅œμƒμœ„ μ°½μ—λŠ” 메뉴와 MdiAreaκ°€ μžˆλ‹€. - super(MainWindow, self).__init__(parent) - self.mdi = QMdiArea() - self.setCentralWidget(self.mdi) - bar = self.menuBar() - - file = bar.addMenu("File") - file.addAction("New") - file.addAction("cascade") - file.addAction("Tiled") - file.addAction("remove") - file.triggered[QAction].connect(self.windowaction) - self.setWindowTitle("MDI demo") - - def windowaction(self, q): - print "triggered" - if q.text() == "New": - MainWindow.count = MainWindow.count+1 - sub = QMdiSubWindow() - sub.setWidget(QTextEdit()) - sub.setWindowTitle("subwindow"+str(MainWindow.count)) - self.mdi.addSubWindow(sub) # MDI μ˜μ—­μ— μƒˆ ν•˜μš° 창으둜 μœ„μ ― μΆ”κ°€ - sub.show() - # if q.text() == "remove": - # self.mdi.removeSubWindow() # ν•˜μœ„ 창의 λ‚΄λΆ€ μœ„μ ― 인 μœ„μ ―μœΌ γ„Ήμ œκ±° - if q.text() == "cascade": - self.mdi.cascadeSubWindows() # MDIArea의 ν•˜μœ„ 창을 κ³„λ‹¨μ‹μœΌλ‘œ μ •λ ¬ - if q.text() == "Tiled": - self.mdi.tileSubWindows() # MDIArea의 ν•˜μœ„ 창을 λ°”λ‘‘νŒ μ‹μœΌλ‘œ λ°°μ—΄ - - - -def main(): - app = QApplication(sys.argv) - ex = MainWindow() - ex.show() - sys.exit(app.exec_()) - - -if __name__ == '__main__': - main() - -''' -setActiveSubWindow() : ν•˜μœ„ 창을 ν™œμ„±ν™” -closeActiveSubWindow() : ν™œμ„± ν•˜μœ„ 창을 λ‹«λŠ”λ‹€. -subWindowList() : MDI μ˜μ—­μ˜ ν•˜μœ„ μ°½ λͺ©λ‘μ„ λ°˜ν™˜ -setWidget() : QWidget을 QMdiSubwindow μΈμŠ€ν„΄μŠ€μ˜ λ‚΄λΆ€ μœ„μ ―μœΌλ‘œ μ„€μ • - -QMdiArea κ°μ²΄λŠ” subWindowActivated() μ‹ ν˜Έλ₯Ό 방좜 -windowStateChanged() Signal은 QMdisubWindow 객체에 μ˜ν•΄ λ°©μΆœλœλ‹€. - -''' \ No newline at end of file diff --git a/tmp/QBoxLayout.py b/tmp/QBoxLayout.py deleted file mode 100644 index eb782ae..0000000 --- a/tmp/QBoxLayout.py +++ /dev/null @@ -1,25 +0,0 @@ -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - - -def window(): - app = QApplication(sys.argv) - win = QWidget() - - b1 = QPushButton("Button 1") - b2 = QPushButton("Button 2") - - vbox = QVBoxLayout() # μœ„μ ―μ„ 수직으둜 μ •λ ¬ - vbox.addWidget(b1) # BoxLayout 에 μœ„μ ― μΆ”κ°€ - vbox.addStretch() # 동적 - vbox.addWidget(b2) - win.setLayout(vbox) # λ ˆμ΄μ•„μ›ƒ μ„€μ • - - win.setWindowTitle("Namin") - win.show() - sys.exit(app.exec_()) - - -if __name__ == "__main__": - window() \ No newline at end of file diff --git a/tmp/QDialog_.py b/tmp/QDialog_.py deleted file mode 100644 index 5712f3e..0000000 --- a/tmp/QDialog_.py +++ /dev/null @@ -1,43 +0,0 @@ -import sys -from PyQt4.QtGui import * -from PyQt4.QtCore import * - -def window(): - app = QApplication(sys.argv) - w = QWidget() - b = QPushButton(w) - b.setText("Hello World!") - b.move(50,50) - b.clicked.connect(showdialog) - w.setWindowTitle("PyQt Dialog demo") - w.show() - sys.exit(app.exec_()) - -def showdialog(): - d = QDialog() - b1 = QPushButton("ok",d) - b1.move(50,50) - d.setWindowTitle("Dialog") - d.setWindowModality(Qt.ApplicationModal) - d.exec_() - -if __name__ == '__main__': - window() - -# QDialog - -''' -QDialog μœ„μ ―μ€ μ‚¬μš©μžμ˜ 응닡을 μˆ˜μ§‘ν•˜λŠ”λ° 주둜 μ‚¬μš©λ˜λŠ” μ΅œμƒμœ„ 창을 μ œμ‹œν•œλ‹€. -Modal (λΆ€λͺ¨ 창을 μ°¨λ‹¨ν•˜λŠ” μœ„μΉ˜) -Modeless(λŒ€ν™”μƒμž 창을 λ¬΄μ‹œν•  수 μžˆλ‹€.) -두 개둜 ꡬ성됨 -PyQtAPIμ—λŠ” InputDialog, FileDialog, FontDialog λ“± 미리 κ΅¬μ„±λœ μ—¬λŸ¬ λŒ€ν™” μœ„μ ―μ΄ μžˆλ‹€. - -μ½”λ“œ- -λŒ€ν™” μƒμž 창의 λͺ¨λ“  속성은 λͺ¨λ“œμΈμ§€ λͺ¨λ“œκ°€ μ—†λŠ”μ§€ μ—¬λΆ€λ₯Ό κ²°μ •ν•œλ‹€. -λŒ€ν™”μƒμžμ˜ λ²„νŠΌ 쀑 ν•˜λ‚˜λ₯Ό κΈ°λ³Έκ°’μœΌλ‘œ μ„€μ •ν•  μˆ˜μžˆλ‹€. -λŒ€ν™”μƒμžλŠ” μ‚¬μš©μžκ°€ escape ν‚€λ₯Ό λˆ„λ₯Ό λ•Œ QDialog.reject() λ°©λ²•μœΌλ‘œ νκΈ°λœλ‹€. -ν΄λ¦­ν•˜λ©΄ μ΅œμƒμœ„ 레벨 QWidget 창의 μΆ”μ‹œλ²„νŠΌμ΄ λŒ€ν™”μƒμž 창을 μƒμ„±ν•œλ‹€. -λŒ€ν™” μƒμžμ—λŠ” 제λͺ© μ΅Έμ‹œμ€„μ˜ μ œμ–΄ κΈ°λŠ₯이 μ΅œμ†Œν™”λ˜κ³  μ΅œλŒ€ν™”λ˜μ§€ μ•ŠλŠ”λ‹€. -μ°½ λͺ¨λ“œκ°€ μ‘μš© ν”„λ‘œκ·Έλž¨ λͺ¨λ“œλ‘œ μ„€μ •λ˜μ–΄ 있기 떄문에 μ‚¬μš©μžκ°€ 이 λŒ€ν™” μƒμžλ₯Ό λ°°κ²½μ—μ„œ ν•΄μ œ ν•  수 μ—†λ‹€. -''' \ No newline at end of file diff --git a/tmp/QHBoxLayout.py b/tmp/QHBoxLayout.py deleted file mode 100644 index a523361..0000000 --- a/tmp/QHBoxLayout.py +++ /dev/null @@ -1,23 +0,0 @@ -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QApplication(sys.argv) - win = QWidget() - - b1 = QPushButton("Button1") - b2 = QPushButton("Button2") - - hbox = QHBoxLayout() - - hbox.addWidget(b1) - hbox.addStretch() - hbox.addWidget(b2) - win.setLayout(hbox) - win.setWindowTitle("PyQt") - win.show() - sys.exit(app.exec_()) - -if __name__ == '__main__': - window() \ No newline at end of file diff --git a/tmp/QHVLayout.py b/tmp/QHVLayout.py deleted file mode 100644 index b48382d..0000000 --- a/tmp/QHVLayout.py +++ /dev/null @@ -1,33 +0,0 @@ -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QApplication(sys.argv) - win = QWidget() - - b1 = QPushButton("Button1") - b2 = QPushButton("Button2") - - vbox = QVBoxLayout() - vbox.addWidget(b1) - vbox.addStretch() - vbox.addWidget(b2) - hbox = QHBoxLayout() - - b3 = QPushButton("Button3") - b4 = QPushButton("Button4") - hbox.addWidget(b3) - hbox.addStretch() - hbox.addWidget(b4) - - vbox.addStretch() - vbox.addLayout(hbox) - win.setLayout(vbox) - - win.setWindowTitle("PyQt") - win.show() - sys.exit(app.exec_()) - -if __name__ == '__main__': - window() \ No newline at end of file diff --git a/tmp/QformLayout.py b/tmp/QformLayout.py deleted file mode 100644 index a012cac..0000000 --- a/tmp/QformLayout.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QApplication(sys.argv) - win = QWidget() - - l1 = QLabel("Name") - nm = QLineEdit() - - l2 = QLabel("Address") - add1 = QLineEdit() - add2 = QLineEdit() - fbox = QFormLayout() - fbox.addRow(l1,nm) - vbox = QVBoxLayout() - - vbox.addWidget(add1) - vbox.addWidget(add2) - fbox.addRow(l2,vbox) - hbox = QHBoxLayout() - - r1 = QRadioButton("Male") - r2 = QRadioButton("Female") - hbox.addWidget(r1) - hbox.addWidget(r2) - hbox.addStretch() - fbox.addRow(QLabel("sex"),hbox) - fbox.addRow(QPushButton("Submit"),QPushButton("Cancel")) - - win.setLayout(fbox) - - win.setWindowTitle("PyQt") - win.show() - sys.exit(app.exec_()) - -if __name__ == '__main__': - window() - - -# addRow (QLabel, Qwidget) // λ ˆμ΄λΈ” 및 μž…λ ₯ ν•„λ“œλ₯Ό ν¬ν•¨ν•˜λŠ” 행을 μΆ”κ°€ν•œλ‹€. -# addRow (QLabel, QLayout) // 두 번째 열에 μžμ‹ λ ˆμ΄μ•„μ›ƒ μΆ”κ°€ -# addRow (Qwidget) // 두 열에 κ±Έμ³μžˆλŠ” μœ„μ ―μ„ μΆ”κ°€ν•œλ‹€. \ No newline at end of file diff --git a/tmp/Qmessagebox.py b/tmp/Qmessagebox.py deleted file mode 100644 index 11f3fb5..0000000 --- a/tmp/Qmessagebox.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -''' -일반적으둜 μ‚¬μš©λ˜λŠ” modal λŒ€ν™” μƒμž -일뢀 정보 λ©”μ‹œμ§€λ₯Ό ν‘œμ‹œν•˜κ³  μ„ νƒμ μœΌλ‘œ μ‚¬μš©μžμ—κ²Œ ν‘œμ€€ λ²„νŠΌ 쀑 ν•˜λ‚˜λ₯Ό ν΄λ¦­ν•˜μ—¬ μ‘λ‹΅ν•˜λ„λ‘ μš”μ²­ -각 ν‘œμ€€ λ²„νŠΌμ—λŠ” 미리 μ •μ˜λœ μΊ‘μ…˜, μ—­ν™œμ΄ 있으며 미리 μ •μ˜λœ 16μ§„μˆ˜ 숫자λ₯Ό λ°˜ν™˜ν•œλ‹€. -''' -import sys -from PyQt4.QtGui import * -from PyQt4.QtCore import * - -def window(): - app = QApplication(sys.argv) - w = QWidget() - b = QPushButton(w) - b.setText("Show message!") - - b.move(50,50) - b.clicked.connect(showdialog) - w.setWindowTitle("PyQt Dialog demo") - w.show() - sys.exit(app.exec_()) - -def showdialog(): - msg = QMessageBox() - msg.setIcon(QMessageBox.Warning) # setIcon {Question, Information, Warning, Critical} - - msg.setText("This is a message box") # body text - msg.setInformativeText("This is additional information") # information text - msg.setWindowTitle("MessageBox demo") # title text - msg.setDetailedText("The details are as follows:") # Detatil button click to detail text - # standardButton μ›ν•˜λŠ” λ²„νŠΌμ„ ν‘œμ‹œ 함 - msg.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel) - msg.buttonClicked.connect(msgbtn) - # setDefaultButton() : λ²„νŠΌμ„ κΈ°λ³Έκ°’μœΌλ‘œ μ„€μ • Enter ν‚€λ₯Ό λˆ„λ₯΄λ©΄ 클릭된 μ‹ ν˜Έκ°€ 좜λ ₯ - # setEscapeButton : Escape ν‚€λ₯Ό λˆ„λ₯Ό 경우 λ²„νŠΌμΌ 클릭된 κ²ƒμœΌλ‘œ μ²˜λ¦¬λœλ‹€. - retval = msg.exec_() - print "value of pressed message box button:", retval - -def msgbtn(i): - print "Button pressed is:",i.text() - -if __name__ == '__main__': - window() \ No newline at end of file diff --git a/tmp/drag&drop.py b/tmp/drag&drop.py deleted file mode 100644 index 95e922e..0000000 --- a/tmp/drag&drop.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -''' -drag and drop은 μ‚¬μš©μžμ—κ²Œ 맀우 μ§κ΄€μ μœΌλ‘œ λ‚˜νƒ€λ‚  수 μžˆλ‹€. -μ‚¬μš©μžκ°€ ν•œ μ°½μ—μ„œ λ‹€λ₯Έ 창으둜 개체λ₯Ό λ³΅μ‚¬ν•˜κ±°λ‚˜ 이동할 수 μžˆλŠ” λ§Žμ€ λ°μŠ€ν¬ν†±μ—μ„œ μ‚¬μš©λ¨ - -MIME 기반 λ“œλž˜κ·Έ μ•€ λ“œλ‘­ 데이터 전솑은 QDrag 클래슀 기반으둜 ν•œλ‹€. -QMimeData κ°œμ²΄λŠ” 데이터λ₯Ό ν•΄λ‹Ή MIME μœ ν˜•κ³Ό μ—°κ²°ν•œλ‹€. -ν΄λ¦½λ³΄λ“œμ— μ €μž₯λ˜μ–΄ λŒμ–΄μ„œ 놓기 κ³Όμ •μ—μ„œ μ‚¬μš©λœλ‹€. -QMimeData 클래슀 ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜λ©΄ MIME μœ ν˜•μ„ κ°μ§€ν•˜κ³  νŽΈλ¦¬ν•˜κ²Œ μ‚¬μš©ν•  μˆ˜μžˆλ‹€. -Tester Getter Setter MIME Types -hasText() text() setText() text/plain -hasHtml() html() setHtml() text/html -hasUrls() urls() setUrls() text/uri-list -hasImage() imageData() setImageData() image/ * -hasColor() colorData() setColorData() application/x-color -''' -import sys -from PyQt4.QtGui import * -from PyQt4.QtCore import * - -class combo(QComboBox): - - def __init__(self, title, parent): - super(combo, self).__init__( parent) - - self.setAcceptDrops(True) - # 이벀트의 MIME 데이터에 ν…μŠ€νŠΈκ°€ ν¬ν•¨λ˜μ–΄ μžˆλŠ”μ§€ 확인 - # 이벀트의 μ œμ•ˆλœ μž‘μ—…μ΄ 수락되고 ν…μŠ€νŠΈκ°€ ComboBox에 μƒˆ ν•­λͺ©μœΌλ‘œ μΆ”κ°€λœλ‹€. - def dragEnterEvent(self, e): - print e - if e.mimeData().hasText(): - e.accept() - else: - e.ignore() - - def dropEvent(self, e): - self.addItem(e.mimeData().text()) - -class Example(QWidget): - - def __init__(self): - super(Example, self).__init__() - - self.initUI() - - def initUI(self): - lo = QFormLayout() - lo.addRow(QLabel("Type some text in textbox and drag it into combo box")) - - edit = QLineEdit() - edit.setDragEnabled(True) - com = combo("Button", self) - lo.addRow(edit,com) - self.setLayout(lo) - self.setWindowTitle('Simple drag & drop') - -def main(): - app = QApplication(sys.argv) - ex = Example() - ex.show() - app.exec_() - -if __name__ == '__main__': - main() - -''' -QWidget κ°œμ²΄λŠ” λŒμ–΄μ„œ 놓기 ν™œλ™μ„ μ§€μ›ν•œλ‹€. -!!데이터λ₯Ό λ“œλž˜κ·Έ ν•  μˆ˜μžˆλ„λ‘ ν—ˆμš©ν•˜λŠ” 경우 true둜 μ„€μ •ν•΄μ•Ό ν•˜λŠ” setDragEnabled() κ°€ μžˆλ‹€. -λ°˜λ©΄μ— μœ„μ ―μ€ λ“œλž˜κ·Έμ•€ λ“œλ‘­ μ΄λ²€νŠΈμ— μ‘λ‹΅ν•˜μ—¬ λ“œλž˜κ·Έλœ λ°μžμ–΄λ₯Ό μ €μž₯ν•΄μ•Ό ν•œλ‹€. - -DragEnterEvent: drag action이 λ“€μ–΄μ˜¬ λ•Œ λŒ€μƒ μœ„μ ―μœΌλ‘œ μ „μ†‘λ˜λŠ” 이벀트λ₯Ό 제곡 -DragMoveEvent : drag and drop λ™μž‘μ΄ 진행쀑일 λ•Œ μ‚¬μš© -DragLeaveEvent : drag and drop λ™μž‘μ΄ μœ„μ ―μ„ λ– λ‚  λ•Œ μƒμ„±λœλ‹€. -DropEvent : Drop이 μ™„λ£Œλ  λ•Œ λ°œμƒν•œλ‹€. 이벀트의 μ œμ•ˆ 된 μž‘μ—…μ€ μ‘°κ±΄λΆ€λ‘œ 수락 λ˜λŠ” κ±°λΆ€ 될 수 μžˆλ‹€. - -''' \ No newline at end of file diff --git a/tmp/event.py b/tmp/event.py deleted file mode 100644 index 92d873a..0000000 --- a/tmp/event.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QApplication(sys.argv) - win = QDialog() - b1 = QPushButton(win) - b1.setText("Button1") - b1.move(50,20) - b1.clicked.connect(b1_clicked) - - b2 = QPushButton(win) - b2.setText("Button2") - b2.move(50,50) - QObject.connect(b2,SIGNAL("clicked()"),b2_clicked) - - win.setGeometry(100,100,200,100) - win.setWindowTitle("PyQt") - win.show() - sys.exit(app.exec_()) - -def b1_clicked(): - print "Button 1 clicked" - -def b2_clicked(): - print "Button 2 clicked" - -if __name__ == '__main__': - window() - -# event μ²˜λ¦¬μ‹œ SIGNAL 을 λ°”νƒ•μœΌλ‘œ μ²˜λ¦¬ν•¨ -# SLOT : 호좜 κ°€λŠ₯ν•œ λͺ¨λ“  python ν•¨μˆ˜ -> event handler function - -# # κ°€μž₯ 일반적인 이벀트 μ²˜λ¦¬λ°©λ²• -# QtCore.QObject.connect(widget, QtCore.SIGNAL('signalname'), slot_function) - -# μ‹œκ·Έλ„μ΄ μœ„μ ―μ— μ˜ν•΄ 방좜 될 λ•Œ slot_function 을 μ΄ˆλ£¨ν•˜λŠ” 더 νŽΈλ¦¬ν•œ 방법 -# widget.signale.connect(slot_function) - -# λ²„νŠΌμ„ 클릭 ν•  λ•Œ ν•¨μˆ˜κ°€ ν˜ΈμΆœλœλ‹€κ³  κ°€μ •ν•˜μ˜€μ„ λ•Œ 클릭된 μ‹ ν˜ΈλŠ γ„΄ν˜ΈμΆœ κ°€λŠ₯ν•œ ν•¨μˆ˜μ— μ—°κ²°λœλ‹€. -# QtCore.QtObject.connect(button, QtCore.SIGNAL("clicked()"), slot_function) -# button.clicked.connect(slot_function) diff --git a/tmp/gridLayout.py b/tmp/gridLayout.py deleted file mode 100644 index 6270233..0000000 --- a/tmp/gridLayout.py +++ /dev/null @@ -1,26 +0,0 @@ -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - - -def window(): - app = QApplication(sys.argv) - win = QWidget() - grid = QGridLayout() - - for i in range(1,5): - for j in range(1,5): - grid.addWidget(QPushButton("B"+str(i)+str(j)),i,j) - - win.setLayout(grid) - win.setGeometry(100,100,200,100) - win.setWindowTitle("PyQt") - win.show() - sys.exit(app.exec_()) - -if __name__ == '__main__': - window() - -# addWidget (Qwidget, int r, int c) // μ§€μ •λœ ν–‰κ³Ό 열에 μœ„μ ―μ„ μΆ”κ°€ν•œλ‹€. -# addWidget (Qwidget, inr r, int c, int rowspan, int columnspan) // μ§€μ •λœ ν–‰κ³Ό 열에 μ§€μ •λœ λ„ˆλΉ„ 및 / λ˜λŠ” 높이λ₯Ό κ°–λŠ” μœ„μ ―μ„ μΆ”κ°€ν•œλ‹€. -# addLayout(QLayout, int r, int c) // μ§€μ •λœ ν–‰κ³Ό 열에 λ ˆμ΄μ•„μ›ƒ 개체λ₯Ό μΆ”κ°€ν•œλ‹€. diff --git a/tmp/img/Bl-10.png b/tmp/img/Bl-10.png deleted file mode 100644 index 4d5006b..0000000 Binary files a/tmp/img/Bl-10.png and /dev/null differ diff --git a/tmp/img/Bl-8.png b/tmp/img/Bl-8.png deleted file mode 100644 index 1ac6a40..0000000 Binary files a/tmp/img/Bl-8.png and /dev/null differ diff --git a/tmp/img/Bl-9.png b/tmp/img/Bl-9.png deleted file mode 100644 index 9ca82cf..0000000 Binary files a/tmp/img/Bl-9.png and /dev/null differ diff --git a/tmp/interface.py b/tmp/interface.py deleted file mode 100644 index bef3e36..0000000 --- a/tmp/interface.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QtGui.QApplication(sys.argv) - w = QtGui.QWidget() # QWidget μ΅œμƒμœ„ 창을 λ§Œλ“ λ‹€. (Qlabel κ°œμ²΄μ— μΆ”κ°€) - b = QtGui.QLabel(w) - b.setText('NAMIN') # setText (라벨의 μΊ‘μ…˜μ„ "μ„€μ •") - w.setGeometry(100, 100, 200, 50) # 창의 크기와 μœ„μΉ˜λ₯Ό μ •μ˜ - b.move(50, 10) - w.setWindowTitle("PyQt") - w.show() - sys.exit(app.exec_()) # μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ 메인 루프 - - - - - -if __name__ == "__main__": - window() \ No newline at end of file diff --git a/tmp/layout.py b/tmp/layout.py deleted file mode 100644 index 3550f6b..0000000 --- a/tmp/layout.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# QWidget.setGeometry(xpos, ypos, width, height) -import sys -from PyQt4 import QtGui - - -def window(): - app = QtGui.QApplication(sys.argv) - w = QtGui.QWidget() - - b = QtGui.QPushButton(w) - b.setText("NAMIN!!") - b.move(100, 100) # 였λ₯Έμͺ½ 50px, μΆ”κ°€ 및 ν•˜λ°© 20px μΆ”κ°€ (x, y) κ°œλ… // μ ˆλŒ€μœ„μΉ˜ μž„ - # - - w.setGeometry(10, 20, 300, 200) - w.setWindowTitle("NAMIN") - w.show() - sys.exit(app.exec_()) - -if __name__ == "__main__": - window() diff --git a/tmp/test/test.py b/tmp/test/test.py deleted file mode 100644 index 2950ae2..0000000 --- a/tmp/test/test.py +++ /dev/null @@ -1,5 +0,0 @@ -# coding: utf-8 - -import sys -from PyQt4 import uic -from PyQt4 import Qt diff --git a/tmp/widget_/QLabel_.py b/tmp/widget_/QLabel_.py deleted file mode 100644 index 2186823..0000000 --- a/tmp/widget_/QLabel_.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- -''' -QLabel의 객체가 μ•„λ‹Œ νŽΈμ§‘ κ°€λŠ₯ν•œ ν…μŠ€νŠΈ λ˜λŠ” 이미지, λ˜λŠ” μ• λ‹ˆλ©”μ΄μ…˜ GIF의 μ˜ν™”λ₯Ό ν‘œμ‹œν•˜λŠ” 자리 ν‘œμ‹œ 자 μ—­ν• μ„ν•©λ‹ˆλ‹€. λ‹€λ₯Έ μœ„μ ―μ˜ λ‹ˆλͺ¨λ‹‰ ν‚€λ‘œλ„ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 일반 ν…μŠ€νŠΈ, ν•˜μ΄νΌ 링크 λ˜λŠ” μ„œμ‹μžˆλŠ” ν…μŠ€νŠΈλ₯Ό λ ˆμ΄λΈ”μ— ν‘œμ‹œ ν•  수 μžˆμŠ΅λ‹ˆλ‹€. - -λ‹€μŒ ν‘œλŠ” QLabel ν΄λž˜μŠ€μ— μ •μ˜ 된 μ€‘μš”ν•œ λ©”μ„œλ“œλ₯Ό λ‚˜μ—΄ν•©λ‹ˆλ‹€- -''' -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QApplication(sys.argv) - win = QWidget() - - l1 = QLabel() - l2 = QLabel() - l3 = QLabel() - l4 = QLabel() - - l1.setText("Hello World") - l4.setText("TutorialsPoint") - l2.setText("welcome to Python GUI Programming") - - # μ •λ ¬ (Center, left, Right, Justify) - l1.setAlignment(Qt.AlignCenter) - l3.setAlignment(Qt.AlignCenter) - l4.setAlignment(Qt.AlignRight) - l3.setPixmap(QPixmap("nm.jpg")) # setPixmap(이미지 ν‘œμ‹œ) - - vbox = QVBoxLayout() - vbox.addWidget(l1) - vbox.addStretch() - vbox.addWidget(l2) - vbox.addStretch() - vbox.addWidget(l3) - vbox.addStretch() - vbox.addWidget(l4) - - l1.setOpenExternalLinks(True) # Signal!! - l4.linkActivated.connect(clicked) - l2.linkHovered.connect(hovered) - l1.setTextInteractionFlags(Qt.TextSelectableByMouse) - win.setLayout(vbox) - - win.setWindowTitle("QLabel Demo") - win.show() - sys.exit(app.exec_()) - -def hovered(): - print "hovering" -def clicked(): - print "clicked" - -if __name__ == '__main__': - window() - -# setIndent() : λ ˆμ΄λΈ” ν…μŠ€νŠΈ λ“€μ—¬ μ“°κΈ° μ„€μ • -# text() : λ ˆμ΄λΈ”μ˜ μΊ‘μ…˜μ„ ν‘œμ‹œν•œλ‹€. -# setText() : ν”„λ‘œκ·Έλž˜λ° λ°©μ‹μœΌλ‘œ μΊ‘μ…˜ μ„€μ • -# selectedText() : λ ˆμ΄λΈ”μ—μ„œ μ„ νƒν•œ ν…μŠ€νŠΈλ₯Ό ν‘œμ‹œ -# textInteractionFlag : TextSelectableByMouse 둜 μ„€μ •ν•΄μ•Ό 함 -# setBuddy() : λ ˆμ΄λΈ”μ„ μž…λ ₯ μœ„μ ―κ³Ό μ—°κ²° -# setWordWrap : λ ˆμ΄λΈ”μ—μ„œ 쀄 λ°”κΏˆμ„ ν™œμ„±ν™” λ˜λŠ” λΉ„ν™œμ„±ν™” ν•œλ‹€. - -''' -QLabel Class Signal -linkActivated : ν¬ν•¨λœ ν•˜μ΄νΌ 링크가 ν¬ν•¨λœ λ ˆμ΄λΈ”μ„ ν΄λ¦­ν•˜λ©΄ URL이 μ—΄λ¦°λ‹€. -linkHovered : 이 μ‹ ν˜Έν™” κ΄€λ ¨λœ slot λ©”μ„œλ“œλŠ” ν•˜μ΄νΌλ§ν¬κ°€ ν¬ν•¨λœ λ ˆμ΄λΈ”μ„ 마우슀둜 κ°€λ¦¬ν‚¬λ•Œ ν˜ΈμΆœλœλ‹€. - -''' \ No newline at end of file diff --git a/tmp/widget_/QLineEdit.py b/tmp/widget_/QLineEdit.py deleted file mode 100644 index 805bfd3..0000000 --- a/tmp/widget_/QLineEdit.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -''' -QLineEdit : -μž…λ ₯ ν•„λ“œ, ν•œ μ€„μ˜ ν…μŠ€νŠΈλ₯Ό μž…λ ₯ ν•  수 μžˆλŠ” Boxλ₯Ό μ œκ³΅ν•œλ‹€. -μ—¬λŸ¬ 쀄 ν…μŠ€νŠΈλ₯Ό μž…λ ₯ν•˜λ €λ©΄ QTextEdit κ°œμ²΄κ°€ ν•„μš”ν•˜λ‹€. - -''' -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -def window(): - app = QApplication(sys.argv) - win = QWidget() - - e1 = QLineEdit() - e1.setValidator(QIntValidator()) # μœ νš¨μ„± 검사 κ·œμΉ™μ„ μ„€μ •ν•œλ‹€. - # QintValidator() : μ •μˆ˜λ§Œ μž…λ ₯ κ°€λŠ₯ - # QDoubleValidator : μ§€μ •λœ μ†Œμˆ˜λ‘œ μ œν•œλœ 수의 λΆ„ν•  λΆ€λΆ„ - # QRegexpValidator : Regex 식에 λŒ€ν•œ μž…λ ₯을 ν™•μΈν•œλ‹€. - - e1.setMaxLength(4) # μž…λ ₯에 λŒ€ν•œ μ΅œλŒ€ 문자 수λ₯Ό μ„€μ • ν•œλ‹€. (4) - e1.setAlignment(Qt.AlignRight) # μ •λ ¬ (Left, Right, Center, Justify) - e1.setFont(QFont("Arial",20)) - - e2 = QLineEdit() - e2.setValidator(QDoubleValidator(0.99,99.99,2)) - - flo = QFormLayout() - flo.addRow("integer validator", e1) - flo.addRow("Double validator",e2) - - e3 = QLineEdit() - e3.setInputMask('+99_9999_999999') # μž…λ ₯μ‹œ 문자 μ‘°ν•© 마슀크 적용 - flo.addRow("Input Mask",e3) - - e4 = QLineEdit() - e4.textChanged.connect(textchanged) - flo.addRow("Text changed",e4) - - e5 = QLineEdit() - e5.setEchoMode(QLineEdit.Password) # μƒμž μ•ˆμ˜ ν…μŠ€νŠΈ λͺ¨μ–‘을 μ œμ–΄ν•œλ‹€. - # Normal, NoEcho, Password, PasswordEchoOnEdit - flo.addRow("Password",e5) - - e6 = QLineEdit("Hello Python") - e6.setReadOnly(True) # ν…μŠ€νŠΈ μƒμžλ₯Ό νŽΈμ§‘ν•  수 없도둝 μ„€μ • - flo.addRow("Read Only",e6) - - e5.editingFinished.connect(enterPress) - win.setLayout(flo) - win.setWindowTitle("PyQt") - win.show() - - sys.exit(app.exec_()) - -def textchanged(text): - print "contents of text box: "+text - -def enterPress(): - print "edited" - -if __name__ == '__main__': - window() - -''' method - -clear() : μ½˜ν…μΈ  제거 - -''' - -''' signal -cursorPostionChanged() : μ»€μ„œ μ›€μ§μž„ -editingFinished() : Enter ν‚€λ₯Ό λˆ„λ₯΄κ±°λ‚˜ , μž…λ ₯ ν•„λ“œ μ—μ„œ λ‚˜κ°”μ„ 경우 -returnPressed() : Enter ν‚€λ₯Ό λˆŒλ €μ„ λ•Œ -selectionChanged() : μ„ νƒν•œ ν…μŠ€νŠΈκ°€ 변경될 λ•Œ λ§ˆλ‹€. -textChanged() : μƒμžμ˜ ν…μŠ€νƒ€κ°€ μž…λ € λ˜λŠ” ν”„λ‘œκ·Έλž¨μ  μˆ˜λ‹¨μ— μ˜ν•΄ 변경됨에 따라 -textEdited() : ν…μŠ€νŠΈλ₯Ό μž…λ ₯ν–ˆμ„ λ•Œ - - -''' \ No newline at end of file diff --git a/tmp/widget_/QPushButton.py b/tmp/widget_/QPushButton.py deleted file mode 100644 index 7e59747..0000000 --- a/tmp/widget_/QPushButton.py +++ /dev/null @@ -1,55 +0,0 @@ -''' -λͺ…λ Ή λ²„νŠΌμ΄ κ°€μž₯ μ€‘μš”ν•¨ -μΊ‘μ…˜μœΌλ‘œ Save, Open, OK, Yes, No, Cancel 등이 ν¬ν•¨λœ λ²„νŠΌμ€ μ»΄ν“¨ν„°μ‚¬μš©μžμ—κ²Œ μΉœμˆ™ν•˜λ‹€. -ν΄λ¦­μ‹œ νŠΉμ • κΈ°λŠ₯을 ν˜ΈμΆœν•˜λ„λ‘ ν”„λ‘œκ·Έλž˜λ° ν•  μˆ˜μžˆλŠ” λ²„νŠΌμ„ μ œκ³΅ν•œλ‹€. -QAbstractButton classμ—μ„œ 핡심 κΈ°λŠ₯을 κ³„μŠΉμ„ 함, -''' -import sys -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -class Form(QDialog): - def __init__(self, parent=None): - super(Form, self).__init__(parent) - - layout = QVBoxLayout() - self.b1 = QPushButton("Button1") - self.b1.setCheckable(True) # true둜 μ„€μ •λœ 경우 λ²„νŠΌμ˜ λˆŒλ €λ‹€ 놓은 μƒνƒœλ₯Ό μΈμ‹ν•œλ‹€. - self.b1.toggle() # 체크 κ°€λŠ₯ν•œ μƒνƒœκ°„ μ „ν™˜ - self.b1.clicked.connect(lambda:self.whichbtn(self.b1)) - self.b1.clicked.connect(self.btnstate) - layout.addWidget(self.b1) - - self.b2 = QPushButton() - self.b2.setIcon(QIcon(QPixmap("python.gif"))) # setIcon : 이미지 파일의 ν”½μŠ€λ§΅μœΌλ‘œ ν˜•μ„±λœ μ•„μ΄μ½˜μ„ 보여쀀닀. - self.b2.clicked.connect(lambda:self.whichbtn(self.b2)) - layout.addWidget(self.b2) - self.setLayout(layout) - self.b3 = QPushButton("Disabled") - self.b3.setEnabled(False) # false둜 μ„€μ •ν•˜λ©΄ λ²„νŠΌμ΄ λΉ„ν™œμ„±ν™”λ˜λ―€λ‘œ 클릭해도 μ‹ ν˜Έκ°€ λ°œμƒν•˜μ§€ μ•ŠλŠ”λ‹€. - layout.addWidget(self.b3) - - self.b4 = QPushButton("&Default") - self.b4.setDefault(True) # λ²„νŠΌμ„ κΈ°λ³Έκ°’μœΌλ‘œ μ„€μ • - self.b4.clicked.connect(lambda:self.whichbtn(self.b4)) - layout.addWidget(self.b4) - - self.setWindowTitle("Button demo") - - def btnstate(self): - if self.b1.isChecked(): # λ²„νŠΌμ˜ bool μƒνƒœλ₯Ό λ°˜ν™˜ν•œλ‹€. - print "button pressed" - else: - print "button released" - - def whichbtn(self,b): - print "clicked button is "+b.text() - -def main(): - app = QApplication(sys.argv) - ex = Form() - ex.show() - sys.exit(app.exec_()) - -if __name__ == '__main__': - main() \ No newline at end of file