title: How to get int from QLineEdit()?
body: <p>So here is my code and I tried many ways of changing the input of QLineEdit, but nothing is working, only thing I'm getting is </p>
  
  <blockquote>
    <p>TypeError: '>' not supported between instances of 'QLineEdit' and 'QLineEdit'</p>
  </blockquote>
  
  <pre><code>from matplotlib import pyplot
  import numpy as np
  from PyQt5.QtWidgets import (QWidget, QPushButton,
                               QLabel, QGridLayout,
                               QLineEdit, QApplication,
                               QListWidget, QListWidgetItem)
  from PyQt5.QtGui import QIntValidator, QRegExpValidator
  
  import sys
  
  
  class Program(QWidget):
  
      def __init__(self):
          super().__init__()
  
          self.x_pts = []
          self.y_pts = []
  
          self.fig, self.ax = pyplot.subplots()
          self.points, = self.ax.plot(self.x_pts, self.y_pts, marker="o", linestyle="")
  
          self.label1 = QLabel('Rozpocznij wyznaczanie' + 2*'')
          self.button1 = QPushButton('Start')
          self.label2 = QLabel('Wprowadź zakres x')
          self.label3 = QLabel('Wprowadź zakres y')
          self.label4 = QLabel('Od')
          self.label5 = QLabel('Do')
          self.label6 = QLabel('Od')
          self.label7 = QLabel('Do')
          self.range_from1 = QLineEdit()
          self.range_to1 = QLineEdit()
          self.range_from2 = QLineEdit()
          self.range_to2 = QLineEdit()
          self.onlyInt = QIntValidator(-100, 100)
          self.range_from1.setValidator(QRegExpValidator(
              QRegExp('^(-(100|([1-9]{1}[0-9]{1})|[1-9]{1}))|(0)$')))
          self.range_from2.setValidator(self.onlyInt)
          self.range_to1.setValidator(QRegExpValidator(
              QRegExp('^(-(100|([1-9]{1}[0-9]{1})|[1-9]{1}))|(0)$')))
          self.range_to2.setValidator(self.onlyInt)
  
          self.ax.set_ylim(self.range_from2, self.range_to2)
  
          siatka = QGridLayout()
          siatka.setSpacing(10)
  
          siatka.addWidget(self.label1, 0, 0)
          siatka.addWidget(self.label2, 1, 0)
          siatka.addWidget(self.label4, 2, 0)
          siatka.addWidget(self.range_from1, 2, 1)
          siatka.addWidget(self.label5, 3, 0)
          siatka.addWidget(self.range_to1, 3, 1)
          siatka.addWidget(self.label3, 4, 0)
          siatka.addWidget(self.label6, 5, 0)
          siatka.addWidget(self.range_from2, 5, 1)
          siatka.addWidget(self.label7, 6, 0)
          siatka.addWidget(self.range_to2, 6, 1)
          siatka.addWidget(self.button1, 7, 0)
  
          self.setLayout(siatka)
  
          self.button1.clicked.connect(self.showing_canvas)
  
          self.show()
  
      def wyznaczanie(self, event):
          m_x, m_y = event.x, event.y
          x, y = self.ax.transData.inverted().transform([m_x, m_y])
          self.x_pts.append(x)
          self.y_pts.append(y)
          self.points.set_xdata(self.x_pts)
          self.points.set_ydata(self.y_pts)
          self.fig.canvas.draw()
  
      def showing_canvas(self):
          self.fig.canvas.mpl_connect('button_press_event', self.wyznaczanie)
          pyplot.show()
  
  
  if __name__ == '__main__':
      app = QApplication(sys.argv)
      ex = Program()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>I want to set axis limits as the user wants them to be, and I have no idea what is going on. The things I tried was QRegValidator, by using int function, float function, and different ways of setting axis limits, and yet always this error.</p>