HamzaKaan
Centipat
- Katılım
- 4 Ocak 2021
- Mesajlar
- 65
Daha fazla
- Cinsiyet
- Erkek
import sys.
from PyQt5 import QtWidgets.
class Pencere(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
self.kullanici_adi=QtWidgets.QLineEdit()
self.parola=QtWidgets.QLineEdit()
self.parola.setEchoMode(QtWidgets.QLineEdit.Password)
self.giris=QtWidgets.QPushButton("Giriş Yap")
self.yazialani=QtWidgets.QLabel("")
v_box=QtWidgets.QVBoxLayout()
v_box.addWidget(self.kullanici_adi)
v_box.addWidget(self.parola)
v_box.addWidget(self.yazialani)
v_box.addStretch()
v_box.addWidget(self.giriş)
h_box=QtWidgets.QHBoxLayout
h_box.addLayout(v_box)
h_box.addStretch()
self.setLayout(v_box)
self.setWindowTitle("Kullanıcı Girişi")
self.show()
app=QtWidgets.QApplication(sys.argv)
pencere=Pencere()
sys.exit(app.exec_())
Evet buradaki hatam nedir Udemy'deki hocanın yaptığı şeyin aynısını yaptım ama olmuyor
Not: Butona işlev atmadığımın farkındayım.
[CODE lang="python" title="Böyle Daha Anlaşılır Sanırım"]import sys
from PyQt5 import QtWidgets
class Pencere(QtWidgets.QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
self.kullanici_adi=QtWidgets.QLineEdit()
self.parola=QtWidgets.QLineEdit()
self.parola.setEchoMode(QtWidgets.QLineEdit.Password)
self.giris=QtWidgets.QPushButton("Giriş Yap")
self.yazialani=QtWidgets.QLabel("")
v_box=QtWidgets.QVBoxLayout()
v_box.addWidget(self.kullanici_adi)
v_box.addWidget(self.parola)
v_box.addWidget(self.yazialani)
v_box.addStretch()
v_box.addWidget(self.giriş)
h_box=QtWidgets.QHBoxLayout
h_box.addLayout(v_box)
h_box.addStretch()
self.setLayout(v_box)
self.setWindowTitle("Kullanıcı Girişi")
self.show()
app=QtWidgets.QApplication(sys.argv)
pencere=Pencere()
sys.exit(app.exec_())[/CODE]