title: Is there any way to delete widget by its position in grid or delete row in this grid?
body: <p>I need to have ability to create endless widgets by .addWidget (in grid, new widget - new row). I already have it. But im also need ability to delete widgets by his position. I tried this:</p>
  
  <pre><code>from PyQt5 import QtWidgets, QtGui
  from PyQt5.QtCore import QTime, QTimer, QObject
  from PyQt5.QtWidgets import QMainWindow, QApplication, QLCDNumber, QPushButton, QGridLayout, QLabel, QLineEdit, QTextEdit, QGroupBox
  import sys
  from somethingtestui import Ui_MainWindow
  
  global selection
  selection = 1
  
  
  class mywindow(QtWidgets.QMainWindow):
  
  def __init__(self):
      super(mywindow, self).__init__()
      self.ui = Ui_MainWindow()
      self.ui.setupUi(self)
      self.ui.pushButton.clicked.connect(self.add)
  
  def add(self):
      global selection
      self.row = QTextEdit('')
      self.text3 = QPushButton('Delete row')
      self.ui.gridLayout.addWidget(self.row, selection, 0, 1, 1)
      self.ui.gridLayout.addWidget(self.text3, selection, 1, 1, 1)
      # global delf
      def delf():
          global selection
          selection = selection-1
          number = self.ui.gridLayout.itemAtPosition(selection,1)
          print(number)
          self.row.deleteLater()
          self.rrow = None
          self.text3.deleteLater()
          self.text3 = None
      self.text3.clicked.connect(delf)
      selection = selection+1
  app = QtWidgets.QApplication([])
  application = mywindow()
  application.show()
  
  sys.exit(app.exec())
  </code></pre>
  
  <p>With it i can add many widgets. If there are one created widget i am free to delete it and repeat it. But if there are 2 or more created widget i can delete one of them, and after click button "Delete" in the other row it crash:</p>
  
  <pre><code>Traceback (most recent call last):
    File "E:\Programs\YandexDisk\Tempfiles\TournamentBot\testi22.py", line 31, in delf
      self.row.deleteLater()
  RuntimeError: wrapped C/C++ object of type QTextEdit has been deleted
  </code></pre>