Can't add item to QLIstWidget

Trying to add an item to a QListWidget but it won't add the item to the list.

code:

dirListLayout = QListWidget()
 def dropped(dir):
      dirListLayout.addItem(dir)
            
      print("dropped and added")

dir is a string "test" in this case.

It doesn't show any error. it does print "dropped and added"

Thanks in advance.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum