How can i get the input from the users??

i have used this code

Qt Code:
  1. void Dialog::gettext()
  2. {
  3. QString text = QInputDialog::getText(this, tr("Enter the username"),
  4. tr("User name:"), QLineEdit::Normal);
  5. ui->dislabel->setText(text);
  6. }
To copy to clipboard, switch view to plain text mode 

but this code pops up a dialog which i dont need.

What i want is, when i add the text in the lineedit, it should be reflected in the label, or

when i add the text in the lineedit, a variable names text has to store it.