Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. search button
Qt 6.11 is out! See what's new in the release blog

search button

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 716 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alexandre Dias
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you mean search the complete file to get the content of that specific line ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Alexandre Dias
        wrote on last edited by
        #3

        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

        jsulmJ 1 Reply Last reply
        0
        • A Alexandre Dias

          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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved