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. QSqlTableModel o QSqlQueryModel

QSqlTableModel o QSqlQueryModel

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.8k 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.
  • P Offline
    P Offline
    parcpaes
    wrote on last edited by
    #1

    hi all:
    My question is simple, with which class best fits and performs better, for example-Al sql query.
    A built-in row or column QcheckBox, ComboBox, QPushButton and others.
    And when there is a relationship between tables in a database.
    It is better or Create my StandardModel.
    What is the most profecial
    (QSqltableModel or QSqlQueryModel).

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Which one fits best, depends on your use case. And you are telling us nothing about what you want to achieve.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        The usual answer with that much information would be: It depends.

        In particular:

        • the number of columns
        • the number of rows
        • how the user is supposed to interact with the data

        and possibly many more points.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • P Offline
          P Offline
          parcpaes
          wrote on last edited by
          #4

          Hello
          If the forum I saw many problems using QSqlTableModel in queries, using setFilter () sql limiting, a comparison of the method QsqlQueryModel setQuery () solve this problem, but not well integrated QSqlQueryModel to sort data in QTableView sortingEnabled to order the sql query (producModel-> QSqlQueryModel :: setQuery (QString ("Select * From product where (product.id =% 1) limit 200"). arg (id)) ;) vanishes, well this is just some , what would be the best option

          Management System For Cars (desktop).
          -With a large amount of data (200000 users).
          -DB-Connection (Postgres).
          -Ease of use.

          1 Reply Last reply
          0

          • Login

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