Important: Please read the Qt Code of Conduct -

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

  • 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?


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

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

Log in to reply