I am a total newbie. I have this doubt

suppose one has to change text
We use:

ui->lineEdit->setText("hello world") ;

for inside .cpp of any window, we use the above.

But if I want to setText of one dialog from another window,how do I do that?
I have a dialog called 'dialog',which has a lineEdit called "qwerty".
How to set text of qwerty from another window,say MainWindow?