PDA

View Full Version : Data from dialog to form



matulik
11th May 2010, 12:04
Hello.
I have a problem. I have two windows: form and dialog.
Form include tableview (model-based).
Dialog include lineEdit's fields and button.

I want to send information from dialog box to model (in main window).
For example, in dialog box Name and Surname to header in my model.

Thanks

aamer4yu
11th May 2010, 12:08
Read about signals and slots

matulik
11th May 2010, 21:33
Ok. I had read.
But I still don't know how to send value of variable x from Dialog box to variable y in MainWindow form.
I try this:

connect(m_ui->pushButton,SIGNAL(clicked()),?,?);
but I don't know what I must enter instead "?".

I try also it:


MainWindow *dupa = new MainWindow;
QString temp = m_ui->lineEdit->text();
dupa->?


Please and thanks for help ;-)

calhal
12th May 2010, 13:36
First you could at least try to use Assistant and use "search" to look for similar threads here.

There's lot of ways of doing this, depending of what you want to do. For example you can use signals/slots or simply setter/getter methods. Try this link (http://www.qtcentre.org/threads/25690-How-to-pass-data-from-QDialog-to-MainWindow?highlight=how+to+pass+data+from+qdialog +to+mainwindow) and/or use the search engine.

And please don't use words like "dupa" and it's "more polite" friends in your source. Some of us speak this language, if you didn't know.