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. How to receive signals from a QTableView to sort by column?
Qt 6.11 is out! See what's new in the release blog

How to receive signals from a QTableView to sort by column?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 620 Views
  • 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.
  • J Offline
    J Offline
    jdent
    wrote on last edited by
    #1

    Hi,
    I am venturing into SQL programming with Qt. I have the QTableView and the QSqlRelationalDelegate and the QSQLRelationalTableModel and they work nice! Yet, how can I make my table to react to a click int the header in order to sort by that column?

    Regards,
    Juan

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

      QTableView* v = .....
      v->setSortingEnabled( true );

      QSqlTableModel implements sort(), so I believe that is it.

      1 Reply Last reply
      1

      • Login

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