PDA

View Full Version : Line edit and push button



dela
10th December 2008, 14:07
I am trying to get started with my school project relating to QT designer, but after going through different tutorials I still don't seem to get it. I haven't programmed with graphical user interfaces before.

Problem is that I have a line edit box for text input and a push button. What I am trying to do is to save a text from the line edit box to a certain variable when push button is clicked. This sounds like a basic thing to me but I would appreciate if some one could give me a hint how to do this. Thanks.

td
10th December 2008, 16:10
Have you looked at Signals and Slots? It a way of linking events between two objects.

For your problem, you'll need to write a function (to activate on the pushbutton being clicked) that would do something along the lines of

QString var = linedit.text();

Connect that with the pushbutton clicked.