title: PYQT5: Using a for loop or something else to create many QSliders of the same type
body: <p>I'm using PYQT5 to create a GUI to display sliders, and I want an efficient way to create many sliders of the same type but with different names. Currently, I have to copy paste the same code to make each individual slider, so my code is unnecessarily long. </p>
  
  <p>Here's what it looks like currently for 3 sliders:</p>
  
  <pre><code>class Ui_MainWindow(object):
     def setupUi(self, MainWindow):
      MainWindow.setObjectName("MainWindow")
      self.width = 1120
      self.height = 527
      MainWindow.resize(self.width, self.height)
      self.centralwidget = QtWidgets.QWidget(MainWindow)
      self.centralwidget.setObjectName("centralwidget")
      self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
      self.horizontalLayout.setObjectName("horizontalLayout")
      self.label = QtWidgets.QLabel(self.centralwidget)
  
      self.verticalSlider1 = QtWidgets.QSlider(self.shape_tab)
      self.shape_minimum = 1
      self.shape_maximum = 2000000
      self.verticalSlider1.setRange(self.shape_minimum, self.shape_maximum)
      self.verticalSlider1.setGeometry(QtCore.QRect(40, 40, 31, 251))
      self.verticalSlider1.setOrientation(QtCore.Qt.Vertical)
      self.verticalSlider1.setMaximum(self.shape_maximum)
      self.verticalSlider1.setObjectName("verticalSlider1")
  
      self.verticalSlider2 = QtWidgets.QSlider(self.shape_tab)
      self.shape_minimum = 1
      self.shape_maximum = 2000000
      self.verticalSlider2.setRange(self.shape_minimum, self.shape_maximum)
      self.verticalSlider2.setGeometry(QtCore.QRect(80, 40, 31, 251))
      self.verticalSlider2.setOrientation(QtCore.Qt.Vertical)
      self.verticalSlider2.setMaximum(self.shape_maximum)
      self.verticalSlider2.setObjectName("verticalSlider2")
  
      self.verticalSlider3 = QtWidgets.QSlider(self.shape_tab)
      self.shape_minimum = 1
      self.shape_maximum = 2000000
      self.verticalSlider3.setRange(self.shape_minimum, self.shape_maximum)
      self.verticalSlider3.setGeometry(QtCore.QRect(120, 40, 31, 251))
      self.verticalSlider3.setOrientation(QtCore.Qt.Vertical)
      self.verticalSlider3.setMaximum(self.shape_maximum)
      self.verticalSlider3.setObjectName("verticalSlider3")
  </code></pre>
  
  <p>I have to create 199 sliders in total, and they have the same properties. They only differ in names and the positioning in the UI (setGeometry(QtCore.QRect()). What's the best way to create this many sliders without just copy and pasting the same code 199 times and changing the name. </p>
  
  <p>I thought of creating a Slider as an class object, but I don't think it works with the UI_MainWindow class. I'm not sure how a for loop would work either. Any thoughts or opinions would be greatly appreciated!</p>