help !! addRow doesn't show
-
I have problem with PyQt5, I implement software from Udemy course. The instructor write the addRow property but it doesn't show in Pycharm IDE as shown in photos. also when I write addRow manually to the app. The app is crash.! addRow photo
-
I have problem with PyQt5, I implement software from Udemy course. The instructor write the addRow property but it doesn't show in Pycharm IDE as shown in photos. also when I write addRow manually to the app. The app is crash.! addRow photo
@Kamalep
What type isself.bottom_layout? It looks like it is not of a type which has anyaddRow()method.... I don't think any of the classes derived fromQLayouthave such a method.And please paste the text of relevant excerpts of code rather than screenshots.
-
the self.bottom_layout = QVBoxLayout()
here is the code
def layouts(self): # Creating main layout self.main_layout = QVBoxLayout() self.top_layout = QVBoxLayout() self.bottom_layout = QVBoxLayout() # Creating child layout to main layout self.main_layout.addLayout(self.top_layout) self.main_layout.addLayout(self.bottom_layout) # Adding Widget top layout # Top layout self.top_layout.addStretch() self.top_layout.addWidget(self.title) self.top_layout.addWidget(self.img_add) self.top_layout.addStretch() self.top_layout.setContentsMargins(120, 20, 10, 30) # left, top , right, bottom # Bottom layout self.bottom_layout.add self.bottom_layout.addRow(self.lblname, self.name_entry) self.bottom_layout.addRow(self.lblsurname, self.surname_entry) self.bottom_layout.addRow(self.lblphone, self.phone_entry) self.bottom_layout.addRow(self.lblemail, self.email_entry) self.bottom_layout.addRow(self.lblimg, self.btnimg) self.bottom_layout.addRow(self.lbladdress, self.address_editor) self.bottom_layout.addRow(self.lblemail, self.email_entry) self.bottom_layout.addRow("", self.btnadd) #sitting main layout for window self.setLayout(self.main_layout)if you want see all my project, i uploaded to github , the code is in Section-4 file name is main.py.
https://github.com/Kamalep/Udmey_PyQt5 -
the self.bottom_layout = QVBoxLayout()
here is the code
def layouts(self): # Creating main layout self.main_layout = QVBoxLayout() self.top_layout = QVBoxLayout() self.bottom_layout = QVBoxLayout() # Creating child layout to main layout self.main_layout.addLayout(self.top_layout) self.main_layout.addLayout(self.bottom_layout) # Adding Widget top layout # Top layout self.top_layout.addStretch() self.top_layout.addWidget(self.title) self.top_layout.addWidget(self.img_add) self.top_layout.addStretch() self.top_layout.setContentsMargins(120, 20, 10, 30) # left, top , right, bottom # Bottom layout self.bottom_layout.add self.bottom_layout.addRow(self.lblname, self.name_entry) self.bottom_layout.addRow(self.lblsurname, self.surname_entry) self.bottom_layout.addRow(self.lblphone, self.phone_entry) self.bottom_layout.addRow(self.lblemail, self.email_entry) self.bottom_layout.addRow(self.lblimg, self.btnimg) self.bottom_layout.addRow(self.lbladdress, self.address_editor) self.bottom_layout.addRow(self.lblemail, self.email_entry) self.bottom_layout.addRow("", self.btnadd) #sitting main layout for window self.setLayout(self.main_layout)if you want see all my project, i uploaded to github , the code is in Section-4 file name is main.py.
https://github.com/Kamalep/Udmey_PyQt5@Kamalep said in help !! addRow doesn't show:
QVBoxLayout
has no addRow() method!
You need to put all these "self.lblname, self.name_entry" into horizontal layouts and add these horizontal layouts to bottom_layout (https://doc.qt.io/qt-5/qboxlayout.html#addLayout). -
@Kamalep said in help !! addRow doesn't show:
QVBoxLayout
has no addRow() method!
You need to put all these "self.lblname, self.name_entry" into horizontal layouts and add these horizontal layouts to bottom_layout (https://doc.qt.io/qt-5/qboxlayout.html#addLayout). -
Hi,
I would say that the layout used is a QFormLayout.
-
Hi,
I would say that the layout used is a QFormLayout.