Feb-04-2019, 02:28 PM
(This post was last modified: Feb-04-2019, 02:28 PM by AlekseyPython.)
In Qt Designer, I created a form, on which I placed a QlistWidget to display the processing progress:
2. During execution of my procedure, events arrive to form.
3. They are processed without errors, including line: current_object.addItem(current_event.message)
, but no new lines appear on dialog form, in QListWidget. It always remains completely empty.
Why?
from PyQt5 import QtWidgets, uic from Database import Manager from MyLib import Events, GUI import Forms, General class Form(QtWidgets.QWidget): def __init__(self, parent: QtWidgets.QMainWindow): QtWidgets.QWidget.__init__(self) ClassForm, _ = uic.loadUiType(Forms.Directory + 'CreateDatabase.ui') self.ui = ClassForm() self.ui.setupUi(self) self.parent = parent #name of form self.setWindowTitle('Form for creating database') self.widget = QtWidgets.QWidget(self) layoutV = QtWidgets.QVBoxLayout() layoutV.addWidget(self.ui.label) layoutV.addWidget(self.ui.ButtonCreateDatabase) layoutV.addWidget(self.ui.MessageList) self.widget.setLayout(layoutV) self.setLayout(layoutV) self.ui.ButtonCreateDatabase.clicked.connect(self.CreateDatabase) ... def event(self, current_event: Events.EventForMessageList) -> bool: if current_event.type() != General.type_event: return False current_object = self.ui.MessageList current_object.addItem(current_event.message) return True1. The form is perfectly created.
2. During execution of my procedure, events arrive to form.
3. They are processed without errors, including line: current_object.addItem(current_event.message)
, but no new lines appear on dialog form, in QListWidget. It always remains completely empty.
Why?