Mailinglist Archive: opensuse-programming (62 mails)

< Previous Next >
Re: [suse-programming-e] Getting the text value of a lineEdit
  • From: Preston <maillist@xxxxxxxx>
  • Date: Fri, 04 Jun 2004 10:09:39 -0500
  • Message-id: <40C090B3.4040900@xxxxxxxx>
If your line edit is named lineEdit1:

lineEdit1->text() returns a QString;

lineEdit1->text().ascii() returns a const char* (if you like using stl strings instead of QStrings).

So, for example, you might say:

//begin code
QString textEntered;

textEntered = lineEdit1->text();
//end code

and then you have a QString textEntered with the text of lineEdit1 in it.

Hope that helps.

Preston

Prabu Subroto wrote:

Dear my friends...

I am a very beginner in Qt. I am still learning hard
this programming tool.

I made it to do a sql connection inserting a record
into my MySQL Database Server;

I want to get a text value of a lineEdit which typed
in by the user of my program (if I succeed to master
Qt) and processed my by code as put it into a SQL
Query or else.
In Kylix I do it very simply, just do like this :
"
a=TEdit1.Text;
".

if I do "lineEdit1." then I find only set<<...>>
property and slot diplayed on the Qt Designer display
as a hint.

Please tell me how to get the value in the lineEdit
widget.

Thank you very much.



__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/



< Previous Next >
Follow Ups
References