I know how to add items to the list widget if you enter the items into an array, however I want to be able to edit the list widget in the user interface, to be able to add your own task to the widget from a user input without having to create a dialog to capture the inputs.
By pressing add tasks, I want to be able to add a task to the QListWidget without hard coding them in. Is there a way to do this?
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
super().__init__()
loadUi("main.ui", self)
self.calendarWidget.selectionChanged(self.new_day_selected)
self.addButton.clicked.connect(self.add_task)
self.editButton.clicked.connect(self.edit_task)
tasks = [] #array to store items
def new_day_selected(self, checked):
dateSelected = self.calendarWidget.selectedDate().toPy()
print("Date Changed: " + dateSelected)
def add_task(self, checked):
pass
def edit_task(self, checked):
pass