1

I'm appending 'fileDirectory' list with some objects. How can I create and add button to scroll area for each object in the list. Button should contain the name of the object.

filenames.append(fileDirectory)
print filenames
['obj1', 'obj2', 'obj3']
file = os.path.basename(fileDirectory)
button = QtGui.QPushButton(file)
window.scrollArea.setWidget(button)

The problem is that I always get only one button in my scroll area. How can I make it look like on the photo. Photo

falsetru
  • 357,413
  • 63
  • 732
  • 636
Julia Cooper
  • 13
  • 1
  • 3
  • But do you want to put those buttons inside a QListView? Is this the idea? You code (demo) puts a button inside a widget. Do you want to change the text in that button based on the choice on the QListView? – armatita Mar 21 '16 at 09:06

0 Answers0