Emit QTableWidget to another class

  • Hello!

    I have a QTableWidget in a class A, and I want to send it to a class B to show it in another ui file. How could I do it?

    Thank you very much!!

  • Qt Champions 2018

    You don't... really.
    If you are sure the first table widget does not get deleted in the meantime, you can expose the model QAbstractItemModel* tableModel() const {return ui->tableWidget->model();} and then load it in a QTableView in another ui using QTableView::setModel()

Log in to reply

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