Can we assign a model to a QTableWidget even though its setModel is private?

  • Hi,

    I love the view/model architecture and I think Qt has done a great job following it. I have seen examples of views which get a model associated, but what about QTableWidget (and other Widgets), do they participate in the view/model architecture as well?


  • Qt Champions 2017

    Short answer is no. If you wish to assign a model, you're simply supposed to use QTableView. You could do some hacking to expose the method but why would you want to do that? In the end putting a table view with a QStandardItemModel should behave exactly as QTableWidget.

    Kind regards.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.