PDA

View Full Version : lineEdit show in other form as label



avpro
23rd June 2013, 22:29
hi all,

i have the following problem: i have a mainWindow and a 1.ui form which opens if i press a button in the mainWindow.
on 1.ui i have an button (something like "add new item") which opens another form (2.ui) where information could be entered as text in lineEdit. 2.ui has a Save and a Cancel button.

as soon as I press Save, i would like to show the information inserted in the lineEdit in form 1.ui, as a label.

any suggestions how to do it?
thanks for your input.

anda_skoa
24th June 2013, 10:03
There are several ways to do that:
1) manipulate a shared data structure
2) let the second class emit its data on OK
3) let the first class retrieve the data from the second class using getter methods

Cheers,
_

avpro
10th August 2013, 13:04
hi,

There are several ways to do that:
1) manipulate a shared data structure
2) let the second class emit its data on OK
3) let the first class retrieve the data from the second class using getter methods

could you please let me know where I should start reading about these methods? i need a starting point. no info found so far.
thanks.

anda_skoa
10th August 2013, 14:44
(1) and (2) are standard C++ features so they are most likely covered in all non-trivial C++ tutorials out there.
For (2) see http://qt-project.org/doc/qt-5.0/qtcore/signalsandslots.html

Cheers,
_