PDA

View Full Version : The way to insert pattern



Pablo128
9th April 2010, 21:13
I have a little problem. I'm writing a program to drawing mathematical lineal functions. It's easy. I can do lineEdits to insert parameters a,b,c. But it's not satisfy me. I want to do sth better. Not only program to read from general form of pattern.
And in this point is the problem. I want to convert pattern which I write in listEdit.
Can you help me? Do you have some idea?

aamer4yu
10th April 2010, 06:56
What do you mean by pattern ?
and can u explain with an example ?

Pablo128
10th April 2010, 12:15
In lineEdit I want to insert for example
-|(x+1)^2+3|-2 and I want to program draw it.

JohannesMunk
10th April 2010, 12:37
You will need a math expression parser for that. I cannot recommend writing one yourself, unless you can restrict the number of operators/functions or you have a lot of time at your disposal.

(http://www.qtcentre.org/Quick%20search:%20http://www.codeproject.com/KB/recipes/FastMathParser.aspx)Quick search: http://www.codeproject.com/KB/recipes/FastMathParser.aspx

Another approach would be to do this with qtscript. The syntax would be different, but the user could easily define his own functions etc..

HIH

Johannes