title: How to assign the values from the line edit of Qt to the variables
body: <p>suppose I have the line edit in my Qt window and if I have to assign value to the variables from the line edit of the window, what should be the changes in code.
  my mainwindow.ccp is:</p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
  {
   ui-&gt;setupUi(this);
  }
  
  MainWindow::~MainWindow()
  {
    delete ui;
  }
  </code></pre>
  
  <p>and mainwindow.h is:</p>
  
  <pre><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  
  namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
    Q_OBJECT
  
  public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
  
  private:
    Ui::MainWindow *ui;
  };
  
  #endif // MAINWINDOW_H
  </code></pre>
  
  <p>here the entered input from the line edit should assign the value for variable V1 and V2 means</p>
  
  <pre><code>V1 = variable1
  V2 = variable2
  </code></pre>
  
  <p>and these variables V1 and V2 later we can use in any class as global varible.</p>