PDA

View Full Version : QRegeXp - searching a pattern given in QLineEdit



mattis16
9th June 2011, 11:34
I've got some points in some sets and i want to search for specified point in each set by entering pattern in QLineEdit (like 2,3 to search point (2,3) etc.). I think regexp would be the best for it, but i totally don't know how to do that.

MarekR22
9th June 2011, 23:23
1. read documentation QRegExp and QTextDocument::find.
2. if its not enough give better description of problem (examples, also negative).

mattis16
10th June 2011, 16:06
I've got a class Set and i create objects set1,set2,etc... I add to this objects points (x,y),for example set1: (1,2), (0,0), (-8,65) and i want to find specified point (i put wanted pattern into QLineEdit). For example I want to search for point (0,0), so i write this points into QLineEdit. If i put (1,*) it will search for all points with first coordinate = 1.
I was trying to do linear search, but i don't know how to do (1,*) (*,*) etc...