Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with "autosort" with QTableView and QSqlQueryModel
Qt 6.12 LTS is out! See what's new in the release blog

Problem with "autosort" with QTableView and QSqlQueryModel

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 567 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi, I have a problem with QTableView and QSqlQueryModel. When I use setQuery method and with sql statement "Select ... Order by columnX DESC", I see in view my select always ascending. Can I turn off this "autosort" in QTableView or QSqlQueryModel?

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

      Hi and welcome to devnet,

      Looks like you're searching for "setSort":http://doc.qt.io/qt-5/qsqltablemodel.html#setSort

      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
      0

      • Login

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