How can I read from Text Edit
Dear Friends
I have some values in Text Edit in the dialog box , the values are like below
2 0.323 0.3232
1st values is an ineteger and the rest two are doubles.
How can I read these values independently from Text Edit. !!
Any suggestion would be appreciated.
Re: How can I read from Text Edit
you can't. grab the (complete) text as a QString and parse it.
You can use QTextStream for reading the numbers.
Code:
QString text
= edit
->toPlainText
();
double f1, f2, f3;
ts >> f1 >> f2 >> f3;
HTH
Re: How can I read from Text Edit
would this reading be sequential reading ??
Re: How can I read from Text Edit
please rephrase that (or just try it out....)
Re: How can I read from Text Edit
Thanks Friends let me I am trying it...
Re: How can I read from Text Edit
Hi, i have created a project(Gui project) and in the main.cpp file i have some sql queries that gets data from a remote sever liekt this;
if(!query.exec("SELECT..........")){
qDebug()<<"FAIL";
}
while(query.next()){
QString name = query.value(0).toString();
qDebug() << name;
}
it works well and i have the results printed out like "abdnsh"
Now in my .ui i have Text Edit. How can i append the sql reults to the Text Edit in my .ui?
I'm a beginner, please i will appreciate