Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mustafamuratcoskun
GitHub Repository: mustafamuratcoskun/Sifirdan-Ileri-Seviyeye-Python-Programlama
Path: blob/master/PyQt5 - Arayüz Geliştirme/Videolarda Kullanılan Kodlar/yazı alanları ve textedit.py
765 views
1
import sys
2
3
from PyQt5.QtWidgets import QWidget,QApplication,QTextEdit,QLabel,QPushButton,QVBoxLayout
4
5
6
class Pencere(QWidget):
7
def __init__(self):
8
9
super().__init__()
10
11
self.init_ui()
12
13
def init_ui(self):
14
15
self.yazi_alani = QTextEdit()
16
17
self.temizle = QPushButton("Temizle")
18
19
v_box = QVBoxLayout()
20
21
v_box.addWidget(self.yazi_alani)
22
v_box.addWidget(self.temizle)
23
24
self.setWindowTitle("Yazı Alanı")
25
26
self.setLayout(v_box)
27
self.temizle.clicked.connect(self.click)
28
29
self.show()
30
31
def click(self):
32
33
self.yazi_alani.clear()
34
35
36
37
38
39
40
41
42
app = QApplication(sys.argv)
43
44
pencere = Pencere()
45
46
sys.exit(app.exec_())
47