Results 1 to 2 of 2

Thread: Search by Product Name in QTableView which load from SQL Database

  1. #1
    Join Date
    Apr 2018
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Question Search by Product Name in QTableView which load from SQL Database

    Hello Seniors

    I need some help from you all. I'm having difficulties and I've no idea on how to do/code "cats.jpg" in QT Creator C++.

    I would really need help from you guys if there's any tutorials or steps to do it. Your kind help would be much appreciated, thank you in adv #qtcreator #cplusplus

    P/S: I'm still a new beginner in/for QT Creator

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,016
    Thanks
    233
    Thanked 638 Times in 628 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Search by Product Name in QTableView which load from SQL Database

    Search by Product Name in QTableView which load from SQL Database
    What exactly do you want to do? Do you want to search the database for all entries that match the product name, or do you want to see if a certain product name was retrieved from the database and is displayed in the table?

    What you you want to do after you find a match? Do you want to leave the table as it is and just highlight the matching entries? Do you want to clear the table and only display the matching entries?

    What have you tried already?

    If you don't want to change the database search results, but just want to highlight matching entries, then you should look at making a custom QIdentityProxyModel. If you want to filter out results that don't match, then you should look at a custom QSortFilterProxyModel. In either case, you should study the examples and tutorials from the Qt distribution to see how these classes are used.
    Last edited by d_stranz; 28th April 2018 at 16:56.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 2
    Last Post: 6th April 2014, 11:07
  2. Search For Header name in QTableview, QsqlQueryModel
    By nagabathula in forum Qt Programming
    Replies: 0
    Last Post: 25th April 2011, 08:58
  3. Database combobox search
    By poporacer in forum Newbie
    Replies: 10
    Last Post: 24th October 2010, 14:21
  4. Load menu from database
    By daica2003 in forum Qt Programming
    Replies: 5
    Last Post: 11th May 2008, 18:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.