Hi I’m trying to create a renaming tool. I have created a Qlistview named filenames to store the selection of user to rename but when I iterate over the list to rename in the rename function I’m getting a bool value.
using this code I think I get the list of the pointer to that item but not the item name
class MainWindow(QDialog):
def __init__(self):
super(MainWindow, self).__init__()
loadUi("gui.ui", self)
self.browse.clicked.connect(self.browsefiles)
self.rename.clicked.connect(self.renamefiles)
def browsefiles(self):
fname = QFileDialog.getOpenFileNames(self,'Open file')[0]
for f in fname:
head, tail = os.path.split(f)
self.filenames.addItem(tail)
print (tail)
def renamefiles(self):
filesrc = self.orgname.toPlainText()
print(filesrc)
filedst = self.chngname.toPlainText()
print(filedst)
lst = []
for index in range(self.filenames.count()):
lst.append(self.filenames.item(index))
print(lst)