search button
-
I made a program using the QT graphic library and a file to make a car registration, such as name, brand, color, year, I can register the car, and I can edit, and I can list all of the file.
MInha doubt and a sequel, how do I make a button that returns me only what was typed.
Example: Digit bmw just returns the line containing the string bmw.I already tried using TextStream, ReadLine, TextCursor, QFile.
Thank you.
-
Hi and welcome to devnet,
Do you mean search the complete file to get the content of that specific line ?
-
yes, for example look for the board and list the line containing that board, or list a color, and list all that contains that color
-
@Alexandre-Dias You can read the file line by line (http://doc.qt.io/qt-5/qiodevice.html#readLine-1) and search for the string user entered using http://doc.qt.io/qt-5/qstring.html#contains