class Demo(QWidget):
def __init__(self):
super(Demo,self).__init__()
self.username = QLabel("username:",self)
self.user_line = QLineEdit()
self.pwd = QLabel("password:",self)
self.pwd_line = QLineEdit()
self.f_layout = QFormLayout()
self.f_layout.addRow(self.username,self.user_line)
self.f_layout.addRow(self.pwd, self.pwd_line)
self.setLayout(self.f_layout)
class Demo(QWidget):
def __init__(self):
super(Demo,self).__init__()
self.user_line = QLineEdit()
self.pwd_line = QLineEdit()
self.f_layout = QFormLayout()
self.f_layout.addRow('username:', self.user_line)
self.f_layout.addRow('password:',self.pwd_line)
self.setLayout(self.f_layout)