Hi all, I am encountering a problem with directories-reading. It is able to read it but it is not displaying correctly.
Like it is reading from Source A but it displays the item from Source B instead of A

When user types executes the program, it will display 2 ListWidgets respectively - refItemList and jobItemList, depending on what the user types in the LineEdit
For example, if the user types testItemA, and hits the ShowItems button, it will displays all the folders only (test01 etc)
I have placed an example output in the code below, hopefully it makes sense

Qt Code:
  1. ''' Directory for users to compare refList folders to '''
  2. jobList = os.listdir("/u/ykt/Desktop/test/testItemA")
  3. # ['test01', 'test02', 'test03', 'test04', 'test05']
  4.  
  5. ''' Directory that users access and compare it to jobList folders '''
  6. refList = os.listdir("/user_data/testItemEx")
  7. #['test01', 'test02', 'test03', 'format01', 'format02.py', 'test.py']
  8.  
  9. refItems = []
  10. for item in jobList:
  11. if item in refList:
  12. refItems.append(item)
  13.  
  14. # Output in refList: ['test01', 'test02', 'test03']
  15. # Output in jobList: ['test01', 'test02', 'test03', 'test04', 'test05']
  16.  
  17. ''' Adding the items into the listWidgets '''
  18. self.jobItemList.addItems(jobList)
  19. self.refItemList.addItems(refItems)
  20.  
  21. ''' So that there can only be one selection between the 2 Lists '''
  22. self.itemsDict = {}
  23. self.itemsDict[self.refItemList] = self.jobItemList
  24. self.itemsDict[self.jobItemList] = self.refItemList
  25.  
  26. self.refItemList.clicked.connect(self.listSelect)
  27. self.jobItemList.clicked.connect(self.listSelect)
  28.  
  29. def listSelect(self):
  30. self.shotsDict[self.sender()].clearSelection()
To copy to clipboard, switch view to plain text mode 

But as there are some parts that I am using my school in-house modules to write on, I am encountering the problem where as I am printing out the item selected, it retains from the previous selection.

For example, in test01, it contains itemD, itemE, itemF; test02 contains itemG, itemH, itemI
It happens when I retype in the LineEdit to test02 (therefore reading test02 items in the jobList), and as I print it out, it is actually printing as 'test01, itemD' instead of 'test01, itemG'

Are there anyways for me to force item read according to the jobList?
I hope I am making sense here